Jörn, I would volunteer to write the documentation piece and samples when I understand how that works. I have seen this script from a book and now I am in the process of understanding it.
#!/bin/sh # # Usage: ./opennlp-coreference.sh < input.txt > coref.txt OPENNLP_HOME=~gwilcock/Tools/opennlp-tools-1.3.0 export OPENNLP_HOME WORDNET_HOME=~gwilcock/Tools/wordnet-2.0 export WORDNET_HOME CLASSPATH=.:\ $OPENNLP_HOME/output/opennlp-tools-1.3.0.jar:\ $OPENNLP_HOME/lib/maxent-2.4.0.jar:\ $OPENNLP_HOME/lib/trove.jar:\ $OPENNLP_HOME/lib/jwnl-1.3.3.jar export CLASSPATH java opennlp.tools.lang.english.SentenceDetector \ $OPENNLP_HOME/models/english/sentdetect/EnglishSD.bin.gz | java opennlp.tools.lang.english.Tokenizer \ $OPENNLP_HOME/models/english/tokenize/EnglishTok.bin.gz | java -Xmx1024m opennlp.tools.lang.english.TreebankParser -d \ $OPENNLP_HOME/models/english/parser | java -Xmx1024m opennlp.tools.lang.english.NameFinder -parse \ $OPENNLP_HOME/models/english/namefind/*.bin.gz | java -Xmx1024m -DWNSEARCHDIR=$WORDNET_HOME/dict -Duser.language=en \ opennlp.tools.lang.english.TreebankLinker \ $OPENNLP_HOME/models/english/coref On Wed, Jun 13, 2012 at 10:46 AM, Jörn Kottmann <[email protected]> wrote: > Hello, > > the main method is actually a good example on how to use > it. So have a look at it. > > Let me know if there are further questions. We still need to update that > part of the documentation. There should be a proper sample and explanation. > > Hope that helps, > Jörn > > > On 06/13/2012 06:42 PM, Carlos Scheidecker wrote: > >> The opennlp.tools.lang.english.**TreebankLinker has a Main method to >> perform >> Coreference resolutions. >> >> One can call that from the command line. >> >> I would like to know how to use that with the Java API. Can anyone provide >> an example? >> >> Thanks, >> >> Carlos. >> >> I've also found this explanation here: >> http://mail-archives.apache.**org/mod_mbox/opennlp-users/** >> 201112.mbox/%3C4ED76AF3.**[email protected]%3E<http://mail-archives.apache.org/mod_mbox/opennlp-users/201112.mbox/%[email protected]%3E> >> >> I now got it running with 1.5. >> You need to do the following. >> >> Use our Parser to parse an input article. >> >> Use the TreebankNameFinder to add names to your parsed article (its now >> in the trunk, see OPENNLP-407). >> I used this command: >> java -cp ... TreebankNameFinder -parse ner/date.bin ner/location.bin >> ner/money.bin ner/organization.bin ner/percentage.bin ner/person.bin >> ner/time.bin >> >> The names of models does matter. When you get the models from the >> website rename them as I did. >> >> Now you need to run the TreebankLinker. It just needs the model >> directory and you need to set WNSEARCHDIR >> to your wordnet directory, e.g like this -DWNSEARCHDIR=wordnet/dict >> >> Now the TreebankLinker is ready to link mentions together. >> >> Let us know if you have issues to get this running. >> >> Hope this helps, >> Jörn >> >> >
