visual-NLP / ner.py
ryyhan's picture
Upload 10 files
a0325b5 verified
raw
history blame contribute delete
237 Bytes
import nltk
from nltk.tokenize import word_tokenize
nltk.download('maxent_ne_chunker')
nltk.download('words')
def namedEntityRecognition(corpus) -> list:
words = word_tokenize(corpus)
return (nltk.ne_chunk(nltk.pos_tag(words)))