{"id":2247,"date":"2012-08-24T02:45:11","date_gmt":"2012-08-24T02:45:11","guid":{"rendered":"http:\/\/dalelane.co.uk\/blog\/?p=2247"},"modified":"2012-08-24T14:41:05","modified_gmt":"2012-08-24T14:41:05","slug":"using-uima-as-to-run-uima-annotators-in-parallel","status":"publish","type":"post","link":"https:\/\/dalelane.co.uk\/blog\/?p=2247","title":{"rendered":"Using UIMA-AS to run UIMA annotators in parallel"},"content":{"rendered":"<p><strong>Overview<\/strong><\/p>\n<p><a href=\"http:\/\/uima.apache.org\/\">UIMA<\/a> stands for Unstructured Information Management Architecture. It&#8217;s an Apache technology that provides <a href=\"http:\/\/en.wikipedia.org\/wiki\/UIMA\">a framework and standard for building text analytics applications<\/a>. I&#8217;ve <a href=\"http:\/\/dalelane.co.uk\/blog\/?tag=uima\">mentioned it before<\/a>.<\/p>\n<p>In this post, I want to talk about an area of UIMA which isn&#8217;t covered well in the documentation. <\/p>\n<p>I couldn&#8217;t find practical getting-started instructions for running UIMA-AS annotators in parallel. In this post I want to discuss why you might want to do it, and share some simple sample code to show how. <\/p>\n<p><strong>Background &#8211; the UIMA pipeline<\/strong><\/p>\n<p>UIMA provides a framework for managing a text analytics application. You break up the analytics functionality into discrete pieces called annotators. UIMA takes care of moving a text document through an analytics engine: a pipeline containing a series of annotators.<\/p>\n<p>A document goes in one end of the pipeline, passes through a number of annotators, each of which adds some metadata to the document. What comes out the other side of the pipeline is an annotated copy of the document. <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/dalelane.co.uk\/blog\/post-images\/120824-uima-pipeline-serial.png\"\/><\/p>\n<p>By default, you get UIMA to run these annotators one at a time &#8211; one after another. <\/p>\n<p><strong>Background &#8211; annotators in parallel<\/strong><\/p>\n<p>What if your annotators are quite slow &#8211; perhaps they take several seconds to run? <\/p>\n<p>If there is no dependency between any or all of your annotators, then maybe running them one at a time isn&#8217;t the most efficient approach. <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/dalelane.co.uk\/blog\/post-images\/120824-uima-pipeline-parallel.png\"\/><\/p>\n<p>You can run all of them at the same time, in parallel. UIMA will merge the output from all of the annotators into a single annotated document. <\/p>\n<p><strong>My sample code<\/strong><\/p>\n<p>I&#8217;ve written <a href=\"http:\/\/dalelane.co.uk\/files\/120824-uima-sample.zip\">two sample UIMA apps<\/a>. Each demonstrates one of these approaches, to compare and contrast. <\/p>\n<p>They are divided into three eclipse projects. You can import them into an <a href=\"http:\/\/eclipse.org\/\">eclipse IDE<\/a>.   <\/p>\n<p>The UIMA eclipse plugins are very helpful if you want to make changes to the XML configuration files, but they&#8217;re not essential. If you want them, there are instructions on how to install them at <a href=\"http:\/\/uima.apache.org\/downloads.cgi\">uima.apache.org<\/a>. <\/p>\n<p>I&#8217;ve added comments to <a href=\"http:\/\/dalelane.co.uk\/files\/120824-uima-sample.zip\">the sample code<\/a> to explain how the apps work, but I&#8217;ll give an overview here. <\/p>\n<p><!--more-->For these samples, I have five simple annotators. They sleep for six seconds, then add an empty annotation to the document CAS. <\/p>\n<pre style=\"border: thin solid silver; background-color: #eeeeee; padding: 0.7em; font-size: 1em; overflow: auto;\">public void process(JCas jCas) throws AnalysisEngineProcessException {\r\n\r\n  \/\/ sleep for six seconds...\r\n  try {\r\n    Thread.sleep(6000);\r\n  }\r\n  catch (InterruptedException e) {\r\n    e.printStackTrace();\r\n  }\r\n\r\n  \/\/ add an empty annotation to the CAS\r\n  jCas.addFsToIndexes(new AnnotationB(jCas));\r\n}<\/pre>\n<p>They do enough to prove that all five of them are being run, and that they all really contribute to the final annotated document. They take long enough to demonstrate the differences between these two approaches to running the pipeline. <\/p>\n<p><strong>Sample code : running one annotator at a time<\/strong><\/p>\n<p>This can be done using UIMA. The first app <code>uima-project<\/code> demonstrates this. <\/p>\n<p>An XML descriptor file (<code>uima-project\/conf\/analysisEngine.xml<\/code>) specifies which annotators should be included in the pipeline, and which order they should be run in. <\/p>\n<pre style=\"border: thin solid silver; background-color: #eeeeee; padding: 0.7em; font-size: 1em; overflow: auto;\">&lt;analysisEngineMetaData&gt;\r\n\t&lt;name&gt;UIMA demonstration&lt;\/name&gt;\r\n\t&lt;version&gt;1.0&lt;\/version&gt;\r\n\t&lt;flowConstraints&gt;\r\n\t  &lt;fixedFlow&gt;\r\n\t    &lt;node&gt;annotatorA&lt;\/node&gt;\r\n\t    &lt;node&gt;annotatorB&lt;\/node&gt;\r\n\t    &lt;node&gt;annotatorC&lt;\/node&gt;\r\n\t    &lt;node&gt;annotatorD&lt;\/node&gt;\r\n\t    &lt;node&gt;annotatorE&lt;\/node&gt;\r\n\t  &lt;\/fixedFlow&gt;\r\n\t&lt;\/flowConstraints&gt;<\/pre>\n<p>The descriptor file (<code>uima-project\/conf\/analysisEngine.xml<\/code>) imports a descriptor for each individual annotator. <\/p>\n<pre style=\"border: thin solid silver; background-color: #eeeeee; padding: 0.7em; font-size: 1em; overflow: auto;\">&lt;delegateAnalysisEngineSpecifiers&gt;\r\n    &lt;delegateAnalysisEngine key=\"annotatorA\"&gt;\r\n      &lt;import location=\"annotatorA\/analysisEngine.xml\"\/&gt;\r\n    &lt;\/delegateAnalysisEngine&gt;\r\n    &lt;delegateAnalysisEngine key=\"annotatorB\"&gt;\r\n      &lt;import location=\"annotatorB\/analysisEngine.xml\"\/&gt;\r\n    &lt;\/delegateAnalysisEngine&gt;\r\n    &lt;delegateAnalysisEngine key=\"annotatorC\"&gt;\r\n      &lt;import location=\"annotatorC\/analysisEngine.xml\"\/&gt;\r\n    &lt;\/delegateAnalysisEngine&gt;\r\n    &lt;delegateAnalysisEngine key=\"annotatorD\"&gt;\r\n      &lt;import location=\"annotatorD\/analysisEngine.xml\"\/&gt;\r\n    &lt;\/delegateAnalysisEngine&gt;\r\n    &lt;delegateAnalysisEngine key=\"annotatorE\"&gt;\r\n      &lt;import location=\"annotatorE\/analysisEngine.xml\"\/&gt;\r\n    &lt;\/delegateAnalysisEngine&gt;\r\n&lt;\/delegateAnalysisEngineSpecifiers&gt;<\/pre>\n<p>Each of those imported descriptors identifies the Java class that implements the annotator, and specifies the metadata annotations that it can add to the output document. <\/p>\n<p>For example,<br \/>\n<code>uima-project\/conf\/annotatorC\/analysisEngine.xml<\/code>:<\/p>\n<pre style=\"border: thin solid silver; background-color: #eeeeee; padding: 0.7em; font-size: 1em; overflow: auto;\">&lt;annotatorImplementationName&gt;com.dalelane.uima.annotators.DemoC&lt;\/annotatorImplementationName&gt;\r\n&lt;analysisEngineMetaData&gt;\r\n    &lt;name&gt;annotatorC&lt;\/name&gt;\r\n    &lt;typeSystemDescription&gt;\r\n      &lt;types&gt;\r\n        &lt;typeDescription&gt;\r\n          &lt;name&gt;com.dalelane.uima.annotators.gen.AnnotationC&lt;\/name&gt;\r\n          &lt;description\/&gt;\r\n          &lt;supertypeName&gt;uima.tcas.Annotation&lt;\/supertypeName&gt;\r\n        &lt;\/typeDescription&gt;\r\n      &lt;\/types&gt;\r\n    &lt;\/typeSystemDescription&gt;<\/pre>\n<p>The overall pipeline is started from<br \/>\n<code>uima-project\/src\/com\/dalelane\/uima\/serial\/Pipeline.java<\/code>. This reads in the descriptor file for the pipeline, and uses it to create an instance of a UIMA analysis engine. <\/p>\n<pre style=\"border: thin solid silver; background-color: #eeeeee; padding: 0.7em; font-size: 1em; overflow: auto;\">File descriptorFile = new File(\".\/conf\/analysisEngine.xml\");\r\nXMLInputSource descriptorSource = new XMLInputSource(descriptorFile);\r\n\r\nResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(descriptorSource);\r\nanalysisEngine = UIMAFramework.produceAnalysisEngine(specifier);<\/pre>\n<p>To summarise:<\/p>\n<ol>\n<li>The provided eclipse launch config starts a Java application <br \/><code>uima-project\/src\/com\/dalelane\/uima\/serial\/Application.java<\/code><\/li>\n<li>The Java application creates <br \/><code>uima-project\/src\/com\/dalelane\/uima\/serial\/Pipeline.java<\/code> which creates a UIMA <code>AnalysisEngine<\/code> <\/li>\n<li>The analysis engine reads in the XML descriptor file <code>uima-project\/conf\/analysisEngine.xml<\/code> <\/li>\n<li>The analysis engine descriptor identifies the descriptors for each annotator <br \/>(e.g. <code>uima-project\/conf\/annotatorC\/analysisEngine.xml<\/code>) <\/li>\n<li>The descriptor for the annotator identifies the Java class which implements it <br \/>(e.g. <code>uima-project\/src\/com\/dalelane\/uima\/annotators\/DemoC.java<\/code> )<\/li>\n<\/ol>\n<p>The output from running the launch config shows that it takes about 30 seconds (5 annotators, each of which takes about 6 seconds) to process the document text. <\/p>\n<pre style=\"border: thin solid silver; background-color: #eeeeee; padding: 0.7em; font-size: 1em; overflow: auto;\">Sample UIMA application - serial\r\n==================================\r\nAccessing analysis engine descriptor file\r\nCreating analysis engine\r\nProcessing document...\r\nTime spent in pipeline: 30121\r\nConfirming what was added...\r\n  Found: org.apache.uima.jcas.tcas.Annotation\r\n  Found: com.dalelane.uima.annotators.gen.AnnotationD\r\n  Found: com.dalelane.uima.annotators.gen.AnnotationC\r\n  Found: com.dalelane.uima.annotators.gen.AnnotationB\r\n  Found: com.dalelane.uima.annotators.gen.AnnotationA<\/pre>\n<p> &nbsp;<\/p>\n<p><strong>Sample code : running all annotators at once<\/strong><\/p>\n<p>This can be done using <a href=\"http:\/\/uima.apache.org\/doc-uimaas-what.html\">UIMA-AS<\/a> &#8211; a variant of UIMA that provides support for asynchronous scale out. The second app <code>uima-as-project<\/code> demonstrates this. <\/p>\n<p>To describe the approach at a high level, the idea is that you want to create five separate copies of the document to be analysed. Each of these copies can be run through a separate annotator at the same time. Once they&#8217;ve all finished, the output from all of the annotators can be collected together and merged to form the single output document.  <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/dalelane.co.uk\/blog\/post-images\/120824-uima-pipeline-services.png\"\/> <\/p>\n<p>Each of the annotators are run as a separate service. A by-product of this is that each can be run on a remote machine, and UIMA-AS manages moving the documents to\/from the remote services using <a href=\"http:\/\/dalelane.co.uk\/blog\/?s=jms\">JMS messaging<\/a>. <\/p>\n<p>In my sample, I&#8217;m running them all on the same server, and using &#8220;localhost&#8221; to define the interactions. A JMS broker is still required for this. Instructions for starting the message broker is contained in <code>uima-as-project\/README<\/code><\/p>\n<p>Because the annotators are run as &#8220;remote&#8221; services, this introduces an extra step &#8211; the services need to be deployed before the pipeline can be started. <\/p>\n<p><code>uima-as-project\/src\/com\/dalelane\/uima\/parallel\/Pipeline.java<\/code> deploys each of the services by specifying the deployment descriptors. <\/p>\n<pre style=\"border: thin solid silver; background-color: #eeeeee; padding: 0.7em; font-size: 1em; overflow: auto;\">\/\/ creating UIMA analysis engine\r\nUimaAsynchronousEngine uimaAsEngine = new BaseUIMAAsynchronousEngine_impl();\r\n\r\n\/\/ preparing map for use in deploying services\r\nMap&lt;String,Object&gt; deployCtx = new HashMap&lt;String,Object&gt;();\r\ndeployCtx.put(UimaAsynchronousEngine.DD2SpringXsltFilePath, System.getenv(\"UIMA_HOME\") + \"\/bin\/dd2spring.xsl\");\r\ndeployCtx.put(UimaAsynchronousEngine.SaxonClasspath, \"file:\" + System.getenv(\"UIMA_HOME\") + \"\/saxon\/saxon8.jar\");\r\n\r\n\/\/ preparing map for use in deploying services\r\nuimaAsEngine.deploy(\".\/conf\/annotatorA\/deploy.xml\", deployCtx);\r\nuimaAsEngine.deploy(\".\/conf\/annotatorB\/deploy.xml\", deployCtx);\r\nuimaAsEngine.deploy(\".\/conf\/annotatorC\/deploy.xml\", deployCtx);\r\nuimaAsEngine.deploy(\".\/conf\/annotatorD\/deploy.xml\", deployCtx);\r\nuimaAsEngine.deploy(\".\/conf\/annotatorE\/deploy.xml\", deployCtx);<\/pre>\n<p>The deployment descriptors for each annotator specify the name of the JMS endpoint that UIMA can use to send documents to the annotator for analysis, and the location of the analysis engine descriptor file that defines the annotator. <\/p>\n<p>For example <code>uima-as-project\/conf\/annotatorB\/deploy.xml<\/code><\/p>\n<pre style=\"border: thin solid silver; background-color: #eeeeee; padding: 0.7em; font-size: 1em; overflow: auto;\">&lt;analysisEngineDeploymentDescription&gt;\r\n  &lt;deployment protocol=\"jms\" provider=\"activemq\"&gt;\r\n    &lt;service&gt;\r\n      &lt;inputQueue endpoint=\"AnnotatorBRemoteQ\" brokerURL=\"tcp:\/\/localhost:61616\"\/&gt;\r\n      &lt;topDescriptor&gt;\r\n        &lt;import location=\"analysisEngine.xml\"\/&gt;\r\n      &lt;\/topDescriptor&gt;\r\n    &lt;\/service&gt;\r\n  &lt;\/deployment&gt;\r\n&lt;\/analysisEngineDeploymentDescription&gt;<\/pre>\n<p>The individual annotator descriptors are the same as in the first project <code>uima-project<\/code>. <\/p>\n<p>For example,<br \/>\n<code>uima-as-project\/conf\/annotatorB\/analysisEngine.xml<\/code><\/p>\n<p>As before, it identifies the Java class which implements the annotator, and the types of annotations that it can create. <\/p>\n<p>Once the UIMA services are deployed, the analysis engine descriptor for the overall pipeline can be deployed.<\/p>\n<p>This is also done in<br \/>\n<code>uima-as-project\/src\/com\/dalelane\/uima\/parallel\/Pipeline.java<\/code><\/p>\n<pre style=\"border: thin solid silver; background-color: #eeeeee; padding: 0.7em; font-size: 1em; overflow: auto;\">uimaAsEngine.deploy(\".\/conf\/deploy.xml\", deployCtx);<\/pre>\n<p>The deployment descriptor for the overall pipeline (<code>uima-as-project\/conf\/deploy.xml<\/code>), identifies how the pipeline can communicate with each of the &#8220;remote&#8221; services that make up it&#8217;s annotators. <\/p>\n<pre style=\"border: thin solid silver; background-color: #eeeeee; padding: 0.7em; font-size: 1em; overflow: auto;\">&lt;delegates&gt;\r\n  &lt;remoteAnalysisEngine key=\"annotatorA\"&gt;\r\n    &lt;inputQueue brokerURL=\"tcp:\/\/localhost:61616\" endpoint=\"AnnotatorARemoteQ\"\/&gt;\r\n    &lt;serializer method=\"xmi\"\/&gt;\r\n  &lt;\/remoteAnalysisEngine&gt;\r\n  &lt;remoteAnalysisEngine key=\"annotatorB\"&gt;\r\n    &lt;inputQueue brokerURL=\"tcp:\/\/localhost:61616\" endpoint=\"AnnotatorBRemoteQ\"\/&gt;\r\n    &lt;serializermethod=\"xmi\"\/&gt;\r\n  &lt;\/remoteAnalysisEngine&gt;\r\n  &lt;remoteAnalysisEnginekey=\"annotatorC\"&gt;\r\n    &lt;inputQueue brokerURL=\"tcp:\/\/localhost:61616\" endpoint=\"AnnotatorCRemoteQ\"\/&gt;\r\n    &lt;serializer method=\"xmi\"\/&gt;\r\n  &lt;\/remoteAnalysisEngine&gt;\r\n  &lt;remoteAnalysisEnginekey=\"annotatorD\"&gt;\r\n    &lt;inputQueue brokerURL=\"tcp:\/\/localhost:61616\" endpoint=\"AnnotatorDRemoteQ\"\/&gt;\r\n    &lt;serializer method=\"xmi\"\/&gt;\r\n  &lt;\/remoteAnalysisEngine&gt;\r\n  &lt;remoteAnalysisEngine key=\"annotatorE\"&gt;\r\n    &lt;inputQueue brokerURL=\"tcp:\/\/localhost:61616\" endpoint=\"AnnotatorERemoteQ\"\/&gt;\r\n    &lt;serializer method=\"xmi\"\/&gt;\r\n  &lt;\/remoteAnalysisEngine&gt;\r\n&lt;\/delegates&gt;<\/pre>\n<p>UIMA-AS provides a sample (<code>AdvancedFixedFlowController<\/code>) that takes care of making the copies (a CAS Multiplier) of the document being analysed, and defines the sequence for the annotators to be run in parallel. <\/p>\n<p>The deployment descriptor for my pipeline uses this sample.<\/p>\n<pre style=\"border: thin solid silver; background-color: #eeeeee; padding: 0.7em; font-size: 1em; overflow: auto;\">&lt;flowController key=\"AdvancedFixedFlowController\"&gt;\r\n    &lt;import location=\"UIMA_HOME\/examples\/descriptors\/flow_controller\/AdvancedFixedFlowController.xml\"\/&gt;\r\n&lt;\/flowController&gt;\r\n&lt;analysisEngineMetaData&gt;\r\n\t&lt;configurationParameterSettings&gt;\r\n\t  &lt;nameValuePair&gt;\r\n\t    &lt;name&gt;Flow&lt;\/name&gt;\r\n\t    &lt;value&gt;\r\n\t      &lt;array&gt;\r\n\t        &lt;string&gt;annotatorA,annotatorB,annotatorC,annotatorD,annotatorE&lt;\/string&gt;\r\n\t      &lt;\/array&gt;\r\n\t    &lt;\/value&gt;\r\n\t  &lt;\/nameValuePair&gt;\r\n\t&lt;\/configurationParameterSettings&gt;<\/pre>\n<p>It also identifies the descriptor file for running the analysis engine<\/p>\n<pre style=\"border: thin solid silver; background-color: #eeeeee; padding: 0.7em; font-size: 1em; overflow: auto;\">&lt;topDescriptor&gt;\r\n    &lt;import location=\"analysisEngine.xml\"\/&gt;\r\n&lt;\/topDescriptor&gt;<\/pre>\n<p>The analysis engine descriptor file (<code>uima-as-project\/conf\/analysisEngine.xml<\/code>), similar to before, identifies the annotators that make up the aggregate pipeline. <\/p>\n<pre style=\"border: thin solid silver; background-color: #eeeeee; padding: 0.7em; font-size: 1em; overflow: auto;\">&lt;delegateAnalysisEngineSpecifiers&gt;\r\n  &lt;delegateAnalysisEngine key=\"annotatorA\"&gt;\r\n    &lt;import location=\"annotatorA\/remote.xml\"\/&gt;\r\n  &lt;\/delegateAnalysisEngine&gt;\r\n  &lt;delegateAnalysisEngine key=\"annotatorB\"&gt;\r\n    &lt;import location=\"annotatorB\/remote.xml\"\/&gt;\r\n  &lt;\/delegateAnalysisEngine&gt;\r\n  &lt;delegateAnalysisEngine key=\"annotatorC\"&gt;\r\n    &lt;import location=\"annotatorC\/remote.xml\"\/&gt;\r\n  &lt;\/delegateAnalysisEngine&gt;\r\n  &lt;delegateAnalysisEngine key=\"annotatorD\"&gt;\r\n    &lt;import location=\"annotatorD\/remote.xml\"\/&gt;\r\n  &lt;\/delegateAnalysisEngine&gt;\r\n  &lt;delegateAnalysisEngine key=\"annotatorE\"&gt;\r\n    &lt;import location=\"annotatorE\/remote.xml\"\/&gt;\r\n  &lt;\/delegateAnalysisEngine&gt;\r\n&lt;\/delegateAnalysisEngineSpecifiers&gt;<\/pre>\n<p>These describe the way that the analysis engine can send documents to the remote services for analysis, using JMS. For example, <code>uima-as-project\/conf\/annotatorB\/remote.xml<\/code> contains:<\/p>\n<pre style=\"border: thin solid silver; background-color: #eeeeee; padding: 0.7em; font-size: 1em; overflow: auto;\">&lt;customResourceSpecifierxmlns=\"http:\/\/uima.apache.org\/resourceSpecifier\"&gt;\r\n   &lt;resourceClassName&gt;org.apache.uima.aae.jms_adapter.JmsAnalysisEngineServiceAdapter&lt;\/resourceClassName&gt;\r\n   &lt;parameters&gt;\r\n     &lt;parameter name=\"brokerURL\" value=\"tcp:\/\/localhost:61616\"\/&gt;\r\n     &lt;parameter name=\"endpoint\" value=\"AnnotatorBRemoteQ\"\/&gt;\r\n     &lt;parameter name=\"timeout\" value=\"5000\"\/&gt;\r\n     &lt;parameter name=\"getmetatimeout\" value=\"5000\"\/&gt;\r\n     &lt;parameter name=\"cpctimeout\" value=\"5000\"\/&gt;\r\n   &lt;\/parameters&gt;\r\n&lt;\/customResourceSpecifier&gt;<\/pre>\n<p>To summarise:<\/p>\n<ol>\n<li>The provided eclipse launch config starts a Java application <code>uima-as-project\/src\/com\/dalelane\/uima\/parallel\/Application.java<\/code><\/li>\n<li>The Java application creates an instance of <code>uima-as-project\/src\/com\/dalelane\/uima\/parallel\/Pipeline.java<\/code><\/li>\n<li><code>Pipeline.java<\/code> creates an <code>UimaAsynchronousEngine<\/code> which deploys each of the annotator services, such as <code>uima-as-project\/conf\/annotatorD\/deploy.xml<\/code><\/li>\n<li>Each annotator&#8217;s deployment descriptor identifies the actual implementation of the annotator, giving the analysis engine XML <code>uima-as-project\/conf\/annotatorD\/analysisEngine.xml<\/code> which in turn specifies the Java implementation class<\/li>\n<li><code>Pipeline.java<\/code> then deploys the overall analysis engine pipeline as specified in the deployment descriptor <code>uima-as-project\/conf\/deploy.xml<\/code> <\/li>\n<li>This deployment descriptor identifies the way that the analysis engine should communicate with the remote services (by importing JMS specs such as <code>uima-as-project\/conf\/annotatorC\/remote.xml<\/code>) and the order that they should be invoked in (using <code>AdvancedFixedFlowController<\/code>)<\/li>\n<\/ol>\n<p>The output from running the launch config shows that it takes about 6 seconds (5 annotators run in parallel, each of which takes about 6 seconds) to process the document text. <\/p>\n<p>Full sample output is at<br \/>\n<code>uima-as-project\/example-output\/console.log<\/code><\/p>\n<p>A summary is:<\/p>\n<pre style=\"border: thin solid silver; background-color: #eeeeee; padding: 0.7em; font-size: 1em; overflow: auto;\">Sample UIMA application - parallel\r\n==================================\r\nDeploying UIMA services\r\nService:annotatorA Initialized. Ready To Process Messages From Queue:AnnotatorARemoteQ\r\nService:annotatorB Initialized. Ready To Process Messages From Queue:AnnotatorBRemoteQ\r\nService:annotatorC Initialized. Ready To Process Messages From Queue:AnnotatorCRemoteQ\r\nService:annotatorD Initialized. Ready To Process Messages From Queue:AnnotatorDRemoteQ\r\nService:annotatorE Initialized. Ready To Process Messages From Queue:AnnotatorERemoteQ\r\nDeploying analysis engine\r\nService:UIMA demonstration Initialized. Ready To Process Messages From Queue:DemoAnnotatorQueue\r\nInitialising UIMA client\r\nProcessing document...\r\nTime spent in pipeline: 6117\r\nConfirming what was added...\r\n  Found: org.apache.uima.cas.impl.AnnotationImpl\r\n  Found: org.apache.uima.cas.impl.AnnotationImpl\r\n  Found: org.apache.uima.cas.impl.AnnotationImpl\r\n  Found: org.apache.uima.cas.impl.AnnotationImpl\r\n  Found: org.apache.uima.cas.impl.AnnotationImpl\r\n  Found: org.apache.uima.cas.impl.AnnotationImpl<\/pre>\n<p><strong>Summary<\/strong><\/p>\n<p>This isn&#8217;t definitive model code for using UIMA-AS. It&#8217;s intended more as a helpful first step into getting started with UIMA-AS &#8211; which there seems to be a shortage of documentation for. But there is a *lot* more to UIMA-AS, with a lot of settings and features to tweak. <\/p>\n<p>Even with this simple example, you can see that output which takes 30 seconds to get using UIMA can be completed in 6 seconds if run in parallel, and how this can be done with UIMA-AS and a few extra config files. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview UIMA stands for Unstructured Information Management Architecture. It&#8217;s an Apache technology that provides a framework and standard for building text analytics applications. I&#8217;ve mentioned it before. In this post, I want to talk about an area of UIMA which isn&#8217;t covered well in the documentation. I couldn&#8217;t find practical getting-started instructions for running UIMA-AS [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[219,544,533,543],"class_list":["post-2247","post","type-post","status-publish","format-standard","hentry","category-code","tag-java","tag-jms","tag-uima","tag-uima-as"],"_links":{"self":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2247"}],"version-history":[{"count":0,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2247\/revisions"}],"wp:attachment":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}