相关疑难解决方法(0)

如何从文本中提取国家?

我使用Python 3(我也安装了Python 2),我想从短文本中提取国家或城市.例如,text = "I live in Spain"text = "United States (New York), United Kingdom (London)".

各国答案:

  1. 西班牙
  2. [美国,英国]

我试图安装,geography但我无法运行pip install geography.我收到此错误:

收集地理位置找不到满足要求地理位置的版本(来自版本:)没有找到地理位置的匹配分布

它看起来geography只适用于Python 2.

我也有geopandas,但我不知道如何使用geopandas从文本中提取所需的信息.

python geography nltk python-3.x

6
推荐指数
1
解决办法
3323
查看次数

标签 统计

geography ×1

nltk ×1

python ×1

python-3.x ×1