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

error when encountering unknown NER label #95

Open
jgroschwitz opened this issue Nov 19, 2021 · 2 comments
Open

error when encountering unknown NER label #95

jgroschwitz opened this issue Nov 19, 2021 · 2 comments
Assignees
Labels
nice-to-have Not essential

Comments

@jgroschwitz
Copy link
Contributor

a toy model crashes when encountering an unknown NER label.

To reproduce: run python3 -u train.py jsonnets/toyAMRAutomata.jsonnet -s example/toyAMRAutomataOutput/ -f --file-friendly-logging

on commit 1282115 on the unsupervised2020 branch.

According to allenai/allennlp#2147, crashing when encountering a label that is unseen is the intended behaviour as long as no OOV token (i.e. a token that says "i'm the OOV token") is in the vocabulary. My guess is that usually, such an OOV token gets added automatically, but not in this toy example.

@jgroschwitz jgroschwitz added the nice-to-have Not essential label Nov 19, 2021
@jgroschwitz jgroschwitz self-assigned this Nov 19, 2021
@namednil
Copy link
Contributor

Whether or not an OOV token is added is controlled by the vocabulary class: https://docs.allennlp.org/v0.9.0/api/allennlp.data.vocabulary.html#allennlp.data.vocabulary.Vocabulary. You can adjust this in the config file; there already is an entry for "vocabulary" in jsonnets/emnlp20/glove/AMR-2015.jsonnet for example. Of course the OOV token embedding will be untrained.

@jgroschwitz
Copy link
Contributor Author

jgroschwitz commented Nov 19, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nice-to-have Not essential
Projects
None yet
Development

No branches or pull requests

2 participants