Jester Shoeman
Jester Shoeman

Reputation: 107

How to set the model for an external analysis engine in UIMA Ruta

I am trying to use the StanfordNamedEntityRecognizer for German. I loaded a model from dkpro. Unfortunately, the model is not recognized. Instead the NER tries to use a different model, that is not provided anywhere.

How can I tell the AE which model to use? For example instead of "model-ner-de-nemgp" use "model-ner-de-Person".

This is my main ruta file:

PACKAGE org.apache.uima.ruta.novel;
IMPORT PACKAGE de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos FROM desc.type.POS AS pos;
IMPORT PACKAGE de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence FROM desc.type.LexicalUnits AS sentence;
IMPORT PACKAGE de.tudarmstadt.ukp.dkpro.core.api.ner.type.NamedEntity FROM desc.type.NamedEntity;

UIMAFIT de.tudarmstadt.ukp.dkpro.core.opennlp.OpenNlpSegmenter;
UIMAFIT de.tudarmstadt.ukp.dkpro.core.stanfordnlp.StanfordPosTagger;
UIMAFIT de.tudarmstadt.ukp.dkpro.core.stanfordnlp.StanfordParser;
UIMAFIT de.tudarmstadt.ukp.dkpro.core.stanfordnlp.StanfordNamedEntityRecognizer;

uima.tcas.DocumentAnnotation{-CONTAINS(pos.POS)} -> {
    uima.tcas.DocumentAnnotation{-> SETFEATURE("language", "de")};
    EXEC(OpenNlpSegmenter);
    EXEC(StanfordPosTagger, {pos.POS});
    EXEC(StanfordNamedEntityRecognizer);
};

Upvotes: 1

Views: 66

Answers (1)

Jester Shoeman
Jester Shoeman

Reputation: 107

Inspecting the corresponding descriptor.xml I found the configurationParameter "modelVariant". I added the following lines to my Ruta script which solved my request.

This sets the modelVariant for the StanfordNamedEntityRecognizer to my prefered model named "germeval2014.hgc_175m_600.crf".

Document{-> CONFIGURE(StanfordNamedEntityRecognizer, "modelVariant" = "germeval2014.hgc_175m_600.crf")};

Upvotes: 1

Related Questions