コード例 #1
0
ファイル: EvalManager.java プロジェクト: eponvert/upparse
  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);
  }
コード例 #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);
      }
    }
  }