Commit 7da41e97 authored by Shyam Upadhyay's avatar Shyam Upadhyay
Browse files

wip

parent 7ec300c3
......@@ -49,8 +49,7 @@ public class Evaluator {
}
public static void evaluateOnGoldData(String goldannFile,List<EventInstance>predevents) throws FileNotFoundException {
EvaluationRecord r = new EvaluationRecord();
public static void evaluateOnGoldData(EvaluationRecord r, String goldannFile, List<EventInstance> predevents) throws FileNotFoundException {
// ClassificationTester tester = new ClassificationTester();
List<EventInstance> goldann = readGoldData(goldannFile);
for(EventInstance inst:predevents)
......@@ -72,13 +71,6 @@ public class Evaluator {
}
}
if(r.getPrecision()>1.0 || r.getRecall() > 1.0 || r.getF1() > 1.0)
{
System.err.println("Something wrong!!! metric > 1 !!!");
System.out.println(r.getCorrectCount()+" "+r.getPredictedCount()+" "+r.getGoldCount()+" "+r.getPrecision()+" "+r.getRecall()+" "+r.getF1());
System.exit(-1);
}
System.out.println(r.getPrecision()+" "+r.getRecall()+" "+r.getF1());
}
// public static void EvaluateOnTriggerSurface(TextAnnotation absTa, List<Constituent> event_triggers, ClassificationTester tester, List<String> acceptableFrames) {
// List<String>event_trigger_surfaces = new ArrayList<String>();
......
......@@ -2,6 +2,7 @@ package edu.illinois.cs.cogcomp.nytlabs.corpus.core;
import edu.illinois.cs.cogcomp.annotation.AnnotatorException;
import edu.illinois.cs.cogcomp.core.datastructures.textannotation.TextAnnotation;
import edu.illinois.cs.cogcomp.core.experiments.EvaluationRecord;
import edu.illinois.cs.cogcomp.core.io.IOUtils;
import edu.illinois.cs.cogcomp.core.io.LineIO;
import edu.illinois.cs.cogcomp.nytlabs.corpus.FramenetExtractor;
......@@ -182,11 +183,19 @@ public class LazyNYTReader{
LazyNYTReader reader = new LazyNYTReader(cc, alreadyCached, docids);
AnnotatedDocument doc = reader.next();
System.out.println(doc==null);
EvaluationRecord r = new EvaluationRecord();
while(doc!=null)
{
System.out.println(doc.nydoc.getGuid());
Evaluator.evaluateOnGoldData(Params.goldPath + "/" + doc.nydoc.getGuid() +"_abs.ann",doc.abs_events);
Evaluator.evaluateOnGoldData(r, Params.goldPath + "/" + doc.nydoc.getGuid() +"_abs.ann",doc.abs_events);
doc=reader.next();
}
if(r.getPrecision()>1.0 || r.getRecall() > 1.0 || r.getF1() > 1.0)
{
System.err.println("Something wrong!!! metric > 1 !!!");
System.out.println(r.getCorrectCount()+" "+r.getPredictedCount()+" "+r.getGoldCount()+" "+r.getPrecision()+" "+r.getRecall()+" "+r.getF1());
System.exit(-1);
}
System.out.println(r.getPrecision()+" "+r.getRecall()+" "+r.getF1());
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment