|
51 | 51 | "_CONLL_4_NOT_IN_GOLD_FILE = os.path.join(data_dir, \"CoNLL_4_not_in_gold.csv\")\n",
|
52 | 52 | "_CONLL_4_TRAIN_NOT_IN_GOLD_FILE = os.path.join(data_dir, \"CoNLL_4_train_not_in_gold.csv\")\n",
|
53 | 53 | "\n",
|
54 |
| - "# Optionally output figures generated\n", |
55 |
| - "save_figures = True\n", |
| 54 | + "# Change this constant to True to regenerate PDF/EPS/PNG files with figures.\n", |
| 55 | + "save_figures = False\n", |
56 | 56 | "figure_dir = os.path.join(data_dir, \"label_stats_images\")\n",
|
57 | 57 | "if save_figures and not os.path.exists(figure_dir):\n",
|
58 | 58 | " os.mkdir(figure_dir)"
|
|
8655 | 8655 | "write_file.loc[:, \"hand_labelled\"] = write_file[\"agreeing_models\"].isna()\n",
|
8656 | 8656 | "write_file = write_file[write_file.error_type != \"None\"]\n",
|
8657 | 8657 | "\n",
|
8658 |
| - "write_file.rename(columns={\"conll_2\": \"Original entrants ensemble\", \"conll_3\": \"custom models ensemble\", \"conll_4\": \"cross validation ensemble\"}, inplace=True)\n", |
| 8658 | + "write_file = write_file.rename(columns={\"conll_2\": \"Original entrants ensemble\", \n", |
| 8659 | + " \"conll_3\": \"Custom models ensemble\", \n", |
| 8660 | + " \"conll_4\": \"Cross validation ensemble\"})\n", |
8659 | 8661 | "\n",
|
8660 |
| - "write_file.to_csv(ALL_LABELS_OUTPUT_FILE_NAME)\n", |
8661 |
| - "print(\"Done\")" |
| 8662 | + "# Drop \"agreeing_models\" and boolean columns to make diffs smaller.\n", |
| 8663 | + "write_file = write_file.drop(columns=[\"agreeing_models\",\n", |
| 8664 | + " \"hand_labelled\",\n", |
| 8665 | + " \"Original entrants ensemble\",\n", |
| 8666 | + " \"Custom models ensemble\",\n", |
| 8667 | + " \"Cross validation ensemble\"])\n", |
| 8668 | + "\n", |
| 8669 | + "# TODO: Sort so that order is consistent across Python versions.\n", |
| 8670 | + "#write_file = write_file.sort_values([\"fold\", \"doc_offset\", \"corpus_span\", \"corpus_ent_type\", \"error_type\"])\n", |
| 8671 | + "\n", |
| 8672 | + "write_file.to_csv(ALL_LABELS_OUTPUT_FILE_NAME, index=False)\n", |
| 8673 | + "print(f\"Wrote merged labels to {ALL_LABELS_OUTPUT_FILE_NAME}\")" |
8662 | 8674 | ]
|
8663 | 8675 | },
|
8664 | 8676 | {
|
|
10189 | 10201 | "name": "python",
|
10190 | 10202 | "nbconvert_exporter": "python",
|
10191 | 10203 | "pygments_lexer": "ipython3",
|
10192 |
| - "version": "3.8.6" |
| 10204 | + "version": "3.8.5" |
10193 | 10205 | }
|
10194 | 10206 | },
|
10195 | 10207 | "nbformat": 4,
|
|
0 commit comments