Archive
Instalação do Apache UIMA (Apache UIMA Installation)
Introdução |
Introduction |
---|---|
|
|
![]() |
|
Figura 1. Modelo a ser testado no Apache UIMA.
|
Figure 1. Model to be tested in Apache UIMA.
|
|
|
Neste texto, a preocupação é mostrar, informalmente, a experiência da implementação do Apache UIMA sob o ambiente do Eclipse (MARS.1) em Windows 10, sob Notebook Dual Core (inicialmente) e servir como guia de apoio aos interessados. Posteriormente, outros textos poderão ser produzidos com abordagens focadas no Apache UIMA, como ferramenta de análise dos dados não estruturados dentro do domínio da Infraestrutura da Internet e seus resultados em relação às experiências sobre a hipótese mostrada na Figura 1. A Figura 2, abstratamente, ilustra a tarefa do Apache UIMA em submeter informações (multi modal) do mundo não estruturado, sob um processo de transformação ao mundo dos dados estruturados. Sem mágica, naturalmente. |
In this text, the concern is to show informally the experience of implementation of Apache UIMA under the Eclipse environment (MARS.1) in Windows 10, under Notebook Dual Core (initially) and serve as a guide to support interested. Later, other texts can be |
![]() |
|
Figura 2. O que faz o Apache UIMA8.
|
Figure 2. What does the Apache UIMA8.
|
… from now on, only in Portuguese…
Instalação do Apache UIMA
São em sete, o número de etapas3 para se preparar o Apache UIMA para o trabalho a ser executado. Todas elas envolvem diretamente a implementação do Eclipse.
- Instalar o Eclipse
- Instalar os plugins UIMA no Eclipse
- Instalar algumas extensões complementares no Eclipse
- Instalar o UIMA SDK
- Instalar o código fonte UIMA nos arquivos jar
- Instalar o Javadocs do UIMA
- Preparar o Eclipse para ver o Código Exemplo
Instalação do Eclipse
1). Foi instalado o Java SE Develpment Kit (8u66)4
2). Foi instalado o Eclipse “for Java Developers”5, que inclui: Java IDE, cliente GIT, Editor XML, Myliyn, integrador Maven e WindowBulder. Em seguida foi incluído o m2e e o Py IDE. Para as instalações posteriores, veja a documentação6 do Eclipse.
3). Instalados os plugins do UIMA, conforme pode ser visto na Figura 3.

Figura 3. Versões dos plugins UIMA instalados no Eclipse.
4). Adicionar a variável de ambiente para o Maven7, recomentado em “One time setup ofr Maven” e “One time setup for Eclipse”. Detalhes nas Figuras 4 e 5.

Figura 4. Inclusão da variável de ambiente MAVEN_OPTS (Resultado final)

Figura 5. Visão geral da operação de inclusão da variável de ambiente MAVEN_OPTS.
5). Instalar o UIMA SDK (Apache UIMA Version 2.8.1) disponível em http://mirror.nbtelecom.com.br/apache//uima//uimaj-2.8.1/uimaj-2.8.1-bin.zip . Descompacte-o em qualquer diretório. No meu caso foi em E:apache-uima. Em seguida crie a variável de ambiente %UIMA_HOME% para este diretório. Faça o mesmo para %ECLIPSE_HOME%, para o caminho C:Usersjbeclipsejava-marseclipse.
6). Em seguida executar adjustExamplePaths.bat, no diretório %UIMA_HOME%bin cujo resultado segue abaixo. É preciso ficar atento às quebras de linhas forçadas, para que o texto caiba integralmente.
E:apache-uimabin>adjustExamplePaths.bat E:apache-uimabin>setlocal E:apache-uimabin>if "" == "" (set UIMA_JAVA_CALL=java ) else (set "UIMA_JAVA_CALL=binjava" ) E:apache-uimabin>"java" -cp "E:apache-uima/lib/uima-core.jar" org.apache.uima.internal.util.ReplaceStringInFiles "E:apache-uima/examples" .xml "C:/Program Files/apache-uima" "E:apache-uima" -ignorecase Ignoring case Working on file: E:apache-uimaexamplesdataxml IBM_LifeSciences.xml Working on file: E:apache-uimaexamplesdataxml New_IBM_Fellows.xml Working on file: E:apache-uimaexamplesdataxml SeminarChallengesInSpeechRecognition.xml Working on file: E:apache-uimaexamplesdataxml TrainableInformationExtractionSystems.xml Working on file: E:apache-uimaexamplesdataxml UIMASummerSchool2003.xml Working on file: E:apache-uimaexamplesdataxml UIMA_Seminars.xml Working on file: E:apache-uimaexamplesdataxml WatsonConferenceRooms.xml Working on file: E:apache-uimaexamplesdeployvinci Deploy_MeetingDetectorTAE.xml File modified, number of instances replaced: 1 Working on file: E:apache-uimaexamplesdeployvinci Deploy_PersonTitleAnnotator.xml File modified, number of instances replaced: 1 Working on file: E:apache-uimaexamplesdeployvinci Deploy_XmiWriterWithTutorialTypeSystem.xml File modified, number of instances replaced: 1 Working on file: E:apache-uimaexamplesdescriptors MixedAggregate.xml Working on file: E:apache-uimaexamplesdescriptors analysis_engineGovernmentOfficialRecognizer_RegEx_TAE.xml Working on file: E:apache-uimaexamplesdescriptors analysis_engineNamesAndGovernmentOfficials_TAE.xml Working on file: E:apache-uimaexamplesdescriptors analysis_engineNamesAndPersonTitles_TAE.xml Working on file: E:apache-uimaexamplesdescriptors analysis_enginePersonTitleAnnotator.xml Working on file: E:apache-uimaexamplesdescriptors analysis_enginePersonTitleAnnotator_WithinNamesOnly.xml Working on file: E:apache-uimaexamplesdescriptors analysis_engineRegExAnnotator.xml Working on file: E:apache-uimaexamplesdescriptors analysis_engineSimpleEmailRecognizer_RegEx_TAE.xml Working on file: E:apache-uimaexamplesdescriptors analysis_engineSimpleNameRecognizer_RegEx_TAE.xml Working on file: E:apache-uimaexamplesdescriptors analysis_engineSimpleTokenAndSentenceAnnotator.xml Working on file: E:apache-uimaexamplesdescriptors analysis_engineSofaExampleAnnotator.xml Working on file: E:apache-uimaexamplesdescriptors analysis_engineUIMA_Analysis_Example.xml Working on file: E:apache-uimaexamplesdescriptors analysis_engineXmlDetagger.xml Working on file: E:apache-uimaexamplesdescriptors cas_consumerAnnotationPrinter.xml Working on file: E:apache-uimaexamplesdescriptors cas_consumerInlineXmlCasConsumer.xml Working on file: E:apache-uimaexamplesdescriptors cas_consumerXCasWriterCasConsumer.xml Working on file: E:apache-uimaexamplesdescriptors cas_consumerXmiEcoreCasConsumer.xml Working on file: E:apache-uimaexamplesdescriptors cas_consumerXmiWriterCasConsumer.xml Working on file: E:apache-uimaexamplesdescriptors cas_consumerXmiWriterWithTutorialTypeSystem.xml Working on file: E:apache-uimaexamplesdescriptors cas_multiplierSegmenterAndTokenizerAE.xml Working on file: E:apache-uimaexamplesdescriptors cas_multiplierSegment_Annotate_Merge_AE.xml Working on file: E:apache-uimaexamplesdescriptors cas_multiplierSimpleTextMerger.xml Working on file: E:apache-uimaexamplesdescriptors cas_multiplierSimpleTextSegmenter.xml Working on file: E:apache-uimaexamplesdescriptors collection_processing_engineMeetingFinderCPE_Integrated.xml Working on file: E:apache-uimaexamplesdescriptors collection_processing_engineMeetingFinderCPE_Managed_Unix.xml File modified, number of instances replaced: 5 Working on file: E:apache-uimaexamplesdescriptors collection_processing_engineMeetingFinderCPE_Managed_Windows.xml File modified, number of instances replaced: 5 Working on file: E:apache-uimaexamplesdescriptors collection_processing_engineMeetingFinderCPE_NonManaged.xml Working on file: E:apache-uimaexamplesdescriptors collection_processing_engineMeetingFinderCPE_ NonManagedCasConsumer.xml Working on file: E:apache-uimaexamplesdescriptors collection_processing_engineMeetingFinderCPE_WithXmlDetagging.xml File modified, number of instances replaced: 1 Working on file: E:apache-uimaexamplesdescriptors collection_readerFileSystemCollectionReader.xml File modified, number of instances replaced: 1 Working on file: E:apache-uimaexamplesdescriptors collection_readerXmiCollectionReader.xml File modified, number of instances replaced: 1 Working on file: E:apache-uimaexamplesdescriptors flow_controllerAdvancedFixedFlowController.xml Working on file: E:apache-uimaexamplesdescriptors flow_controllerMeetingDetectorTAE_AdvancedFixedFlow.xml Working on file: E:apache-uimaexamplesdescriptors flow_controllerMeetingDetectorTAE_Whiteboard.xml Working on file: E:apache-uimaexamplesdescriptors flow_controllerWhiteboardFlowController.xml Working on file: E:apache-uimaexamplesdescriptors soapServiceGovernmentTitleRecognizerService.xml Working on file: E:apache-uimaexamplesdescriptors soapServiceNamesAndPersonTitlesService.xml Working on file: E:apache-uimaexamplesdescriptors soapServicePersonTitleAnnotatorService.xml Working on file: E:apache-uimaexamplesdescriptors soapServiceSimpleNameRecognizerService.xml Working on file: E:apache-uimaexamplesdescriptors tutorialex1RoomNumberAnnotator.xml Working on file: E:apache-uimaexamplesdescriptors tutorialex1TutorialTypeSystem.xml Working on file: E:apache-uimaexamplesdescriptors tutorialex2RoomNumberAnnotator.xml Working on file: E:apache-uimaexamplesdescriptors tutorialex3RoomNumberAndDateTime.xml Working on file: E:apache-uimaexamplesdescriptors tutorialex3TutorialDateTime.xml Working on file: E:apache-uimaexamplesdescriptors tutorialex3TutorialTypeSystem.xml Working on file: E:apache-uimaexamplesdescriptors tutorialex4MeetingAnnotator.xml Working on file: E:apache-uimaexamplesdescriptors tutorialex4MeetingDetectorTAE.xml Working on file: E:apache-uimaexamplesdescriptors tutorialex4TutorialTypeSystem.xml Working on file: E:apache-uimaexamplesdescriptors tutorialex5RoomNumberAnnotator.xml Working on file: E:apache-uimaexamplesdescriptors tutorialex6TutorialTypeSystem.xml Working on file: E:apache-uimaexamplesdescriptors tutorialex6UimaAcronymAnnotator.xml Working on file: E:apache-uimaexamplesdescriptors tutorialex6UimaMeetingAnnotator.xml Working on file: E:apache-uimaexamplesdescriptors tutorialex6UimaMeetingDetectorTAE.xml Working on file: E:apache-uimaexamplesdescriptors tutorialsearchMeetingIndexBuildSpec.xml Working on file: E:apache-uimaexamplesdescriptors vinciServiceMeetingDetectorVinciService.xml Working on file: E:apache-uimaexamplesdescriptors vinciServicePersonTitleVinciService.xml Working on file: E:apache-uimaexamplesdescriptors vinciServiceXmiWriterVinciServiceWithTutorialTypeSystem.xml Working on file: E:apache-uimaexamplesresourcesorg apacheuimaexamplesSourceDocumentInformation.xml E:apache-uimabin>"java" -cp "E:apache-uima/lib/uima-core.jar" org.apache.uima.internal.util.ReplaceStringInFiles "E:apache-uima/examples" .classpath "C:/Program Files/ apache-uima" "E:apache-uima" -ignorecase Ignoring case Working on file: E:apache-uimaexamples.classpath File modified, number of instances replaced: 5 E:apache-uimabin>"java" -cp "E:apache-uima/lib/uima-core.jar" org.apache.uima.internal.util.ReplaceStringInFiles "E:apache-uima/examples" .launch "C:/Program Files/ apache-uima" "E:apache-uima" -ignorecase Ignoring case Working on file: E:apache-uimaexamplesrun_configuration UIMA Annotation Viewer.launch Working on file: E:apache-uimaexamplesrun_configuration UIMA CAS Visual Debugger.launch Working on file: E:apache-uimaexamplesrun_configuration UIMA CPE GUI.launch Working on file: E:apache-uimaexamplesrun_configuration UIMA Document Analyzer.launch Working on file: E:apache-uimaexamplesrun_configuration UIMA JCasGen Merge.launch Working on file: E:apache-uimaexamplesrun_configuration UIMA JCasGen.launch Working on file: E:apache-uimaexamplesrun_configuration UIMA PEAR Installer.launch Working on file: E:apache-uimaexamplesrun_configuration UIMA Run AE.launch Working on file: E:apache-uimaexamplesrun_configuration UIMA Run CPE.launch Working on file: E:apache-uimaexamplesrun_configuration UIMA Start Vinci Service.launch Working on file: E:apache-uimaexamplesrun_configuration UIMA Start VNS.launch E:apache-uimabin>"java" -cp "E:apache-uima/lib/uima-core.jar" org.apache.uima.internal.util.ReplaceStringInFiles "E:apache-uima/examples" .wsdd "C:/Program Files/ apache-uima" "E:apache-uima" -ignorecase Ignoring case Working on file: E:apache-uimaexamplesdeploysoap Deploy_GovernmentTitleRecognizer.wsdd File modified, number of instances replaced: 1 Working on file: E:apache-uimaexamplesdeploysoap Deploy_NamesAndPersonTitles.wsdd File modified, number of instances replaced: 1 Working on file: E:apache-uimaexamplesdeploysoap Deploy_PersonTitleAnnotator.wsdd File modified, number of instances replaced: 1 Working on file: E:apache-uimaexamplesdeploysoap Deploy_SimpleNameRecognizer.wsdd File modified, number of instances replaced: 1 Working on file: E:apache-uimaexamplesdeploysoap Undeploy_GovernmentTitleRecognizer.wsdd Working on file: E:apache-uimaexamplesdeploysoap Undeploy_NamesAndPersonTitles.wsdd Working on file: E:apache-uimaexamplesdeploysoap Undeploy_PersonTitleAnnotator.wsdd Working on file: E:apache-uimaexamplesdeploysoap Undeploy_SimpleNameRecognizer.wsdd E:apache-uimabin>
7). Execute no prompt, eclipse -clean, para carregar o Eclipse.
8). Inclua o caminho %UIMA_HOME% no Eclipse, como mostra a Figura 5.

Figura 5. Incluindo o %UIMA_HOME% no Eclipse.
9). Crie o novo projeto exemplo do UIMA executando os passos, no Eclipse:
- Selecione o menu “File” e “Import”
- Selecione “General/Existing Project into Workspace” e clique no botão “Next”.
- Clique em “Browse” e indique o diretório %UIMA_HOME%.
- Clique em “Finish”. Isto irá criar um novo projeto no Eclipse, chamado “uimaj-examples”. Realmente, não houve erro de compilação, como mostra a Figura 6.

Figura 6. Nenhum erro de compilação do projeto exemplo do UIMA
Após estes passos, o código fonte do UIMA já foi inserido no ambiente do Eclipse, incluindo o Javadocs, não sendo necessário cumprir outras atividades. Portanto, o Eclipse está pronto para o UIMA! Cumpriu-se assim, todas as sete etapas da constantes da seção “Instalação do UIMA”, como mostra a Figura 7.

Figura 7. Visão parcial do Eclipse pronto para o UIMA.
Comentários Finais
Esta iniciativa de preparar o Apache UIMA para ser testado foi motivado pela disciplina Cognição e Aplicações Computacionais [turma 01A] – 2015/2, ministrada pelos Profs. Dr. Nizam Omar e Dr. Ismar Frango Silveira, no Programa de Pós Graduação em Engenharia Elétrica e Computação, da Universidade Presbiteriana Mackenzie, São Pauo, aos quais expresso meus agradecimentos pela oportunidade.
Referências
BRAGA, J.; OMAR, N.; GRANVILLE, L. Z. Uma proposta para o uso de elementos inteligentes em domínios restritos da infraestrutura da internet. In: Anais CSBC 2015 – WPIETFIRTF. Recife, Pernambuco, Brasil: [s.n.], 2015.
FAN, J. et al. Automatic knowledge extraction from documents. IBM Journal of Research and Development, IBM, v. 56, n. 3.4, p. 5–1, 2012.
FERRUCCI, D.; BROWN, E. AdaptWatson: A methodology for developing and adapting Watson technology. Armonk, NY, 2011. 8 p. Disponível em: <http://domino.research.ibm.com/library/cyberdig.ns/papers/29303F8DC7A92FC9852579F30049ABCD>.
FERRUCCI, D. A. Introduction to “This is Watson”. IBM Journal of Research and Development, IBM, v. 56, n. 3.4, p. 1–1, 2012.
FERRUCCI, D. et al. Building Watson: An overview of the DeepQA project. AI Magazine, v. 31, n. 3, p. 59–79, 2010.
- Apache UIMA. http://uima.apache.org/index.html
- Wikidata. https://www.wikidata.org/wiki/Wikidata:Main_Page
- UIMA Overview & SDK Setup. http://uima.apache.org/d/uimaj-current/overview_and_setup.pdf
- http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
- http://www.eclipse.org/users/
- http://help.eclipse.org/mars/index.jsp
- http://uima.apache.org/one-time-setup.html#maven-setup
- Adaptation of Figure 2.1 available in http://uima.apache.org/d/uimaj-current/overview_and_setup.pdf