AlexPoint / OpenNlp

Open source NLP tools (sentence splitter, tokenizer, chunker, coref, NER, parse trees, etc.) in C#

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using other languages' models with this port

njfm0001 opened this issue · comments

I would like to know how to use bin files from the OpenNLP official site to make it work with this port.

commented

To use the bin files for other languages, you should use the generic classes (or create specific classes for a given language) and pass the appropriate bin files to the constructor.
For instance, for sentence detection:

var modelPath = "path/to/de-sent.bin";
var sentenceDetector = new MaximumEntropySentenceDetector(new SharpEntropy.GisModel(new SharpEntropy.IO.BinaryGisModelReader(modelPath)));
var sentences = sentenceDetector.SentenceDetect(paragraph);