Re: Reordering Analysis Engines

2017-02-27 Thread Richard Eckart de Castilho
On 27.02.2017, at 17:50, james.d.ba...@gmail.com wrote:
> 
> Thanks Richard,
> 
> I don’t think we’re using any multi-threading bits at the moment, so it 
> sounds like the SimplePipeline might be ok for the time being. If we do 
> decide to move to a multi-threaded system in the future, presumably 
> implementing our own is the best way forwards, or is there an alternative to 
> CPE/SimplePipeline that I’ve missed?

No alternatives in uimaFIT. If you are looking towards scaling, you might want 
to have a look at UIMA-AS.

Cheers,

-- Richard

Re: Reordering Analysis Engines

2017-02-27 Thread Jaroslaw Cwiklik
Take a look at UIMA-AS:

"UIMA Asynchronous Scaleout (AS) is a set of capabilities supported in the
UIMA Framework for achieving scaleout that is more general than the
approaches provided for in the Collection Processing Manager (CPM). AS is a
second generation design, replacing the CPM and Vinci Services. The CPM and
Vinci are still available and are not being deprecated, but new designs are
encouraged to use AS for scalability, and current designs reaching
limitations may want to move to AS.

AS is integrated with the flow controller architecture, and can be applied
to both primitive and aggregate analysis engines."

https://uima.apache.org/d/uima-as-2.9.0/uima_async_scaleout.html

-jerry



On Mon, Feb 27, 2017 at 6:22 AM, James Baker 
wrote:

> Is it possible to reorder the analysis engines in a CPE once it is created?
>
> I have a CPE consisting of a large number of analysis engines, and I'd like
> to automatically optimise the order. However, some of the parameters needed
> to perform the optimisation are only calculated once the analysis engines
> are initialised. So I will need to initialise the CPE and then reorder the
> analysis engines. Is this possible?
>
> Thanks,
> James
>


Reordering Analysis Engines

2017-02-27 Thread James Baker
Is it possible to reorder the analysis engines in a CPE once it is created?

I have a CPE consisting of a large number of analysis engines, and I'd like
to automatically optimise the order. However, some of the parameters needed
to perform the optimisation are only calculated once the analysis engines
are initialised. So I will need to initialise the CPE and then reorder the
analysis engines. Is this possible?

Thanks,
James


Re: Reordering Analysis Engines

2017-02-27 Thread james . d . baker
Thanks Richard,

I don’t think we’re using any multi-threading bits at the moment, so it sounds 
like the SimplePipeline might be ok for the time being. If we do decide to move 
to a multi-threaded system in the future, presumably implementing our own is 
the best way forwards, or is there an alternative to CPE/SimplePipeline that 
I’ve missed?

James

> On 27 Feb 2017, at 16:35, Richard Eckart de Castilho  wrote:
> 
> On 27.02.2017, at 16:39, James Baker  wrote:
>> 
>> Thanks Richard, switching over to SimplePipeline did the trick. I'll update
>> the GitHub repository with a working solution for reference.
>> 
>> Is there any information available on the advantages/disadvantages of
>> SimplePipeline over using the CPE? The application I'm using already uses
>> CPE, so I'd like to understand what the impact of moving away from that
>> might be.
> 
> SimplePipeline is just a basic single-threaded thing. What it does internally
> is basically creating an aggregate from all the engines that it receives,
> creating a CAS, and using that CAS to loop over the collection reader and
> all the engines. All no extra threads created, no parallelization.
> 
> CpePipeline and CpeBuilder make use of the rather deprecated UIMA CPE [1].
> They are very simple wrappers around CPE mimicking the API of SimplePipeline.
> CpePipeline configures CPE to scale up the analysis engines creating one
> parallel instance per CPU core (reserving one core for your other work).
> With CpeBuilder, you have a bit more control over the settings, e.g. you 
> can change the number of threads to use and you can post-process the
> CpeDescription if you want that.
> 
> Cheers,
> 
> -- Richard
> 
> [1] 
> https://uima.apache.org/d/uimaj-2.9.0/references.html#ugr.ref.xml.cpe_descriptor



Re: Reordering Analysis Engines

2017-02-27 Thread Andrew Defries PhD
UNSUBSCRIBE


Re: Reordering Analysis Engines

2017-02-27 Thread Richard Eckart de Castilho
On 27.02.2017, at 16:39, James Baker  wrote:
> 
> Thanks Richard, switching over to SimplePipeline did the trick. I'll update
> the GitHub repository with a working solution for reference.
> 
> Is there any information available on the advantages/disadvantages of
> SimplePipeline over using the CPE? The application I'm using already uses
> CPE, so I'd like to understand what the impact of moving away from that
> might be.

SimplePipeline is just a basic single-threaded thing. What it does internally
is basically creating an aggregate from all the engines that it receives,
creating a CAS, and using that CAS to loop over the collection reader and
all the engines. All no extra threads created, no parallelization.

CpePipeline and CpeBuilder make use of the rather deprecated UIMA CPE [1].
They are very simple wrappers around CPE mimicking the API of SimplePipeline.
CpePipeline configures CPE to scale up the analysis engines creating one
parallel instance per CPU core (reserving one core for your other work).
With CpeBuilder, you have a bit more control over the settings, e.g. you 
can change the number of threads to use and you can post-process the
CpeDescription if you want that.

Cheers,

-- Richard

[1] 
https://uima.apache.org/d/uimaj-2.9.0/references.html#ugr.ref.xml.cpe_descriptor

Re: Reordering Analysis Engines

2017-02-27 Thread James Baker
Thanks Richard, switching over to SimplePipeline did the trick. I'll update
the GitHub repository with a working solution for reference.

Is there any information available on the advantages/disadvantages of
SimplePipeline over using the CPE? The application I'm using already uses
CPE, so I'd like to understand what the impact of moving away from that
might be.

James

On 27 February 2017 at 15:00, Richard Eckart de Castilho 
wrote:

> I don't think that CPE supports flow controllers. I would recommend you
> first try this with SimplePipeline.
>
> The CpeBuilder / CpePipeline takes an aggregate and disassembles it into
> its components and then passes each component separately to the CPE. At
> this point, the FlowController is lost. You *could* wrap your
> flow-controlled aggregate into yet another aggregate and pass that to the
> CPE, but then the CPE would try to scale it out en-block.
>
> Cheers,
>
> -- Richard
>
> > On 27.02.2017, at 14:46, james.d.ba...@gmail.com wrote:
> >
> > I realised after sending this that actually I could do what I want with
> a FlowController. However, I’ve been struggling to get a FlowController up
> and running as part of my pipeline. I’ve created a simple project which
> should run the annotators in reverse order… but it’s still running them in
> the listed order and in fact isn’t even initialising the FlowController.
> There are very few examples of using a FlowController with UimaFIT online,
> so is there anyone who could cast an eye over what I’ve done and help me
> find the issue?
> >
> > https://github.com/jamesdbaker/uima-ordering
> >
> > Thanks,
> > James
> >
> >> On 27 Feb 2017, at 11:48, james.d.ba...@gmail.com wrote:
> >>
> >> Is it possible to reorder the analysis engines in a CPE once it is
> created?
> >>
> >> I have a CPE consisting of a large number of analysis engines, and I'd
> like to automatically optimise the order. However, some of the parameters
> needed to perform the optimisation are only calculated once the analysis
> engines are initialised. So I will need to initialise the CPE and then
> reorder the analysis engines. Is this possible?
> >>
> >> Thanks,
> >> James
> >
>
>


Re: Reordering Analysis Engines

2017-02-27 Thread Richard Eckart de Castilho
I don't think that CPE supports flow controllers. I would recommend you first 
try this with SimplePipeline.

The CpeBuilder / CpePipeline takes an aggregate and disassembles it into its 
components and then passes each component separately to the CPE. At this point, 
the FlowController is lost. You *could* wrap your flow-controlled aggregate 
into yet another aggregate and pass that to the CPE, but then the CPE would try 
to scale it out en-block.

Cheers,

-- Richard

> On 27.02.2017, at 14:46, james.d.ba...@gmail.com wrote:
> 
> I realised after sending this that actually I could do what I want with a 
> FlowController. However, I’ve been struggling to get a FlowController up and 
> running as part of my pipeline. I’ve created a simple project which should 
> run the annotators in reverse order… but it’s still running them in the 
> listed order and in fact isn’t even initialising the FlowController. There 
> are very few examples of using a FlowController with UimaFIT online, so is 
> there anyone who could cast an eye over what I’ve done and help me find the 
> issue?
> 
> https://github.com/jamesdbaker/uima-ordering
> 
> Thanks,
> James
> 
>> On 27 Feb 2017, at 11:48, james.d.ba...@gmail.com wrote:
>> 
>> Is it possible to reorder the analysis engines in a CPE once it is created?
>> 
>> I have a CPE consisting of a large number of analysis engines, and I'd like 
>> to automatically optimise the order. However, some of the parameters needed 
>> to perform the optimisation are only calculated once the analysis engines 
>> are initialised. So I will need to initialise the CPE and then reorder the 
>> analysis engines. Is this possible?
>> 
>> Thanks,
>> James
> 



Re: Reordering Analysis Engines

2017-02-27 Thread james . d . baker
I realised after sending this that actually I could do what I want with a 
FlowController. However, I’ve been struggling to get a FlowController up and 
running as part of my pipeline. I’ve created a simple project which should run 
the annotators in reverse order… but it’s still running them in the listed 
order and in fact isn’t even initialising the FlowController. There are very 
few examples of using a FlowController with UimaFIT online, so is there anyone 
who could cast an eye over what I’ve done and help me find the issue?

https://github.com/jamesdbaker/uima-ordering

Thanks,
James

> On 27 Feb 2017, at 11:48, james.d.ba...@gmail.com wrote:
> 
> Is it possible to reorder the analysis engines in a CPE once it is created?
> 
> I have a CPE consisting of a large number of analysis engines, and I'd like 
> to automatically optimise the order. However, some of the parameters needed 
> to perform the optimisation are only calculated once the analysis engines are 
> initialised. So I will need to initialise the CPE and then reorder the 
> analysis engines. Is this possible?
> 
> Thanks,
> James



Reordering Analysis Engines

2017-02-27 Thread james . d . baker
Is it possible to reorder the analysis engines in a CPE once it is created?

I have a CPE consisting of a large number of analysis engines, and I'd like to 
automatically optimise the order. However, some of the parameters needed to 
perform the optimisation are only calculated once the analysis engines are 
initialised. So I will need to initialise the CPE and then reorder the analysis 
engines. Is this possible?

Thanks,
James