On 30. Dec 2019, at 08:49, Assassin Gaming <
rohi...@gmail.com> wrote:
>
> I work on UIMA regularly, so i know that such exceptions come when we don't set a certain typesystem(In our case Dkpro's Sentence typesystem) in our analysis engine xml.
> The problem is that i don't have dkpro's typesystem so that i can add them in analysis engine, instead i have maven dependencies of the same.
DKPro Core is typically used in conjunction with uimaFIT and uimaFIT's type-system detection mechanism. This mechanism kicks in e.g. when running constructing readers/engines, running pipelines or constructing CASes:
CollectionReaderDescription textReader = createReaderDescription(
TextReader.class,
TextReader.PARAM_LANGUAGE, "en",
TextReader.PARAM_SOURCE_LOCATION, "src/test/resources/texts/*.txt");
AnalysisEngineDescription segmenter = createEngineDescription(OpenNlpSegmenter.class);
AnalysisEngineDescription posTagger = createEngineDescription(OpenNlpPosTagger.class);
AnalysisEngineDescription parser = createEngineDescription(OpenNlpParser.class);
AnalysisEngineDescription ner = createEngineDescription(OpenNlpNamedEntityRecognizer.class);
AnalysisEngineDescription dump = createEngineDescription(CasDumpWriter.class);
AnalysisEngineDescription teiWriter = createEngineDescription(
TeiWriter.class,
TeiWriter.PARAM_TARGET_LOCATION, targetFolder,
TeiWriter.PARAM_WRITE_CONSTITUENT, true);
SimplePipeline.runPipeline(textReader, segmenter, posTagger, parser, ner, dump, teiWriter);
You see above that the type system is never injected because it is automatically handled through classpath scanning by uimaFIT [1].
In your example, you didn't say how you constructed and ran the pipeline...
If you want to access the DKPro Core type systems directly: they are included in the JARs - that means they are also on the classpath and you can import them into your down type system descriptors, e.g. using lines such as
<imports>
<import name="desc.type.LexicalUnits"/>
<import name="desc.type.LexicalUnits_customized"/>
</imports>
There are various type system descriptors in the various DKPro Core modules.
One easy way to aggregate all type system descriptors available on the classpath via uimaFIT would be this:
TypeSystemDescription tsd = TypeSystemDescriptionFactory.createTypeSystemDescription();
You can then write the tsd as XML to a file if you want.
You may want to have a closer look and uimaFIT and e.g. how it is used in DKPro Core to inject parameter values [2].
Note in particular how the code extends the uimaFIT base classes instead of the UIMA base classes of the same name,
e.g. `org.apache.uima.fit.component.JCasAnnotator_ImplBase`.
Cheers,
-- Richard
[1]
https://uima.apache.org/d/uimafit-current/tools.uimafit.book.html#ugr.tools.uimafit.typesystem
[2]
https://uima.apache.org/d/uimafit-current/tools.uimafit.book.html#d5e120