Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create an empty text file.  The standard file extension for piper files is .piper
  2. Set a reader for your pipeline.   To set values to parameters used by the reader class, simply add one or more name=value pairs after the class name.     
    readFiles is a convenience command.  "readFiles my/data" is equivalent to "reader FileTreeReader InputDirectory=my/data".
  3. add annotation engines and cas consumers to your pipeline. To set values to parameters used by the annotation engine class, simply add one or more name=value pairs after the class name. 
  4. load common groups of components from another piper file.  See Table 2 for piper files in cTAKES.
  5. reader, load and add* commands all take class names or file directories as their first parameter.  If  
    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.
  6. Use package to simplify adding multiple pipeline components from a package not standard to cTAKES.
    Gliffy Diagram
    chromemin
    nameUse of package
  7. Use set to assign a value to a parameter used by following components.
    Gliffy Diagram
    nameset global value

    *A name=value pair on a component line will, for that component, override a set parameter value.
  8. cli is  is a special type of set that sets a parameter to some value entered by the User on a command line.

    Gliffy Diagram
    nameUse of cli

    * cli can only be used with the PiperFileRunner class or the bin/runPiperFile script.
    * Reserved parameters unavailable for cli are listed in Table 3.

  9. et a reader for your pipeline.  readFiles is a convenience method.  "readFiles my/data" is equivalent to "reader FileTreeReader InputDirectory=my/data".

  10. To add common groups of components, load another piper file.  See Table 2 for piper files in cTAKES.
  11. add annotation engines and cas consumers to your pipeline. 

 

 

 

  1. .

  2. 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.

  3. Use addLogged to ensure a component's start and finish time are logged.  This is useful for debugging and profiling some components.

  4. Use addLast to ensure that a component, such as a writer, executes at the end of a pipeline.  Multiple components can be added with addLast.
    * writeXmis is a convenience command.  "writeXmis my/output" is equivalent to "add FileTreeXmiWriter OutputDirectory=my/output".

 

  1. To run a piper file from the command line, execute the script bin/runPiperFile -p path/to/piper
  2. 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.

  3. There are examples of piper file use in the ctakes-examples module.

 

ModulePiper fileDescription
coreDefaultTokenizerPipelineComplete Tokenizer pipeline.
chunkerChunkerSubPipeChunker partial pipeline.
assertionAssertionSubPipeEntity attribute partial pipeline.
assertionAttributeCleartkSubPipeEntity attribute partial pipeline.
clinical-pipelineDefaultFastPipelineComplete Clinical pipeline.

Table 2.  Available standard piper files in cTAKES.

 

 

Gliffy Diagram
nameDefaultFastPipeline.piper

Diagram 1.  Piper files used in the cTAKES default Clinical Pipeline.  Upper left is DefaultFastPipeline.piper

  

cliParameter NameDescription
pPiperLocation of a Piper file.
iInputDirectoryDirectory for all input files.
oOutputDirectoryDirectory for all output files.
sSubDirectorySubdirectory for files.
lLookupXmlPath to fast dictionary lookup xml.

Table 3.  Reserved cli characters and their corresponding parameter names.

 

Info

Content by Label
showLabelsfalse
max5
spacesCTAKES
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("pipeline","piper","custom") and type = "page" and space = "CTAKES"
labelscustom pipeline piper

...