/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package seekfeel.testing;
import edu.stanford.nlp.process.Morphology;
import java.io.File;
import java.util.ArrayList;
import seekfeel.evaluators.SentiWordNetEvaluator;
import seekfeel.miners.supervised.SupervisedPanel;
import seekfeel.miners.supervised.SupportedFeature;
import seekfeel.supervised.essentials.ReviewsCorpusLoader;
import seekfeel.supervised.essentials.TweeterCorpusLoader;
import seekfeel.utilities.PropertiesGetter;
import weka.core.stemmers.ArabicLightStemmer;
import weka.core.stemmers.SnowballStemmer;
/**
*
* @author Ahmed
*/
public class WekaTesting {
public static void main(String[] args) {
/*MovieReview_Reader mrReader = new MovieReview_Reader();
ArrayList<DataUnit> posReviews = mrReader.readReviews(1);
ArrayList<DataUnit> negReviews = mrReader.readReviews(-1);
CorpusHolder cHolder = new CorpusHolder();
cHolder.setPositiveExamples(posReviews);
cHolder.setNegativeExamples(negReviews);
SVMEvaluator theEvaluator = new SVMEvaluator();
theEvaluator.setAnnotatedCorpus(cHolder);
ArrayList<SupportedFeature> allFeats = new ArrayList<SupportedFeature>();
allFeats.add(SupportedFeature.UniGrams);
theEvaluator.evaluateClassifier(PropertiesGetter.getProperty("SVMEvaluationFile"), allFeats);*/
/* File dir = new File("C://Users//Ahmed//Documents//NetBeansProjects//SeekFeel//Data//Reviews//customer review data");
SentiWordNetEvaluator theEvaluator;
String[] fileNames = dir.list();
if (fileNames != null) {
for (String fileName : fileNames) {
theEvaluator = new SentiWordNetEvaluator(dir.getAbsolutePath() + "//" + fileName,new ReviewsCorpusLoader());
theEvaluator.evaluateClassifier(PropertiesGetter.getProperty("EvaluationDir") + "//" + fileName, new ArrayList<SupportedFeature>());
}
}*/
/* SentiWordNetEvaluator theEvaluator;
theEvaluator = new SentiWordNetEvaluator("C://Users//Ahmed//Documents//NetBeansProjects//SeekFeel//Data//Reviews//myTest.txt");
theEvaluator.evaluateClassifier(PropertiesGetter.getProperty("EvaluationDir") + "//myTest.txt", new ArrayList<SupportedFeature>());
*/
//ArrayList<SupportedFeature> supportedFeatures = new ArrayList<SupportedFeature>();
/*supportedFeatures.add(SupportedFeature.UniGrams);
supportedFeatures.add(SupportedFeature.BiGrams);
supportedFeatures.add(SupportedFeature.SentimentFeats);
SupervisedPanel sp = new SupervisedPanel("C://Users//Ahmed//Documents//NetBeansProjects//SeekFeel//Data//Reviews//customer review data//Creative Labs Nomad Jukebox Zen Xtra 40GB.txt", supportedFeatures);
sp.train();*/
//supportedFeatures = new ArrayList<SupportedFeature>();
// supportedFeatures.add(SupportedFeature.UniGrams);
// supportedFeatures.add(SupportedFeature.BiGrams);
// supportedFeatures.add(SupportedFeature.SentimentFeats);
// CrossValidator validator = new CrossValidator(10, supportedFeatures, CorpusLoader.loadCorpus("C://Users//Ahmed//Documents//NetBeansProjects//SeekFeel//Data//Reviews//customer review data//Creative Labs Nomad Jukebox Zen Xtra 40GB.txt"));
// System.out.println(validator.validate());
ArrayList<SupportedFeature> supportedFeatures = new ArrayList<SupportedFeature>();
supportedFeatures.add(SupportedFeature.TaggedStems);
SupervisedPanel sp = new SupervisedPanel(PropertiesGetter.getProperty("AnnotatedTweets"),supportedFeatures,new TweeterCorpusLoader());
sp.train();
}
}