pkumod / gAnswer

A KBQA system based on DBpedia.
http://ganswer.gstore-pku.com
BSD 3-Clause "New" or "Revised" License
376 stars 98 forks source link

gAnwer运行正确,我用的是浏览器进行http请求,输出结果是{"question":"who is the wife of Donald Trump?","message":"InvalidQuestionException: the question you input is invalid, please check","status":"500"},日志如下: #52

Open haozheng61 opened 3 years ago

haozheng61 commented 3 years ago

[Input:] who is the wife of Donald Trump? EntityRecognizer Initial : ok! --------- entity/type recognition start --------- Type Check: wife Type Check: Donald Ent Check: Donald java.lang.NullPointerException at qa.mapping.DBpediaLookup.getEntityMappings(DBpediaLookup.java:53) at qa.extract.EntityRecognition.getEntityIDsAndNamesByStr(EntityRecognition.java:734) at qa.extract.EntityRecognition.process(EntityRecognition.java:330) at qa.Query.getMergedQuestionList(Query.java:109) at qa.Query.(Query.java:35) at qa.GAnswer.getSparqlList(GAnswer.java:42) at application.GanswerHandler.handle(GanswerHandler.java:66) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1096) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1032) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:258) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:445) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:267) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:224) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:358) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532) at java.lang.Thread.run(Unknown Source)

麻烦告知一下,谢谢您

haozheng61 commented 3 years ago

我http请求的输入是 http://localhost:9999/gSolve/?data={maxAnswerNum:3,needSparql:1,question:who%20is%20the%20wife%20of%20Donald%20Trump?}

nicklin96 commented 3 years ago

您好!这里是因为dbpedialookup它更新成https访问了,gAnswer中原来的访问方法无法处理https,我们正在着手修改这部分的代码。如果您急需使用的话,您可以在本地自己建一个dbpedialookup,您可以发一封邮件到我的邮箱linyinnian@pku.edu.cn 我可以把相关文件发给您。

haozheng61 commented 3 years ago

好的,谢谢,因为我需要中文知识问答,然后我就避开了dbpedialookup的问题,但是现在我在测试中文问答的源码时,发现输出结果为:{"question":"北京奥运会的口号是什么?","vars":["?口号"],"sparql":["select DISTINCT ?口号 where { <2008年北京奥运会>\t<口号>\t?口号. } LIMIT 3"],"results":{"bindings":[]},"status":"200"} 输出日志为: java.io.IOException: Server returned HTTP response code: 502 for URL: http://pkubase.gstore-pku.com:80/%3Foperation%3Dquery%26username%3Dendpoint%26password%3D123%26db_name%3Dpkubase%26format%3Dtxt%26sparql%3Dselect+DISTINCT+%3F%E5%8F%A3%E5%8F%B7++where+%7B+%3C2008%E5%B9%B4%E5%8C%97%E4%BA%AC%E5%A5%A5%E8%BF%90%E4%BC%9A%3E%09%3C%E5%8F%A3%E5%8F%B7%3E%09%3F%E5%8F%A3%E5%8F%B7.+%7D+LIMIT+3 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1950) at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1945) at java.security.AccessController.doPrivileged(Native Method) at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1944) at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1514) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498) at jgsc.GstoreConnector.sendGet(GstoreConnector.java:67) at jgsc.GstoreConnector.query(GstoreConnector.java:264) at qa.GAnswer.getAnswerFromGStore2(GAnswer.java:159) at application.GanswerHandler.handle(GanswerHandler.java:89) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1096) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1032) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:258) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:445) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:267) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:224) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:358) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532) at java.lang.Thread.run(Thread.java:748) Caused by: java.io.IOException: Server returned HTTP response code: 502 for URL: http://pkubase.gstore-pku.com:80/%3Foperation%3Dquery%26username%3Dendpoint%26password%3D123%26db_name%3Dpkubase%26format%3Dtxt%26sparql%3Dselect+DISTINCT+%3F%E5%8F%A3%E5%8F%B7++where+%7B+%3C2008%E5%B9%B4%E5%8C%97%E4%BA%AC%E5%A5%A5%E8%BF%90%E4%BC%9A%3E%09%3C%E5%8F%A3%E5%8F%B7%3E%09%3F%E5%8F%A3%E5%8F%B7.+%7D+LIMIT+3 at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498) at sun.net.www.protocol.http.HttpURLConnection.getHeaderFields(HttpURLConnection.java:3084) at jgsc.GstoreConnector.sendGet(GstoreConnector.java:64)

这是不是因为您那边服务器服务没开???,因为我这边没有建立本地的gStore库

nicklin96 commented 3 years ago

这两天一直有个脚本在发送导致重启的查询,我们正在处理~ 建议的话还是本地建一个比较稳定~

haozheng61 commented 3 years ago

这两天一直有个脚本在发送导致重启的查询,我们正在处理~ 建议的话还是本地建一个比较稳定~

好的,谢谢您在百忙之中帮我回答这些问题。

nicklin96 commented 3 years ago

https://pan.baidu.com/s/1qeRIRBMqUbahhF-7QwNIpQ 这个是目前用的知识库 密码m9gc

haozheng61 commented 3 years ago

https://pan.baidu.com/s/1qeRIRBMqUbahhF-7QwNIpQ 这个是目前用的知识库 密码m9gc

您好,能否提供一个相对较小的pkubase triples文件,我这边想构建本地gStore库,但是您之前提供的文件太大了,我现在只是想跑通您的这个gAnswer问答系统。