Answers for "stanford ner model colab python"

0

stanford ner model colab python

from nltk.tag import StanfordNERTagger
from nltk.tokenize import word_tokenize



st = StanfordNERTagger('/content/english.muc.7class.distsim.crf.ser.gz',
                   '/content/stanford-ner.jar',
                   encoding='utf-8')

text = 'While in France, Christine Lagarde discussed short-term stimulus efforts in a recent interview with the Wall Street Journal.'

tokenized_text = word_tokenize(text)
classified_text = st.tag(tokenized_text)

print(classified_text)
Posted by: Guest on February-19-2021

Python Answers by Framework

Browse Popular Code Answers by Language