I have a CTakes API endpoint based on the REST API and I am trying to specifiy a different BSV file depending on the type of text.
My idea is to instantiate two different analysis engine pools, and direct text one or the other depending on which type of report it is. This seems simpler to me than spinning up two entirely separate ctakes end points and using one for one type and one for the other, though I know that I could accomplish what I am looking to do by going that direction. It seems like I am missing something basic that is preventing my initial plan from working though. Let’s say the different AE pools are A and B as below, and say the PIPER_FILEs at the paths are the same except they hard code a different Bsv file like so: A_PIPER_FILE includes: add BsvRegexSectionizer SectionsBsv=resources/a.bsv B_PIPER_FILE includes: add BsvRegexSectionizer SectionsBsv=resources/b.bsv final PiperFileReader a_reader = new PiperFileReader(A_PIPER_FILE_PATH); final PipelineBuilder a_builder = a_reader.getBuilder(); final AnalysisEngineDescription a_pipeline = a_builder.getAnalysisEngineDesc(); _a_engine = UIMAFramework.produceAnalysisEngine(pipeline); _a_pool = new JCasPool( 2, _a_engine ); final PiperFileReader b_reader = new PiperFileReader(B_PIPER_FILE_PATH); final PipelineBuilder b_builder = b_reader.getBuilder(); final AnalysisEngineDescription b_pipeline = b_builder.getAnalysisEngineDesc(); _b_engine = UIMAFramework.produceAnalysisEngine(pipeline); _b_pool = new JCasPool( 2, _b_engine ); The problem I am running in to is that the “B” analysis engine uses the “A” SectionsBsv file even though the piper files specify the correct one to use. It seems that once SectionsBsv is set once, it is not reset even though a subsequent piper file may specify a different resource to use. Any ideas on what is happening, how I can clear or reset that param, or whether there is a different way to accomplish what I am trying to do? Things I have tried: 1. Adding “_b_engine.reconfigure();” between _b_engine and _b_pool lines. * No effect. 2. Removing the hard-coded SectionsBsv assignment from the piper file, using the SAME piper file for each instance, and passing in SectionsBsv as a param. * I am not sure how to do this using the construction above. I have looked in to CliOptionals but do not have a good grasp of them. * I have tried adding “a_builder.set(“SectionsBsv”, “resources/a.bsv”) after the a_builder is created but that had no affect either Thanks in advance for your consideration. Tom **CONFIDENTIALITY NOTICE** This e-mail communication and any attachments are for the sole use of the intended recipient and may contain information that is confidential and privileged under state and federal privacy laws. If you received this e-mail in error, be aware that any unauthorized use, disclosure, copying, or distribution is strictly prohibited. If you received this e-mail in error, please contact the sender immediately and destroy/delete all copies of this message.