How could I extract a location from a string like San Francisco 49ers and get San Francisco from it? The only way I can is by training a neural-network, but training with every city, state, country, location is expensive isn't it? Wouldn't it be?

Is there another way to approach this?

  • I'm voting to close this question as off-topic because it is about choosing the software library, not about the NLP algorithms. Jun 17, 2015 at 18:26

1 Answer 1


You can parse the string with a regular expression. You can use the Google Geocoding API to enter a location like San Francisco and get data related to that location, like latitude, longitude, etc.

Yes, building your own geolocation service would be very costly - let Google's API do the work for you!

  • I forgot that I am already using the geocoding api! Thank you. I'll see if it works!
    – wordSmith
    Jun 17, 2015 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.