Search in sources :

Example 1 with PrettyCorpusReader

use of edu.illinois.cs.cogcomp.comma.readers.PrettyCorpusReader in project cogcomp-nlp by CogComp.

the class ClassifierComparison method main.

public static void main(String[] args) throws Exception {
    PrettyCorpusReader pcr = new PrettyCorpusReader(CommaProperties.getInstance().getCommaLabeledDataFile());
    CommaParser parser = new CommaParser(pcr.getSentences(), Ordering.ORDERED, true);
    System.out.println("GOLD GOLD");
    localCVal(true, true, parser, 250, 0.003, 0, 2.0, false);
    System.out.println("GOLD AUTO");
    localCVal(true, false, parser, 200, 0.003, 0, 2.0, false);
    System.out.println("AUTO AUTO");
    localCVal(false, false, parser, 250, 0.003, 0, 3.5, false);
    List<Classifier> lbjExtractors = new ArrayList<>();
    lbjExtractors.add(new LocalCommaClassifier().getExtractor());
    Classifier lbjLabeler = new LocalCommaClassifier().getLabeler();
    System.out.println("STRUCTURED GOLD");
    StructuredCommaClassifier goldStructured = new StructuredCommaClassifier(lbjExtractors, lbjLabeler);
    structuredCVal(goldStructured, parser, true, false);
    System.out.println("STRUCTURED AUTO");
    StructuredCommaClassifier autoStructured = new StructuredCommaClassifier(lbjExtractors, lbjLabeler);
    structuredCVal(autoStructured, parser, false, false);
    System.out.println("BAYRAKTAR GOLD");
    EvaluateDiscrete bayraktarGold = getBayraktarBaselinePerformance(parser, true);
    bayraktarGold.printPerformance(System.out);
    System.out.println("BAYRAKTAR AUTO");
    EvaluateDiscrete bayraktarAuto = getBayraktarBaselinePerformance(parser, false);
    bayraktarAuto.printPerformance(System.out);
    reasonForBelievingThatStructuredIsPerformingWorseDueToOverfitting(parser, false);
    printConstrainedClassifierPerformance(parser);
}
Also used : EvaluateDiscrete(edu.illinois.cs.cogcomp.comma.utils.EvaluateDiscrete) CommaParser(edu.illinois.cs.cogcomp.comma.readers.CommaParser) ArrayList(java.util.ArrayList) OxfordCommaConstrainedCommaClassifier(edu.illinois.cs.cogcomp.comma.lbj.OxfordCommaConstrainedCommaClassifier) Classifier(edu.illinois.cs.cogcomp.lbjava.classify.Classifier) LocativePairConstrainedCommaClassifier(edu.illinois.cs.cogcomp.comma.lbj.LocativePairConstrainedCommaClassifier) StructuredCommaClassifier(edu.illinois.cs.cogcomp.comma.sl.StructuredCommaClassifier) SubstitutePairConstrainedCommaClassifier(edu.illinois.cs.cogcomp.comma.lbj.SubstitutePairConstrainedCommaClassifier) LocalCommaClassifier(edu.illinois.cs.cogcomp.comma.lbj.LocalCommaClassifier) ListCommasConstrainedCommaClassifier(edu.illinois.cs.cogcomp.comma.lbj.ListCommasConstrainedCommaClassifier) PrettyCorpusReader(edu.illinois.cs.cogcomp.comma.readers.PrettyCorpusReader) LocalCommaClassifier(edu.illinois.cs.cogcomp.comma.lbj.LocalCommaClassifier) StructuredCommaClassifier(edu.illinois.cs.cogcomp.comma.sl.StructuredCommaClassifier)

Aggregations

ListCommasConstrainedCommaClassifier (edu.illinois.cs.cogcomp.comma.lbj.ListCommasConstrainedCommaClassifier)1 LocalCommaClassifier (edu.illinois.cs.cogcomp.comma.lbj.LocalCommaClassifier)1 LocativePairConstrainedCommaClassifier (edu.illinois.cs.cogcomp.comma.lbj.LocativePairConstrainedCommaClassifier)1 OxfordCommaConstrainedCommaClassifier (edu.illinois.cs.cogcomp.comma.lbj.OxfordCommaConstrainedCommaClassifier)1 SubstitutePairConstrainedCommaClassifier (edu.illinois.cs.cogcomp.comma.lbj.SubstitutePairConstrainedCommaClassifier)1 CommaParser (edu.illinois.cs.cogcomp.comma.readers.CommaParser)1 PrettyCorpusReader (edu.illinois.cs.cogcomp.comma.readers.PrettyCorpusReader)1 StructuredCommaClassifier (edu.illinois.cs.cogcomp.comma.sl.StructuredCommaClassifier)1 EvaluateDiscrete (edu.illinois.cs.cogcomp.comma.utils.EvaluateDiscrete)1 Classifier (edu.illinois.cs.cogcomp.lbjava.classify.Classifier)1 ArrayList (java.util.ArrayList)1