You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Hugo Mougard <mo...@crydee.eu> on 2014/04/16 08:26:54 UTC
CAS Multiplier usage in UIMAfit
Dear all,
I'm trying to use a multiplier to discard some CASes based on some
annotation. It currently doesn't work (the CASes are not discarded). I
also noticed several tickets opened on the suject of multipliers and
am therefore not sure if it's currently possible to use them in
UIMAfit.
If it possible, what are the necessary steps so that only CASes
returned by next() are considered?
Any pointer welcome.
Best,
Hugo
Re: CAS Multiplier usage in UIMAfit
Posted by Hugo Mougard <mo...@crydee.eu>.
I solved my issue by specifying a flow controller with a "drop" option
on cas multipliers as follows (as was mentioned in one of the Jira's
tickets):
AnalysisEngineDescription aae = createEngineDescription(
FlowControllerFactory.createFlowControllerDescription(
FixedFlowController.class,
FixedFlowController.PARAM_ACTION_AFTER_CAS_MULTIPLIER,
"drop"),
...someAes...
theCasMultiplier,
...someAes);
Sorry for the noise :)
Best,
Hugo
Le 2014-04-16 15:26, Hugo Mougard a écrit :
> Dear all,
>
> I'm trying to use a multiplier to discard some CASes based on some
> annotation. It currently doesn't work (the CASes are not discarded).
> I
> also noticed several tickets opened on the suject of multipliers and
> am therefore not sure if it's currently possible to use them in
> UIMAfit.
>
> If it possible, what are the necessary steps so that only CASes
> returned by next() are considered?
>
> Any pointer welcome.
>
> Best,
> Hugo
Re: CAS Multiplier usage in UIMAfit
Posted by Richard Eckart de Castilho <re...@apache.org>.
Hum, I had totally forgotten about this code by Philipp W.
But anyway, I recently looked into the problem as well [1]
and I wasn't particularly happy because whatever I could
come up with required client code to call CAS.release()
explicitly - at least when trying to solve the problem
in JCasIterable.
Addressing that only on the level of SimplePipeline
may be more straight-forward. I'll look into that as well.
Btw. feel free to comment on the issue if you have further
insight or suggestions (or patches ;) ).
Cheers,
-- Richard
[1] https://issues.apache.org/jira/browse/UIMA-3470
On 16.04.2014, at 11:27, Petr Baudis <pa...@ucw.cz> wrote:
> Hi!
>
> On Wed, Apr 16, 2014 at 03:26:54PM +0900, Hugo Mougard wrote:
>> I'm trying to use a multiplier to discard some CASes based on some
>> annotation. It currently doesn't work (the CASes are not discarded). I
>> also noticed several tickets opened on the suject of multipliers and
>> am therefore not sure if it's currently possible to use them in
>> UIMAfit.
>
> Perhaps a better solution exists meanwhile, but some time ago,
> Philipp W suggested on this mailing list a SimplePipeline replacement
> that can deal with CAS multipliers:
>
> https://groups.google.com/forum/#!topic/uimafit-users/yA0w2Q8tGNE
>
> I had to wrap it up in an actual class and fix it for Aggregate Engines,
> my version is at:
>
> https://github.com/brmson/yodaqa/blob/master/src/main/java/cz/brmlab/yodaqa/flow/MultiCASPipeline.java
>
> You just use it in the same way as you'd use SimplePipeline then, e.g.:
>
> https://github.com/brmson/yodaqa/blob/9e12a80c/src/main/java/cz/brmlab/yodaqa/YodaQAApp.java
>
>
> P.S.: I think ideally, to enable better scale-out and for consistency
> if you are using other Aggregate Engines anyway, you would probably
> create a single aggregate engine for your pipeline with the proper flow
> controller setup within, setting FlowController's ActionForIntermediateSegments
> to "drop". In XML CPE descriptor you'd do that like this:
>
> https://github.com/brmson/yodaqa/blob/bad64d5c/src/main/resources/cz/brmlab/yodaqa/pipeline/YodaQA.xml
>
> If you come up with a way to do that in UIMAfit, I will be glad if you'd
> share a working code snippet.
>
> Petr "Pasky" Baudis
Re: CAS Multiplier usage in UIMAfit
Posted by Petr Baudis <pa...@ucw.cz>.
Hi!
On Wed, Apr 16, 2014 at 03:26:54PM +0900, Hugo Mougard wrote:
> I'm trying to use a multiplier to discard some CASes based on some
> annotation. It currently doesn't work (the CASes are not discarded). I
> also noticed several tickets opened on the suject of multipliers and
> am therefore not sure if it's currently possible to use them in
> UIMAfit.
Perhaps a better solution exists meanwhile, but some time ago,
Philipp W suggested on this mailing list a SimplePipeline replacement
that can deal with CAS multipliers:
https://groups.google.com/forum/#!topic/uimafit-users/yA0w2Q8tGNE
I had to wrap it up in an actual class and fix it for Aggregate Engines,
my version is at:
https://github.com/brmson/yodaqa/blob/master/src/main/java/cz/brmlab/yodaqa/flow/MultiCASPipeline.java
You just use it in the same way as you'd use SimplePipeline then, e.g.:
https://github.com/brmson/yodaqa/blob/9e12a80c/src/main/java/cz/brmlab/yodaqa/YodaQAApp.java
P.S.: I think ideally, to enable better scale-out and for consistency
if you are using other Aggregate Engines anyway, you would probably
create a single aggregate engine for your pipeline with the proper flow
controller setup within, setting FlowController's ActionForIntermediateSegments
to "drop". In XML CPE descriptor you'd do that like this:
https://github.com/brmson/yodaqa/blob/bad64d5c/src/main/resources/cz/brmlab/yodaqa/pipeline/YodaQA.xml
If you come up with a way to do that in UIMAfit, I will be glad if you'd
share a working code snippet.
Petr "Pasky" Baudis