Archive

Archive for the ‘RDF Schema’ Category

Instalação do Apache UIMA (Apache UIMA Installation)

Introdução

Introduction


Este texto relata o processo de instalação do Eclipse, juntamente com o Apache UIMA1. O objetivo é usar o Apache UIMA, em uma primeira etapa, para testar a hipótese ilustrada pela Figura 1.


This paper reports the Eclipse installation process along with Apache UIMA1. The goal is to use the Apache UIMA, in a first step, to test the hypothesis illustrated in Figure 1.

aeasd
Figura 1. Modelo a ser testado no Apache UIMA.
Figure 1. Model to be tested in Apache UIMA.


Na figura, (1), representa o modelo AEASD (Autonomous Elements Architecture for Specific Domains) (BRAGA; OMAR; GRANVILLE, 2015), o qual organiza um ambiente de agentes inteligentes com características voltadas para o domínio específico dos Sistemas Autônomos, que povoam a Internet. Presume-se que os elementos inteligentes terão mais autonomia, se conseguirem aprender, ensinar e cooperar através de uma base de conhecimento ou ontologia, (2), local ou remota (como a Wikidata2 e/ou outras). Esta ontologia pode ser construída a partir de bases de dados não estruturadas, (3), desde que se possua as ferramentas adequadas (FAN et al., 2012). Um conjunto de tais ferramentas foi desenvolvido pela IBM (FERRUCCI, 2012) (FERRUCCI et al., 2010), através de uma competente equipe quando da construção do IBM Watson, (5), diante do incrível desafio de vencer humanos no Jeopardy! – existem diversos vídeos no YouTube sobre este evento, que aconteceu em 2011. Há fortes indícios de que com adaptações adequadas, tais técnicas possam ser transportadas para domínios específicos (FERRUCCI; BROWN, 2011), como o domínio de interesse da hipótese a ser testada, (4). Através das técnicas adaptadas, bases intermediárias, (6), poderão ser construídas, sobre as quais novas ferramentas, (7), podem direcionar o conhecimento adquirido no formato adequado, (2). Os elementos inteligentes do modelo AEASD irão interagir com as novas ferramentas adaptadas, (5), e desenvolvidas, (7).


In the figure, (1) represents the AEASD
model (Autonomous Elements Architecture for Specific Domains) (BRAGA; OMAR; GRANVILLE, 2015), which organizes an intelligent agents environment with features focused on the specific area of ​​Autonomous Systems, populating the Internet. It is assumed these smart elements will have more autonomy, if they can learn, teach and cooperate through a knowledge base or ontology, (2), local or remote (such as Wikidata2 and / or others). This ontology can be constructed from unstructured databases, (3), provided that it has the appropriate tools (FAN et al., 2012).
A set of such tools was developed by IBM (FERRUCCI, 2012) (FERRUCCI et al., 2010), through a competent team when the construction of the IBM Watson, (5), facing the incredible challenge to beat humans in Jeopardy! – there are several videos on YouTube about this event, which took place
in 2011. There is strong evidence that with appropriate adjustments, such techniques
can be transported to specific areas (FERRUCCI; BROWN, 2011), as the domain of interest hypothesis to be tested, (4). Through the adapted techniques, intermediate bases, (6), may be built, for which new tools, (7), can direct the acquired knowledge in the proper format, (2). Intelligent elements in AEASD model will interact with new adapted tools, (5), and developed, (7).
.

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
produced with approaches focused on the Apache UIMA as unstructured data analysis tool within the Internet infrastructure domain and its results against experience on the hypothesis shown in Figure 1. Figure 2, abstractly, illustrates the Apache UIMA task
to submit information from (multi modal) unstructured world, in a process of transformation to the world of structured data. No magic, of course.

uima-estrutura
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.

  1. Instalar o Eclipse
  2. Instalar os plugins UIMA no Eclipse
  3. Instalar algumas extensões complementares no Eclipse
  4. Instalar o UIMA SDK
  5. Instalar o código fonte UIMA nos arquivos jar
  6. Instalar o Javadocs do UIMA
  7. 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.

eclipse-uima

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.

eclipse-maven

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

eclipse-maven2

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.

eclipse-path

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.
eclipse-noproblem

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.

eclipse-pronto

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&gt;.

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.


  1. Apache UIMA. http://uima.apache.org/index.html
  2. Wikidata. https://www.wikidata.org/wiki/Wikidata:Main_Page
  3. UIMA Overview & SDK Setup. http://uima.apache.org/d/uimaj-current/overview_and_setup.pdf
  4. http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  5. http://www.eclipse.org/users/
  6. http://help.eclipse.org/mars/index.jsp
  7. http://uima.apache.org/one-time-setup.html#maven-setup
  8. Adaptation of Figure 2.1 available in http://uima.apache.org/d/uimaj-current/overview_and_setup.pdf