1from nltk.tag import StanfordNERTagger
2from nltk.tokenize import word_tokenize
3
4
5
6st = StanfordNERTagger('/content/english.muc.7class.distsim.crf.ser.gz',
7 '/content/stanford-ner.jar',
8 encoding='utf-8')
9
10text = 'While in France, Christine Lagarde discussed short-term stimulus efforts in a recent interview with the Wall Street Journal.'
11
12tokenized_text = word_tokenize(text)
13classified_text = st.tag(tokenized_text)
14
15print(classified_text)