Codota Logo
LemmatizerEvaluator.<init>
Code IndexAdd Codota to your IDE (free)

How to use
opennlp.tools.lemmatizer.LemmatizerEvaluator
constructor

Best Java code snippets using opennlp.tools.lemmatizer.LemmatizerEvaluator.<init> (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: apache/opennlp

LemmatizerEvaluator evaluator = new LemmatizerEvaluator(
  new opennlp.tools.lemmatizer.LemmatizerME(model),
  missclassifiedListener, reportListener);
origin: apache/opennlp

/**
 * Checks the evaluator results against the results got using the conlleval,
 * available at http://www.cnts.ua.ac.be/conll2000/chunking/output.html but
 * containing lemmas instead of chunks.
 *
 * @throws IOException
 */
@Test
public void testEvaluator() throws IOException {
 String inPredicted = "opennlp/tools/lemmatizer/output.txt";
 String inExpected = "opennlp/tools/lemmatizer/output.txt";
 String encoding = "UTF-8";
 DummyLemmaSampleStream predictedSample = new DummyLemmaSampleStream(
   new PlainTextByLineStream(
    new MockInputStreamFactory(new File(inPredicted)), encoding), true);
 DummyLemmaSampleStream expectedSample = new DummyLemmaSampleStream(
   new PlainTextByLineStream(
    new MockInputStreamFactory(new File(inExpected)), encoding), false);
 Lemmatizer dummyLemmatizer = new DummyLemmatizer(predictedSample);
 OutputStream stream = new ByteArrayOutputStream();
 LemmatizerEvaluationMonitor listener = new LemmaEvaluationErrorListener(stream);
 LemmatizerEvaluator evaluator = new LemmatizerEvaluator(dummyLemmatizer, listener);
 evaluator.evaluate(expectedSample);
 Assert.assertEquals(0.9877049180327869, evaluator.getWordAccuracy(), DELTA);
 Assert.assertNotSame(stream.toString().length(), 0);
}
origin: apache/opennlp

private double trainAndEval(String lang, File trainFile, TrainingParameters params,
                  File evalFile) throws IOException {
 ConlluTagset tagset = ConlluTagset.X;
 ObjectStream<LemmaSample> trainSamples = new ConlluLemmaSampleStream(new ConlluStream(
   new MarkableFileInputStreamFactory(trainFile)), tagset);
 LemmatizerModel model = LemmatizerME.train(lang, trainSamples, params, new LemmatizerFactory());
 LemmatizerEvaluator evaluator = new LemmatizerEvaluator(new LemmatizerME(model));
 evaluator.evaluate(new ConlluLemmaSampleStream(new ConlluStream(
   new MarkableFileInputStreamFactory(evalFile)), tagset));
 return evaluator.getWordAccuracy();
}
origin: ai.idylnlp/idylnlp-opennlp-tools-1.8.3

LemmatizerEvaluator evaluator = new LemmatizerEvaluator(
  new opennlp.tools.lemmatizer.LemmatizerME(model),
  missclassifiedListener, reportListener);
origin: org.apache.opennlp/opennlp-tools

LemmatizerEvaluator evaluator = new LemmatizerEvaluator(
  new opennlp.tools.lemmatizer.LemmatizerME(model),
  missclassifiedListener, reportListener);
opennlp.tools.lemmatizerLemmatizerEvaluator<init>

Javadoc

Initializes the current instance.

Popular methods of LemmatizerEvaluator

  • evaluate
  • getWordAccuracy
    Retrieves the word accuracy. This is defined as: word accuracy = correctly detected tags / total wor

Popular in Java

  • Reading from database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getExternalFilesDir (Context)
  • getContentResolver (Context)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now