Another follow-up release to 0.12 that fixes a several bugs and adds a new multilingual frame tagger. Further, our new documentation website at https://flairnlp.github.io/docs/intro is now online!
New frame tagging model #3172
Adds a new model for detecting PropBank frame. The model is trained using the "FLERT" approach, so it is much stronger than the previous 'frame' model. We also added some training data from the universal proposition bank to improve multilingual frame detection.
Use it like this:
# load the large frame model
model = Classifier.load('frame-large')
# English sentence with the verb "return" in two different senses
sentence = Sentence("Dirk returned to Berlin to return his hat.")
model.predict(sentence)
print(sentence)
# German sentence with the verb "trug" in two different senses
sentence_de = Sentence("Dirk trug einen Koffer und trug einen Hut.")
model.predict(sentence_de)
print(sentence_de)
This should print:
Sentence[9]: "Dirk returned to Berlin to return his hat." → ["returned"/return.01, "return"/return.02]
Sentence[9]: "Dirk trug einen Koffer und trug einen Hut." → ["trug"/carry.01, "trug"/wear.01]
The printout tells us that the verbs in both sentences are correctly disambiguated.
Documentation
- adds a pointer to the new Flair documentation website at https://flairnlp.github.io/docs/intro
- adds a night mode Flair logo #3145
Enhancements / New Features
- more consistent behavior of context dropout and FLERT token #3168
- settting device through environment variable #3148 (thanks @HallerPatrick)
- modify Sentence.to_original_text() to take into account Sentence.start_position for whitespace calculation #3150 (thanks @mauryaland)
- gather dev and test labels if the dataset is available #3162 (thanks @helpmefindaname)
Bug fixes
- fix bugs caused by wrong data point equality and caching #3157
- fix transformer smaller training vocab #3155 (thanks @helpmefindaname)
- update scispacy version #3144 (thanks @mariosaenger)
- unpin huggingface-hub #3149 (thanks @marctorsoc)