Skip to content
dabeat edited this page Feb 12, 2013 · 16 revisions

DeSR UIMA wrapper

UIMA wrapper for the DeSR dependency parser. This UIMA analysis engine creates dependency annotations provided sentence and token annotations have been previously generated.

The annotator descriptor allows to set which five attributes (token, lemma, pos, cpos, feats) are going to be used by the DeSR parser, as well as a flag for each attribute, indicating whether the attribute is to be used in the process or not.

Dependencies

  • DeSR dependency parser. Follow the compilation steps in the README included in the DeSR distribution (needs to be downloaded separately. Version 1.3.2 has been successfully used). The file $DeSR_HOME/src/libdesr.so will be generated, among other files.
  • Annotator shared library (DeSR.so) generated by the annotator makefile (in directory source/).

These two shared libraries, libdesr.so and DeSR.so, will be required by the annotator to properly be executed.

Technical description

The UIMA DeSR analysis engine is a UIMA C++ annotator. It has been developed by means of the C++ SDK provided by UIMA. This SDK allows to develop C++ UIMA annotators. In particular, version 2.4.0 of UIMA-CPP has been used to develop the DeSR annotator, although it has also been succesfully tested with earlier versions for compiling and executing. The DeSR annotator source code has been compiled successfully with gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9) and some others on Ubuntu 10.04 and 12.04 systems. It also might be necessary to install doxygen in /usr/local/bin (Ubuntu sets doxygen in /usr/bin).

The UIMA C++ SDK allows to develop C++ annotators, generating a shared library that will be called from the pipeline. Annotator descriptor must be set with the C++ implementation option. UIMA pipeline will look for a shared library named the same as the annotator in the dynamic library path specified in the $LD_LIBRARY_PATH environmental variable.


Some environmental variables are needed in order to compile and execute UIMA C++ SDK examples:

Environment Variables

The following environmental variables are needed for UIMA C++ to function properly.

* UIMACPP_HOME should point to the uimacpp directory of your unpacked Apache UIMA C++
  distribution. UIMACPP_HOME is used when compiling & linking UIMA C++ components.
* Append $UIMACPP_HOME/bin to your PATH to pick up the runAECpp test driver
  and shared libraries (Windows)
* Append $UIMACPP_HOME/lib to your LD_LIBRARY_PATH (Linux) or DYLD_LIBRARY_PATH (MacOSX)
  so that the necessary shared libraries can be found.

Also note that UIMA C++ annotators are built as shared libraries, so they must be in a directory in the LD_LIBRARY_PATH, DYLD_LIBRARY_PATH or PATH (as appropriate to your platform) as well. An example of this is given in the next section.

For better runtime integration between Java and C++, the Apache UIMA Java SDK command line utilities and Eclipse run configurations automatically add $UIMA_HOME/uimacpp/lib to LD_LIBRARY_PATH and DYLD_LIBRARY_PATH, and add $UIMA_HOME/uimacpp/bin to PATH.


Warning: Unlike the UIMA Java SDK, the UIMA SDK C++ doesn't require annotator Type System implementation (JCas), It automatically generates the necessary classes from the Type System specification in the descriptor and Type System XML files.

Compiling the wrapper

The $DESR_HOME environmental variable is required for the DeSR annotator compilation. The wrapper compilation will need to access the compiled DeSR library at $DeSR_HOME/src/libdesr.so.

Execute the following (in source/DeSR-cpp/): make -f DeSR.mak

Generating the Analysis Engine UIMA component

An example annotator descriptor file can be found in the example/DeSR_ES directory. You will need to copy the needed resources (model file) to /resources and possibly adapt the descriptor. Copy libdesr.so and DeSR.so to lib/ and generate the PEAR using mvn package.

Using the DeSR annotator from a pipeline

Install the PEAR file using the PEAR installer.

The LD_LIBRARY_PATH variable needs to point to the directories containing DeSR.so (obtained from compiling the wrapper), as well as the libdesr.so DeSR parser shared library. Both will be contained in the lib/ directory of the installed PEAR, so adding that directory to the LD_LIBRARY_PATH should work.

Contact

You can contact us via email: [email protected]

We also follow the UIMA mailing lists, so for questions that may be of interest to other users preferably post to the users list: http://uima.apache.org/mail-lists.html

For bug reports use the github "Issues". Pull requests for bug fixes or improvements are welcome.

Clone this wiki locally