stanfordnlp/CoreNLP

Inifinite recursion issue ... :(

alanlit opened this issue · 3 comments

Running 4.5.2 and the default English model 4.5.2. Every so often I get the following stack-blowing recursion:
at edu.stanford.nlp.parser.lexparser.TreeBinarizer.outsideBinarizeLocalTree(TreeBinarizer.java:479)
at edu.stanford.nlp.parser.lexparser.TreeBinarizer.outsideBinarizeLocalTree(TreeBinarizer.java:479)
at edu.stanford.nlp.parser.lexparser.TreeBinarizer.outsideBinarizeLocalTree(TreeBinarizer.java:479)
at edu.stanford.nlp.parser.lexparser.TreeBinarizer.outsideBinarizeLocalTree(TreeBinarizer.java:479)
at edu.stanford.nlp.parser.lexparser.TreeBinarizer.outsideBinarizeLocalTree(TreeBinarizer.java:479) ......

On either an NER pipe:
props.setProperty("annotators", "tokenize,ssplit,pos,lemma,ner")
props.setProperty("ner.statisticalOnly", "true")
props.setProperty("parse.model", "edu/stanford/nlp/models/srparser/englishSR.ser.gz")
Or a sentiment pipe:
props.setProperty("parse.model", "edu/stanford/nlp/models/srparser/englishSR.ser.gz")
props.setProperty("annotators", "tokenize,ssplit,pos,parse,sentiment")

Sorry I don't know which yet (or have a sample of the text that seems to trigger it .. working on it).

Using openjdk 17.0.2.

Any thoughts as to what might be going on ?

Tnx
Alan

Quite understand - the problem is it can run for a day or so before blowing -- I'm still trying to isolate a test case, but in the meantime it decided to stack overflow via a different route. No idea if this gives you a clue or not:
ava.lang.StackOverflowError
at org.ejml.simple.AutomaticSimpleMatrixConvert.specify(AutomaticSimpleMatrixConvert.java:46)
at org.ejml.simple.SimpleBase.insertIntoThis(SimpleBase.java:960)
at edu.stanford.nlp.neural.NeuralUtils.concatenateWithBias(NeuralUtils.java:282)
at edu.stanford.nlp.sentiment.SentimentCostAndGradient.forwardPropagateTree(SentimentCostAndGradient.java:543)
at edu.stanford.nlp.sentiment.SentimentCostAndGradient.forwardPropagateTree(SentimentCostAndGradient.java:511)
at edu.stanford.nlp.sentiment.SentimentCostAndGradient.forwardPropagateTree(SentimentCostAndGradient.java:512)
at edu.stanford.nlp.sentiment.SentimentCostAndGradient.forwardPropagateTree(SentimentCostAndGradient.java:512)
at edu.stanford.nlp.sentiment.SentimentCostAndGradient.forwardPropagateTree(SentimentCostAndGradient.java:512)
at edu.stanford.nlp.sentiment.SentimentCostAndGradient.forwardPropagateTree(SentimentCostAndGradient.java:512)
at edu.stanford.nlp.sentiment.SentimentCostAndGradient.forwardPropagateTree(SentimentCostAndGradient.java:512)
at edu.stanford.nlp.sentiment.SentimentCostAndGradient.forwardPropagateTree(SentimentCostAndGradient.java:512)
..... and so on .. :)
Tnx
Alan

It certainly looks like an issue with a very deep parse tree, either because the parse was degenerate or because the text was very long and led to a huge parse tree. Are you giving it any text that is unrealistically long?