Search icon indicating copy to clipboard operation
Search copied to clipboard

Performances of NER models could be extremely different between dev and test sets

Open pafonta opened this issue 5 years ago • 0 comments

🐛 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-Score from 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:

  1. [evaluation] As we don't evaluate the models with the same tool (spaCy Language.evaluate() vs our eval.py), maybe the different ways of computing the F1 score could explain the issue. See #308 for adopting the spaCy computation.

  2. [training] As our EntityRuler is 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.

  3. [data sampling] As our dev and test sets are coming from different annotation sessions, maybe an unbalancing in the dev and test sets 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 our train / dev / test sets are used at the moment.

  4. [domain adaptation] As we train the models by resuming training on base models, maybe a domain adaptation challenge, which would be visible only on the test set, 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:

  1. dvc repro -f eval_pathway
  2. Read the 'Best F-Score' from Prodigy logs
  3. 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).

pafonta avatar Mar 25 '21 15:03 pafonta