Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with coreference #372

Open
nopper opened this issue Jun 13, 2016 · 3 comments
Open

Problems with coreference #372

nopper opened this issue Jun 13, 2016 · 3 comments

Comments

@nopper
Copy link

nopper commented Jun 13, 2016

I am having troubles running a NLP server with coreference resolution. Here's the things I've tried in order:

Using just --ner-forward-coref won't work because of annotator dependencies. Apparently NerSpanBuffer attribute is not provided by any of the previous annotators in the pipeline.

$ bin/fac nlp --wsj-forward-pos --transition-based-parser --conll-chain-ner --ner-forward-coref
..
Exception in thread "main" java.lang.AssertionError: assertion failed: Prerequisite interface cc.factorie.app.nlp.ner.NerSpanBuffer not satisfied before cc.factorie.app.nlp.coref.NerForwardCoref$@681aad3b gets called in pipeline cc.factorie.app.nlp.segment.DeterministicNormalizingTokenizer$@1ee4730 cc.factorie.app.nlp.segment.DeterministicSentenceSegmenter$@3af4e0bf cc.factorie.app.nlp.segment.PlainTokenNormalizer$@60094a13 cc.factorie.app.nlp.pos.WSJForwardPosTagger$@6f70f32f cc.factorie.app.nlp.lemma.WordNetLemmatizer$@cc6460c cc.factorie.app.nlp.parse.OntonotesTransitionBasedParser$@5aceec94 cc.factorie.app.nlp.ner.ConllChainNer@52350abb cc.factorie.app.nlp.ner.BilouConllNerChunkAnnotator$@35293c05 cc.factorie.app.nlp.coref.NerForwardCoref$@681aad3b

By using --parse-forward-coref the server is started correctly but an exception is thrown as soon as some text gets annotated. I guess that the NerSpanBuffer attribute is null.

$ bin/fac nlp --wsj-forward-pos --transition-based-parser --conll-chain-ner --parse-forward-coref
...
Exception in thread "ServerThread" java.lang.NullPointerException
        at cc.factorie.app.nlp.coref.NerPhraseFinder.apply(MentionPhraseFinder.scala:58)
        at cc.factorie.app.nlp.phrase.ParseBasedPhraseFinder.getPhrases(ParseBasedMention.scala:45)
        at cc.factorie.app.nlp.coref.ParseForwardCoref.annotateMentions(ForwardCoref.scala:34)
        at cc.factorie.app.nlp.coref.CorefSystem.process(ForwardCoref.scala:261)
        at cc.factorie.app.nlp.DocumentAnnotationPipeline$$anonfun$process$2.apply(DocumentAnnotatorPipeline.scala:37)
        at cc.factorie.app.nlp.DocumentAnnotationPipeline$$anonfun$process$2.apply(DocumentAnnotatorPipeline.scala:35)
        at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:733)
        at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
        at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
        at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:732)
        at cc.factorie.app.nlp.DocumentAnnotationPipeline.process(DocumentAnnotatorPipeline.scala:35)
        at cc.factorie.app.nlp.NLP$ServerThread$$anonfun$run$1.apply(NLP.scala:124)
        at cc.factorie.app.nlp.NLP$ServerThread$$anonfun$run$1.apply(NLP.scala:122)
        at scala.collection.Iterator$class.foreach(Iterator.scala:893)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
        at cc.factorie.app.nlp.NLP$ServerThread.run(NLP.scala:122)

So the question is what's the proper way to invoke a server that is capable of doing coreference resolution?

@nopper
Copy link
Author

nopper commented Jun 13, 2016

Alternatively could you provide me a with a snippet of scala code capable of doing coreference with NerForwardCoref model? Currently I am using the following code:

    val annotators = Seq(
      app.nlp.segment.DeterministicSentenceSegmenter,
      app.nlp.segment.DeterministicTokenizer,
      app.nlp.pos.OntonotesForwardPosTagger,
      app.nlp.parse.WSJTransitionBasedParser,
      app.nlp.ner.ConllChainNer,
      app.nlp.ner.BilouConllNerChunkAnnotator,
      app.nlp.phrase.ParseAndNerBasedPhraseFinder,
      app.nlp.coref.NerForwardCoref
    )

    val pipeline = app.nlp.DocumentAnnotatorPipeline(annotators:_*)

But unfortunately the system complains about the BILOUChainChunker.factorie model file missing.

@marcocor
Copy link

marcocor commented Jul 6, 2017

Hi, I am having the same issue -- any update or hint?

I can add that even trying to run the server with the --ner-forward-coref (noun mention coreference), at start I get:

Exception in thread "main" java.lang.Error: No file named Nothing$.factorie found in classpath for class scala.runtime.Nothing$, and no value found in system property scala.runtime.Nothing$. To fix this either add a file with the right name to the classpath or set the system property to point to a directory containing the file.
        at cc.factorie.util.ClasspathURL$.apply(ClasspathURL.scala:42)
        at cc.factorie.util.ModelProvider$$anon$1.<init>(ModelProvider.scala:94)
        at cc.factorie.util.ModelProvider$.classpath(ModelProvider.scala:93)
        at cc.factorie.app.nlp.ner.NoEmbeddingsOntonotesStackedChainNer$.<init>(StackedChainNer.scala:637)
        at cc.factorie.app.nlp.ner.NoEmbeddingsOntonotesStackedChainNer$.<clinit>(StackedChainNer.scala)
        at cc.factorie.app.nlp.DocumentAnnotatorPipeline$$anonfun$13.apply(DocumentAnnotatorPipeline.scala:76)
        at cc.factorie.app.nlp.DocumentAnnotatorPipeline$$anonfun$13.apply(DocumentAnnotatorPipeline.scala:76)
(...many more lines...)

Thanks for any help!

@tribbloid
Copy link
Contributor

I got the same kind of error:

found model

No file named Nothing$.factorie found in classpath for class scala.runtime.Nothing$, and no value found in system property scala.runtime.Nothing$. To fix this either add a file with the right name to the classpath or set the system property to point to a directory containing the file.
java.lang.Error: No file named Nothing$.factorie found in classpath for class scala.runtime.Nothing$, and no value found in system property scala.runtime.Nothing$. To fix this either add a file with the right name to the classpath or set the system property to point to a directory containing the file.
at cc.factorie.util.ClasspathURL$.apply(ClasspathURL.scala:42)
at cc.factorie.util.ModelProvider$$anon$1.(ModelProvider.scala:94)
at cc.factorie.util.ModelProvider$.classpath(ModelProvider.scala:93)
at cc.factorie.app.nlp.ner.ConllChainNer$.(ChainNer.scala:67)
at cc.factorie.app.nlp.ner.ConllChainNer$.(ChainNer.scala)
at cc.factorie.app.nlp.DocumentAnnotatorPipeline$$anonfun$11.apply(DocumentAnnotatorPipeline.scala:74)
at cc.factorie.app.nlp.DocumentAnnotatorPipeline$$anonfun$11.apply(DocumentAnnotatorPipeline.scala:74)
at cc.factorie.app.nlp.DocumentAnnotatorPipeline$.cc$factorie$app$nlp$DocumentAnnotatorPipeline$$recursiveSatisfyPrereqs$1(DocumentAnnotatorPipeline.scala:111)
at cc.factorie.app.nlp.DocumentAnnotatorPipeline$$anonfun$apply$5.apply(DocumentAnnotatorPipeline.scala:123)
at cc.factorie.app.nlp.DocumentAnnotatorPipeline$$anonfun$apply$5.apply(DocumentAnnotatorPipeline.scala:123)
at scala.collection.immutable.List.foreach(List.scala:381)
at cc.factorie.app.nlp.DocumentAnnotatorPipeline$.apply(DocumentAnnotatorPipeline.scala:123)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants