Examples of transformTree()


Examples of edu.stanford.nlp.international.french.pipeline.FTBCorrector.transformTree()

        continue;
      }
     
      // Punctuation normalization, etc.
      Tree backupCopy = tree.deepCopy();
      tree = tt.transformTree(tree);
      if (tree.firstChild().children().length == 0) {
        // Some trees have only punctuation. Tregex will mangle these. Don't throw those away.
        System.err.println("Saving tree: " + tree.toString());
        System.err.println("Backup: " + backupCopy.toString());
        tree = backupCopy;
View Full Code Here

Examples of edu.stanford.nlp.parser.lexparser.TreeBinarizer.transformTree()

    ParserAnnotatorUtils.fillInParseAnnotations(VERBOSE, BUILD_GRAPHS, gsf, sentence, tree);

    if (saveBinaryTrees) {
      TreeBinarizer binarizer = TreeBinarizer.simpleTreeBinarizer(parser.getTLPParams().headFinder(), parser.treebankLanguagePack());
      Tree binarized = binarizer.transformTree(tree);
      Trees.convertToCoreLabels(binarized);
      sentence.set(TreeCoreAnnotations.BinarizedTreeAnnotation.class, binarized);
    }
  }
View Full Code Here

Examples of edu.stanford.nlp.parser.lexparser.TreeBinarizer.transformTree()

      }

      // TODO: add an option which treats the spans as constraints when parsing

      Tree tree = parser.apply(tokens);
      Tree binarized = binarizer.transformTree(tree);
      Tree collapsedUnary = transformer.transformTree(binarized);

      // if there is a sentiment model for use in prelabeling, we
      // label here and then use the user given labels to adjust
      if (sentimentModel != null) {
View Full Code Here

Examples of edu.stanford.nlp.parser.lexparser.TreebankLangParserParams.transformTree()

    int numTrees = 0;
    for (Tree tree : tb) {
      for (Tree subTree : tree) {
        if (!subTree.isLeaf()) {
          tlpp.transformTree(subTree, tree);
        }
      }
      List<Label> pretermList = tree.preTerminalYield();
      List<Label> yield = tree.yield();
      assert yield.size() == pretermList.size();
View Full Code Here

Examples of edu.stanford.nlp.trees.TreeTransformer.transformTree()

          basicEval.eval(ourBrackets, goldBrackets);
          System.out.println("\nScores:");
          basicEval.displayLast();

          Tree collinsTree = collinizer.transformTree(tree);
          Tree collinsGold = collinizer.transformTree(gold);
          ourBrackets = proc.allBrackets(collinsTree);
          goldBrackets = proc.allBrackets(collinsGold);
          if (goodPOS) {
            ourBrackets.addAll(proc.commonWordTagTypeBrackets(collinsTree, collinsGold));
View Full Code Here

Examples of edu.stanford.nlp.trees.TreeTransformer.transformTree()

          basicEval.eval(ourBrackets, goldBrackets);
          System.out.println("\nScores:");
          basicEval.displayLast();

          Tree collinsTree = collinizer.transformTree(tree);
          Tree collinsGold = collinizer.transformTree(gold);
          ourBrackets = proc.allBrackets(collinsTree);
          goldBrackets = proc.allBrackets(collinsGold);
          if (goodPOS) {
            ourBrackets.addAll(proc.commonWordTagTypeBrackets(collinsTree, collinsGold));
            goldBrackets.addAll(proc.commonWordTagTypeBrackets(collinsGold, collinsTree));
View Full Code Here

Examples of edu.stanford.nlp.trees.TreeTransformer.transformTree()

    final Iterator<Tree> goldItr = goldTreebank.iterator();
    int goldLineId = 0;
    int skippedGuessTrees = 0;

    for(final Tree guess : guessTreebank) {
      final Tree evalGuess = tc.transformTree(guess);
      if(guess.yield().size() > MAX_GUESS_YIELD) {
        skippedGuessTrees++;
        continue;
      }
View Full Code Here

Examples of edu.stanford.nlp.trees.TreeTransformer.transformTree()

      }

      boolean doneEval = false;
      while(goldItr.hasNext() && !doneEval) {
        final Tree gold = goldItr.next();
        final Tree evalGold = tc.transformTree(gold);
        goldLineId++;

        if(gold.yield().size() > MAX_GOLD_YIELD) {
          continue;
View Full Code Here

Examples of edu.stanford.nlp.trees.TreeTransformer.transformTree()

    final Iterator<Tree> goldItr = goldTreebank.iterator();
    int goldLineId = 0;
    int skippedGuessTrees = 0;

    for(final Tree guess : guessTreebank) {
      final Tree evalGuess = tc.transformTree(guess);
      final ArrayList<Label> guessSent = guess.yield();
      final String guessChars = Sentence.listToString(guessSent).replaceAll("\\s+","");
      if(guessSent.size() > maxGuessYield) {
        skippedGuessTrees++;
        continue;
View Full Code Here

Examples of edu.stanford.nlp.trees.TreeTransformer.transformTree()

      }

      boolean doneEval = false;
      while(goldItr.hasNext() && !doneEval) {
        final Tree gold = goldItr.next();
        final Tree evalGold = tc.transformTree(gold);
        goldLineId++;

        final ArrayList<Label> goldSent = gold.yield();
        final String goldChars = Sentence.listToString(goldSent).replaceAll("\\s+","");
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.