Examples of FullAlchemyClassification


Examples of uk.ac.cam.ha293.tweetlabel.classify.FullAlchemyClassification

  public void fillRestricted(boolean baseline, String topicType, int topTopics, double alpha) {
    List<Map<String,Double>> classifications = new ArrayList<Map<String,Double>>();
    if(baseline) {
      if(topicType.equals("alchemy")) {
        for(long id : Tools.getCSVUserIDs()) {
          FullAlchemyClassification c = new FullAlchemyClassification(id);
          Map<String,Double> classification = new HashMap<String,Double>();
          int topicCount = 0;
          for(String topic : c.getCategorySet()) {
            if(topicCount == topTopics) break;
            classification.put(topic, c.getScore(topic));
            topicCount++;
          }
          classifications.add(classification);
        }
      } else if(topicType.equals("calais")) {
        for(long id : Tools.getCSVUserIDs()) {
          FullCalaisClassification c = new FullCalaisClassification(id);
          Map<String,Double> classification = new HashMap<String,Double>();
          int topicCount = 0;
          for(String topic : c.getCategorySet()) {
            if(topicCount == topTopics) break;
            if(topic.equals("Other")) continue;
            classification.put(topic, c.getScore(topic));
            topicCount++;
          }
          classifications.add(classification);
        }
      } else if(topicType.equals("textwise")) {
        for(long id : Tools.getCSVUserIDs()) {
          FullTextwiseClassification c = new FullTextwiseClassification(id,true);
          Map<String,Double> classification = new HashMap<String,Double>();
          int topicCount = 0;
          for(String topic : c.getCategorySet()) {
            if(topicCount == topTopics) break;
            classification.put(topic, c.getScore(topic));
            topicCount++;
          }
          classifications.add(classification);
        }
      }
    } else {
      for(long id : Tools.getCSVUserIDs()) {
        FullLLDAClassification c = new FullLLDAClassification(topicType,alpha,id);
        Map<String,Double> classification = new HashMap<String,Double>();
        int topicCount = 0;
        for(String topic : c.getCategorySet()) {
          if(topicCount == topTopics) break;
          if(topic.equals("Other")) continue;
          classification.put(topic, c.getScore(topic));
          topicCount++;
        }
        classifications.add(classification);
      }
    }
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.