Comments (2)
Hi @DonaldFeuz
I see you already figured out the from_params
and to_params
method. What is missing is the @register_embeddings
decorator.
from flair.embeddings.base import register_embeddings
@register_embeddings
class MyEmbeddings(TokenEmbeddings):
....
that way, the lookup will know to also consider this embeddings class when loading embeddings.
Keep in mind, that the Moduel that defines the Embedding class needs to be loaded beforehands, e.g. you need to import it. I usually use the __init__.py
to do that:
import my_project.my_embeddings
__all__ = ["my_embeddings"]
``
Then I can be sure that any file in `my_project` has the embeddings already registered and can load the model the correct way
from flair.
Thank you very much @helpmefindaname
My problem has been successfully solved thanks to your solution.
from flair.
Related Issues (20)
- [Question]: Using flair for creating tags or keywords that represents a given text
- [Bug]: optimizer state not saved HOT 2
- [Bug]: Loading task classifier from `Classifier` class not working
- [Bug]: Shared layers in multi-task model are no longer shared after loading the model from a checkpoint HOT 1
- [Question]: Extending NER tags of Hunflair
- [Bug]: SequenceTagger._all_scores_for_token() function returns incorrect prediction distribution for tokens
- [Bug]: transformers 4.40.0 assumes infinite sequence length on many models and breaks HOT 2
- [Question]: Multi-Task Learning with use_all_task
- [Question]: Experimenting with xLSTM with Flair ?
- [Question]: How to do what MultiTagger used to do? HOT 1
- [Question]: Release of Biaffine/SpanTagger
- [Question]: Resume training HOT 1
- [Bug]: Custom trained model not correctly loaded when using FlairEmbeddings HOT 1
- flair correct shows FileNotFoundError:
- [Bug]: reduce transformer vocab plugin overwrites best-model with final-model (which has worse F1 score)
- [Feature]: Adding xLSTM
- [Question]: Compatibility with old models trained with 0.7
- [Bug]: BytePairEmbeddings are not loading for English HOT 2
- [Bug]: Sequence tagger with CRF gives wrong probabilities for all classes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flair.