Questions tagged [geotext]

https://pypi.org/project/geotext/

see also https://stackoverflow.com/questions/tagged/geograpy for an alternative package

7 questions
2
votes
2 answers

What is the easiest way to check if a city name belongs to a given country?

I have two lists of city and country names, and I would like to check which city belong to which country. What is the easiest way to achieve that in python? Please note that I have used till now GeoText to extract city and country names from a test…
I. A
  • 2,252
  • 26
  • 65
2
votes
1 answer

Python - Geotext - Cities like "Rio de Janeiro" are not recognized

I'm trying to use GeoText to genrate country mentions, but cities like Rio de Janeiro, Rio das Ostras are not recognized. I verified the dictionary and those cities are OK in there. Input: text = "Rio de Janeiro, Las Vegas, New York" geo =…
1
vote
0 answers

Getting instead of the city name

I am new to python I am trying to extract the city from text which is all over the place: For an Example: London, HighgateLondon, etc. I am using GeoText to try and extract this. However, when I run it fills the column with
Red_bull
  • 19
  • 5
1
vote
1 answer

Geotext detecting countries in some cases, not detecting the same country in a different case

Im trying to extract all the countries in a string using Geotext It works fine for a few sentences but doesnt work for some. Ive tried to do it in Python 3.6. s="India Vs Ireland T20 Series" s=GeoText(s) s.countries Expected…
1
vote
1 answer

geotext library is not picking up the correct name of cities in python

Hi I am new bee in python and we are trying to find the country ,cities name from geotext library of python but it is not picking every name correctly. could anyone please suggest what should be wrong. While reading the data from email it is…
sharma
  • 23
  • 3
1
vote
1 answer

GeoText and UDF in PySpark

I'm a noobie in PySpark (Spark 2.1.0 and python 3.5) and I have a problem which I could't pass. I try to use GeoText in UDF, here is my code: def countries(x): count = GeoText(x).countries w = '' if not count: return '' …
PastorPL
  • 968
  • 3
  • 17
  • 36
-1
votes
2 answers

Cannot import name 'GeoText' from the geotext Python package

I have installed the geotext module from pip. However this line: from geotext import GeoText produces this error: ImportError: cannot import name 'GeoText' The module structure is as follows: where there is no sub directory but directly the…
Anindita Bhowmik
  • 844
  • 1
  • 10
  • 18