Examples of classifyDocument()


Examples of org.apache.mahout.classifier.bayes.model.ClassifierContext.classifyDocument()

  }

  public void test() throws InvalidDatastoreException {
    ClassifierContext classifier = new ClassifierContext(algorithm, store);
    String[] document = { "aa", "ff" };
    ClassifierResult result = classifier.classifyDocument(document, "unknown");
    assertNotNull("category is null and it shouldn't be", result);
    assertEquals(result + " is not equal to e", "e", result.getLabel());

    document = new String[] { "ff" };
    result = classifier.classifyDocument(document, "unknown");
View Full Code Here

Examples of org.apache.mahout.classifier.bayes.model.ClassifierContext.classifyDocument()

    ClassifierResult result = classifier.classifyDocument(document, "unknown");
    assertNotNull("category is null and it shouldn't be", result);
    assertEquals(result + " is not equal to e", "e", result.getLabel());

    document = new String[] { "ff" };
    result = classifier.classifyDocument(document, "unknown");
    assertNotNull("category is null and it shouldn't be", result);
    assertEquals(result + " is not equal to d", "d", result.getLabel());// GSI:
                                                                        // was
                                                                        // unknown,
                                                                        // but
View Full Code Here

Examples of org.apache.mahout.classifier.bayes.model.ClassifierContext.classifyDocument()

                                                                        // the
                                                                        // first
                                                                        // cat

    document = new String[] { "cc" };
    result = classifier.classifyDocument(document, "unknown");
    assertNotNull("category is null and it shouldn't be", result);
    assertEquals(result + " is not equal to d", "d", result.getLabel());
  }

  public void testResults() throws Exception {
View Full Code Here

Examples of org.apache.mahout.classifier.bayes.model.ClassifierContext.classifyDocument()

  }

  public void testResults() throws Exception {
    ClassifierContext classifier = new ClassifierContext(algorithm, store);
    String[] document = { "aa", "ff" };
    ClassifierResult result = classifier.classifyDocument(document, "unknown");
    assertNotNull("category is null and it shouldn't be", result);
    System.out.println("Result: " + result);
  }
}
View Full Code Here

Examples of org.apache.mahout.classifier.bayes.model.ClassifierContext.classifyDocument()

  }

  public void test() throws InvalidDatastoreException {
    ClassifierContext classifier = new ClassifierContext(algorithm, store);
    String[] document = {"aa", "ff"};
    ClassifierResult result = classifier.classifyDocument( document, "unknown");
    assertNotNull("category is null and it shouldn't be", result);
    assertEquals(result + " is not equal to e", "e", result.getLabel());

    document = new String[]{"ff"};
    result = classifier.classifyDocument(document, "unknown");
View Full Code Here

Examples of org.apache.mahout.classifier.bayes.model.ClassifierContext.classifyDocument()

    ClassifierResult result = classifier.classifyDocument( document, "unknown");
    assertNotNull("category is null and it shouldn't be", result);
    assertEquals(result + " is not equal to e", "e", result.getLabel());

    document = new String[]{"ff"};
    result = classifier.classifyDocument(document, "unknown");
    assertNotNull("category is null and it shouldn't be", result);
    assertEquals(result + " is not equal to d", "d", result.getLabel());

    document = new String[]{"cc"};
    result = classifier.classifyDocument( document, "unknown");
View Full Code Here

Examples of org.apache.mahout.classifier.bayes.model.ClassifierContext.classifyDocument()

    result = classifier.classifyDocument(document, "unknown");
    assertNotNull("category is null and it shouldn't be", result);
    assertEquals(result + " is not equal to d", "d", result.getLabel());

    document = new String[]{"cc"};
    result = classifier.classifyDocument( document, "unknown");
    assertNotNull("category is null and it shouldn't be", result);
    assertEquals(result + " is not equal to d", "d", result.getLabel());
  }

  public void testResults() throws Exception {
View Full Code Here

Examples of org.apache.mahout.classifier.bayes.model.ClassifierContext.classifyDocument()

  }

  public void testResults() throws Exception {
    ClassifierContext classifier = new ClassifierContext(algorithm, store);
    String[] document = {"aa", "ff"};
    ClassifierResult result = classifier.classifyDocument( document, "unknown");
    assertNotNull("category is null and it shouldn't be", result);
    System.out.println("Result: " + result);
  }
}
View Full Code Here

Examples of org.apache.mahout.classifier.bayes.model.ClassifierContext.classifyDocument()

          for (Map.Entry<String, List<String>> stringListEntry : document
              .entrySet()) {
            List<String> strings = stringListEntry.getValue();
            TimingStatistics.Call call = operationStats.newCall();
            TimingStatistics.Call outercall = totalStatistics.newCall();
            ClassifierResult classifiedLabel = classifier.classifyDocument(
                strings.toArray(new String[strings.size()]), params
                    .get("defaultCat"));
            call.end();
            outercall.end();
            boolean correct = resultAnalyzer.addInstance(correctLabel,
View Full Code Here

Examples of org.apache.mahout.classifier.bayes.model.ClassifierContext.classifyDocument()

    List<String> doc = new NGrams(line.toString(), gramSize)
        .generateNGramsWithoutLabel();

    log.info("Done converting");
    log.info("Classifying document: {}", docPath);
    ClassifierResult category = classifier.classifyDocument(doc
        .toArray(new String[doc.size()]), defaultCat);
    log.info("Category for {} is {}", docPath, category);

  }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.