uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jaroslaw Cwiklik <cwik...@us.ibm.com>
Subject Re: POJOing uima, is it possible?
Date Thu, 24 Jan 2008 15:02:25 GMT





Not sure if I fully grasp what you are trying to do.

             <bean name="normalizer"
class="it.celi.uima.engine.RegExpNormalizer">
                         <property name="aProperty" value="value"/>
                         <property name="anotherProperty"
value="anotherValue"/>
       </bean>

             <bean name="uima" class="it.celi.uima.engine.CpmUIMAEngine">
[cut]
                         <property name="analisysDescriptors">
                                     <description>The pipeline of analysis:
analysis engines, aggregates
and pears descriptors allowed</description>
                                     <list>
                                                 <ref bean="normalizer"/>
                                     </list>
                         </property>
In the above you are specifying spring beans which are wrappers (I presume)
around uima components. The uima spring bean
under the covers crates an instance of the cpm ( I presume). What I dont
see is how you are initializing the cpm engine. I only
see the AE being plugged in (the normalizer).

Incidentally, we are working on a replacement for the cpm that uses Spring
extensively. The new approach is based on asynchronous
architecture using JMS ( ActiveMQ specifically) for transport.

jerry cwiklik


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Jerry Cwiklik
 UIMA Extensions
 IBM T.J.  Watson Research Center
 Hawtorne, NY, 10532
 Tel: 914-784-7665,  T/L: 863-7665
 Email: cwiklik@us.ibm.com



                                                                           
             "Roberto                                                      
             Franchini"                                                    
             <ro.franchini@gma                                          To 
             il.com>                   uima-user@incubator.apache.org      
                                                                        cc 
             01/24/2008 05:46                                              
             AM                                                    Subject 
                                       POJOing uima, is it possible?       
                                                                           
             Please respond to                                             
             uima-user@incubat                                             
               or.apache.org                                               
                                                                           
                                                                           




Hi to all,
I embedded a CPM in a Spring context (www.springframework.org) via a
wrapper class that parses AE xml (collectionreaders, annotators and
consumers) and push them in the CPM.
I did the same thing with aggregate AE to be used by a web app (here I
don't need collection readers nor consumers).

A snippet from the spring context:

             <bean name="listener" class="it.celi.uima.engine.Listener">
                         <property name="cpm" ref="cpm" />
             </bean>

             <bean name="cpm" class="org.apache.uima.UIMAFramework"
factory-method="newCollectionProcessingManager">
                         <description>The collection processing manager
that holds uima
components</description>
             </bean>

             <bean name="uima" class="it.celi.uima.engine.CpmUIMAEngine">
                         <description>An Engine that wraps UIMA components:
collection
readers, analsys engines and consumers</description>
                         <property name="pearsInstallPath"
value="${pears.base.path}installed" />
                         <property name="cpm" ref="cpm">
                                     <description>The uderlying Collection
Processing Manager</description>
                         </property>
                         <property name="listeners">
                                     <description>A collection of listeners
to be attached to CPM</description>
                                     <list>
                                                 <ref bean="listener" />
                                     </list>
                         </property>
                         <property name="readerDescriptors">
                                     <description>A collection of
CollectionReaders: the entire pipeline
is activated for each reader</description>
                                     <list>

<value>${conf.base.path}RecursiveFileSystemCollectionReader.xml</value>
                                     </list>
                         </property>
                         <property name="analisysDescriptors">
                                     <description>The pipeline of analysis:
analysis engines, aggregates
and pears descriptors allowed</description>
                                     <list>

<value>${conf.base.path}SentenceAnnotator.xml</value>

<value>${conf.base.path}RegExpTokenizer.xml</value>
                                     </list>
                         </property>
                         <property name="consumerDescriptors">
                                     <list>

<value>${conf.base.path}XmiWriterCasConsumer.xml</value>

<value>${conf.base.path}XCasWriterCasConsumer.xml</value>
                                     </list>
                         </property>
             </bean>

Now I would go a step forward and avoid UIMA xml descritptor, please
don't blame me :)
What I'm looking for is something like this:

RegExpNormalizer annotator = new RegExpNormalizer();

annotar.setAProperty(value);
annotar.setAnotehrProperty(anotherValue);

CollectionProcessingManager cpm =
UIMAFramework.newCollectionProcessingManager();
cpm.add(annotator)

Where RegExpNormalizer  extends JCasAnnotator_ImplBase.

So in the spring context I can write:

             <bean name="normalizer"
class="it.celi.uima.engine.RegExpNormalizer">
                         <property name="aProperty" value="value"/>
                         <property name="anotherProperty"
value="anotherValue"/>
       </bean>

             <bean name="uima" class="it.celi.uima.engine.CpmUIMAEngine">
[cut]
                         <property name="analisysDescriptors">
                                     <description>The pipeline of analysis:
analysis engines, aggregates
and pears descriptors allowed</description>
                                     <list>
                                                 <ref bean="normalizer"/>
                                     </list>
                         </property>

Is it possible to do that?
Thanks
Roberto
--
Roberto Franchini
CELI s.r.l.  (http://www.celi.it) - C.so Moncalieri 21 - 10131 Torino -
ITALY
Tel +39-011-6600814 - Fax +39-011-6600687
jabber:ro.franchini@gmail.com skype:ro.franchini

Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message