问题
How to find if a word in a sentence is pointing to a city
I live in San Francisco I work in San Jose I was born in New York
Is there a way to find that "San Francisco" is a city in the above sentence.
回答1:
The task of recognising possibly multi-word expressions that reference individuals of various specific types (locations, but also organisations, dates, etc.) is called named-entity recognition (NER).
For a simple task such as yours, existing freely available tools and models are sufficient. You could try the Stanford Named Entity Recognizer, which is free software. Try analysing your sentence using their online demo.
来源:https://stackoverflow.com/questions/22397698/how-to-find-if-a-word-in-a-sentence-is-pointing-to-a-city