You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@opennlp.apache.org by Mario Gómez <mg...@dc.exa.unrc.edu.ar> on 2014/05/21 22:01:09 UTC

Regards from Argentina!

Hi guys!

Is there a tool to represent the general grammar of natural text (say a
text file or a web page) in a data base, like DAVID ----- HAS A -----
GUITAR?
I mean, to automatically generate the relation HAS A?
Or is it best to use some kind of tree? Like AIML does?

Thanx for your time.

Mario y Ale.

Re: Regards from Argentina!

Posted by Mark G <ma...@apache.org>.
Hola! there are two ways I have approached this with OpenNLP, others may
provide more sophisticated methods... one is to use the sentencechunker
results and look for noun->verb->noun sequential combinations, and assert
the noun phrases as nodes and the verb phrase as an edge (like in your
example). Another way is to use the sentence Parser and come up with other
similar heuristics.

Generally, I think OpenNLP's Chunker and Parser give you what you need to
be creative about how you generate relations within a sentence, but of
course you will have to implement what to do with the tags in your own code.

These stackoverflow posts give you some code for implementing a sentence
chunker
http://stackoverflow.com/questions/22386160/retrieving-a-number-of-important-terms-for-a-document/22591661#22591661
and this one for using the parser
http://stackoverflow.com/questions/14708047/how-to-extract-the-noun-phrases-using-open-nlps-chunking-parser/20601852#20601852

HTH
MG


On Wed, May 21, 2014 at 4:01 PM, Mario Gómez <mg...@dc.exa.unrc.edu.ar>wrote:

> Hi guys!
>
> Is there a tool to represent the general grammar of natural text (say a
> text file or a web page) in a data base, like DAVID ----- HAS A -----
> GUITAR?
> I mean, to automatically generate the relation HAS A?
> Or is it best to use some kind of tree? Like AIML does?
>
> Thanx for your time.
>
> Mario y Ale.
>