Git Product home page Git Product logo

Comments (3)

AngledLuffa avatar AngledLuffa commented on May 17, 2024

CoreNLP should be able to read the caseless parser model. Is it possible
you are using code and models from different releases?

If you're using the latest code, it's also possible that the models file on
the website is out of date.

Regardless, it would help diagnosing the problem a lot if you said more
about how CoreNLP can't read the model. For example, if it's throwing an
exception, a copy of the exception would help.

There should not be conflicts if you use the same version for the two tools.

On Tue, Dec 23, 2014 at 11:03 PM, lkq1992yeah [email protected]
wrote:

In my project, I use Stanford CoreNLP to perform some basic operations.
Meanwhile I need use a caseless model for parsing, so I chose
"englichPCFG.caseless.ser.gz" in the model of Stanford Parser. However,
CoreNLP cannot read this model, so I added Stanford Parser into my project,
along with CoreNLP.

But here comes the question: there are java files with the same path (same
package and same name) in both Stanford CoreNLP and Stanford Parser, once
there are slight differences between these two java files, things got
complicated, because I don't know which function am I going to call in my
project. Actually after I added Stanford Parser in my project, the original
lemmatize module couldn't work, error was occurred when loading the model.

Is there anyone who tried to add both Stanford Parser and Stanford CoreNLP
in one project, and could you give me some advice to avoid conflicts?
Thanks. :-)


Reply to this email directly or view it on GitHub
#43.

from corenlp.

lkq1992yeah avatar lkq1992yeah commented on May 17, 2024

Emm, maybe the version of Stanford Parser model is a little bit older.
Currently I used stanford-corenlp-3.4 and stanford-parser-2.0.5.

Below is the exception when I only use CoreNLP to load a caseless parsing model:
Loading parser from serialized file edu/stanford/nlp/models/lexparser/englishPCFG.caseless.ser.gz ...
java.lang.RuntimeException: java.lang.ClassNotFoundException: edu.stanford.nlp.util.LowercaseFunction
at edu.stanford.nlp.parser.lexparser.LexicalizedParser.loadModel(LexicalizedParser.java:206)
at edu.stanford.nlp.parser.lexparser.LexicalizedParser.getParserFromSerializedFile(LexicalizedParser.java:630)
at edu.stanford.nlp.parser.lexparser.LexicalizedParser.getParserFromFile(LexicalizedParser.java:424)
at edu.stanford.nlp.parser.lexparser.LexicalizedParser.loadModel(LexicalizedParser.java:183)
at edu.stanford.nlp.parser.lexparser.LexicalizedParser.loadModel(LexicalizedParser.java:162)
at kangqi.baseline.TypeWordExtractor.initSyntParser(TypeWordExtractor.java:44)
at kangqi.baseline.TypeWordExtractor.main(TypeWordExtractor.java:181)
My CoreNLP doesn't contain edu.stanford.nlp.util.LowercaseFunction, while Stanford Parser has.

And below is the exception when I added CoreNLP and Parser together, then try to lemmatize:
Exception in thread "main" java.lang.NoSuchMethodError: edu.stanford.nlp.process.WordToSentenceProcessor.stringToNewlineIsSentenceBreak(Ljava/lang/String;)Ledu/stanford/nlp/process/WordToSentenceProcessor$NewlineIsSentenceBreak;
at edu.stanford.nlp.pipeline.WordsToSentencesAnnotator.(WordsToSentencesAnnotator.java:55)
at edu.stanford.nlp.pipeline.StanfordCoreNLP$3.create(StanfordCoreNLP.java:529)
at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:85)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:267)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:129)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:125)
at kangqi.util.grammar.Lemmatizer.initPipeline(Lemmatizer.java:27)
at kangqi.util.grammar.Lemmatizer.lemmatize(Lemmatizer.java:32)
at kangqi.baseline.TypeWordExtractor.parseQuestion(TypeWordExtractor.java:71)
at kangqi.baseline.TypeWordExtractor.work(TypeWordExtractor.java:134)
at kangqi.baseline.TypeWordExtractor.main(TypeWordExtractor.java:142)

from corenlp.

AngledLuffa avatar AngledLuffa commented on May 17, 2024

Using these versions together will definitely not work.

I suggest updating to the latest version of both parser and corenlp and
using the caseless models available on the webpage. If those still don't
work, it is possible the models are out of date. If so, we will post new
ones.

On Wed, Dec 24, 2014 at 1:16 AM, lkq1992yeah [email protected]
wrote:

Emm, maybe the version of Stanford Parser model is a little bit older.
Currently I used stanford-corenlp-3.4 and stanford-parser-2.0.5.

Below is the exception when I only use CoreNLP to load a caseless parsing
model:
Loading parser from serialized file
edu/stanford/nlp/models/lexparser/englishPCFG.caseless.ser.gz ...
java.lang.RuntimeException: java.lang.ClassNotFoundException:
edu.stanford.nlp.util.LowercaseFunction
at
edu.stanford.nlp.parser.lexparser.LexicalizedParser.loadModel(LexicalizedParser.java:206)
at
edu.stanford.nlp.parser.lexparser.LexicalizedParser.getParserFromSerializedFile(LexicalizedParser.java:630)
at
edu.stanford.nlp.parser.lexparser.LexicalizedParser.getParserFromFile(LexicalizedParser.java:424)
at
edu.stanford.nlp.parser.lexparser.LexicalizedParser.loadModel(LexicalizedParser.java:183)
at
edu.stanford.nlp.parser.lexparser.LexicalizedParser.loadModel(LexicalizedParser.java:162)
at
kangqi.baseline.TypeWordExtractor.initSyntParser(TypeWordExtractor.java:44)
at kangqi.baseline.TypeWordExtractor.main(TypeWordExtractor.java:181)
My CoreNLP doesn't contain edu.stanford.nlp.util.LowercaseFunction, while
Stanford Parser has.

And below is the exception when I added CoreNLP and Parser together, then
try to lemmatize:
Exception in thread "main" java.lang.NoSuchMethodError:
edu.stanford.nlp.process.WordToSentenceProcessor.stringToNewlineIsSentenceBreak(Ljava/lang/String;)Ledu/stanford/nlp/process/WordToSentenceProcessor$NewlineIsSentenceBreak;
at
edu.stanford.nlp.pipeline.WordsToSentencesAnnotator.(WordsToSentencesAnnotator.java:55)
at
edu.stanford.nlp.pipeline.StanfordCoreNLP$3.create(StanfordCoreNLP.java:529)
at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:85)
at
edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:267)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:129)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:125)
at kangqi.util.grammar.Lemmatizer.initPipeline(Lemmatizer.java:27)
at kangqi.util.grammar.Lemmatizer.lemmatize(Lemmatizer.java:32)
at
kangqi.baseline.TypeWordExtractor.parseQuestion(TypeWordExtractor.java:71)
at kangqi.baseline.TypeWordExtractor.work(TypeWordExtractor.java:134)
at kangqi.baseline.TypeWordExtractor.main(TypeWordExtractor.java:142)


Reply to this email directly or view it on GitHub
#43 (comment).

from corenlp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.