public void testUseModel() throws Exception{
String fileSubj = "corpus/quote.tok.gt9.5000";
String fileObj = "corpus/plot.tok.gt9.5000";
TextClassifier applier = TextClassifier.getClassifier("./temp");
List subjectiveCorpus = getCorpus(fileSubj,"subjective",applier);
List objectiveCorpus = getCorpus(fileObj,"objective",applier);
long l0 = System.currentTimeMillis();
double[][] scores = applier.classify(subjectiveCorpus);
int totalDocs = scores.length;
int totalcorrect = 0;
int correct = 0;
// this one should be positive
for (int i=0;i<scores.length;i++){
if (scores[i][0]>scores[i][1])correct++;
}
totalcorrect=correct;
System.out.println("----- Subjectives -----");
System.out.println(correct+" correct");
scores = applier.classify(objectiveCorpus);
correct = 0;
totalDocs += scores.length;
// this one should be negative
for (int i=0;i<scores.length;i++){
if (scores[i][0]<scores[i][1])correct++;