Examples of CalaisClassification


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

   
    Map<String,Double> resultsMap = new HashMap<String,Double>();
    Map<String,Integer> countsMap = new HashMap<String,Integer>();
   
    for(SimpleTweet tweet : tweets) {
      CalaisClassification classification = CalaisClassifier.classifyText(tweet.getText());
      if(classification == null) {
        //Normally this is because of a <100 char tweet
        continue;
      }
      for(String category : classification.getCategories()) {
        double score = classification.lookupScore(category);     
        if(resultsMap.containsKey(category)) {
          resultsMap.put(category, resultsMap.get(category) + score);
          countsMap.put(category, countsMap.get(category) + 1);
        } else {
          resultsMap.put(category, score);
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.