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

Allow to keep token embeddings after SequenceTagger.predict() #809

Merged
merged 4 commits into from
Jun 19, 2019
Merged

Allow to keep token embeddings after SequenceTagger.predict() #809

merged 4 commits into from
Jun 19, 2019

Conversation

khituras
Copy link
Contributor

This PR addresses #784. A new parameter clear_word_embeddings was added to SequenceTagger.predict() which is just connected through to clear_embeddings method that already has this parameter.
Since the embeddings are also cleared at the beginning of the predict method, there should be no issue with embeddings bleeding through the usage of multiple models on the same sentence/tokens.

I added a small test to show that the new parameter works as intended.

I hopy everything is fine with the PR, let me know!

khituras and others added 4 commits June 17, 2019 15:26
…dict() method. This parameter controls the cleaning of token embeddings after the prediction. Setting it to false allows to retrieve the token embeddings for reuse.
@alanakbik
Copy link
Collaborator

@khituras the build was failing due to not passing the code formatting checks performed by black. I've corrected and hopefully it runs through now. Will merge then!

@khituras
Copy link
Contributor Author

Aw, I forgot about that part, I meant to check via black myself. Sorry about that!

@alanakbik
Copy link
Collaborator

No worries - I'm actually thinking of perhaps removing the formatter again as it seems to be causing confusion.

@alanakbik
Copy link
Collaborator

👍

1 similar comment
@yosipk
Copy link
Collaborator

yosipk commented Jun 19, 2019

👍

@alanakbik alanakbik merged commit fd2f2b5 into flairNLP:master Jun 19, 2019
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.

None yet

3 participants