Package uk.ac.cam.ha293.tweetlabel.util

Examples of uk.ac.cam.ha293.tweetlabel.util.Tools


      Corpus corpus = new Corpus(topicType);
      int count = 0;
      for(Long userID : Tools.getCSVUserIDs()) {
        if(count % 50 == 0) System.out.println("Added "+count+" profiles to Corpus");
        count++;
        SimpleProfile profile = Profiler.loadCSVProfile(userID);
        profile.reduceBy(reduction);
        corpus.addDocument(profile.asDocument(topicType));
      }
      return corpus; 
    }
View Full Code Here


      Corpus corpus = new Corpus(topicType);
      int count = 0;
      for(Long userID : Tools.getCSVUserIDs()) {
        if(count % 50 == 0) System.out.println("Added "+count+" profiles to Corpus");
        count++;
        SimpleProfile profile = Profiler.loadCSVProfile(userID);
        corpus.addDocument(profile.asDocument(topicType));
      }
      return corpus;
    }
View Full Code Here

  public static void alchemyClassificationRoutine() {
    System.out.println("Beginning complete Alchemy classification...");
    Profiler profiler = new Profiler();
    while(!synchronisedUserIDList.isEmpty()) {
      long currentID = synchronisedUserIDList.remove(0);
      SimpleProfile profile = profiler.loadCSVProfile(currentID);
      if(!profile.classifyAlchemy()) {
        System.err.println("Failed to classify profile properly, probably reached the daily limit");
        return;
      }
    }
    System.out.println("Classification thread complete");
View Full Code Here

 
  public static void liwcClassificationRoutine() {
    System.out.println("Beginning complete LIWC classification...");
    while(!synchronisedUserIDList.isEmpty()) {
      long currentID = synchronisedUserIDList.remove(0);
      SimpleProfile profile = Profiler.loadCSVProfile(currentID);
      if(!profile.classifyLIWC()) {
        System.err.println("Failed to classify profile "+currentID+" properly using the LIWC");
        return;
      }
    }
  }
View Full Code Here

 
  public static void calaisClassificationRoutine() {
    System.out.println("Beginning complete Calais classification...");
    while(!synchronisedUserIDList.isEmpty()) {
      long currentID = synchronisedUserIDList.remove(0);
      SimpleProfile profile = Profiler.loadCSVProfile(currentID);
      if(!profile.classifyCalais()) {
        System.err.println("Failed to classify profile "+currentID+" properly using Calais");
        return;
      }
    }
  }
View Full Code Here

  public static void textwiseClassificationRoutine() {
    System.out.println("Beginning complete Textwise classification...");
    Profiler profiler = new Profiler();
    while(!synchronisedUserIDList.isEmpty()) {
      long currentID = synchronisedUserIDList.remove(0);
      SimpleProfile profile = profiler.loadCSVProfile(currentID);
      if(!profile.classifyTextwise()) {
        System.err.println("Failed to classify profile "+currentID+" properly using Textwise");
        return;
      }
    }
  }
View Full Code Here

  public static void properTextwiseClassificationRoutine() {
    System.out.println("Beginning complete Textwise classification...");
    Profiler profiler = new Profiler();
    while(!synchronisedUserIDList.isEmpty()) {
      long currentID = synchronisedUserIDList.remove(0);
      SimpleProfile profile = profiler.loadCSVProfile(currentID);
      if(!profile.classifyTextwiseProper()) {
        System.err.println("Failed to classify profile "+currentID+" properly using Textwise");
        return;
      }
    }
  }
View Full Code Here

      System.err.println("An error occured");
    }
  }
 
  public SimpleProfile asSimpleProfile() {
    SimpleProfile profile = new SimpleProfile(0);
    for(String document : documents) {
      profile.addTweet(new SimpleTweet(0,0,document));
    }
    return profile;
  }
View Full Code Here

  }
 
  public SimpleProfile asSimpleProfile() {
    SimpleProfile profile = new SimpleProfile(0);
    for(String document : documents) {
      profile.addTweet(new SimpleTweet(0,0,document));
    }
    return profile;
  }
View Full Code Here

 
  public List<CategoryScore> logClassify(String document) {
    List<CategoryScore> categoryScores = new ArrayList<CategoryScore>();
    for(Category category : categories.keySet()) {
      double logP = logPOfCategoryGivenDocument(category, Tools.LIWCStripTweet(document));
      categoryScores.add(new CategoryScore(category,logP));     
    }
    return categoryScores;
  }
View Full Code Here

TOP

Related Classes of uk.ac.cam.ha293.tweetlabel.util.Tools

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.