Skip to content

pbj_examples

Johnsd11 edited this page Apr 26, 2023 · 3 revisions

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 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())

Initialize the pipeline (line not necessary anymore i think)

pipeline.initialize()

Start the receiver using pipeline as the parameter.

start_receiver(pipeline)

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 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())

Initialize the pipeline (line not necessary anymore i think)

pipeline.initialize()

Start the receiver using pipeline as the parameter.

start_receiver(pipeline)
Clone this wiki locally