Examples of Classification


Examples of cc.mallet.classify.Classification

    // as features
    FeatureVector[] fva = new FeatureVector[fvs.size()];

    for (int i = 0; i < ilist.size(); i++) {
      Instance inst = ilist.get(i);
      Classification c = m_tokenClassifiers.classify(inst, ! m_inProduction);
      LabelVector lv = c.getLabelVector();
      AugmentableFeatureVector afv1 = (AugmentableFeatureVector) inst.getData();
      int[] indices = afv1.getIndices();
      AugmentableFeatureVector afv2 = new AugmentableFeatureVector(m_dataAlphabet,
          indices, afv1.getValues(), indices.length + m_predRanks2add.length);
View Full Code Here

Examples of cc.mallet.classify.Classification

    int numCorrect = 0;
//    System.out.println("NumTrials="+numTrials);
    for(int i= classifications.size()-1;
        i >= classifications.size()-numTrials; i--)
    {
      Classification temp = (Classification)classifications.get(i);
      if(temp.bestLabelIsCorrect())
        numCorrect++;
    }
//    System.out.println("Accuracy at cov "+cov+" is "+
    //(double)numCorrect/numTrials);
    return((double)numCorrect/numTrials);
View Full Code Here

Examples of cc.mallet.classify.Classification

  {
    FeatureVector fv = (FeatureVector) instance.getData ();
    assert (instancePipe == null || fv.getAlphabet () == this.instancePipe.getDataAlphabet ());
   
    Node leaf = getLeaf(m_root, fv);
    return new Classification (instance, this, leaf.getGainRatio().getBaseLabelDistribution());
  }
View Full Code Here

Examples of demoapp.domain.Classification

        entityManager.getTransaction().begin();
        Locale en = new Locale("en", "English");
        managerImpl.dao.create(en);
        Locale es = new Locale("es", "Spanish");
        managerImpl.dao.create(es);
        Classification c = new Classification();
        c.setColor(new Color());
        c.getColor().setRed(100);c.getColor().setGreen(100);c.getColor().setBlue(20);
        c.setLetter("A");
        c.setNumber(1);
        c.setName(new I18nText());
        c.getName().setKey("key.1");
        c.getName().setValues(new ArrayList<LocalizedValue>(2));
        c.getName().getValues().add(new LocalizedValue());
        c.getName().getValues().get(0).setLocale(en);
        c.getName().getValues().get(0).setLocalizedValue("one");
        c.getName().getValues().add(new LocalizedValue());
        c.getName().getValues().get(1).setLocale(es);
        c.getName().getValues().get(1).setLocalizedValue("uno");
        managerImpl.dao.create(c);
        Classification c2 = new Classification();
        c2.setColor(new Color());
        c2.getColor().setRed(20);c2.getColor().setGreen(100);c2.getColor().setBlue(100);
        c2.setLetter("B");
        c2.setNumber(2);
        c2.setName(new I18nText());
        c2.getName().setKey("key.2");
        c2.getName().setValues(new ArrayList<LocalizedValue>(2));
        c2.getName().getValues().add(new LocalizedValue());
        c2.getName().getValues().get(0).setLocale(en);
        c2.getName().getValues().get(0).setLocalizedValue("two");
        c2.getName().getValues().add(new LocalizedValue());
        c2.getName().getValues().get(1).setLocale(es);
        c2.getName().getValues().get(1).setLocalizedValue("dos");
        managerImpl.dao.create(c2);
        entityManager.getTransaction().commit();
        entityManager.close();
    }
View Full Code Here

Examples of javax.xml.registry.infomodel.Classification

      user.setTelephoneNumbers(numbers);

      ClassificationScheme cScheme = getClassificationScheme("ntis-gov:naics", "");
      Key cKey = blm.createKey("uuid:C0B9FE13-324F-413D-5A5B-2004DB8E5CC2");
      cScheme.setKey(cKey);
      Classification classification = blm.createClassification(cScheme, "Computer Systems Design and Related Services", "5415");
      org.addClassification(classification);
      ClassificationScheme cScheme1 = getClassificationScheme("D-U-N-S", "");
      Key cKey1 = blm.createKey("uuid:3367C81E-FF1F-4D5A-B202-3EB13AD02423");
      cScheme1.setKey(cKey1);
      ExternalIdentifier ei = blm.createExternalIdentifier(cScheme1, "D-U-N-S number", "08-146-6849");
View Full Code Here

Examples of javax.xml.registry.infomodel.Classification

      // Get registry service and business query manager
      RegistryService rs = connection.getRegistryService();
      BusinessQueryManager bqm = rs.getBusinessQueryManager();
      BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
      ClassificationScheme classificationScheme = bqm.findClassificationSchemeByName(null, "uddi-org:general_keywords");
      Classification classification = blm.createClassification(classificationScheme,
          "Test transformation service", "transformation");
      Collection<Classification> classifications = new ArrayList<Classification>();
      classifications.add(classification);
      //Here I'd like to test filtering by this classification, but scout ignored the classification
      String name=classificationScheme.getName().getValue();
View Full Code Here

Examples of javax.xml.registry.infomodel.Classification

            }
            serviceBindings.add(serviceBinding);
           
            service.addServiceBindings(serviceBindings);
            ClassificationScheme cScheme = registry.getClassificationScheme(bqm, blm);
            Classification classification = blm.createClassification(cScheme, "category", TEST_SERVICE_CATEGORY);
            service.addClassification(classification);
           
            registry.saveRegistryObject(serviceBinding, jaxrConnectionFactory);
        } catch (JAXRException je) {
            throw new RegistryException(je.getLocalizedMessage(), je);
View Full Code Here

Examples of javax.xml.registry.infomodel.Classification

      RegistryService rs = connection.getRegistryService();
      BusinessQueryManager bqm = rs.getBusinessQueryManager();
            BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
            final ClassificationScheme cScheme = registry.getClassificationScheme(bqm, blm) ;
            Collection<Classification> classifications = new ArrayList<Classification>();
            Classification classification =
                blm.createClassification(
                  cScheme,
                  "category", category);
            classifications.add(classification);
      Collection<String> namePatterns = new ArrayList<String>();
View Full Code Here

Examples of javax.xml.registry.infomodel.Classification

    logger.debug("Service name: " + service.getName().getValue());
    if (service.getDescription()!=null) {
      logger.debug("Description: " + service.getDescription().getValue());
    }
        for (Object c : service.getClassifications()) {
            Classification classific = (Classification ) c;                      
          logger.debug("  Service Category: " + classific.getName().getValue());
          logger.debug("  Service Description: " + classific.getDescription().getValue());
          logger.debug("  Service Category: " + classific.getValue());
      logger.debug("  Number of EPRs : " + service.getServiceBindings().size());
        }
    logger.debug("Key id: " + service.getKey().getId());
  }
View Full Code Here

Examples of javax.xml.registry.infomodel.Classification

            }
            serviceBindings.add(serviceBinding);
           
            service.addServiceBindings(serviceBindings);
            ClassificationScheme cScheme = getClassificationScheme(bqm, blm);
            Classification classification = blm.createClassification(cScheme, "category", category);
            service.addClassification(classification);
           
            saveRegistryObject(serviceBinding, jaxrConnectionFactory);
        } catch (JAXRException je) {
            throw new RegistryException(je.getLocalizedMessage(), je);
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.