Search in sources :

Example 1 with PooledTokenNameFinderModel

use of org.elasticsearch.service.opennlp.models.PooledTokenNameFinderModel in project elasticsearch-opennlp-plugin by spinscale.

the class SimpleNlpTest method loadFinders.

public void loadFinders() throws Exception {
    finders = new NameFinderME[names.length];
    StopWatch sw = new StopWatch("Loading models").start();
    for (int mi = 0; mi < names.length; mi++) {
        finders[mi] = new NameFinderME(new PooledTokenNameFinderModel(new FileInputStream(new File("src/test/resources/models", "en-ner-" + names[mi] + ".bin"))));
    }
    sw.stop();
}
Also used : NameFinderME(opennlp.tools.namefind.NameFinderME) File(java.io.File) FileInputStream(java.io.FileInputStream) StopWatch(org.elasticsearch.common.StopWatch) PooledTokenNameFinderModel(org.elasticsearch.service.opennlp.models.PooledTokenNameFinderModel)

Aggregations

File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 NameFinderME (opennlp.tools.namefind.NameFinderME)1 StopWatch (org.elasticsearch.common.StopWatch)1 PooledTokenNameFinderModel (org.elasticsearch.service.opennlp.models.PooledTokenNameFinderModel)1