HIT-SCIR / pyltp

pyltp: the python extension for LTP
1.53k stars 352 forks source link

语义角色运行失败 #217

Closed laceylam closed 4 years ago

laceylam commented 4 years ago

其他模块都加载并且可以运行,语义角色模块加载,但是调用处理数据就出错了!我的系统是windows10, python3.6, 模块用的是3.4那个,试过了pisrl_win那个模块,还是不行,错误如下: Traceback (most recent call last): File "<pyshell#93>", line 1, in role=labeller.label(words, postags, netags, arcs) Boost.Python.ArgumentError: Python argument types in SementicRoleLabeller.label(SementicRoleLabeller, list, list, list, list) did not match C++ signature: label(struct SementicRoleLabeller {lvalue}, class boost::python::list, class boost::python::list, class std::vector<struct std::pair<int,class std::basic_string<char,struct std::char_traits,class std::allocator > >,class std::allocator<struct std::pair<int,class std::basic_string<char,struct std::char_traits,class std::allocator > > > >) label(struct SementicRoleLabeller {lvalue}, class boost::python::list, class std::vector<class std::basic_string<char,struct std::char_traits,class std::allocator >,class std::allocator<class std::basic_string<char,struct std::char_traits,class std::allocator > > >, class std::vector<struct std::pair<int,class std::basic_string<char,struct std::char_traits,class std::allocator > >,class std::allocator<struct std::pair<int,class std::basic_string<char,struct std::char_traits,class std::allocator > > > >) label(struct SementicRoleLabeller {lvalue}, class std::vector<class std::basic_string<char,struct std::char_traits,class std::allocator >,class std::allocator<class std::basic_string<char,struct std::char_traits,class std::allocator > > >, class boost::python::list, class std::vector<struct std::pair<int,class std::basic_string<char,struct std::char_traits,class std::allocator > >,class std::allocator<struct std::pair<int,class std::basic_string<char,struct std::char_traits,class std::allocator > > > >) label(struct SementicRoleLabeller {lvalue}, class std::vector<class std::basic_string<char,struct std::char_traits,class std::allocator >,class std::allocator<class std::basic_string<char,struct std::char_traits,class std::allocator > > >, class std::vector<class std::basic_string<char,struct std::char_traits,class std::allocator >,class std::allocator<class std::basic_string<char,struct std::char_traits,class std::allocator > > >, class std::vector<struct std::pair<int,class std::basic_string<char,struct std::char_traits,class std::allocator > >,class std::allocator<struct std::pair<int,class std::basic_string<char,struct std::char_traits,class std::allocator > > > >)

liu946 commented 4 years ago

看提示是传入了python的数据结构,与C++定义的数据类型不匹配导致的。目前master分支此接口仅支持从其他依赖模块输出的结果作为输入。我们已经在develop分支修复这个问题,将在 https://github.com/HIT-SCIR/pyltp/pull/216 合并后解决。