Skip to end of metadata
Go to start of metadata

These are instructions for installation of cTAKES for developers. With these instructions you can set up your development environment with cTAKES code, change or extend the code, compile the code, and deploy. If you simply want to be a user of the software, refer to the cTAKES 3.0 User Install Guide.

Knowledge about what the cTAKES components do is not supplied by the install instructions. This is found in the cTAKES 3.0 Component Use Guide. There is no training or documentation (except for code comments) on the code itself. You must familiarize yourself with the components and then study the code on your own to be able to extend it.

In order to modify/compile the source code for a cTAKES component, developers must utilize either an IDE, such as Eclipse, or another editor of your choice. Follow the appropriate sections here depending upon your developer preferences.

Once you have compiled the code you can process documents with the cTAKES components. The documents upon which you can run cTAKES will take many forms. An example of doing this is covered in the Processing Documents section.

The minimal install instructions below are short but require a lot of prerequisite setup on your own. If you need more help then follow the step by step instructions. The step by step instructions for Eclipse assume a Windows or Ubuntu Linux install environment. You will need to extrapolate for any other environments.

Eclipse minimal install instructions

Prerequisites: Java JDK 1.6+, Eclipse IDE 4.2+, subversive plugin (or svn equivalent with appropriate SVN team provider connectors), m2e plugin (or mvn equivalent)

The following location is the main trunk of cTAKES. See how cTAKES treats the trunk, branches, and tags in the developer FAQs.

  • Import Project > Maven > Checkout Maven Project from SCM and use: svn and https://svn.apache.org/repos/asf/ctakes/trunk
  • Select all projects.
  • Wait until Eclipse downloads and builds all of your projects (it may take up to 30 minutes depending on the machine).
    • The various build helpers should run jcasgen and build the projects for you. There should not be any reason to run mvn install, etc.
  • Merge the version-matching resources ZIP file from http://sourceforge.net/projects/ctakesresources/files/ into your ctakes-dictionary-lookup project.
  • (Optional) If you would like to launch the UIMA CVD or CPE GUI, run ctakes-clinical-pipeline/resources/launch/UIMA_<CVD | CPE>GUI--clinical_documents pipeline.launch
  • (Optional) UIMA plug-ins called "UIMA Eclipse tooling and runtime support" can be installed from update site: http://www.apache.org/dist/uima/eclipse-update-site

Eclipse step by step install instructions

Preparing Java

Unable to render {include} The included page could not be found.

Preparing Eclipse

If you are going to use Eclipse for development then follow these instructions.

Step

Example

1. Download and install Eclipse 4.2+.

(optional) It is recommended that you start a new workspace to keep your cTAKES projects separate from other work.

No example

2. Subversion Eclipse plug-in (based on Subversive site). We will use the one called "Subversive - SVN Team Provider"

Help -> Install New Software...
Select the current Eclipse release (in the case of Eclipse 4 it is Juno) for the "Work with" field:

Expand the Collaboration category.
Select "Subversive SVN Team Provider".
Click Next.
Click Next.
Agree to the license agreement.
Click Finish.
Restart Eclipse.

3. Subversion team provider connectors 1.7+.

After restarting Eclipse a dialog will ask you to install an SVN Kit for the Team Provider.
Select SVN Kit 1.7 or greater.
Click Finish.
Click Next.
Click Next.
Agree to the license agreement.
Click Finish.
Accept the security warning (if one appears).
Restart Eclipse.


4. Maven is already part of Eclipse, but more integration to Maven commands is needed.

Help -> Install New Software...
Select the current Eclipse release (in the case of Eclipse 4 it is Juno) for the "Work with" field:

Expand the Collaboration category.
Select "m2e - Maven Integration for Eclipse".
Click Next.
Click Finish.
Restart Eclipse.

5. Maven SCM connector.

File -> Import ... -> Maven -> Check out Maven Projects from SCM.
Click Next.
Click the "m2e Marketplace" link.
You are now in the m2e Marketplace not the Eclipse Marketplace.
Scroll to and select m2e-subversive.
Click Finish.
Leave the defaults to install the "Maven SCM Handler for Subversive" and click Next.
Click Next.
Accept the license agreement.
Click Finish.
Accept the security warning (if one appears).
Restart Eclipse.


Compile a release in Eclipse

Step

Example

1. Import the cTAKES projects using Maven.

File -> Import ... -> Maven -> Check out Maven Projects from SCM.
Click Next.

The following location is the main trunk of cTAKES. See how cTAKES treats the trunk, branches, and tags in the developer FAQs.

2. For SCM URL use "svn" in the drop-down and this in the text field

Click Finish.
Eclipse will download and build all of the cTAKES sub-projects including running jcasgen as needed.

Due to the way Maven and Eclipse work together you will see two copies of the sub-projects in Eclipse. If you look into your workspace directories there is only one set of underlying files.

3. Download cTAKES 3.0 Dictionaries and models.

Due to licensing considerations and easy of installability, one download from an external location was established with all the resources you will need. Licensing for these resources is found within the download.

Download time will be commensurate with 1GB of data.


Windows:
Go to cTAKES resources and download the ZIP file with a matching version from the ctakesresources project.
Unzip the files into a temporary location such as C:\temp.

Linux:
Obtain the URL of the version matching ZIP file from cTAKES resources, get the file, and unzip to a temporary location.

Windows:


Linux:

4. Copy (or move) the resources to cTAKES_HOME.
With Eclipse, cTAKES_HOME will be your workspace location followed by the project name "ctakes". Copy the contents of the temporary resources directory (and all sub-directories) to <cTAKES_HOME>/ctakes-dictionary-lookup/resources.

There may be conflicts while taking this action. Overwrite the cTAKES_HOME files with those in the resources download.

Windows:

Linux:

5. Refresh Eclipse.

You must refresh your Eclipse projects to make sure that Eclipse knows about the new directories and data.

No example

6. Add ctakes-dictionary-lookup/resources as a folder to the classpath.
You will need to repeat this step for EACH project that needs access to those resources (nearly all of them do except for ctakes-relation-extractor). For example:

Open the properties on the top-level project ctakes-clinical-pipeline. For Eclipse, do not select the one under the ctakes project but the sibling to that at the highest level. Select Java Build Path -> Libraries tab -> Add Class Folder ... button.
Select the resources directory under the ctakes-dictionary-lookup.
Click OK on all dialogs until you are out of the sequence.

7. UMLS user ID and password.
Usually the dictionaries are required to process data. If you plan to utilize the UMLS dictionaries you must pass your UMLS user ID and password to the pipeline. There are several ways to do this - select one.

If you do not have a UMLS username and password, you may request one at UMLS Terminology Services

  1. Environment variable - Set or export environment variable

    ctakes.umlsuser=<username>, ctakes.umlspw=<password>
    
  2. Add the system properties to the Java arguments for a run configuration (shown in the next cell). Navigate to ctakes-clinical-pipeline -> resources -> launch > UIMA_<CVD | CPE>GUI--clinical_documents pipeline.launch. Right-click on the launch file and select Run-As -> Run Configurations... In the Arguments tab enter these parameters in the VM. Click Apply.

    -Dctakes.umlsuser=<username> -Dctakes.umlspw=<password>
    
  3. Change the UMLSUser and UMLSPW <nameValuePair> strings in these descriptor files with your UMLS username and password.
    • Dictionary Lookup: <cTAKES_HOME>/desc/ctakes-dictionary-lookup/desc/analysis_engine/DictionaryLookupAnnotatorUMLS.xml* (optional) Drug NER: <cTAKES_HOME>/desc/ctakes-drug-ner/desc/analysis_engine/DictionaryLookupAnnotatorUMLS.xml
      The following shows where in the files you would make the changes. (Do not change the <configurationParameters> by the same name.)

    • Now include the DictionaryLookupAnnotatorUMLS.xml Analysis Engine within your aggregate Analysis Engine or switch to the ones provided by cTAKES. cTAKES has provided duplicates of shipped Analysis Engine descriptors, put UMLS in the name, and placed DictionaryLookupAnnotatorUMLS.xml within them for these components:
      • Dictionary Lookup
      • Clinical Documents pipeline
      • Drug NER
      • Side Effect 
    • So you simply need to switch to using those descriptors. For example, if you were using AggregateCdaProcessor.xml in the Clinical Documents pipeline you would switch to using AggregateCdaUMLSProcessor.xml instead and you will now hook into the complete dictionaries.

      You can, of course, modify your own aggregate Analysis Engine files and place the DictionaryLookupAnnotatorUMLS.xml Analysis Engine within them.
      Since this is an in-memory database implementation, please be patient during the initial load as it could take approximately 20-30 seconds for the database to initialize.




Process documents using cTAKES

Step

Example

1. Launching the UIMA CAS Visual Debugger (CVD) or the Collection Processing Engine (CPE) from Eclipse can now be accomplished in the ctakes-clinical-pipeline project. Navigate to:

where you must select between CVD and CPE in the command. Right-click on the launch file and select Run-As -> UIMA_<CVD | CPE>GUI-clinical_documents.

Note: Don't forget to set the location of the resources and your UMLS user ID and password if you have not done so for a particular project or run configuration.


2. (Optional) Process data.

Now that you can launch the tools, the User Guide has steps to walk you through processing test data if you want to go there.

The User Guide describes files in the form that they came in the binary distributions. That form does not match the form when you checkout the code as we have done here.

For developers there is only one directory named "desc" in a path. When you use the User Guide you must ignore the first "desc" shown in a path.

No example

(Optional) UIMA tools plug-in

Developers may be interested in the Eclipse plug-ins provided by the UIMA community. They include, for example, a UIMA component descriptor editor.

Step

Example

1. Find UIMA Eclipse plug-ins.

Help> Install New Software...> Add... button
Set a repository name and this site location


Click OK.

2. Install UIMA Eclipse plug-ins.

Select the UIMA Eclipse tooling and runtime support.
Click Next.
Leave the defaults and click Next.
Accept the license agreement.
Click Finish.
Restart Eclipse.

3. (optional) Verify the installation of the UIMA Plug-ins. Go to Help -> About Eclipse -> Installation Details -> Plug-ins. You will see a dialog such as that i the next cell with plug-in names starting with "UIMA Eclipse:".

Command line minimal install instructions

Prerequisites: Java JDK 1.6+, SVN, Maven 3.0+

The following location is the main trunk of cTAKES. See how cTAKES treats the trunk, branches, and tags in the developer FAQs.

  • svn co https://svn.apache.org/repos/asf/ctakes/trunk ctakes-3.0
  • mvn clean compile package
    • Running the mvn package command will generate a binary distribution in /ctakes-distribution/target/ctakes-<release>-bin.tar.gz/zip
  • Merge the version-matching resources ZIP file from http://sourceforge.net/projects/ctakesresources/files/ into your ctakes-dictionary-lookup project.
  • (Optional) If you would like to launch the UIMA CVD or CPE GUI
    • with MAVEN_OPTS="-Xmx2g -Xms1g" run mvn -PrunCVD compile

For further information see the Apache Source Code Repository page.

Command line step by step install instructions

Preparing Java

Unable to render {include} The included page could not be found.

Preparing command line tools

Step

Example

1. Install an SVN client.

Run this command to check the setup.
svn --version



Windows:
We used a binary package of Apache Subversion from SlikSVN.
Apache has a larger list here.
Download and run the MSI file.
Click Next.
Accept the license agreement.
Click Next.
Click Next.
Select Typical.
Select Install.
Wait
Click Finish.
Exit and restart any command prompts that were open.

Linux:

Windows:


Linux:

2. Install a Maven 3.0+ client.

Windows:
We downloaded Apache Maven 3.0.4 from http://archive.apache.org/dist/maven/binaries/

Unzip the file to the root drive.
C:\apache-maven-3.0.4 will be your MAVEN_HOME.

Linux:
We downloaded Apache Maven 3.0.4 from http://archive.apache.org/dist/maven/binaries/

Unzip the file to /usr/local/apache-maven-3.0.4 which will be your MAVEN_HOME.


 

Windows:


Linux:

3. Set the Maven environment variable values -
M2_HOME=<MAVEN_HOME>
M2=<MAVEN_HOME>/bin
PATH=<existing Path>;<MAVEN_HOME>
where MAVEN_HOME is the path you unzipped to.

Run this command to check the setup.
mvn --version



Windows:
Right-click on Computer > Properties > Advanced System Settings > Advanced tab > Environment Variables button > New button for User variables. Once the values are entered click OK until you are out of the dialog series.

Linux:

It is left to the user to make environment variables permanent in their development environment.

Windows:





Linux:

Compile a release from command line

Step

Example

1. Checkout the cTAKES project.

The following location is the main trunk of cTAKES. See how cTAKES treats the trunk, branches, and tags in the developer FAQs.


Windows/Linux:

The parameter on the end will be created as a new directory in your current location.

For Linux, make sure that you have write access to the directory that you are in.

We will refer to the directory you specify at the end of the checkout command as <cTAKES_HOME>.

Windows:

Linux:

2. Download cTAKES 3.0 Dictionaries and models.

Due to licensing considerations and easy of installability, one download from an external location was established with all the resources you will need. Licensing for these resources is found within the download.

Download time will be commensurate with 1GB of data.


Windows:
Go to cTAKES resources and download the ZIP file with a matching version from the ctakesresources project.
Unzip the files into a temporary location such as C:\temp.

Linux:
Obtain the URL of the version matching ZIP file from cTAKES resources, get the file, and unzip to a temporary location.

Windows:


Linux:

3. Copy (or move) the resources to cTAKES_HOME.
Copy the contents of the temporary resources directory (and all sub-directories) to <cTAKES_HOME>/ctakes-dictionary-lookup/resources.

There may be conflicts while taking this action. Overwrite the cTAKES_HOME files with those in the resources download.

Windows:

Linux:

4. Compile the complete set.

Make sure you are in the proper directory.

Windows/Linux:

For Linux, make sure you are using the user that has access to the files in your cTAKES directory.

Instead of "compile" you can use the maven target called "package" to compile and build all the cTAKES deliverables. Package is convenient in situations like running cTAKES outside of maven with custom processes/scripts because it will bundle up all of the 3rd party and transient dependencies.




Windows/Linux:



5. Add the resources as a folder to the classpath.
Make sure the current path or dot (.) is in your CLASSPATH environment variable accessible to the process maven is running in.

No example

6. UMLS user ID and password.
Usually the dictionaries are required to process data. If you plan to utilize the UMLS dictionaries you must pass your UMLS user ID and password to the pipeline. There are several ways to do this - select one.

If you do not have a UMLS username and password, you may request one at UMLS Terminology Services

  1. Environment variable - Set or export environment variables.
    Refer to the Eclipse documentation above for more information.
  2. Add the system properties to the Java arguments for the maven environment.
    Add these parameters to the MAVEN_OPTS environment variable in the next section as you run the commands to process documents.

    -Dctakes.umlsuser=<username> -Dctakes.umlspw=<password>
    

    Make the ID and password specific to you.

  3. Change the UMLSUser and UMLSPW <nameValuePair> strings in these descriptor files with your UMLS username and password.
    Refer to the Eclipse documentation above for more information.

No example

Process documents using cTAKES

Step

Example

1. Launching the UIMA CAS Visual Debugger (CVD) or the Collection Processing Engine (CPE) can now be accomplished in the ctakes-clinical-pipeline project:

Windows:

Linux:

where you must select between CVD and CPE in the command.

2. (Optional) Process data.

Now that you can launch the tools, the User Guide has steps to walk you through processing test data if you want to go there.

The User Guide describes files in the form that they came in the binary distributions. That form does not match the form when you checkout the code as we have done here.

For developers there is only one directory named "desc" in a path. When you use the User Guide you must ignore the first "desc" shown in a path.

No example

Next Steps

The cTAKES 3.0 Component Use Guide will help you to understand, in great detail, each of the cTAKES components that have been installed. In some cases you can learn how to improve the components.

Also, before you go on to process text in production you will need to consider dictionaries and models. cTAKES does not distribute from Apache a complete dictionary capable of annotating production data. The models provided have been trained on data that may not match your data well enough to be effective. In most cases, you will need to modify the dictionaries and train models on your own data to be effective.

  • No labels