user1441719
user1441719

Reputation: 21

Stanford CoreNLP failing only on Windows

We're implementing a QA pipeline that starts by using Stanford CoreNLP to parse the question. It works perfectly on my Linux installation, but fails on my colleague's Windows. Has anybody else come across this problem before and have a resolution?

I'll start with a list of differences between the two set-ups and at the end I'll provide the stacktrace for the failure on Windows. I'm not sure what info is needed so please forgive me if I've missed something obvious!

O/S:
Linux: Linux Mint 15: Olivia (x86-64) 3.8.0-30-generic
Windows: Windows 7 Professional Service Pack 1

Java Version:
Linux: OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.13.04.2)
Windows: Java(TM) SE Runtime Environment (build 1.7.0_25-b17)

IDE:
Linux: NetBeans 7.3.1
Windows: Eclipse Indigo (3.7) Service Release 1

Stacktrace:
    edu.stanford.nlp.parser.lexparser.NoSuchParseException
     at edu.stanford.nlp.parser.lexparser.LexicalizedParserQuery.getBestParse(LexicalizedParserQuery.java:381)
     at edu.stanford.nlp.parser.lexparser.LexicalizedParserQuery.getBestParse(LexicalizedParserQuery.java:353)
     at edu.stanford.nlp.pipeline.ParserAnnotator.doOneSentence(ParserAnnotator.java:263)
     at edu.stanford.nlp.pipeline.ParserAnnotator.doOneSentence(ParserAnnotator.java:235)
     at edu.stanford.nlp.pipeline.ParserAnnotator.annotate(ParserAnnotator.java:217)
     at edu.stanford.nlp.pipeline.AnnotationPipeline.annotate(AnnotationPipeline.java:70)
     at edu.stanford.nlp.pipeline.StanfordCoreNLP.annotate(StanfordCoreNLP.java:852)
     ...

Upvotes: 0

Views: 723

Answers (2)

Stephen C
Stephen C

Reputation: 718708

I think your best bet is to forget about differences between the two platforms. Instead, focus on reproducing and/or debugging the problem on your colleague's machine. Figure out why it is throwing that exception.

And the start of the journey is the javadoc for getBestParse which says:

"Return the best parse of the sentence most recently parsed. This will be from the factored parser, if it was used and it succeeded else from the PCFG if it was used and succeed, else from the dependency parser."

Throws: NoSuchParseException If no previously successfully parsed sentence


Note that Stanford CoreNLP apparently does not alert you that it doesn't have enough memory!

If that is true, that means that CoreNLP is catching and squashing Error exceptions. That would be a totally evil thing to do.

In fact, I'd be more inclined to believe that something in your code is at fault. For instance, this could happen if you spawned worker threads and you didn't install a default uncaught exception handler to report / log unchecked exceptions. If one of your worker threads then triggered an OOME, there would be nothing to report it.

Upvotes: 0

user1441719
user1441719

Reputation: 21

Turned out to be a memory issue. I was allocating -Xms2G -Xmx2G, my colleague hadn't changed it from the default.

Note that Stanford CoreNLP apparently does not alert you that it doesn't have enough memory!

Upvotes: 1

Related Questions