I am using Python geograpy library to extract city names from a text Here is my code:-
import geograpy
text='I live in Kadawatha'
places = geograpy.get_place_context(text=text)
print(places.country_cities)
OUTPUT:- { }
When I extract city names from a URL it works but from a text, it is not possible and also there is another way to do this by using geograpy.extraction but that is not extracting all possible city names so that I want to use above mentioned way to do this. In additionally there is another question(Unable to extract countries/cities name from text file using geograpy) related to this but that is also not working.