Examples of yield()


Examples of edu.stanford.nlp.trees.Tree.yield()

      Tree guessTree = guessItr.next();
      List<Label> guessYield = guessTree.yield();
      guessLineId++;

      Tree goldTree = goldItr.next();
      List<Label> goldYield = goldTree.yield();
      goldLineId++;

      // Check that we should evaluate this tree
      if(goldYield.size() > MAX_GOLD_YIELD) {
        skippedGuessTrees++;
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.yield()

    int goldLineId = 0;
    int guessLineId = 0;
    int skippedGuessTrees = 0;
    while( guessItr.hasNext() && goldItr.hasNext() ) {
      Tree guessTree = guessItr.next();
      List<Label> guessYield = guessTree.yield();
      guessLineId++;

      Tree goldTree = goldItr.next();
      List<Label> goldYield = goldTree.yield();
      goldLineId++;
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.yield()

      Tree guessTree = guessItr.next();
      List<Label> guessYield = guessTree.yield();
      guessLineId++;

      Tree goldTree = goldItr.next();
      List<Label> goldYield = goldTree.yield();
      goldLineId++;

      // Check that we should evaluate this tree
      if(goldYield.size() > maxGoldYield) {
        skippedGuessTrees++;
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.yield()

    assertEquals(1, document.get(CoreAnnotations.SentencesAnnotation.class).size());
    CoreMap sentence = document.get(CoreAnnotations.SentencesAnnotation.class).get(0);
    Tree parse = sentence.get(TreeCoreAnnotations.TreeAnnotation.class);
    assertEquals("(ROOT (S (NP (NNP John) (NNP Bauer)) (VP (VBZ works) (PP (IN at) (NP (NNP Stanford)))) (. .)))", parse.toString());
    List<CoreLabel> tokens = sentence.get(CoreAnnotations.TokensAnnotation.class);
    List<Label> leaves = parse.yield();
    assertEquals(6, tokens.size());
    assertEquals(6, leaves.size());
    String[] expectedTags = {"NNP", "NNP", "VBZ", "IN", "NNP", "."};
    for (int i = 0; i < tokens.size(); ++i) {
      assertEquals(expectedTags[i], tokens.get(i).tag());
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.yield()

    int goldLineId = 0;
    int guessLineId = 0;
    int skippedGuessTrees = 0;
    while( guessItr.hasNext() && goldItr.hasNext() ) {
      Tree guessTree = guessItr.next();
      List<Label> guessYield = guessTree.yield();
      guessLineId++;

      Tree goldTree = goldItr.next();
      List<Label> goldYield = goldTree.yield();
      goldLineId++;
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.yield()

      try {
        Tree rawTree = null;
        if(op.doPCFG && pparser.parse(lattice)) {
          rawTree = pparser.getBestParse(); //1best segmentation
          bestSegmentationB = rawTree.yield(new ArrayList<CoreLabel>()); //has boundary symbol

          if(op.doDep && dparser.parse(bestSegmentationB)) {
            System.err.printf("%s: Dependency parse succeeded!\n", this.getClass().getName());
            if(bparser.parse(bestSegmentationB)) {
              System.err.printf("%s: Factored parse succeeded!\n", this.getClass().getName());
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.yield()

      Tree guessTree = guessItr.next();
      List<Label> guessYield = guessTree.yield();
      guessLineId++;

      Tree goldTree = goldItr.next();
      List<Label> goldYield = goldTree.yield();
      goldLineId++;

      // Check that we should evaluate this tree
      if(goldYield.size() > maxGoldYield) {
        skippedGuessTrees++;
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.yield()

    assertEquals(1, document.get(CoreAnnotations.SentencesAnnotation.class).size());
    CoreMap sentence = document.get(CoreAnnotations.SentencesAnnotation.class).get(0);
    Tree parse = sentence.get(TreeCoreAnnotations.TreeAnnotation.class);
    assertEquals("(ROOT (S (NP (NNP John) (NNP Bauer)) (VP (VBZ works) (PP (IN at) (NP (NNP Stanford)))) (. .)))", parse.toString());
    List<CoreLabel> tokens = sentence.get(CoreAnnotations.TokensAnnotation.class);
    List<Label> leaves = parse.yield();
    assertEquals(6, tokens.size());
    assertEquals(6, leaves.size());
    String[] expectedTags = {"NNP", "NNP", "VBZ", "IN", "NNP", "."};
    for (int i = 0; i < tokens.size(); ++i) {
      assertEquals(expectedTags[i], tokens.get(i).tag());
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.yield()

          pwErr.println("Couldn't transform hypothesis tree for evaluation, skipping eval. Tree was:");
          tree.pennPrint(pwErr);
          numSkippedEvals++;
          return;

        } else if(treeFact.yield().size() != transGoldTree.yield().size()) {
          List<Label> fYield = treeFact.yield();
          List<Label> gYield = transGoldTree.yield();
          pwErr.println("WARNING: Evaluation could not be performed due to gold/parsed yield mismatch.");
          pwErr.printf("  sizes: gold: %d (transf) %d (orig); parsed: %d (transf) %d (orig).%n", gYield.size(), goldTree.yield().size(),
                       fYield.size(), tree.yield().size());
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.yield()

          numSkippedEvals++;
          return;

        } else if(treeFact.yield().size() != transGoldTree.yield().size()) {
          List<Label> fYield = treeFact.yield();
          List<Label> gYield = transGoldTree.yield();
          pwErr.println("WARNING: Evaluation could not be performed due to gold/parsed yield mismatch.");
          pwErr.printf("  sizes: gold: %d (transf) %d (orig); parsed: %d (transf) %d (orig).%n", gYield.size(), goldTree.yield().size(),
                       fYield.size(), tree.yield().size());
          pwErr.println("  gold: " + Sentence.listToString(gYield, true));
          pwErr.println("  pars: " + Sentence.listToString(fYield, true));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.