August 2018
Intermediate to advanced
522 pages
12h 45m
English
Named Entity Recognition (NER) is a method for extracting specific pieces of semantic information from tokens. Consider the last example: we are interested in understanding whether Rome is a city, a lake, or a company. The action performed by our simple chatbot is, in fact, strictly related to the contextual element indicated by the generic proper noun (for example, if Rome is a city, the request can be easily fulfilled, while if it were a company, the chatbot should ask the exact location). Let's consider another example (the first steps are the same as the previous ones):
from nltk import word_tokenize, pos_tag, ne_chunk, tree2conlltagssentence_2 = 'Search a hotel in Cambridge near the MIT'print(tree2conlltags(ne_chunk(tags_2))) ...
Read now
Unlock full access