Examples of classify()


Examples of org.dbpedia.spotlight.spot.cooccurrence.classification.SpotClassifier.classify()

        SurfaceFormOccurrence unigramOccurrence = new SurfaceFormOccurrence(new SurfaceForm("Berlin"),
                        taggedText, 41, Provenance.Undefined(), -1);

        try {
            unigramClassifier.classify(unigramOccurrence);
            ngramClassifier.classify(ngramOccurrence);
        } catch (Exception e) {
            throw new InitializationException("An error occurred while classifying a test spot using the co-occurrence " +
                    "based spot selector. This is most probably caused by an outdated spot selector model. Please " +
                    "check the spot selector models defined 'org.dbpedia.spotlight.spot.cooccurrence.classifier.*'.", e);
        }
View Full Code Here

Examples of org.dmd.util.parsing.Classifier.classify()

                currLine = s.trim();

                if (currLine.length() == 0)
                    continue;
               
                tokens = classifier.classify(currLine, false);
               
                if (tokens.size() == 0)
                  continue;
               
                ConfigVersion currConfig = configFinder.getConfig(tokens.nth(0).getValue());
View Full Code Here

Examples of org.encog.neural.som.SOM.classify()

    final MLData data1 = new BasicMLData(
        TestCompetitive.SOM_INPUT[0]);
    final MLData data2 = new BasicMLData(
        TestCompetitive.SOM_INPUT[1]);
   
    int result1 = network.classify(data1);
    int result2 = network.classify(data2);
   
    Assert.assertTrue(result1!=result2);

  }
View Full Code Here

Examples of org.fnlp.app.tc.TextClassifier.classify()

    tc.train(reader, modelFile);
    /**
     * 分类器使用
     */
    String str = "韦德:不拿冠军就是失败 詹皇:没拿也不意味失败";
    String label = (String) tc.classify(str).getLabel(0);
    System.out.println("类别:"+ label);
   
    System.out.println("读入模型");
    tc = null;
    tc = new TextClassifier(modelFile);
View Full Code Here

Examples of org.fnlp.ml.classifier.bayes.BayesClassifier.classify()

        bayes.fS_CS(percents_cs[test]);
      int count=0;
      for(int i=0;i<testset.size();i++){
        Instance data = testset.getInstance(i);
        Integer gold = (Integer) data.getTarget();
        Predict<String> pres=bayes.classify(data, Type.STRING, 3);
        String pred_label=pres.getLabel();
        String gold_label = bayes.getLabel(gold);
       
        if(pred_label.equals(gold_label)){
          count++;
View Full Code Here

Examples of org.fnlp.ml.classifier.knn.KNNClassifier.classify()

    System.out.println("Testing Knn...\n");
    count=0;
    for(int i=0;i<testset.size();i++){
      Instance data = testset.getInstance(i);
      Integer gold = (Integer) data.getTarget();
      Predict<String> pres=(Predict<String>) knn.classify(data, Type.STRING, 3);
      String pred_label=pres.getLabel();
      String gold_label = knn.getLabel(gold);
     
      if(pred_label.equals(gold_label)){
        //System.out.println(pred_label+" : "+testsetknn.getInstance(i).getTempData());
View Full Code Here

Examples of org.fnlp.ml.classifier.linear.Linear.classify()

    testSet.loadThruPipes(new SequenceReader(testfile, false, "utf8"));
    System.out.println("测试样本个数: " + testSet.size()); //
    String[][] labelsSet = new String[testSet.size()][];
    for (int i = 0; i < testSet.size(); i++) {
      Instance carrier = testSet.get(i);
      int[] pred = (int[]) cl.classify(carrier).getLabel(0);
      labelsSet[i] = labels.lookupString(pred);
    }
   
    String s = SimpleFormatter.format(testSet, labelsSet);
    System.out.println(s);
View Full Code Here

Examples of org.mindswap.pellet.KnowledgeBase.classify()

    assertSubClass( kb, A, B );

    assertSubClass( kb, B, C );

    kb.classify();
  }

  @Test
  public void testNominalCache() {
    // this case tests isMergable check and specifically the correctness of
View Full Code Here

Examples of org.mindswap.pellet.taxonomy.POTaxonomyBuilder.classify()

      else
        individuals = kb.getIndividuals()// Note: this is not an optimal solution 
     
      for( ATermAppl individual :  individuals)
        if (!ATermUtils.isBnode( individual ))
          builder.classify( individual );
    }
    else {
      builder = new POTaxonomyBuilder( kb, new PartClassesComparator( kb, p ) );
     
      if(filter)
View Full Code Here

Examples of org.mindswap.pellet.taxonomy.TaxonomyBuilder.classify()

      builder.setKB( kb );
    } catch( Exception e ) {
      throw new RuntimeException( e );
    }
builder.setProgressMonitor( new SilentProgressMonitor() );
    builder.classify();
    Taxonomy<ATermAppl> taxonomy = builder.getTaxonomy();
   
//     taxonomy.getTop().print();

    return taxonomy;
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.