项目导入eclipse,已按照说明文档导入了依赖的jar包,并在Globals.java中配置本地搭建gstore的ip和port(gstore中已导入DBpedia2016 triple file),运行GanswerHttp.java报错如下:
......................(此处省略部分输出日志)......................
====== gAnswer2.0 over DBpedia ======
Adding annotator tokenize
Adding annotator ssplit
Adding annotator pos
Loading default properties from tagger edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger
Reading POS tagger model from edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger ... done [0.7 sec].
Adding annotator lemma
Loading parser from serialized file edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz ...Loading MaltParser ... done [0.6 sec].
org.maltparser.core.config.ConfigurationException: Couldn't find the MaltParser configuration file: engmalt.linear-1.7.mco
at org.maltparser.core.config.ConfigurationDir.(ConfigurationDir.java:124)
at org.maltparser.core.config.ConfigDirChartItem.initialize(ConfigDirChartItem.java:85)
at org.maltparser.core.flow.FlowChartInstance.initChartItem(FlowChartInstance.java:72)
at org.maltparser.core.flow.FlowChartInstance.(FlowChartInstance.java:53)
at org.maltparser.core.flow.FlowChartManager.initialize(FlowChartManager.java:104)
at org.maltparser.Engine.initialize(Engine.java:45)
at org.maltparser.MaltParserService.initializeParserModel(MaltParserService.java:109)
at nlp.tool.MaltParser.(MaltParser.java:22)
at qa.Globals.init(Globals.java:58)
at application.GanswerHttp.main(GanswerHttp.java:71)
MaltParser exception: Couldn't find the MaltParser configuration file: engmalt.linear-1.7.mco
Loading classifier from E:\github\gAnswer-master...\lib\stanford-ner-2012-11-11\classifiers\english.all.3class.distsim.crf.ser.gz ... Error deserializing E:\github\gAnswer-master...\lib\stanford-ner-2012-11-11\classifiers\english.all.3class.distsim.crf.ser.gz
Exception in thread "main" java.lang.RuntimeException: java.io.FileNotFoundException: ...\lib\stanford-ner-2012-11-11\classifiers\english.all.3class.distsim.crf.ser.gz (系统找不到指定的路径。)
at edu.stanford.nlp.ie.AbstractSequenceClassifier.loadClassifierNoExceptions(AbstractSequenceClassifier.java:1669)
at edu.stanford.nlp.ie.AbstractSequenceClassifier.loadClassifierNoExceptions(AbstractSequenceClassifier.java:1620)
at edu.stanford.nlp.ie.AbstractSequenceClassifier.loadClassifierNoExceptions(AbstractSequenceClassifier.java:1603)
at edu.stanford.nlp.ie.crf.CRFClassifier.getClassifierNoExceptions(CRFClassifier.java:3017)
at nlp.tool.NERecognizer.(NERecognizer.java:24)
at qa.Globals.init(Globals.java:61)
at application.GanswerHttp.main(GanswerHttp.java:71)
Caused by: java.io.FileNotFoundException: ...\lib\stanford-ner-2012-11-11\classifiers\english.all.3class.distsim.crf.ser.gz (系统找不到指定的路径。)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:213)
at java.base/java.io.FileInputStream.(FileInputStream.java:155)
at edu.stanford.nlp.ie.AbstractSequenceClassifier.loadClassifier(AbstractSequenceClassifier.java:1651)
at edu.stanford.nlp.ie.AbstractSequenceClassifier.loadClassifierNoExceptions(AbstractSequenceClassifier.java:1666)
... 6 more
发送http://localhost:9999/gSolve/?data={maxAnswerNum:1,%20maxSparqlNum:2,%20question:Who%20is%20the%20wife%20of%20Donald%20Trump?} 请求后报错如下:
[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 fgmt.EntityFragment.getEntityMappingList(EntityFragment.java:89)
at qa.extract.EntityRecognition.getEntityIDsAndNamesByStr(EntityRecognition.java:729)
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.base/java.lang.Thread.run(Thread.java:835)
项目导入eclipse,已按照说明文档导入了依赖的jar包,并在Globals.java中配置本地搭建gstore的ip和port(gstore中已导入DBpedia2016 triple file),运行GanswerHttp.java报错如下: ......................(此处省略部分输出日志)...................... ====== gAnswer2.0 over DBpedia ====== Adding annotator tokenize Adding annotator ssplit Adding annotator pos Loading default properties from tagger edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger Reading POS tagger model from edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger ... done [0.7 sec]. Adding annotator lemma Loading parser from serialized file edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz ...Loading MaltParser ... done [0.6 sec]. org.maltparser.core.config.ConfigurationException: Couldn't find the MaltParser configuration file: engmalt.linear-1.7.mco at org.maltparser.core.config.ConfigurationDir.(ConfigurationDir.java:124)
at org.maltparser.core.config.ConfigDirChartItem.initialize(ConfigDirChartItem.java:85)
at org.maltparser.core.flow.FlowChartInstance.initChartItem(FlowChartInstance.java:72)
at org.maltparser.core.flow.FlowChartInstance.(FlowChartInstance.java:53)
at org.maltparser.core.flow.FlowChartManager.initialize(FlowChartManager.java:104)
at org.maltparser.Engine.initialize(Engine.java:45)
at org.maltparser.MaltParserService.initializeParserModel(MaltParserService.java:109)
at nlp.tool.MaltParser.(MaltParser.java:22)
at qa.Globals.init(Globals.java:58)
at application.GanswerHttp.main(GanswerHttp.java:71)
MaltParser exception: Couldn't find the MaltParser configuration file: engmalt.linear-1.7.mco
Loading classifier from E:\github\gAnswer-master...\lib\stanford-ner-2012-11-11\classifiers\english.all.3class.distsim.crf.ser.gz ... Error deserializing E:\github\gAnswer-master...\lib\stanford-ner-2012-11-11\classifiers\english.all.3class.distsim.crf.ser.gz
Exception in thread "main" java.lang.RuntimeException: java.io.FileNotFoundException: ...\lib\stanford-ner-2012-11-11\classifiers\english.all.3class.distsim.crf.ser.gz (系统找不到指定的路径。)
at edu.stanford.nlp.ie.AbstractSequenceClassifier.loadClassifierNoExceptions(AbstractSequenceClassifier.java:1669)
at edu.stanford.nlp.ie.AbstractSequenceClassifier.loadClassifierNoExceptions(AbstractSequenceClassifier.java:1620)
at edu.stanford.nlp.ie.AbstractSequenceClassifier.loadClassifierNoExceptions(AbstractSequenceClassifier.java:1603)
at edu.stanford.nlp.ie.crf.CRFClassifier.getClassifierNoExceptions(CRFClassifier.java:3017)
at nlp.tool.NERecognizer.(NERecognizer.java:24)
at qa.Globals.init(Globals.java:61)
at application.GanswerHttp.main(GanswerHttp.java:71)
Caused by: java.io.FileNotFoundException: ...\lib\stanford-ner-2012-11-11\classifiers\english.all.3class.distsim.crf.ser.gz (系统找不到指定的路径。)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:213)
at java.base/java.io.FileInputStream.(FileInputStream.java:155)
at edu.stanford.nlp.ie.AbstractSequenceClassifier.loadClassifier(AbstractSequenceClassifier.java:1651)
at edu.stanford.nlp.ie.AbstractSequenceClassifier.loadClassifierNoExceptions(AbstractSequenceClassifier.java:1666)
... 6 more
发送http://localhost:9999/gSolve/?data={maxAnswerNum:1,%20maxSparqlNum:2,%20question:Who%20is%20the%20wife%20of%20Donald%20Trump?} 请求后报错如下: [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 fgmt.EntityFragment.getEntityMappingList(EntityFragment.java:89) at qa.extract.EntityRecognition.getEntityIDsAndNamesByStr(EntityRecognition.java:729) 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.base/java.lang.Thread.run(Thread.java:835)