Examples of classify()


Examples of com.flaptor.hounder.classifier.bayes.BayesClassifier.classify()

            String item=cache.getItem(url);
            if (null==item){
                LOGGER.warn("Page " + url + "is in notIncluded for " + catName + " but not in cache");
                continue;
            }
            double classifierScore = classifier.classify(DocumentParser.parse(item, classifier.getMaxTuple()));
            boolean classifierIncluded = (classifierScore > 0.5);
            addToIncNotIncMap(mp, url, false, classifierIncluded, classifierScore);           
        }
        return mp;
    }
View Full Code Here

Examples of com.github.pmerienne.trident.ml.nlp.KLDClassifier.classify()

    kldClassifier.update(0, tokenizer.tokenize(NOSQL_WIKI));
    kldClassifier.update(0, tokenizer.tokenize(MYSQL_WIKI));
    kldClassifier.update(1, tokenizer.tokenize(LILIUM_WIKI));
    kldClassifier.update(1, tokenizer.tokenize(ROSE_WIKI));

    assertEquals(0, (int) kldClassifier.classify(tokenizer.tokenize(DATABASE_WIKI)));
    assertEquals(1, (int) kldClassifier.classify(tokenizer.tokenize(FLOWER_WIKI)));
  }

  @Test
  public void testWithReuters() {
View Full Code Here

Examples of edu.msu.cme.rdp.classifier.Classifier.classify()

        try {
            parser = new SequenceReader(inStream1);
            while((pSeq = parser.readNextSequence()) != null) {
                try {
                    ClassificationResult result = aClassifier.classify(pSeq);
                    root = reconstructTree(result, root, SAMPLE1);
                    wt.write(ClassificationResultFormatter.getOutput(result, format));

                } catch (ShortSequenceException e) {
                    System.out.println(e.getMessage());
View Full Code Here

Examples of edu.msu.cme.rdp.classifier.Classifier.classify()

            }

            parser = new SequenceReader(inStream2);
            while((pSeq = parser.readNextSequence()) != null) {
                try {
                    ClassificationResult result = aClassifier.classify(pSeq);
                    root = reconstructTree(result, root, SAMPLE2);
                    wt.write(ClassificationResultFormatter.getOutput(result, format));

                } catch (ShortSequenceException e) {
                    System.out.println(e.getMessage());
View Full Code Here

Examples of edu.msu.cme.rdp.classifier.Classifier.classify()

        String sequence = "";
        infile.readLine();
        sequence = infile.readLine();
        sequence = sequence.toUpperCase();
        ClassifierSequence pSeq = new ClassifierSequence("name", "title", sequence);
        ClassificationResult result = aClassifier.classify(pSeq);
       
        Iterator it = result.getAssignments().iterator();
        RankAssignment classResult = (RankAssignment) it.next();
        assertEquals(classResult.getBestClass().getName() , rootTree.getName());
        assertEquals(classResult.getConfidence(), 1.0, 0.1);
View Full Code Here

Examples of edu.msu.cme.rdp.classifier.Classifier.classify()

        // test the second sequence
        infile.readLine();
        sequence = infile.readLine();
        sequence = sequence.toUpperCase();
        pSeq = new ClassifierSequence("name", "title", sequence);
        result = aClassifier.classify(pSeq);
       
       
        it = result.getAssignments().iterator();
        classResult = (RankAssignment) it.next();
        assertEquals(classResult.getBestClass().getName() , rootTree.getName());
View Full Code Here

Examples of edu.stanford.nlp.ie.regexp.NumberSequenceClassifier.classify()

      }
      copyL.add(new CoreLabel(l.get(i)));
    }
    // run NumberSequenceClassifier
    AbstractSequenceClassifier<CoreLabel> nsc = new NumberSequenceClassifier();
    copyL = nsc.classify(copyL);
    // update entity only if it was not O
    for (int i = 0; i < sz; i++) {
      E before = l.get(i);
      CoreLabel nscAnswer = copyL.get(i);
      if (before.get(CoreAnnotations.NamedEntityTagAnnotation.class) == null && before.get(CoreAnnotations.NamedEntityTagAnnotation.class).equals(BACKGROUND_SYMBOL) &&
View Full Code Here

Examples of gannuCF.classifiers.Classifier.classify()

      ArrayList<String> sample=new ArrayList<String>(window.size());     
      for(AmbiguousWord word:window)
      {
        sample.add(word.getLemma());       
      }
      float w[]=c.classify(sample);
      for(int j=0;j<target.getSenses().size();j++)
      {
        ArrayList<String> dwords=new ArrayList<String>(window.size());
        for(AmbiguousWord word:window)
        {
View Full Code Here

Examples of jnisvmlight.SVMLightModel.classify()

    int precision = 0;
    for (int i = 0; i < N; i++) {

      // Classify a test vector using the Java object
      // (in a real application, this should not be one of the training vectors)
      double d = model.classify(traindata[i]);
      if ((traindata[i].getLabel() < 0 && d < 0)
          || (traindata[i].getLabel() > 0 && d > 0)) {
        precision++;
      }
      if (i % 10 == 0) {
View Full Code Here

Examples of org.apache.devicemap.DeviceMapClient.classify()

        String test = "Mozilla/5.0 (Linux; U; Android 2.2; en; HTC Aria A6380 Build/ERE27) AppleWebKit/540.13+ (KHTML, like Gecko) Version/3.1 Mobile Safari/524.15.0";

        long startn = System.nanoTime();

        Map<String, String> m = client.classify(test);

        long diffn = (System.nanoTime() - startn) / 1000;

        System.out.println("Test lookup: '" + m.get("id") + "' time: " + diffn + "usec");
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.