Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Micro average precision and recall not listed for non-span sequence labelers #1934

Closed
alanakbik opened this issue Nov 2, 2020 · 0 comments · Fixed by #1935
Closed

Micro average precision and recall not listed for non-span sequence labelers #1934

alanakbik opened this issue Nov 2, 2020 · 0 comments · Fixed by #1935

Comments

@alanakbik
Copy link
Collaborator

The current implementation of the SequenceLabeler evaluation evaluates non-span sequence labeling such that a prediction is made for each word. This is correct in many cases like POS tagging where each word must have one POS tag.

However, in some cases - like word or frame disambiguation - only some words have a predicted sense tag. Many words will have no prediction. Our evaluation currently counts "no prediction" as a class and so no micro average precision and recall are computed.

To reproduce:

# load English universal proposition bank
corpus = UP_ENGLISH().downsample(0.001)

# make tag dictionary
tag_dictionary = corpus.make_tag_dictionary('frame')

# init simple tagger
tagger: SequenceTagger = SequenceTagger(
    hidden_size=256,
    embeddings=WordEmbeddings('glove'),
    tag_dictionary=tag_dictionary,
    tag_type='frame',
    use_crf=False, # there are too many classes for CRF
)

# train model
trainer = ModelTrainer(tagger, corpus)

trainer.train(f'resources/taggers/frame-test-output',
              max_epochs=50,
              mini_batch_size=8,
              )

The output then does not list micro-averaged precision and recall.

(Note that this only affects non-span sequence labeling, so NER for instance is not affected.)

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 a pull request may close this issue.

1 participant