Skip to content

Fix NER evaluation on dataset folders outside the standard benchmark - #409

Open
smuzair7 wants to merge 1 commit into
urchade:mainfrom
smuzair7:fix/eval-custom-dataset-folders
Open

smuzair7 wants to merge 1 commit into
urchade:mainfrom
smuzair7:fix/eval-custom-dataset-folders

Conversation

@smuzair7

Copy link
Copy Markdown

get_for_all_path (what eval.py runs) broke in two ways when pointed at my own data:

  1. open_content checks "train" in p, "dev" in p etc. against the full path, so if a parent folder has one of those words in its name (/home/dev/..., data/test-sets/...) every json loads as that split and create_dataset fails with TypeError: 'NoneType' object is not iterable. It now checks the file name only.

  2. When the data folder has none of the zero-shot sets (mit-movie, CrossNER_*), the average at the end divides by zero after the whole eval has already run, so tables.txt never gets written. Same with only zero-shot sets. A table with no results is now skipped; the output is the same as before when both are present.

tests/test_evaluate_ner.py covers both cases, both tests fail on main.

open_content matched split names against the whole path, so a parent
directory containing "dev", "test" or "train" made every file load as
that split and create_dataset failed on the missing ones. Match on the
file name instead.

get_for_all_path divided by zero when the data folder had no zero-shot
datasets (or only zero-shot ones), after the whole evaluation had run.
Only write the tables that have results.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant