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 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 the source code for a cTAKES component, developers must utilize either an IDE, such as Eclipse, or another editor of your choice. Compiles are then performed in the IDE or with Ant. 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.
Prerequisites
Preparing Java
Step |
Example |
---|---|
1. All forms of development require the Java SDK 1.6+. You can get it from java.com. java -version |
C:\>java -version java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6.0_20-b02) Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing) |
2. It is possible that some commands and programs can find the Java export JAVA_HOME=<path> |
|
Preparing Eclipse
If you are going to use Eclipse for development then follow these instructions.
Step |
Example |
---|---|
1. Download and install Eclipse if you don't already have it. |
No example |
2. Find UIMA Eclipse plug-ins. http://www.apache.org/dist/uima/eclipse-update-site \ |
|
3. Install UIMA Eclipse plug-ins. |
|
Note These install instructions depend upon the installation of these plug-ins. |
Preparing Command Line Tools
If you are going to use command line only to compile then you will need these tools.
Step |
Example |
---|---|
1. Navigate to the Ant download site on apache.org and install Ant 1.7.1+ |
|
2. Download Ant 1.7.1+. Unzip the file you downloaded to a local directory. We will call this <ANT_HOME> Follow the instructions for installing Ant on apache.org. This will include changing the PATH and ANT_HOME environment variables. |
|
Compile the latest stable release in Eclipse
A tested and stable release is delivered as a ZIP file. The cTAKES source code is included in the file as well as UIMA.
Step |
Example |
---|---|
1. Navigate to the source downloads for areleased version on SourceForge.net |
Even without the full LVG data, cTAKES is about 790 MB when compressed. |
2. Download the latest version. |
|
3. c:\cTAKES-3.1 /usr/bin/cTAKES-3.1
|
| |
4. Set UIMA_HOME. UIMA requires a special environment variable for its commands to run. export UIMA_HOME=/usr/bin/cTAKES-3.1 |
|
5. Edit PATH. This will be used for any command line access to binaries. export PATH=%PATH%:/usr/bin/cTAKES-3.1/bin |
|
6. In Eclipse use File > New > Java Project ... |
|
7. Remove unnecessary JAR files. |
|
8. Add cTAKES folders as class resources. |
|
9. Add JAR files from <cTAKES_HOME>/lib. |
|
10. Close the User Libraries dialog. |
|
11. If you have Eclipse set to build automatically it will do so and you may continue to run and debug from Eclipse. |
|
Compile with commands only
The UIMA command to generate the type system through the command line (JCasGen) is not shipped with cTAKES at this time. The common type system has already been generated for you. If you need, for some reason, to generate this then you will need to use the method described for Eclipse or install the entire UIMA SDK.
Step |
Example |
---|---|
1. Follow the first steps of the "Compile the latest stable release in Eclipse" (which do not require Eclipse) until you get to the part about creating a new project in Eclipse. |
No example |
2. Obtain the relevant build.xml file from SVN, placing it into <cTAKES_HOME> |
No example |
3. To compile cTAKES, change to the <cTAKES_HOME> directory and simply run: ant |
No example |
Compile a development release from SVN in Eclipse
If you know what you are doing with the cTAKES code and you must get the latest code currently under development (potentially unstable), then you need to use an SVN connection to retrieve the code.
Step |
Example |
---|---|
1. Install subversion or a suitable plug-in for your IDE. |
No example |
2. Check-out the code to a local directory, such as: c:\cTAKES-3.1 svn checkout https://ohnlp.svn.sourceforge.net/svnroot/ohnlp/trunk/cTAKES If you are checking out via Subclipse in Eclipse, make sure to check out each project separately. |
... A cTAKES\PAD term spotter\desc\type_system A cTAKES\PAD term spotter\desc\type_system\PADSiteAndTerm.xml A cTAKES\PAD term spotter\desc\analysis_engine A cTAKES\PAD term spotter\desc\analysis_engine\Radiology_TermSpotterAnnotatorTAEStyleMap.xml A cTAKES\PAD term spotter\desc\analysis_engine\Radiology_TermSpotterAnnotatorTAE.xml A cTAKES\PAD term spotter\desc\analysis_engine\DxStatusAnnotator.xml A cTAKES\PAD term spotter\desc\analysis_engine\NegationDxAnnotator.xml A cTAKES\PAD term spotter\desc\analysis_engine\PAD_Hit.xml A cTAKES\PAD term spotter\desc\analysis_engine\SubSectionBoundaryAnnotator.xml A cTAKES\PAD term spotter\desc\analysis_engine\Radiology_DictionaryLookupCSVAnnotator.xml A cTAKES\PAD term spotter\desc\collection_processing_engine A cTAKES\PAD term spotter\desc\collection_processing_engine\Radiology_sample.xml A cTAKES\PAD term spotter\desc\collection_reader A cTAKES\PAD term spotter\desc\collection_reader\RadiologyRecordsCollectionReader.xml A cTAKES\PAD term spotter\.settings A cTAKES\PAD term spotter\.settings\org.eclipse.jdt.ui.prefs Checked out revision 667. |
3. In Eclipse use File > Import... > General > Existing Projects into Workspace It may be necessary to import each project one by one! |
|
4. Install UIMA 2.4. Make note of UIMA_HOME. |
No example |
5. Add UIMA JARs to the build path configuration in Eclipse. Add all JARs from: <UIMA_HOME>/lib |
|
6. Generate the common type system. |
|
Process documents using cTAKES
You can now launch or debug the cTAKES components that you have built. You could run commands from a command prompt, as found in the user install instructions, but you can launch them from within Eclipse now instead. Launching the CAS Visual Debugger (CVD) and the Collection processing engine (CPE) from Eclipse is as simple as following this step.
Step |
Example |
---|---|
1. In Eclipse, launch the tools using their main program. |
|