You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am a complete freshman in the whole NLP/NER topic and unfortunately don't have much knowledge of python. I am experimenting with NER with Flair and was happy to get the NER with Flair up and running (with good results using the NER-German-large model). Now there are a few entities like dates or even languages in the english model or the 18-Entities Ontonotes model I want to extract as well. I was wondering if it is possible to combine the german model and for example the english one and extract certain entities of both models?
Due to my lacking knowledge of Python I am hesitant to training a new model and would rather rely on already existing models.
How could a code could look like? I would highly apreciate if someone could help and enlighten me!
Thanks in advance.
Here is my code so far:
from flair.nn import Classifier
from flair.data import Sentence
Question
Hello,
I am a complete freshman in the whole NLP/NER topic and unfortunately don't have much knowledge of python. I am experimenting with NER with Flair and was happy to get the NER with Flair up and running (with good results using the NER-German-large model). Now there are a few entities like dates or even languages in the english model or the 18-Entities Ontonotes model I want to extract as well. I was wondering if it is possible to combine the german model and for example the english one and extract certain entities of both models?
Due to my lacking knowledge of Python I am hesitant to training a new model and would rather rely on already existing models.
How could a code could look like? I would highly apreciate if someone could help and enlighten me!
Thanks in advance.
Here is my code so far:
from flair.nn import Classifier
from flair.data import Sentence
tagger = Classifier.load("flair/ner-german-large")
txt_file_path = …
with open(txt_file_path, 'r', encoding='utf-8') as file:
text_content = file.read()
sentence = Sentence(text_content)
tagger.predict(sentence)
for label in sentence.get_labels('ner'):
print(label)
The text was updated successfully, but these errors were encountered: