Ejemplo n.º 1
0
  private void makeClumpGoldStandard() throws EvalError {
    switch (testFileType) {
      case WSJ:
        clumpGoldStandard = CorpusUtil.wsjClumpGoldStandard(alpha, corpusFiles);
        break;

      case NEGRA:
        clumpGoldStandard = CorpusUtil.negraClumpGoldStandard(alpha, corpusFiles);
        break;

      case CTB:
        clumpGoldStandard = CorpusUtil.ctbClumpGoldStandard(alpha, corpusFiles);
        break;

      case SPL:
        evalTypes.clear();
        evalTypes.add(OutputType.NONE);
        evals.clear();
        evals.add(NullEval.instance());
        break;

      default:
        throw new EvalError("Unexpected file type for clumping gold standard: " + corpusFiles);
    }

    if (filterLength > 0)
      clumpGoldStandard = clumpGoldStandard.filterBySentenceLength(filterLength);
  }
Ejemplo n.º 2
0
 private void checkGoldUnlabeledBracketSet() throws CorpusError {
   if (goldUnlabeledBracketSet == null)
     goldUnlabeledBracketSet =
         CorpusUtil.goldUnlabeledBracketSets(
             testFileType, alpha, corpusFiles, filterLength, reverse);
   assert goldUnlabeledBracketSet != null;
 }
Ejemplo n.º 3
0
  public void evalParserOutput(final UnlabeledBracketSetCorpus output, final OutputManager man)
      throws CorpusError, EvalError, IOException {
    final ChunkedCorpus chunked = CorpusUtil.getChunkedCorpusClumps(alpha, output);
    treebankEval.getExperiment("asTrees", output.getTrees()).writeSummary(man.getResultsStream());

    clumpsEval.addExperiment(clumpsEval.newChunkingExperiment("clumps", chunked));
    clumpsEval.writeSummary(evalReportType, man.getResultsStream(), false);

    ubsFromClumpsEval.getExperiment("", output.getTrees()).writeSummary(man.getResultsStream());

    npsEval.addExperiment(npsEval.newChunkingExperiment("NPs", chunked));
    npsEval.writeSummary(evalReportType, man.getResultsStream(), false);

    ubsFromNPsEval.getExperiment("", output.getTrees()).writeSummary(man.getResultsStream());

    ubsFromPPsEval.getExperiment("", output.getTrees()).writeSummary(man.getResultsStream());

    if (!man.isNull()) {
      BufferedWriter bw = Util.bufferedWriter(man.treeOutputFilename());
      output.writeTo(bw, outputText);
      bw = Util.bufferedWriter(man.clumpsOutputFilename());
      chunked.writeTo(bw, outputText);
    }
  }
Ejemplo n.º 4
0
 private void makeEvalStopSegmentCorpus() throws CorpusError {
   testStopSegmentCorpus =
       CorpusUtil.stopSegmentCorpus(
           alpha, corpusFiles, testFileType, numSent, filterLength, noSeg, reverse);
 }
Ejemplo n.º 5
0
 private void checkPPsGoldStandard() throws CorpusError {
   if (ppsGoldStandard == null)
     ppsGoldStandard = CorpusUtil.ppsGoldStandard(testFileType, alpha, corpusFiles, filterLength);
   assert ppsGoldStandard != null;
 }