liuhuanyong / EventTriplesExtraction

An experiment and demo-level tool for text information extraction (event-triples extraction), which can be a route to the event chain and topic graph, 基于依存句法与语义角色标注的事件三元组抽取,可用于文本理解如文档主题链,事件线等应用。
916 stars 220 forks source link

incompatible constructor arguments. #19

Open cheeryoung79 opened 2 years ago

cheeryoung79 commented 2 years ago

from triple_extraction import 报错 ---------------------------------------------------------------------------TypeError Traceback (most recent call last)/tmp/ipykernel_687/1960098357.py in ----> 1 from triple_extraction import ~/triple_extraction.py in 135 print('svos', svos) 136 --> 137 test() ~/triple_extraction.py in test() 131 content5 = ''' 以色列国防军20日对加沙地带实施轰炸,造成3名巴勒斯坦武装人员死亡。此外,巴勒斯坦人与以色列士兵当天在加沙地带与以交界地区发生冲突,一名巴勒斯坦人被打死。当天的冲突还造成210名巴勒斯坦人受伤。 132 当天,数千名巴勒斯坦人在加沙地带边境地区继续“回归大游行”抗议活动。部分示威者燃烧轮胎,并向以军投掷石块、燃烧瓶等,驻守边境的以军士兵向示威人群发射催泪瓦斯并开枪射击。''' --> 133 extractor = TripleExtractor() 134 svos = extractor.triples_main(content2) 135 print('svos', svos) ~/triple_extraction.py in init(self) 9 class TripleExtractor: 10 def init(self): ---> 11 self.parser = LtpParser() 12 13 '''文章分句处理, 切分长句,冒号,分号,感叹号等做切分标识''' ~/sentence_parser.py in init(self) 10 def init(self): 11 LTP_DIR = "./ltp_data_v3.4.0" ---> 12 self.segmentor = Segmentor() 13 self.segmentor.load(os.path.join(LTP_DIR, "cws.model")) 14 TypeError: init(): incompatible constructor arguments. The following argument types are supported:

  1. pyltp.Segmentor(model_path: str, lexicon_path: str = None, force_lexicon_path: str = None)

Invoked with:

ZilongXue commented 1 year ago

我也有这个报错,你解决了吗?

WYBupup commented 11 months ago

chaoaibeidanci commented 10 months ago

我也遇到了这个问题。。。请问楼上三位解决了么~