You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@opennlp.apache.org by Rodrigo Agerri <ag...@gmail.com> on 2012/12/20 11:56:31 UTC

[opennlp] coreference CLI

Hi,

I have tried to use the Coferencer CLI in 1.5.3 and I do not seem to
manage. I run

bin/opennlp Coreferencer /path/to/models/ < file.parse

and it gives this error

[ERROR] Failed to execute goal
org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on
project opennlp-tools: An exception occured while executing the Java
class. null: InvocationTargetException: NullPointerException -> [Help
1]

the file.parse is simply a constituent parse tree. I also tried to
give it the parse tree itself but it does not work either. For
example,

$ bin/opennlp Coreferencer
/home/ragerri/experiments/coreference/opennlp/original_models/ < (TOP
(S (NP (DT The) (NN fox)) (VP (VBD jumped) (PP (IN over) (NP (DT the)
(JJ lazy) (NN dog.))))))

-bash: syntax error near unexpected token `('

Cheers,

Rodrigo

Re: [opennlp] coreference CLI

Posted by Rodrigo Agerri <ro...@ehu.es>.
On Thu, Dec 20, 2012 at 11:40 PM, Jörn Kottmann <ko...@gmail.com> wrote:
> No, not really, sorry. The whole coref component needs some work so its as
> easy to use as the other
> components in OpenNLP. You are very welcome to help us with that.

I will keep that in mind. :) To be honest I have not really look into
the Coref code just yet (mainly been working with seg, tok, pos and
ner), but sure, I am willing to contribute

> Do you have a data set you would like to train it on? I tried to train it on
> the muc data but still had some issues
> to reach the performance of the old models (the full training code was never
> published by the original author
> and I just tried to write my own).

Current state of the art results are being compared mainly wrt to the
conll task 2011 (using ontonotes 4.0) and SemEval task 2010
(multilingual).

http://conll.cemantix.org/2011/

http://semeval2.fbk.eu/semeval2.php?location=tasks#T7

Cheers,

Rodrigo

Re: [opennlp] coreference CLI

Posted by Jörn Kottmann <ko...@gmail.com>.
On 12/21/2012 03:44 AM, John Stewart wrote:
> Jörn,
>
> Last summer I started looking at coref to see what could be done to update
> it.  I ran into a problem that I summarized in an email that read:
>
>
> In the new (and neat) Tool mechanism for 1.5, is there still a way to
> send parsed (tree) input to the NER module?  Basically I'm trying to
> put together the pipeline to the Coref Tool, but I'm not sure of how
> to hook it up to both parsed and NER-marked output.
>
> Does the question make sense, and if so, does someone on the list know the
> answer?


The TreebankNameFinder is not yet integrated into the new tools, but it 
has a main method
which can do it. I accidentally removed this class in one of the last 
releases, but its back now
in trunk and will be released with 1.5.3 in the near future.

Anyway, the CLI is only recommended for testing the tools, if you have a 
use case which
involves more than a couple of sentences you should use our API.

Jörn

Re: [opennlp] coreference CLI

Posted by John Stewart <ca...@gmail.com>.
Jörn,

Last summer I started looking at coref to see what could be done to update
it.  I ran into a problem that I summarized in an email that read:


In the new (and neat) Tool mechanism for 1.5, is there still a way to
send parsed (tree) input to the NER module?  Basically I'm trying to
put together the pipeline to the Coref Tool, but I'm not sure of how
to hook it up to both parsed and NER-marked output.

Does the question make sense, and if so, does someone on the list know the
answer?

Thanks,

jds


On Thu, Dec 20, 2012 at 6:40 PM, Jörn Kottmann <ko...@gmail.com> wrote:

> On 12/20/2012 06:26 PM, Rodrigo Agerri wrote:
>
>> Hi,
>>
>> Thanks! After checking the stack trace I added the jwnl to my
>> classpath plus the path to WordNet to the maven arguments. It now runs
>> and it outputs the parse tree with numbered mentions. Like this (note
>> the NP#3)
>>
>> (SBAR (S (NP#3 (RB However) (NNS detectives)) (VP (VBD said) (SBAR (S
>> (NP#3 (PRP they)) (VP (VBD had) (RB not) (VP (VBN found) (NP (DT any)
>> (NN proof)) (SBAR (IN that) (S (NP (NP (DT the) (NN 35-year-old,))
>> (SBAR (WHNP (WP who)) (S (VP (VBD went) (S (VP (VBG missing) (PP (IN
>> on) (NP (CD 18) (NNP March,))))))))) (VP (VBD was) (VP (VBN dead.)
>>
>> Is it possible to get something easier to the eye on the CLI?
>> Is it possible to insert NEs to the parse tree on the CLI? (I guess not
>> :)  )
>>
>>
> For visualizations you might want to check out brat. They have a
> javascript visualizer which
> could display that nicely.
>
> Maybe we should make a tool which can format a penn treebank style parse
> into a formated string with
> mulitple lines.
>
> No, not really, sorry. The whole coref component needs some work so its as
> easy to use as the other
> components in OpenNLP. You are very welcome to help us with that.
> Do you have a data set you would like to train it on? I tried to train it
> on the muc data but still had some issues
> to reach the performance of the old models (the full training code was
> never published by the original author
> and I just tried to write my own).
>
> Jörn
>

Re: [opennlp] coreference CLI

Posted by Jörn Kottmann <ko...@gmail.com>.
On 12/20/2012 06:26 PM, Rodrigo Agerri wrote:
> Hi,
>
> Thanks! After checking the stack trace I added the jwnl to my
> classpath plus the path to WordNet to the maven arguments. It now runs
> and it outputs the parse tree with numbered mentions. Like this (note
> the NP#3)
>
> (SBAR (S (NP#3 (RB However) (NNS detectives)) (VP (VBD said) (SBAR (S
> (NP#3 (PRP they)) (VP (VBD had) (RB not) (VP (VBN found) (NP (DT any)
> (NN proof)) (SBAR (IN that) (S (NP (NP (DT the) (NN 35-year-old,))
> (SBAR (WHNP (WP who)) (S (VP (VBD went) (S (VP (VBG missing) (PP (IN
> on) (NP (CD 18) (NNP March,))))))))) (VP (VBD was) (VP (VBN dead.)
>
> Is it possible to get something easier to the eye on the CLI?
> Is it possible to insert NEs to the parse tree on the CLI? (I guess not :)  )
>

For visualizations you might want to check out brat. They have a 
javascript visualizer which
could display that nicely.

Maybe we should make a tool which can format a penn treebank style parse 
into a formated string with
mulitple lines.

No, not really, sorry. The whole coref component needs some work so its 
as easy to use as the other
components in OpenNLP. You are very welcome to help us with that.
Do you have a data set you would like to train it on? I tried to train 
it on the muc data but still had some issues
to reach the performance of the old models (the full training code was 
never published by the original author
and I just tried to write my own).

Jörn

Re: [opennlp] coreference CLI

Posted by Rodrigo Agerri <ro...@ehu.es>.
Hi,

Thanks! After checking the stack trace I added the jwnl to my
classpath plus the path to WordNet to the maven arguments. It now runs
and it outputs the parse tree with numbered mentions. Like this (note
the NP#3)

(SBAR (S (NP#3 (RB However) (NNS detectives)) (VP (VBD said) (SBAR (S
(NP#3 (PRP they)) (VP (VBD had) (RB not) (VP (VBN found) (NP (DT any)
(NN proof)) (SBAR (IN that) (S (NP (NP (DT the) (NN 35-year-old,))
(SBAR (WHNP (WP who)) (S (VP (VBD went) (S (VP (VBG missing) (PP (IN
on) (NP (CD 18) (NNP March,))))))))) (VP (VBD was) (VP (VBN dead.)

Is it possible to get something easier to the eye on the CLI?
Is it possible to insert NEs to the parse tree on the CLI? (I guess not :)  )

Cheers,

Rodrigo

On Thu, Dec 20, 2012 at 11:06 AM, Jörn Kottmann <ko...@gmail.com> wrote:
> Hello,
>
> can you get us a stacktrace here? Try to edit the opennlp start script and
> run maven with the -e option.
>
> You also need to provide the JWNL dictionary path via the environment
> variable
> to get it to work.
>
> Jörn
>
>
> On 12/20/2012 11:56 AM, Rodrigo Agerri wrote:
>>
>> Hi,
>>
>> I have tried to use the Coferencer CLI in 1.5.3 and I do not seem to
>> manage. I run
>>
>> bin/opennlp Coreferencer /path/to/models/ < file.parse
>>
>> and it gives this error
>>
>> [ERROR] Failed to execute goal
>> org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on
>> project opennlp-tools: An exception occured while executing the Java
>> class. null: InvocationTargetException: NullPointerException -> [Help
>> 1]
>>
>> the file.parse is simply a constituent parse tree. I also tried to
>> give it the parse tree itself but it does not work either. For
>> example,
>>
>> $ bin/opennlp Coreferencer
>> /home/ragerri/experiments/coreference/opennlp/original_models/ < (TOP
>> (S (NP (DT The) (NN fox)) (VP (VBD jumped) (PP (IN over) (NP (DT the)
>> (JJ lazy) (NN dog.))))))
>>
>> -bash: syntax error near unexpected token `('
>>
>> Cheers,
>>
>> Rodrigo
>
>

Re: [opennlp] coreference CLI

Posted by Jörn Kottmann <ko...@gmail.com>.
Hello,

can you get us a stacktrace here? Try to edit the opennlp start script and
run maven with the -e option.

You also need to provide the JWNL dictionary path via the environment 
variable
to get it to work.

Jörn

On 12/20/2012 11:56 AM, Rodrigo Agerri wrote:
> Hi,
>
> I have tried to use the Coferencer CLI in 1.5.3 and I do not seem to
> manage. I run
>
> bin/opennlp Coreferencer /path/to/models/ < file.parse
>
> and it gives this error
>
> [ERROR] Failed to execute goal
> org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on
> project opennlp-tools: An exception occured while executing the Java
> class. null: InvocationTargetException: NullPointerException -> [Help
> 1]
>
> the file.parse is simply a constituent parse tree. I also tried to
> give it the parse tree itself but it does not work either. For
> example,
>
> $ bin/opennlp Coreferencer
> /home/ragerri/experiments/coreference/opennlp/original_models/ < (TOP
> (S (NP (DT The) (NN fox)) (VP (VBD jumped) (PP (IN over) (NP (DT the)
> (JJ lazy) (NN dog.))))))
>
> -bash: syntax error near unexpected token `('
>
> Cheers,
>
> Rodrigo