Performances of NER models could be extremely different between dev and test sets
🐛 Bug description
The F1 score on the dev set could be extremely different than the F1 score on the test set.
For example, the NER model for the pathway entity type has:
- 0.8421 F1 on
dev(Best F-Scorefrom Prodigy) but - 0.5804 F1 on
test(metrics/ner/pathway.json).
This is 1.451 times lower.
Note: The same is visible with spaCy 3 (#248)
Several directions are to be investigated:
-
[evaluation]As we don't evaluate the models with the same tool (spaCy Language.evaluate()vs oureval.py), maybe the different ways of computing the F1 score could explain the issue. See #308 for adopting the spaCy computation. -
[training]As ourEntityRuleris added between the end of the training and the evaluation, maybe this addition could explain the issue. See #310 for integrating the entity ruler during training. -
[data sampling]As ourdevandtestsets are coming from different annotation sessions, maybe an unbalancing in thedevandtestsets could explain the issue. See https://github.com/BlueBrain/Search/issues/276#issuecomment-805103451, in the 4th point of the FAQ section, for a related concern about how ourtrain/dev/testsets are used at the moment. -
[domain adaptation]As we train the models by resuming training on base models, maybe a domain adaptation challenge, which would be visible only on thetestset, could explain the issue. See #248, in the NER performances part of the PR description, for a related concern about domain adaptation challenges impacting the performances.
To reproduce
Steps to reproduce the behavior:
dvc repro -f eval_pathway- Read the 'Best F-Score' from Prodigy logs
cat ../../metrics/ner/pathway.json
Expected behavior
The F1 scores on the dev and test sets should be similar.
Environment
Please provide the following information.
- Blue Brain Search version:
78e82f4c0f8f04790f87424a80df622f500a9f5c(master on 25.03.2021).