Create custom pipelines to extract more information than is available through the Default Clinical Pipeline. Special Analysis Engines are in various cTAKES modules. Analysis Engines can be removed or added to pipelines to obtain desired results.
There are four methods available to create custom pipelines.
- XML Descriptor files are the original method used to create pipelines in Apache UIMA™. Though self-descriptive, they are verbose and error prone.
- uimaFIT™ enables creation of pipelines through Java code. This greatly simplifies unit testing and experimentation.
The PipelineBuilder class in ctakes-core is a facade for uimaFIT™ factories and objects.
- Piper files are a modern equivalent of the XML descriptor files. Piper files list basic commands and parameters in a flat format.
Command | Parameter 1 | Parameters 2-n | Description |
---|---|---|---|
package | package path | Add to known packages. Shortens load and add specifications. | |
load | Piper file path | Load external piper file. | |
set | name=value | <name=value ...> | Add global parameter values. |
cli | name=char | <name=char ...> | Add global parameter values based upon command-line character option values. |
reader | CR name | <name=value ...> | Set the collection reader for pipeline input data. |
readFiles | input directory | Set the collection reader for pipeline input data to the files in directory tree reader. | |
add | AE or CC name | <name=value ...> | Add AE/CC to pipeline. |
addDescription | AE or CC name | <value ...> | Add AE/CC to pipeline using its .createDescription method. |
addLogged | AE or CC name | <name=value ...> | Add AE/CC to pipeline with Start/Finish logging. |
addLast | AE or CC name | <name=value ...> | Add AE/CC to the end of pipeline. Useful if the pipeline is meant to be extended. |
writeXmis | output directory | Add XMI writer to the pipeline. | |
// or # or ! | comment text | Line Comment. |
Table 1. Standard Piper commands. A complete runnable pipeline can be created using only add commands.
Step-by-step guide
- Create an empty text file. The standard file extension for piper files is .piper
- To add multiple pipeline components from a package not standard to cTAKES, use the package command to point to it.
reader, load and add* commands all take class names or file directories as their first parameter. If the class is not in a standard cTAKES module's cr ae or cc package, or a piper file is not in a standard module's pipeline/ directory then the package or path must be specified for that component / file. Using package simplifies this.
- To easily add multiple components that use the same parameter, use set to assign a value to that parameter.
Set a reader for your pipeline. readFiles is a convenience method, equivalent to "reader
FileTreeReader
". Note: if you run withPiperFileRunner
and do not specify a reader thenFileTreeReader
will be used.- To add common groups of components, load another piper file. See Table 2 for piper files in cTAKES.
- If you
Module | Piper file | Description |
---|---|---|
core | DefaultTokenizerPipeline | Complete Tokenizer pipeline. |
chunker | ChunkerSubPipe | Chunker partial pipeline. |
assertion | AssertionSubPipe | Entity attribute partial pipeline. |
assertion | AttributeCleartkSubPipe | Entity attribute partial pipeline. |
clinical-pipeline | DefaultFastPipeline | Complete Clinical pipeline. |
Table 2. Available standard piper files in cTAKES.
Diagram 1. Piper files used in the cTAKES default Clinical Pipeline. Upper left is DefaultFastPipeline.piper
Related articles