You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ctakes.apache.org by "Wu, Dee H. (HSC)" <de...@ouhsc.edu> on 2023/11/19 21:46:28 UTC

HELP with making analyzing text with AggregatePlaintextUMLSProcessor.xml a script instead of manually clicking lots of files. I’m trying PIPER

Dear community

This is my first email to this group. Hope you can help? What I’d like to do is have a one pass approach to doing what I have to click through on runctakesCVD.bat I need HELP with making analyzing text with AggregatePlaintextUMLSProcessor.xml a script instead of manually clicking lots of files using piper?]

Here’s what I do now  (MANUALLY).

  1.  From my base directory: C:\Users\dwu\Documents\apache-ctakes-4.0.0.1
bin\runctakesCVD.bat  desc\ctakes-clinical-pipeline\desc\analysis_engine\AggregatePlaintextUMLSProcessor.xml

(this loads the engine from command line)

  1.  read in the text file (too bad that cant be command line implemented, didn’t want to touch the java at this point)

  2.  hit control-R (and/or run -> run AggregatePlaintextUMLSProcessor.xml) from the men

  3.  Then I write out the xmi file (see visuals)





[cid:2b417a70-515d-4f74-84cb-dc8d7ffe0e77][cid:9cae8965-fcc6-42e1-a2a3-88756a64739c]



Wish this was Automated





  1.  Heres what I run
bin\runPiperFile.bat C:\Users\dwu\Documents\test\piper\mypiper.piper

Ideally it should do what

desc\ctakes-clinical-pipeline\desc\analysis_engine\AggregatePlaintextUMLSProcessor.xml ‘



does

Here’s my piper:

//       ***  Piper File  ***

//       Created by DWU

//       on November 19, 2023

//  Text Files Reader

//  Reads document texts from text files specified in a provided list.

#   files  The text files to be loaded

reader org.apache.ctakes.core.cr.TextReader files=C:\Users\dwu\Documents\test\input_dir\inputsample.txt



// Load a simple token processing pipeline from another pipeline file

load DefaultTokenizerPipeline.piper



// Add non-core annotators

add ContextDependentTokenizerAnnotator

addDescription POSTagger



// Add Chunkers

load ChunkerSubPipe.piper



// Default fast dictionary lookup

add DefaultJCasTermAnnotator



// Add Cleartk Entity Attribute annotators

load AttributeCleartkSubPipe.piper



//  XMI Writer

//  Writes XMI files with full representation of input text and all extracted information.

#   OutputDirectory  Output directory to write xmi files

add org.apache.ctakes.core.cc.XmiWriterCasConsumerCtakes OutputDirectory=C:\Users\dwu\Documents\test\output_dir



Here’s the output:

log4j: reset attribute= "false".

log4j: Threshold ="null".

log4j: Retreiving an instance of org.apache.log4j.Logger.

log4j: Setting [ProgressAppender] additivity to [false].

log4j: Level value for ProgressAppender is  [INFO].

log4j: ProgressAppender level set to INFO

log4j: Class name: [org.apache.log4j.ConsoleAppender]

log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"

log4j: Setting property [conversionPattern] to [%m].

log4j: Adding appender named [noEolAppender] to category [ProgressAppender].

log4j: Retreiving an instance of org.apache.log4j.Logger.

log4j: Setting [ProgressDone] additivity to [false].

log4j: Level value for ProgressDone is  [INFO].

log4j: ProgressDone level set to INFO

log4j: Class name: [org.apache.log4j.ConsoleAppender]

log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"

log4j: Setting property [conversionPattern] to [%m%n].

log4j: Adding appender named [eolAppender] to category [ProgressDone].

log4j: Level value for root is  [INFO].

log4j: root level set to INFO

log4j: Class name: [org.apache.log4j.ConsoleAppender]

log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"

log4j: Setting property [conversionPattern] to [%d{dd MMM yyyy HH:mm:ss} %5p %c{1} - %m%n].

log4j: Adding appender named [consoleAppender] to category [root].

Exception in thread "main" com.lexicalscope.jewel.cli.ArgumentValidationException: Unexpected trailing value (C:\Users\dwu\Documents\test\piper\mypiper.piper)

        at com.lexicalscope.jewel.cli.ValidationErrorBuilderImpl.validate(ValidationErrorBuilderImpl.java:64)

        at com.lexicalscope.jewel.cli.validation.ArgumentValidatorImpl.finishedProcessing(ArgumentValidatorImpl.java:104)

        at com.lexicalscope.jewel.cli.ArgumentCollectionBuilder.processArguments(ArgumentCollectionBuilder.java:129)

        at com.lexicalscope.jewel.cli.AbstractCliImpl.parseArguments(AbstractCliImpl.java:42)

        at com.lexicalscope.jewel.cli.CliFactory.parseArguments(CliFactory.java:67)

        at org.apache.ctakes.core.pipeline.PiperFileRunner.main(PiperFileRunner.java:27)



PROBLEM 1:

It doesn’t run (broken



Problem 2: its not doing what AggregatePlaintextUMLSProcessor




Dee H. Wu, Ph.D.

Professor & Chief, Technology Applications & Translational Research

Department of Radiological Sciences

Garrison Tower Room 3258

940 NE 13th Street

Stanton L. Young

University of Oklahoma Health Sciences Center

Oklahoma City, OK 73104

Ph: 405-271-8001 x 35405 (Lab)

Ph: 405-596-2867 (Mobile - Best)



Ph: 405-271-8001x46993 (Office)

Fax: (405) 271-3462

Research Page: http://limes3.ouhsc.edu/deewu

Direction Maps:  (see footer above)

email: dee-wu@ouhsc.edu<ma...@ouhsc.edu>


Re: HELP with making analyzing text with AggregatePlaintextUMLSProcessor.xml a script instead of manually clicking lots of files. I’m trying PIPER

Posted by James Masanz <ma...@gmail.com>.
Hi,

Welcome to the cTAKES community.

I can at least help out with the  "ArgumentValidationException: Unexpected
trailing value" error. It indicates that you're missing the *-p* parameter.

To run a piper from a command line using the batch file, you would use -p
like this

bin\runPiperFile.bat  *-p*  C:\Users\dwu\Documents\test\piper\mypiper.piper

The following page lists the other parameters for runPiperFile.bat
https://cwiki.apache.org/confluence/display/CTAKES/Piper+Files

Hope this helps,
  James

On Thu, Nov 30, 2023 at 9:25 AM Wu, Dee H. (HSC) <de...@ouhsc.edu> wrote:

>
> Dear community
>
> This is my first email to this group. Hope you can help? What I’d like to
> do is have a one pass approach to doing what I have to click through on
> runctakesCVD.bat *I need *HELP with making analyzing text with
> AggregatePlaintextUMLSProcessor.xml a script instead of manually clicking
> lots of files using piper?]
>
> Here’s* what I do now  (MANUALLY).*
>
>    1.
>
>    From my base directory: C:\Users\dwu\Documents\apache-ctakes-4.0.0.1
>    bin\runctakesCVD.bat
>    desc\ctakes-clinical-pipeline\desc\analysis_engine\AggregatePlaintextUMLSProcessor.xml
>
> (this loads the engine from command line)
>
>    1.
>
>    read in the text file (too bad that cant be command line implemented,
>    didn’t want to touch the java at this point)
>    2.
>
>    hit control-R (and/or run -> run
>    AggregatePlaintextUMLSProcessor.xml) from the men
>    3.
>
>    Then I write out the xmi file (see visuals)
>
>
>
>
>
>
>
>
>
> Wish this was Automated
>
>
>
>
>
>    1.
>
>    Heres what I run
>    bin\runPiperFile.bat C:\Users\dwu\Documents\test\piper\mypiper.piper
>
> Ideally it should do what
>
> desc\ctakes-clinical-pipeline\desc\analysis_engine\AggregatePlaintextUMLSProcessor.xml
> ‘
>
>
>
> does
>
> *Here’s my piper:*
>
> //       ***  Piper File  ***
>
> //       Created by DWU
>
> //       on November 19, 2023
>
> //  Text Files Reader
>
> //  Reads document texts from text files specified in a provided list.
>
> #   files  The text files to be loaded
>
> reader
> org.apache.ctakes.core.cr.TextReader files=C:\Users\dwu\Documents\test\input_dir\inputsample.txt
>
>
>
> // Load a simple token processing pipeline from another pipeline file
>
> load DefaultTokenizerPipeline.piper
>
>
>
> // Add non-core annotators
>
> add ContextDependentTokenizerAnnotator
>
> addDescription POSTagger
>
>
>
> // Add Chunkers
>
> load ChunkerSubPipe.piper
>
>
>
> // Default fast dictionary lookup
>
> add DefaultJCasTermAnnotator
>
>
>
> // Add Cleartk Entity Attribute annotators
>
> load AttributeCleartkSubPipe.piper
>
>
>
> //  XMI Writer
>
> //  Writes XMI files with full representation of input text and all
> extracted information.
>
> #   OutputDirectory  Output directory to write xmi files
>
> add org.apache.ctakes.core.cc.XmiWriterCasConsumerCtakes
> OutputDirectory=C:\Users\dwu\Documents\test\output_dir
>
>
>
> *Here’s the output:*
>
> log4j: reset attribute= "false".
>
> log4j: Threshold ="null".
>
> log4j: Retreiving an instance of org.apache.log4j.Logger.
>
> log4j: Setting [ProgressAppender] additivity to [false].
>
> log4j: Level value for ProgressAppender is  [INFO].
>
> log4j: ProgressAppender level set to INFO
>
> log4j: Class name: [org.apache.log4j.ConsoleAppender]
>
> log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
>
> log4j: Setting property [conversionPattern] to [%m].
>
> log4j: Adding appender named [noEolAppender] to category
> [ProgressAppender].
>
> log4j: Retreiving an instance of org.apache.log4j.Logger.
>
> log4j: Setting [ProgressDone] additivity to [false].
>
> log4j: Level value for ProgressDone is  [INFO].
>
> log4j: ProgressDone level set to INFO
>
> log4j: Class name: [org.apache.log4j.ConsoleAppender]
>
> log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
>
> log4j: Setting property [conversionPattern] to [%m%n].
>
> log4j: Adding appender named [eolAppender] to category [ProgressDone].
>
> log4j: Level value for root is  [INFO].
>
> log4j: root level set to INFO
>
> log4j: Class name: [org.apache.log4j.ConsoleAppender]
>
> log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
>
> log4j: Setting property [conversionPattern] to [%d{dd MMM yyyy HH:mm:ss}
> %5p %c{1} - %m%n].
>
> log4j: Adding appender named [consoleAppender] to category [root].
>
> Exception in thread "main"
> com.lexicalscope.jewel.cli.ArgumentValidationException: Unexpected trailing
> value (C:\Users\dwu\Documents\test\piper\mypiper.piper)
>
>         at
> com.lexicalscope.jewel.cli.ValidationErrorBuilderImpl.validate(ValidationErrorBuilderImpl.java:64)
>
>         at
> com.lexicalscope.jewel.cli.validation.ArgumentValidatorImpl.finishedProcessing(ArgumentValidatorImpl.java:104)
>
>         at
> com.lexicalscope.jewel.cli.ArgumentCollectionBuilder.processArguments(ArgumentCollectionBuilder.java:129)
>
>         at
> com.lexicalscope.jewel.cli.AbstractCliImpl.parseArguments(AbstractCliImpl.java:42)
>
>         at
> com.lexicalscope.jewel.cli.CliFactory.parseArguments(CliFactory.java:67)
>
>         at
> org.apache.ctakes.core.pipeline.PiperFileRunner.main(PiperFileRunner.java:27)
>
>
>
> PROBLEM 1:
>
> It doesn’t run (broken
>
>
>
> Problem 2: its not doing what AggregatePlaintextUMLSProcessor
>
>
>
> Dee H. Wu, Ph.D.
>
> Professor & Chief, Technology Applications & Translational Research
>
> Department of Radiological Sciences
>
> Garrison Tower Room 3258
>
> 940 NE 13th Street
>
> Stanton L. Young
>
> University of Oklahoma Health Sciences Center
>
> Oklahoma City, OK 73104
>
> Ph: 405-271-8001 x 35405 (Lab)
>
> Ph: 405-596-2867 (Mobile - Best)
>
>
>
> Ph: 405-271-8001x46993 (Office)
>
> Fax: (405) 271-3462
>
> Research Page: http://limes3.ouhsc.edu/deewu
>
> Direction Maps:  (see footer above)
>
> email: dee-wu@ouhsc.edu
>
>

Re: HELP with making analyzing text with AggregatePlaintextUMLSProcessor.xml a script instead of manually clicking lots of files. I’m trying PIPER

Posted by "Wu, Dee H. (HSC)" <de...@ouhsc.edu>.
Dear community

This is my first email to this group. Hope you can help? What I’d like to do is have a one pass approach to doing what I have to click through on runctakesCVD.bat I need HELP with making analyzing text with AggregatePlaintextUMLSProcessor.xml a script instead of manually clicking lots of files using piper?]

Here’s what I do now  (MANUALLY).

  1.  From my base directory: C:\Users\dwu\Documents\apache-ctakes-4.0.0.1
bin\runctakesCVD.bat  desc\ctakes-clinical-pipeline\desc\analysis_engine\AggregatePlaintextUMLSProcessor.xml

(this loads the engine from command line)

  1.  read in the text file (too bad that cant be command line implemented, didn’t want to touch the java at this point)

  2.  hit control-R (and/or run -> run AggregatePlaintextUMLSProcessor.xml) from the men

  3.  Then I write out the xmi file (see visuals)









Wish this was Automated





  1.  Heres what I run
bin\runPiperFile.bat C:\Users\dwu\Documents\test\piper\mypiper.piper

Ideally it should do what

desc\ctakes-clinical-pipeline\desc\analysis_engine\AggregatePlaintextUMLSProcessor.xml ‘



does

Here’s my piper:

//       ***  Piper File  ***

//       Created by DWU

//       on November 19, 2023

//  Text Files Reader

//  Reads document texts from text files specified in a provided list.

#   files  The text files to be loaded

reader org.apache.ctakes.core.cr.TextReader files=C:\Users\dwu\Documents\test\input_dir\inputsample.txt



// Load a simple token processing pipeline from another pipeline file

load DefaultTokenizerPipeline.piper



// Add non-core annotators

add ContextDependentTokenizerAnnotator

addDescription POSTagger



// Add Chunkers

load ChunkerSubPipe.piper



// Default fast dictionary lookup

add DefaultJCasTermAnnotator



// Add Cleartk Entity Attribute annotators

load AttributeCleartkSubPipe.piper



//  XMI Writer

//  Writes XMI files with full representation of input text and all extracted information.

#   OutputDirectory  Output directory to write xmi files

add org.apache.ctakes.core.cc.XmiWriterCasConsumerCtakes OutputDirectory=C:\Users\dwu\Documents\test\output_dir



Here’s the output:

log4j: reset attribute= "false".

log4j: Threshold ="null".

log4j: Retreiving an instance of org.apache.log4j.Logger.

log4j: Setting [ProgressAppender] additivity to [false].

log4j: Level value for ProgressAppender is  [INFO].

log4j: ProgressAppender level set to INFO

log4j: Class name: [org.apache.log4j.ConsoleAppender]

log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"

log4j: Setting property [conversionPattern] to [%m].

log4j: Adding appender named [noEolAppender] to category [ProgressAppender].

log4j: Retreiving an instance of org.apache.log4j.Logger.

log4j: Setting [ProgressDone] additivity to [false].

log4j: Level value for ProgressDone is  [INFO].

log4j: ProgressDone level set to INFO

log4j: Class name: [org.apache.log4j.ConsoleAppender]

log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"

log4j: Setting property [conversionPattern] to [%m%n].

log4j: Adding appender named [eolAppender] to category [ProgressDone].

log4j: Level value for root is  [INFO].

log4j: root level set to INFO

log4j: Class name: [org.apache.log4j.ConsoleAppender]

log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"

log4j: Setting property [conversionPattern] to [%d{dd MMM yyyy HH:mm:ss} %5p %c{1} - %m%n].

log4j: Adding appender named [consoleAppender] to category [root].

Exception in thread "main" com.lexicalscope.jewel.cli.ArgumentValidationException: Unexpected trailing value (C:\Users\dwu\Documents\test\piper\mypiper.piper)

        at com.lexicalscope.jewel.cli.ValidationErrorBuilderImpl.validate(ValidationErrorBuilderImpl.java:64)

        at com.lexicalscope.jewel.cli.validation.ArgumentValidatorImpl.finishedProcessing(ArgumentValidatorImpl.java:104)

        at com.lexicalscope.jewel.cli.ArgumentCollectionBuilder.processArguments(ArgumentCollectionBuilder.java:129)

        at com.lexicalscope.jewel.cli.AbstractCliImpl.parseArguments(AbstractCliImpl.java:42)

        at com.lexicalscope.jewel.cli.CliFactory.parseArguments(CliFactory.java:67)

        at org.apache.ctakes.core.pipeline.PiperFileRunner.main(PiperFileRunner.java:27)



PROBLEM 1:

It doesn’t run (broken



Problem 2: its not doing what AggregatePlaintextUMLSProcessor




Dee H. Wu, Ph.D.

Professor & Chief, Technology Applications & Translational Research

Department of Radiological Sciences

Garrison Tower Room 3258

940 NE 13th Street

Stanton L. Young

University of Oklahoma Health Sciences Center

Oklahoma City, OK 73104

Ph: 405-271-8001 x 35405 (Lab)

Ph: 405-596-2867 (Mobile - Best)



Ph: 405-271-8001x46993 (Office)

Fax: (405) 271-3462

Research Page: http://limes3.ouhsc.edu/deewu

Direction Maps:  (see footer above)

email: dee-wu@ouhsc.edu<ma...@ouhsc.edu>