Why does the Parse.addNames method not work for you?
Looks like the addNamesToSentenceParse method is almost identical.
Jörn
On 12/13/2012 04:01 PM, Ant B wrote:
Hi Jörn,
Once again, thanks for the response.
After a little while copying & editing the TreeBankNameFinder class source, I
added methods to provide this parse processing feature:
https://github.com/amb-enthusiast/CoreferenceTest/blob/master/src/dev/amb/opennlp/TreebankNameFinder.java
See the addNERsToParse(NameFinderME, String tag, Parse inputParse) method. It
appears to work as expected, which is great.
Feel free to use as you see fit - it may be of some use to other developers.
Many thanks,
Anthony
On Dec 13, 2012, at 4:53 AM, Jörn Kottmann <[email protected]> wrote:
Hello,
in OpenNLP we just provide the core components, but do not offer any workflow
support,
usually people put the components together in their code or use tool which can
do it for them
e.g. UIMA.
The name finder returns a set of Span objects, these can be inserted into a
parse tree
via the Parse.addNames method.
In your code sample below you would create a loop which reads in sentences,
for each sentence you need to do parsing and named entity detection, after the
entity
detection you can insert the names via the addNames method into the parse
object.
I am not sure, but the addNames method might be only in trunk (or later in the
1.5.3 release).
Jörn