コード例 #1
0
ファイル: EvalManager.java プロジェクト: eponvert/upparse
 public void initializeCCLParserEval() throws EvalError, CorpusError {
   checkNPsGoldStandard();
   checkPPsGoldStandard();
   checkClumpGoldStandard();
   treebankEval = new TreebankEval("asTrees", getGoldUnlabeledBracketSets());
   npsEval = ChunkingEval.fromChunkedCorpus(OutputType.NPS, npsGoldStandard);
   clumpsEval = ChunkingEval.fromChunkedCorpus(OutputType.CLUMP, clumpGoldStandard);
   ubsFromClumpsEval =
       new TreebankEval("clumps Recall", clumpGoldStandard.toUnlabeledBracketSetCorpus());
   ubsFromNPsEval = new TreebankEval("NPs Recall", npsGoldStandard.toUnlabeledBracketSetCorpus());
   ubsFromPPsEval = new TreebankEval("PPs Recall", ppsGoldStandard.toUnlabeledBracketSetCorpus());
 }
コード例 #2
0
ファイル: EvalManager.java プロジェクト: eponvert/upparse
  private void initParseEvaluationTypes() throws EvalError, CorpusError {
    for (final OutputType t : evalTypes) {
      switch (t) {
        case CLUMP:
          evals.add(ChunkingEval.fromChunkedCorpus(t, getClumpGoldStandard()));
          break;

        case NPS:
          evals.add(ChunkingEval.fromChunkedCorpus(t, getNPsGoldStandard()));
          break;

        case PPS:
          evals.add(ChunkingEval.fromChunkedCorpus(t, getPPsGoldStandard()));
          break;

        case TREEBANKPREC:
          evals.add(
              TreebankPrecisionEval.fromUnlabeledBracketSets(t, getGoldUnlabeledBracketSets()));
          break;

        case TREEBANKFLAT:
          evals.add(TreebankFlatEval.fromUnlabeledBracketSets(t, getGoldUnlabeledBracketSets()));
          break;

        case TREEBANKRB:
          evals.add(TreebankRBEval.fromUnlabeledBracketSets(t, getGoldUnlabeledBracketSets()));
          break;

        case NONE:
          evals.add(NullEval.instance());
          break;

        default:
          throw new EvalError("Unexpected evaluation type: " + t);
      }
    }
  }