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

GH-1362: Add option for hidden state position in FlairEmbeddings #1571

Merged
merged 6 commits into from
May 3, 2020

Conversation

alanakbik
Copy link
Collaborator

@alanakbik alanakbik commented May 3, 2020

This PR adds the option to choose which hidden state to use in FlairEmbeddings: either the state at the end of each word, or the state at the whitespace after. Default is the state at the whitespace after.

You can change the default like this:

embeddings = FlairEmbeddings('news-forward', with_whitespace=False)

This configuration seems to be better for syntactic tasks. For POS tagging, it seems that you should set with_whitespace=False. For instance, on UD_ENGLISH POS-tagging, we get 96.56 +- 0.03 with whitespace and 96.72 +- 0.04 without, averaged over three runs.

See the discussion in #1362 for more details.

@alanakbik alanakbik merged commit add5f26 into master May 3, 2020
@alanakbik
Copy link
Collaborator Author

Special thanks to @djstrong for noticing this and the discussion in #1362!

@alanakbik alanakbik deleted the offset_mode branch May 3, 2020 23:34
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