dhfbk / tint

The Italian NLP Tool
http://tint.fbk.eu
GNU General Public License v3.0
70 stars 9 forks source link

Requires PartOfSpeechAnnotation #23

Closed gsvarma closed 6 years ago

gsvarma commented 6 years ago

Hi,

A quick question, why am I encountering this exception? Any ideas to fix? Please help.

Exception in thread "main" java.lang.IllegalArgumentException: annotator "ita_lemma" requires 
 annotation "PartOfSpeechAnnotation". The usual requirements for this annotator are: unknown
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:456)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:150)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:146)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:133)
    at eu.fbk.dh.tint.runner.TintPipeline.load(TintPipeline.java:55)
    at eu.fbk.dh.tint.runner.TintPipeline.runRaw(TintPipeline.java:107)
    at eu.fbk.dh.tint.runner.TintPipeline.runRaw(TintPipeline.java:103)

Thanks! in advance.

ziorufus commented 6 years ago

You are using the ita_lemma annotator without the pos one, but ita_lemma needs the part of speech annotation to work. In your configuration file, just add pos in the annotators property. Be sure to put it before ita_lemma.

If you are running Tint as CoreNLP module, you also need the tint-models module to your POM and you may add

pos.model=models/italian-big.tagger

to the configuration file (the same one where you list annotators).

gsvarma commented 6 years ago

Be sure to put it before ita_lemma.

Fixed the pos issue. Then it complained about MorphAnnotation. Similar, to pos added ita_morpho before ita_lemma which resulted in following exception.

Exception in thread "main" edu.stanford.nlp.util.MetaClass$ClassCreationException: java.lang.ClassNotFoundException: eu.fbk.dh.digimorph.annotator.DigiMorphAnnotator
    at edu.stanford.nlp.util.MetaClass.createFactory(MetaClass.java:364)
    at edu.stanford.nlp.util.MetaClass.createInstance(MetaClass.java:381)
    at edu.stanford.nlp.pipeline.AnnotatorImplementations.custom(AnnotatorImplementations.java:143)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.lambda$registerCustomAnnotators$66(StanfordCoreNLP.java:556)
    at edu.stanford.nlp.util.Lazy$3.compute(Lazy.java:118)
    at edu.stanford.nlp.util.Lazy.get(Lazy.java:31)
    at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:146)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:447)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:150)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:146)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:133)
    at eu.fbk.dh.tint.runner.TintPipeline.load(TintPipeline.java:55)
    at eu.fbk.dh.tint.runner.TintPipeline.runRaw(TintPipeline.java:107)
    at eu.fbk.dh.tint.runner.TintPipeline.runRaw(TintPipeline.java:103)

P.S. I have included both tint-digimorph-annotator and tint-digimorph in POM.

ziorufus commented 6 years ago

Try adding tint-digimorph-annotator to the POM, too.

gsvarma commented 6 years ago

Thank you for the quick response.

Try adding tint-digimorph-annotator to the POM, too.

Yes! indeed I have done that.

ziorufus commented 6 years ago

Is it working now?

gsvarma commented 6 years ago

Nope. Still the same exception.

ziorufus commented 6 years ago

There is an error here: https://github.com/VarmaHub/FOX/blob/4efa9d82a4c301ccca741ab0420330360894c9ed/src/main/java/org/aksw/fox/tools/ner/it/TintNER.java#L39

On line 39 just replace eu.fbk.dh.digimorph.annotator.DigiMorphAnnotator with eu.fbk.dh.tint.digimorph.annotator.DigiMorphAnnotator (add tint).

gsvarma commented 6 years ago

Thank you so much. Adding tint, solved the exception.