错误:Python3中不可能提供类建议topia.termex公司

2024-05-14 00:59:55 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在执行nlp任务。我为您编写了以下代码白蚁提取物. 执行时显示错误。如果您建议解决这些错误,这将很有帮助。你知道吗

from topia.termextract import extract
from topia.termextract import tag

# Setup Term Extractor
extractor = extract.TermExtractor()

# Some sample text
text ='''
Police shut Palestinian theatre in Jerusalem.

Israeli police have shut down a Palestinian theatre in East Jerusalem.

The action, on Thursday, prevented the closing event of an international
literature festival from taking place."""

# Extract Keywords
keywords_topica = extractor(text)
print(keywords_topica)

我在googlecolab中使用python3。你知道吗

---------------------------------------------------------------------------      
TypeError                                 Traceback (most recent call last)      
<ipython-input-23-9a094f024dfe> in <module>()      
 ----> 1 from topia.termextract import extract    
       2 from topia.termextract import tag     

 3 frames      
 /usr/local/lib/python3.6/dist-packages/zope/interface/declarations.py in implements(*interfaces)    
     481     # the coverage for this block there. :(     
     482     if PYTHON3:     
 --> 483         raise TypeError(_ADVICE_ERROR % 'implementer')    
     484     _implements("implements", interfaces, classImplements)    
     485      

     TypeError: Class advice impossible in Python3.  Use the @implementer class decorator instead.     

Tags: thetextinfromimporttag错误extract