pbj_examples - apache/ctakes GitHub Wiki
sentence_printer
This example prints every sentence in a Cas. Also prints the begin, end, and part of speech of each sentence.
sentence_printer_pipeline
First Create the instance of a pbj pipeline
pipeline = PBJPipeline()
Add the file that will receive the cas from the Artemis broker. A running pipeline will wait until the receiver gets a cas.
pipeline.reader(PBJReceiver())
Add the file that will make the modifications to the cas you wish (Ask Sean for a cleaner explanation)
pipeline.add(SentencePrinter())
Add the PbjSender to the pipeline instance once you are done adding all other modification files to a cas
pipeline.add(PBJSender())
Start the pipeline.
pipeline.run()
word_finder
In this example we are looking for specific words that are part of certain types in the cas.
word_finder_pipeline
First Create the instance of a pbj pipeline
pipeline = PBJPipeline()
Add the file that will receive the cas from the Artemis broker. A running pipeline will wait until the receiver gets a cas.
pipeline.reader(PBJReceiver())
Add the file that will make the modifications to the cas you wish (Ask Sean for a cleaner explanation)
pipeline.add(WordFinder())
Add the PbjSender to the pipeline instance once you are done adding all other modification files to a cas
pipeline.add(PBJSender())
Start the pipeline.
pipeline.run()