1

我尝试运行geograpy3自述文件中给出的示例代码。但是,我得到这样的答案。可以做些什么呢?

在此处输入图像描述

4

1 回答 1

1

您的问题引发了与https://github.com/somnathrakshit/geograpy3/issues/3类似的问题

现在有一个 get_geoPlace_context 函数,它将搜索限制为 NLTK 的 GPE 标签,因此忽略 PERSON 和 ORGANIZATION 条目,因为原始函数 get_place_context 会这样做:

另见test_extractor.py

 def testGetGeoPlace(self):
    '''
    test geo place handling
    '''
    url='http://www.bbc.com/news/world-europe-26919928'
    places=geograpy.get_geoPlace_context(url=url)
    if self.debug:
        print(places)
    self.assertEqual(['Moscow', 'Donetsk', 'Brussels', 'Kharkiv', 'Russia'],places.cities)
于 2020-09-11T07:33:29.200 回答