Last active
June 5, 2025 14:10
-
-
Save bbelderbos/f1a27f3617c3ff16e72c6728675cec3d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# dependencies = [ | |
# "geotext", | |
# ] | |
# /// | |
from geotext import GeoText | |
places = GeoText("I went from Paris to Berlin.") | |
print(places.cities) # ['Paris', 'Berlin'] | |
# testing it seems city names do need to be capitalized! | |
places = GeoText("How is the weather in Madrid today? And how about in Helsinki?") | |
print(places.cities) # ['Madrid', 'Helsinki'] # helsinki is not recognized |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If not robust / flex enough, you could also try Spacy ...