当运行BaiduDemo.java 类时,报如下错误Unable to resolve "chineseFactored.ser.gz" as either class path, filename or URL
Closed this issue · 2 comments
17:17:39.892 [main] INFO o.a.q.q.p.MainPartExtracter - 模型:chineseFactored.ser.gz
Loading parser from serialized file chineseFactored.ser.gz ...
java.io.IOException: Unable to resolve "chineseFactored.ser.gz" as either class path, filename or URL
at edu.stanford.nlp.io.IOUtils.getInputStreamFromURLOrClasspathOrFileSystem(IOUtils.java:434)
at edu.stanford.nlp.io.IOUtils.readStreamFromString(IOUtils.java:368)
at edu.stanford.nlp.parser.lexparser.LexicalizedParser.getParserFromSerializedFile(LexicalizedParser.java:606)
at edu.stanford.nlp.parser.lexparser.LexicalizedParser.getParserFromFile(LexicalizedParser.java:401)
at edu.stanford.nlp.parser.lexparser.LexicalizedParser.loadModel(LexicalizedParser.java:158)
at edu.stanford.nlp.parser.lexparser.LexicalizedParser.loadModel(LexicalizedParser.java:144)
at org.apdplat.qa.questiontypeanalysis.patternbased.MainPartExtracter.(MainPartExtracter.java:57)
Loading parser from text file chineseFactored.ser.gz java.io.IOException: Unable to resolve "chineseFactored.ser.gz" as either class path, filename or URL
at edu.stanford.nlp.io.IOUtils.getInputStreamFromURLOrClasspathOrFileSystem(IOUtils.java:434)
at edu.stanford.nlp.io.IOUtils.readerFromString(IOUtils.java:512)
at edu.stanford.nlp.parser.lexparser.LexicalizedParser.getParserFromTextFile(LexicalizedParser.java:540)
at edu.stanford.nlp.parser.lexparser.LexicalizedParser.getParserFromFile(LexicalizedParser.java:403)
at edu.stanford.nlp.parser.lexparser.LexicalizedParser.loadModel(LexicalizedParser.java:158)
at edu.stanford.nlp.parser.lexparser.LexicalizedParser.loadModel(LexicalizedParser.java:144)
at org.apdplat.qa.questiontypeanalysis.patternbased.MainPartExtracter.(MainPartExtracter.java:57)
看项目主页的“使用方法”
i have met the same problem. i even didn't use the parser but only the tagger, when i
new MaxentTagger("resources/english-left3words-distsim.tagger")
it just keep telling me that it cannot resolve it as a classpath, filename or url.....