你好,看了你的“pyltp的初始化报错:segmentor = Segmentor() # 初始化实例TypeError: init(): incompatible constructor argument”,很好的解决了问题,但是接下来的运行又遇到了一个问题但我不知道是否还跟这个pyltp的版本有关。
我对过了原代码,基本一致,就是不知道哪里出错了,在网上查询了很多无果,望解答!谢谢!
Traceback (most recent call last):
File "D:\tech\neo4j_work\EventTriplesExtraction-master\sentence_parser.py", line 70, in <module>
words, postags, child_dict_list, roles_dict, format_parse_list = parse.parser_main(sentence)
File "D:\tech\neo4j_work\EventTriplesExtraction-master\sentence_parser.py", line 61, in parser_main
child_dict_list, format_parse_list = self.build_parse_child_dict(words, postags, arcs)
File "D:\tech\neo4j_work\EventTriplesExtraction-master\sentence_parser.py", line 39, in build_parse_child_dict
if arcs[arc_index].head == index+1: #arcs的索引从1开始
AttributeError: 'tuple' object has no attribute 'head'