You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by Richard Eckart de Castilho <re...@apache.org> on 2023/01/06 14:55:09 UTC

Analysis components and pipelines in Python (was: Retire UIMA C++ SDK)

Hi Pablo,

> On 6. Jan 2023, at 14:59, Pablo Duboue <pa...@gmail.com> wrote:
> 
>> If pipelines in Python be a thing, my intuition is that it would be
>> sensible to implement this as a dedicated module covering a component
>> lifecycle API.
> I'm sorry, I don't understand this bit.

That comment was referring to your `MyAE` component implemented in Python [1].
Probably I am the one misunderstanding things here. I thought that the UIMA
Python bindings would allow users to use analysis components implemented in C++
in Python. So I though that if you define an analysis component in Python, then
probably the code that executes this component would also be written in Python?

Are the `buildPipeline(...)` function [2] and the `pipeline.process(...)` function [3]
Python functions or C++ functions?

Cheers,

-- Richard

[1] https://gist.github.com/DrDub/9413410626b5a77d8f1f576f6447d64e#file-uima_python_concept-py-L59-L79
[2] https://gist.github.com/DrDub/9413410626b5a77d8f1f576f6447d64e#file-uima_python_concept-py-L82-L116
[3] https://gist.github.com/DrDub/9413410626b5a77d8f1f576f6447d64e#file-uima_python_concept-py-L120

Re: Analysis components and pipelines in Python (was: Retire UIMA C++ SDK)

Posted by Pablo Duboue <pa...@gmail.com>.
Hi Richard,

Thanks so much for your answers.

On Fri, Jan 6, 2023 at 6:55 AM Richard Eckart de Castilho <re...@apache.org>
wrote:

> Hi Pablo,
>
> > On 6. Jan 2023, at 14:59, Pablo Duboue <pa...@gmail.com> wrote:
> >
> >> If pipelines in Python be a thing, my intuition is that it would be
> >> sensible to implement this as a dedicated module covering a component
> >> lifecycle API.
> > I'm sorry, I don't understand this bit.
>
> That comment was referring to your `MyAE` component implemented in Python
> [1].
> Probably I am the one misunderstanding things here. I thought that the UIMA
> Python bindings would allow users to use analysis components implemented
> in C++
> in Python.


Thanks for pointing this out. It seems I made a lot of assumptions that
need to explicit.

As you know, UIMA-CPP already allows people to write annotators in Python
(through the "scriptators"; I just migrated it to Python3 [1]).

The idea in the concept code would be to expose a Python layer over the
framework allowing people to define their Python annotators in Python code,
register them with the underlying UIMA-CPP framework and run it with
UIMA-CPP code embedded as a Python extension.


> So I though that if you define an analysis component in Python, then
> probably the code that executes this component would also be written in
> Python?
>
> Are the `buildPipeline(...)` function [2] and the `pipeline.process(...)`
> function [3]
> Python functions or C++ functions?
>

They are Python code that feeds the underlying UIMA-CPP framework and runs
it through. Similar to running UIMA (Java) with an embedded JVM JPyPe [2],
but hiding away the UIMA-CPP details. This Python code will create
in-memory versions of the descriptors UIMA-CPP uses (similar to uimaFIT).

I'm hoping we can develop this with input from people in the Python world
so it feels as Pythonic as possible.

P



[1] https://github.com/DrDub/uima-uimacpp/tree/main/scriptators
[2] http://duboue.net/blog7.html