uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Armin.Weg...@bka.bund.de>
Subject AW: uimaFit way of creating an analysis description from an XML descriptor file
Date Tue, 30 Apr 2013 09:20:41 GMT
Hi Richard,

The file is in the file system. But I don't want to create an AnalysisEngine with AnalysisEngineFactory.createAnalysisEngineFromPath().
I'd rather like to have an AnalysisEngineDescription. But there is not method createAnalysisEngineDescriptionFromPath().
Is there an easy way to get an AnalysisEngineDescription from an AnalysisEngine?

Cheers,
Armin

-----Urspr√ľngliche Nachricht-----
Von: Richard Eckart de Castilho [mailto:richard.eckart@gmail.com] 
Gesendet: Dienstag, 30. April 2013 11:15
An: user@uima.apache.org
Betreff: Re: uimaFit way of creating an analysis description from an XML descriptor file

Hi Armin,

sorry I mis-read that.

If the descriptor is in the classpath, try

AnalysisEngineFactory.createAnalysisEngineDescription(String, Object...)

The string is the "package" and the name of the descriptor without ".xml" e.g.

AnalysisEngineFactory.createAnalysisEngineDescription("WhitespaceTokenizer")
AnalysisEngineFactory.createAnalysisEngineDescription("my.nice.package.WhitespaceTokenizer")

if the descriptor is on the file-system, try

AnalysisEngineFactory.createAnalysisEngineFromPath(String, Object.)

The additional parameters (Object.) are usually left empty, unless you need to override parameters
in the descriptor.

Regarding mixing TextMarker with your own pipelines, you may want to have a look at the DKPro
TextMarker stuff, if only for some inspiration how to do it. [1]

-- Richard

[1] https://dkpro-core-asl.googlecode.com/svn/de.tudarmstadt.ukp.dkpro.core-asl/trunk/de.tudarmstadt.ukp.dkpro.core.textmarker-asl

Am 30.04.2013 um 10:48 schrieb <Armin.Wegner@bka.bund.de>:

> Hi Richard,
> 
> I'm not talking about type system descriptors, but of analysis engine descriptors. I
would like to create an AnalysisEngineDescription from an analysis engine descriptor file,
e. g. like one the Textmarker Workbench created in a Textmarker Eclipse project. I'd like
to add this AnalysisEngineDescription to AggregateBuilder and run the aggregate with SimplePipeline.run().
So I can mix Textmarker ae with my own.
> 
> Cheers,
> Armin
> 
> 
> -----Urspr√ľngliche Nachricht-----
> Von: Richard Eckart de Castilho [mailto:richard.eckart@gmail.com]
> Gesendet: Montag, 29. April 2013 18:18
> An: user@uima.apache.org
> Betreff: Re: uimaFit way of creating an analysis description from an 
> XML descriptor file
> 
> Hi Armin,
> 
> the equivalent to your code would be something like
> 
> TypeSystemDescriptionFactory.createTypeSystemDescriptionFromPath("/som
> e/path/AnalysisEngineDescriptorFile.xml")
> 
> However, I'd usually prefer to store my type system descriptors as a resource in my projects,
so that they end up in JARs and on the classpath. To import one type system in another, I
use "import by name" instead of "import by location".
> 
> Type systems accessible via the classpath can be made known to uimaFIT, so that you don't
actually have to load them manually. Many of the uimaFIT factory methods, like AEF.createPrimitive()
exist in a variant that doesn't take a type system. In these variants, the type system is
loaded automatically by uimaFIT. For details see [1].
> 
> Hope this helps.
> 
> Cheers,
> 
> -- Richard
> 
> [1] https://code.google.com/p/uimafit/wiki/TypeDescriptorDetection
> 
> 
> 
> Am 29.04.2013 um 17:04 schrieb <Armin.Wegner@bka.bund.de>:
> 
>> Hi!
>> 
>> In classical UIMA you use following code to create an AnalysisEngineDescription from
an XML descriptor file.
>> 
>> final Path descriptorFilePath = Paths.get("/some/path/", 
>> "AnalysisEngineDescriptorFile.xml");
>> final XMLInputSource xmlInputSource = new 
>> XMLInputSource(descriptorFilePath.toFile());
>> final AnalysisEngineDescription analysisEngineDescription = 
>> UIMAFramework.getXMLParser().parseAnalysisEngineDescription(xmlInputS
>> o
>> urce);
>> 
>> Now you can use analysisEngineDescription with org.uimafit.factory.AggregateBuilder
to create an aggregate analysis engine and run the pipeline with SimpePipeline.run().
>> 
>> How is the uimaFit way to do this?
>> 
>> Cheers,
>> 
>> Armin
>> 
>> 
> 
> 



Mime
View raw message