AlexPoint/OpenNlp

Using other languages' models with this port

njfm0001 opened this issue · 1 comments

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

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);