gAnswer
gAnswer copied to clipboard
gAnswerHttp启动后出现NullPointerException,请问如何解决,多谢。
gAnswer启动过程报错:
====== gAnswer2.0 over Pkubase ======
java.io.IOException: Unable to open "edu/stanford/nlp/models/lexparser/chinesePCFG.ser.gz" as class path, filename or URL
at edu.stanford.nlp.io.IOUtils.getInputStreamFromURLOrClasspathOrFileSystem(IOUtils.java:480)
at edu.stanford.nlp.io.IOUtils.readStreamFromString(IOUtils.java:400)
at edu.stanford.nlp.parser.lexparser.LexicalizedParser.getParserFromSerializedFile(LexicalizedParser.java:601)
at edu.stanford.nlp.parser.lexparser.LexicalizedParser.getParserFromFile(LexicalizedParser.java:405)
at edu.stanford.nlp.parser.lexparser.LexicalizedParser.loadModel(LexicalizedParser.java:187)
at edu.stanford.nlp.parser.lexparser.LexicalizedParser.loadModel(LexicalizedParser.java:166)
at nlp.tool.StanfordParser.
- Total *: 816ms.
==========================
Server ready!
查询过程过错,日志如下:
[Input:] Who is the wife of Barack Obama
Result: who, ,①, ,the, ,wife, ,of, ,barack, ,obama,
step0 [Node Recognition] : 0ms
transQ: Who is the wife of Barack Obama
java.lang.NullPointerException
at nlp.tool.StanfordParser.getTypedDependencyList(StanfordParser.java:46)
at nlp.ds.DependencyTree.
(DependencyTree.java:32) at qa.parsing.QuestionParsing.getDependenciesAndNER(QuestionParsing.java:22) at qa.parsing.QuestionParsing.process(QuestionParsing.java:14) at qa.GAnswer.getSparqlList(GAnswer.java:66) at application.GanswerHandler.handle(GanswerHandler.java:66)
说明: 我是本地windows环境下载源码gAnswer-pkubase.zip和ganswer_pkubase_lib.rar编译的,对接自己搭建的gStore环境(gStore用的是lubm数据库)。
问答查询过程出错,日志如下。请问如何解决,多谢。 [Input:] Who is the wife of Barack Obama Result: who, ,①, ,the, ,wife, ,of, ,barack, ,obama, step0 [Node Recognition] : 0ms transQ: Who is the wife of Barack Obama java.lang.NullPointerException at nlp.tool.StanfordParser.getTypedDependencyList(StanfordParser.java:46) at nlp.ds.DependencyTree.(DependencyTree.java:32) at qa.parsing.QuestionParsing.getDependenciesAndNER(QuestionParsing.java:22) at qa.parsing.QuestionParsing.process(QuestionParsing.java:14) at qa.GAnswer.getSparqlList(GAnswer.java:66) at application.GanswerHandler.handle(GanswerHandler.java:66)
您好!从报错信息看,您的问题是由中文语法树生成器未能正确加载导致的。建议您确认是否已经正确下载所需的jar包,并且正确地将它们放置在lib文件夹并加入Build Path中。 另外,我们更推荐使用linux系统运行ganswer,以避免兼容性问题
您好,我浏览器进行http请求,输入为:http://localhost:9999/gSolve/?data={maxAnswerNum:3,needSparql:1,question:who%20is%20the%20wife%20of%20Donald%20Trump?},输出为:{"question":"who is the wife of Donald Trump?","message":"InvalidQuestionException: the question you input is invalid, please check","status":"500"},日志为:
[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.
也是空指针错误,请问您知道怎么解决这个问题吗