Closed zyn412 closed 6 years ago
I was using LTP 3.3.1
when I developed the model, not sure if the new version is compatible with the code. Could you also confirm you're using Python 2.7+ not Python 3 to run the sample code?
It would be more helpful to pinpoint the line which throws the above exception.
谢谢你的解答!
我确实用的是python2.7,并且程序不会报错,只是输出结果为空。程序打印出的全部信息如下,
Building prefix dict from the default dictionary ...
Loading model from cache /tmp/jieba.cache
Loading model cost 0.125 seconds.
Prefix dict has been built succesfully.
高博德是星展集团的执行总裁及董事。 星展集团是亚洲最大的金融服务集团之一, 拥有约3千5百亿美元资产和超过280间分行, 业务遍及18个市场。总部设于新加坡并于当地上市的星展, 在新加坡市场独佔鳌头, 拥有超过4百万名客户, 同时积极开拓大中华、东南亚和南亚地区市场。星展银行于2012年获《银行家》评选为「亚洲最佳银行」, 并荣获《环球金融》于去年评选为「亚太区最佳银行」, 以及2009至2015获选为「亚洲最安全的银行」。 加入星展集团之前, 他是花旗集团东南亚地区行政总裁, 负责东南亚地区, 澳洲和纽西兰的业务。 高博德的职业生涯始于1982年, 当时他任职印度花旗银行。多年来, 他先后于花旗集团的企业和零售银行掌管多个高级管理职务, 包括在新兴市场策略规划部担任主管, 也在环球交易服务部亚太地区担任区域主管职务。高博德也曾是花旗集团印尼、马来西亚和新加坡区的主管。 高博德是新加坡标新局副主席, 同时是亚洲金融及经济研究局的理事会成员、新加坡资讯通信发展管理局、国际金融研究所(IIF)、银行及财务学院、吴庆瑞博士奖学金基金会、万事达卡亚太、中东及非洲区域谘委员会的董事。他也是沈基文金融经济学院谘询理事会主席、新加坡银行公会的理事会成员, 以及印度商业领袖圆桌会议理事会成员 (属于新加坡印度人发展协会)。 高博德毕业自印度德里大学的 St. Stephen’s College, 考获经济学文学 (荣誉) 学士学位。他也拥有阿默达巴德 (Ahmedabad) 印度管理学院 (IIM) 管理深造文凭 (Post Graduate Diploma in Management)。
[dynet] random seed: 1840168501
[dynet] allocating memory: 2000MB
[dynet] memory allocation done.
Python argument types in
SementicRoleLabeller.label(SementicRoleLabeller, VectorOfString, VectorOfString, VectorOfString, VectorOfParseResult)
did not match C++ signature:
label(SementicRoleLabeller {lvalue}, boost::python::list, boost::python::list, std::vector<std::pair<int, std::cxx11::basic_string<char, std::char_traits
或许我应该试一下LTP 3.3.1
接上(抱歉我不知道有篇幅限制),在反复打印下面信息12次之后,输出 Triple: ,程序结束。 我想我应该去试试LTP3.3.1版本,可能是兼容性问题吧 Python argument types in SementicRoleLabeller.label(SementicRoleLabeller, VectorOfString, VectorOfString, VectorOfString, VectorOfParseResult) did not match C++ signature: label(SementicRoleLabeller {lvalue}, boost::python::list, boost::python::list, std::vector<std::pair<int, std::cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<int, std::cxx11::basic_string<char, std::char_traits, std::allocator > > > >) label(SementicRoleLabeller {lvalue}, boost::python::list, std::vector<std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::cxx11::basic_string<char, std::char_traits, std::allocator > > >, std::vector<std::pair<int, std::cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<int, std::cxx11::basic_string<char, std::char_traits, std::allocator > > > >) label(SementicRoleLabeller {lvalue}, std::vector<std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::cxx11::basic_string<char, std::char_traits, std::allocator > > >, boost::python::list, std::vector<std::pair<int, std::cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<int, std::cxx11::basic_string<char, std::char_traits, std::allocator > > > >) label(SementicRoleLabeller {lvalue}, std::vector<std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::cxx11::basic_string<char, std::char_traits, std::allocator > > >, std::vector<std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::cxx11::basic_string<char, std::char_traits, std::allocator > > >, std::vector<std::pair<int, std::cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<int, std::cxx11::basic_string<char, std::char_traits, std::allocator > > > >)
你好,我按指导安装好ltp(3.4.0),下载了pyltp,并下载了相应版本的model,运行example.py,执行结果为空。且产生提示如下, Python argument types in SementicRoleLabeller.label(SementicRoleLabeller, VectorOfString, VectorOfString, VectorOfString, VectorOfParseResult) did not match C++ signature: label(SementicRoleLabeller {lvalue}, boost::python::list, boost::python::list, std::vector<std::pair<int, std::cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<int, std:: cxx11::basic_string<char, std::char_traits, std::allocator > > > >)
label(SementicRoleLabeller {lvalue}, boost::python::list, std::vector<std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std:: cxx11::basic_string<char, std::char_traits, std::allocator > > >, std::vector<std::pair<int, std::cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<int, std:: cxx11::basic_string<char, std::char_traits, std::allocator > > > >)
label(SementicRoleLabeller {lvalue}, std::vector<std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std:: cxx11::basic_string<char, std::char_traits, std::allocator > > >, boost::python::list, std::vector<std::pair<int, std::cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<int, std:: cxx11::basic_string<char, std::char_traits, std::allocator > > > >)
label(SementicRoleLabeller {lvalue}, std::vector<std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std:: cxx11::basic_string<char, std::char_traits, std::allocator > > >, std::vector<std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std:: cxx11::basic_string<char, std::char_traits, std::allocator > > >, std::vector<std::pair<int, std::cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<int, std:: cxx11::basic_string<char, std::char_traits, std::allocator > > > >)
请问这是由于什么原因产生的?如何解决呢?