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.
The PipelineBuilder
class in ctakes-core is a facade for uimaFIT™ factories and objects.
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 .createAnnotatorDescription 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. | |
// # ! | comment text | Line Comment. |
Table 1. Standard Piper commands. A complete runnable pipeline can be created using only add commands.
Add the steps involved:
.piper
name=value
pairs after the class name. readFiles my/data
" is equivalent to "reader FileTreeReader InputDirectory=my/data
".name=value
pairs after the class name. name=value
pair on a component line will, for that component, override a set parameter value.cli is a special type of set that sets a parameter to some value entered by the User on a command line.
* cli can only be used with the PiperFileRunner
class, the bin/runPiperFile
script or the Piper File Submitter GUI.
* Reserved parameters unavailable for cli are listed in Table 3.
addDescription is a special type of add that utilizes a component's static addDescription(..)
method.
* Use with care as not all components have such a method.
Use addLogged to ensure a component's start and finish time are logged. This is useful for debugging and profiling some components.
writeXmis my/output
" is equivalent to "add FileTreeXmiWriter OutputDirectory=my/output
".name=value
pairs can accept comma-delimited arrays: ArrayParm=this,is,an,array
NotArrayParm="this,is,just,text"
bin/runPiperFile -p path/to/piper
To run a piper from code use the main(..)
method of PiperFileRunner
in ctakes-core, or more directly use the PiperFileReader
class in ctakes-core.
There are examples of piper file use in the ctakes-examples module.
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
cli | Equivalent Parameter Name | Description |
---|---|---|
-p | Piper | Location of a Piper file. |
-i | InputDirectory | Directory for all input files. |
-o | OutputDirectory | Directory for all output files. |
-s | SubDirectory | Subdirectory for files. |
-l | LookupXml | Path to fast dictionary lookup xml. |
Table 3. Reserved cli characters and their corresponding parameter names.
CLI | Equivalent Parameter Name | Description |
---|---|---|
--user | umlsUser , ctakes.umlsuser | UMLS Username for dictionary lookup. |
--pass | umlsPass , ctakes.umlspw | UMLS Password for dictionary lookup. |
--xmiOut | OutputDirectory | Adds FileTreeXmiWriter to pipeline. |
Table 4. Additional command line parameters accepted by bin/runPiperFile
and PiperFileRunner
.
You may also want to use visual panels to communicate related information, tips or things users need to be aware of. |
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.
|