You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Roberto Franchini <fr...@celi.it> on 2012/06/08 17:06:37 UTC

[ANN] UIMA/Drools bridge: use Drools to write NLP gramras

Hi,
we have released on github a little bridge that allow to write NLP
grammars using  Drools rule engine  (http://www.jboss.org/drools)

https://github.com/celi-uim/uima-drools

We use Drools as an NLP-grammars engine since 2010 and we are very
happy with it.

This project is just a proof of concept: it shows how Drools can be
embedded in UIMA, but is not production ready.
The example is very simple: the annotator loads a grammar that emit a
Classification annotation if a Token has text "good".
Here's the grammar:

package it.celi.uima.drool;

import org.uimafit.examples.type.Token;
import it.celi.uima.type.Classification;

global org.apache.log4j.Logger log

global org.apache.uima.jcas.JCas jCas

rule "simple classifier"
when
    $token:Token(coveredText == "good")
then
	Classification cl = new Classification(jCas);
	cl.setBegin($token.getBegin());
	cl.setEnd($token.getEnd());
	cl.setLabel("positive");
	cl.addToIndexes();
	if(log.isDebugEnabled()) log.debug("token:: " + $token.getCoveredText());
end

Regards,
RF

-- 
Roberto Franchini
The impossible is inevitable.
Be smart: http://goo.gl/LqgRY
http://www.celi.it
http://www.blogmeter.it
Tel +39.011.562.71.15
jabber:ro.franchini@gmail.com skype:ro.franchini

Re: [ANN] UIMA/Drools bridge: use Drools to write NLP gramras

Posted by Roberto Franchini <fr...@celi.it>.
On Mon, Jun 11, 2012 at 8:48 AM, Tommaso Teofili
<to...@gmail.com> wrote:
>
> Nice thing Roberto, thanks for letting us know!
> Have a nice day,
> Tommaso

Thank you!
Let me know if you try the component, and don't forget to "fork me on
gitHub"!!!!

FRANK


--
Roberto Franchini
The impossible is inevitable.
Be smart: http://goo.gl/LqgRY
http://www.celi.it
http://www.blogmeter.it
Tel +39.011.562.71.15
jabber:ro.franchini@gmail.com skype:ro.franchini

Re: [ANN] UIMA/Drools bridge: use Drools to write NLP gramras

Posted by Tommaso Teofili <to...@gmail.com>.
Nice thing Roberto, thanks for letting us know!
Have a nice day,
Tommaso

2012/6/8 Roberto Franchini <fr...@celi.it>

> Hi,
> we have released on github a little bridge that allow to write NLP
> grammars using  Drools rule engine  (http://www.jboss.org/drools)
>
> https://github.com/celi-uim/uima-drools
>
> We use Drools as an NLP-grammars engine since 2010 and we are very
> happy with it.
>
> This project is just a proof of concept: it shows how Drools can be
> embedded in UIMA, but is not production ready.
> The example is very simple: the annotator loads a grammar that emit a
> Classification annotation if a Token has text "good".
> Here's the grammar:
>
> package it.celi.uima.drool;
>
> import org.uimafit.examples.type.Token;
> import it.celi.uima.type.Classification;
>
> global org.apache.log4j.Logger log
>
> global org.apache.uima.jcas.JCas jCas
>
> rule "simple classifier"
> when
>    $token:Token(coveredText == "good")
> then
>        Classification cl = new Classification(jCas);
>        cl.setBegin($token.getBegin());
>        cl.setEnd($token.getEnd());
>        cl.setLabel("positive");
>        cl.addToIndexes();
>        if(log.isDebugEnabled()) log.debug("token:: " +
> $token.getCoveredText());
> end
>
> Regards,
> RF
>
> --
> Roberto Franchini
> The impossible is inevitable.
> Be smart: http://goo.gl/LqgRY
> http://www.celi.it
> http://www.blogmeter.it
> Tel +39.011.562.71.15
> jabber:ro.franchini@gmail.com skype:ro.franchini
>