Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incompatible constructor arguments. #19

Open
cheeryoung79 opened this issue Sep 11, 2022 · 3 comments
Open

incompatible constructor arguments. #19

cheeryoung79 opened this issue Sep 11, 2022 · 3 comments

Comments

@cheeryoung79
Copy link

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
Copy link

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

@WYBupup
Copy link

WYBupup commented Dec 7, 2023

@chaoaibeidanci
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants