Package uk.ac.cam.ha293.tweetlabel

Examples of uk.ac.cam.ha293.tweetlabel.TweetLabel


        //if(fac.getScore(topic) < scoreThreshold) break; //stop getting low-prob topics
        topics.add(topic);
        count++;
      }
    } else if(topicType.equals("calais")) {
      FullCalaisClassification fcc = new FullCalaisClassification(userID);
      int topTopics = 3;
      int count = 0;
      for(String topic : fcc.getCategorySet()) {
        if(topic.equals("Other")) continue; //really prominent...
        if(count == topTopics) break; //stop getting more than 3 topics
        //if(fac.getScore(topic) < scoreThreshold) break; //stop getting low-prob topics
        topics.add(topic);
        count++;
View Full Code Here


          }
          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

      FullAlchemyClassification c = new FullAlchemyClassification(uid);
      for(String cat : c.getCategorySet()) {
        valueSet.add(c.getScore(cat));
      }
    } else if(topicType.equals("calais")) {
      FullCalaisClassification c = new FullCalaisClassification(uid);
      for(String cat : c.getCategorySet()) {
        valueSet.add(c.getScore(cat));
      }
    } else if(topicType.equals("textwise")) {
      FullCalaisClassification c = new FullCalaisClassification(uid);
      for(String cat : c.getCategorySet()) {
        valueSet.add(c.getScore(cat));
      }
    }
    return valueSet;
  }
View Full Code Here

              FullLLDAClassification llda = new FullLLDAClassification(topicType,alpha,false,reduction,uid);
              double sim = llda.cosineSimilarity(baseline);
              cosineSum += sim;
              cosineCount++;
            } else if(topicType.equals("calais")) {
              FullCalaisClassification baseline = new FullCalaisClassification(uid);
              FullLLDAClassification llda = new FullLLDAClassification(topicType,alpha,false,reduction,uid);
              double sim = llda.cosineSimilarity(baseline);
              cosineSum += sim;
              cosineCount++;
            } else if(topicType.equals("textwiseproper")) {
View Full Code Here

            if(kCount == k) break;
            kCount++;
            baselineTopicSet.add(topic);
          }
        } else if(topicType.equals("calais")) {
          FullCalaisClassification baseline = new FullCalaisClassification(uid);
          kCount=0;
          for(String topic : baseline.getCategorySet()) {
            if(kCount == k) break;
            if(topic.equals("Other")) continue;
            kCount++;
            baselineTopicSet.add(topic);
          }
        } else if(topicType.equals("textwise")) {
          FullTextwiseClassification baseline = new FullTextwiseClassification(uid,true);
          kCount=0;
          for(String topic : baseline.getCategorySet()) {
            if(kCount == k) break;
            kCount++;
            baselineTopicSet.add(topic);
          }
        }
View Full Code Here

            if(kCount == k) break;
            kCount++;
            baselineTopicSet.add(topic);
          }
        } else if(topicType.equals("calais")) {
          FullCalaisClassification baseline = new FullCalaisClassification(uid);
          kCount=0;
          for(String topic : baseline.getCategorySet()) {
            if(kCount == k) break;
            if(topic.equals("Other")) continue;
            kCount++;
            baselineTopicSet.add(topic);
          }
        } else if(topicType.equals("textwise")) {
          FullTextwiseClassification baseline = new FullTextwiseClassification(uid,true);
          kCount=0;
          for(String topic : baseline.getCategorySet()) {
            if(kCount == k) break;
            kCount++;
            baselineTopicSet.add(topic);
          }
        }
View Full Code Here

        FullAlchemyClassification c = new FullAlchemyClassification(uid);
        if(c.getCategorySet().size() == 0) continue;
        String topTopic = c.getCategorySet().toArray(new String[1])[0];
        topicCounts.put(topTopic,topicCounts.get(topTopic)+1);
      } else if(topicType.equals("calais")) {
        FullCalaisClassification c = new FullCalaisClassification(uid);
        if(c.getCategorySet().size() == 0) continue;
        String topTopic = c.getCategorySet().toArray(new String[1])[0];
        if(topTopic.equals("Other") && c.getCategorySet().size() > 1topTopic = c.getCategorySet().toArray(new String[1])[1];
        else if(topTopic.equals("Other")) continue;
        topicCounts.put(topTopic,topicCounts.get(topTopic)+1);
      } else if(topicType.equals("textwise")) {
        FullTextwiseClassification c = new FullTextwiseClassification(uid,true);
        if(c.getCategorySet().size() == 0) continue;
        String topTopic = c.getCategorySet().toArray(new String[1])[0];
        topicCounts.put(topTopic,topicCounts.get(topTopic)+1);
      }
      count++;
    }
    double sum = 0.0;
View Full Code Here

          if(kCount == k) break;
          kCount++;
          baselineTopicSet.add(topic);
        }
      } else if(topicType.equals("calais")) {
        FullCalaisClassification baseline = new FullCalaisClassification(uid);
        kCount=0;
        for(String topic : baseline.getCategorySet()) {
          if(kCount == k) break;
          if(topic.equals("Other")) continue;
          kCount++;
          baselineTopicSet.add(topic);
        }
      } else if(topicType.equals("textwise")) {
        FullTextwiseClassification baseline = new FullTextwiseClassification(uid,true);
        kCount=0;
        for(String topic : baseline.getCategorySet()) {
          if(kCount == k) break;
          kCount++;
          baselineTopicSet.add(topic);
        }
      }
View Full Code Here

        double sim = inferred.cosineSimilarity(baseline);
        cosineSum += sim;
        squareSum += sim*sim;
        cosineCount++;
      } else if(topicType.equals("calais")) {
        FullCalaisClassification baseline = new FullCalaisClassification(uid);
        FullLLDAClassification inferred = new FullLLDAClassification(topicType,alpha,uid);
        double sim = inferred.cosineSimilarity(baseline);
        cosineSum += sim;
        squareSum += sim*sim;
        cosineCount++;
 
View Full Code Here

        double sim = cosineKSimilarity(baseline,inferred,k);
        cosineSum += sim;
        squareSum += sim*sim;
        cosineCount++;
      } else if(topicType.equals("calais")) {
        FullCalaisClassification baseline = new FullCalaisClassification(uid);
        FullLLDAClassification inferred = new FullLLDAClassification(topicType,alpha,uid);
        double sim = cosineKSimilarity(baseline,inferred,k);
        cosineSum += sim;
        squareSum += sim*sim;
        cosineCount++;
 
View Full Code Here

TOP

Related Classes of uk.ac.cam.ha293.tweetlabel.TweetLabel

Copyright © 2018 www.massapicom. 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.