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-1587: refactor embeddings module #1588

Merged
merged 3 commits into from
May 7, 2020
Merged

GH-1587: refactor embeddings module #1588

merged 3 commits into from
May 7, 2020

Conversation

alanakbik
Copy link
Collaborator

Closes #1587

This PR splits the embeddings.py into several submodules organized in an embeddings/ folder. The submodules are:

  • token.py for all TokenEmbeddings classes
  • document.py for all DocumentEmbeddings classes
  • image.py for all ImageEmbeddings classes
  • legacy.py for embeddings that are now deprecated
  • base.py for remaining basic classes

All embeddings are still exposed through the embeddings package, so the command to load them doesn't change, e.g.:

from flair.embeddings import FlairEmbeddings
embeddings = FlairEmbeddings('news-forward')

so specifying the submodule is not needed.

@alanakbik alanakbik merged commit 7a58329 into master May 7, 2020
@alanakbik alanakbik deleted the GH-1587-embeddings branch May 14, 2020 20:36
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.

Refactor embeddings into submodules
1 participant