从文本中提取国家和城市提及
geotext的Python项目详细描述
Geotext从文本中提取国家和城市提到的内容
- 自由软件:麻省理工学院许可证
- 文档:https://geotext.readthedocs.org。
用法
fromgeotextimportGeoTextplaces=GeoText("London is a great city")places.cities# "London"# filter by country coderesult=geotext.GeoText('I loved Rio de Janeiro and Havana','BR').cities# 'Rio de Janeiro'GeoText('New York, Texas, and also China').country_mentions# OrderedDict([(u'US', 2), (u'CN', 1)])
安装
pip install https://github.com/elyase/geotext/archive/master.zip
功能
- 无外部依赖关系
- 快
- 根据Creative Commons Attribution 3.0许可证授权的http://www.geonames.org中的数据。
类似项目
geography:地理比土工布更先进,范围更广,可以做土工布所做的一切。另一方面,geotext更精简:没有外部依赖性,速度更快(re vs nltk),还依赖于包含更多许可证的库和数据。
历史记录
0.4.0(2018-07-30)
修复Unicode错误
0.3.0(2017-12-03)
对巴西城市的支持(感谢@joseluizcoe)
0.2.0(2017-07-01)
- python 3支持(记入@freezer9)
0.1.0(2014-01-11)
- pypi上的第一个版本。