Skip to content

Release 0.12.1

Compare
Choose a tag to compare
@alanakbik alanakbik released this 10 Mar 15:32
· 887 commits to master since this release
c1f5f0f

This is a quick follow-up release to 0.12 that fixes a few small bugs and includes an improved version of our Zelda entity linker.

New Entity Linking model

We include a new version of our Zelda entity linker with improved predictions. Try it as follows:

from flair.nn import Classifier
from flair.data import Sentence

# load the model
tagger = Classifier.load('linker')

# make a sentence
sentence = Sentence('Kirk and Spock met on the Enterprise.')

# predict NER tags
tagger.predict(sentence)

# print predicted entities
for label in sentence.get_labels():
    print(label)

This should print:

Span[0:1]: "Kirk" → James_T._Kirk (0.9969)
Span[2:3]: "Spock" → Spock (0.9971)
Span[6:7]: "Enterprise" → USS_Enterprise_(NCC-1701-D) (0.975)

Indicating correctly that the span "Kirk" points to "James_T._Kirk". As the prediction for the string "Enterprise" shows, the model is still beta and will be further improved with future releases.

Bug fixes

  • make transformer training vocab optional #3132
  • change token.get_tag() to token.get_label() #3135
  • update required version of transformers library #3138
  • update HunFlair tutorial to Flair 0.12 #3137