Closed MingleiLI closed 6 years ago
HI~ LTP CLOUD已经完成了更新,更新后使用新版api地址,即官方的地址:http://api.ltp-cloud.com/analysis/ 。 之前的地址是哈工大讯飞语言云,致力于稳定高并发的服务,现在的LTP CLOUD服务已经完成分离,原始数据已经导入到该api下,新的API提供语义依存分析(SDP)服务,致力于最新科研成果(LTP)的展示。 欢迎使用新版API,并提出宝贵的意见和反馈。
Another issue; when using xml for pos tagging results, it only returns bad request error(Error 400), even we use the CustomPOSTags.py which provided in your offical github website.
@YUNFEILONG Hi , I have test the CustomPOSTags.py
file , just using right API_KEY for ltpapi.voicecloud.cn , I have get the default result . Then I have changed format
from "conll" to "xml" , I still get an answer . Changing "dp" to "pos" also has been tested .
So may you test agin or give more detail message ?
Dear XU WEI: Is the uri_base equal to 'ltpapi.voicecloud.cn' or "http://api.ltp-cloud.com/analysis/?"?, I have use the later one because the former one seems not authorize me to call the api. but still I get the 'Bad request'. Is the problem because I use 'http://api.ltp-cloud.com/analysis/?' instead of 'ltpapi.voicecloud.cn', or because of other issues. Best wishes! YUNFEI LONG
I am sorry for the confused situation .
As far as I test , the api.ltp-cloud.com
actually do not support customizing the input , that is , the field xml_input=true
will cause the server in api.ltp-cloud.com
return the wrong response . But the original(or the past , the another ...) service ltpapi.voicecloud.cn
support it ! But the way to registrating the ltpapi.voicecloud.cn
seems to be closed. ( At least , our ltp-cloud.com has cloused it).
I am wondering whether you need customizing the input , that is , you provide the word segmentation or even POS-TAG . it not , you may just need to using current api.ltp-cloud.com
, and disabled xml_input
(just omit it ) . It a customizing input is really needed , I'll try to get more information and give a nicer solution (it may be after 2016-01-03 , for the vacation )
More detailed infomation aboud api.ltp-cloud.com
,see 语言云文档 , only Chinese version is available currently .
update: xml_input=True
can work fine, see below.
@YUNFEILONG By asking from @Oneplus , an access to the ltpapi.voicecloud.cn
have been clearly found .
Firstly , visit 讯飞语言云 and make an registion(click 登录/注册
in the top right corner) to create an account .
Secondly , under the accout to click 创建新应用
to create an app(service) , choosing 语言云
and you 'll get an API_KEY to access the ltpapi.voicecloud.cn
memeda: 你好,我想确认一下,现在 api.ltp-cloud.com 服务不提供用户自定义输入是么?比如在已经自定义分词的基础上再调用词性标注的服务。 谢谢
@hui001 这个之前报过BUG,是XML随着模型更新后格式发生改变,原来校验XML正确性的代码还没有更新,但是具体哪里有问题我没有再细查了(= =), 我尽量这周末解决掉这个问题啊
@memeda 好的,非常感谢~
@hui001 找到问题了,非常简单...
请在输入自定义的XML时,保证note
标签下包含以下全部属性:
<note sent="y" word="y" pos="n" ne="n" parser="n" semparser="n" lstmsemparser="y" srl="n" />
会报BAD XML FORMAT
错误就是因为检查到属性不全或者属性值与实际输入不同。
具体地,之前是没有"semparser" 和 "lstmsemparser"属性,所以因为属性缺失导致错误;(现在Python接口下自定义输入的XML格式已经更新了,详情查看commit 9cc8a95
,可更新一下即可直接使用 )
此外,如果属性值与输入的XML数据不同,也会报此错误。比如,如果pos="y"
,但是xml里并没有提供pos
信息,那么就将报错。
@memeda 收到,谢谢~
您好,我在使用 CustomSegmentation.java的範例程式時,一直會有底下錯誤訊息: java.io.IOException: Server returned HTTP response code: 400 for URL: http://api.ltp-cloud.com/analysis/ at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441) at LTP.CustomSegmentation.analyze(CustomSegmentation.java:133) at LTP.CustomSegmentation.main(CustomSegmentation.java:38)
我已經將note部分添加底下兩個敘述 Element note = document.createElement("note"); note.setAttribute("sent", "y"); note.setAttribute("word", "y"); note.setAttribute("pos", "n"); note.setAttribute("ne", "n"); note.setAttribute("parser", "n"); note.setAttribute("semparser", "n"); note.setAttribute("lstmsemparser", "y"); note.setAttribute("srl", "n"); xml4nlp.appendChild(note);
結果還是有以上的錯誤訊息出來,不知道這邊還需要修正哪裡,才可以成功?? 以上希望可以幫助一下,感恩:D
@jiman0317
note.setAttribute("lstmsemparser", "y");
这里似乎应该是n
,改下试试呢~
@memeda 真的是如此呢,感謝! 直接看官方input結果以為是y,謝謝提醒!! 已經成功跑出來了:D
@memeda ,你好,打扰了。我也出现401的问题,但是我的网址已是"http://api.ltpcloud.com/analysis/?", api_key也没有问题,使用的python接口。请问是怎么回事?
@lmzl0302 不好意思,我已经毕业了哈,没有能力再维护这个了 ⏲ @Oneplus 师兄看看组里谁在维护呢,麻烦给解答一下吧
谢谢,打扰你了。
我覺得 你網址可以這樣改成 http>>https
我之前也會產生這種錯誤,不過 在http這邊 多+個s就解決了,但速度會比較慢。
太感谢了,真得解决了。
It return "UNAUTHORIZED" error when using the url uri_base = "http://ltpapi.voicecloud.cn/analysis/?" It works fine with the url = "http://api.ltp-cloud.com/analysis/?" from the official website http://www.ltp-cloud.com/document/