模型:
julien-c/flair-ner
Imported from https://nlp.informatik.hu-berlin.de/resources/models/ner/
from flair.data import Sentence from flair.models import SequenceTagger sentence = Sentence( "My name is Julien, I currently live in Paris, I work at Hugging Face, Inc." ) tagger = SequenceTagger.load("julien-c/flair-ner") # predict NER tags tagger.predict(sentence) # print sentence with predicted tags print(sentence.to_tagged_string())
yields the following output:
My name is Julien <S-PER> , I currently live in Paris <S-LOC> , I work at Hugging <B-LOC> Face <E-LOC> .