本文整理汇总了Java中edu.stanford.nlp.parser.lexparser.TreebankLangParserParams.collinizer方法的典型用法代码示例。如果您正苦于以下问题:Java TreebankLangParserParams.collinizer方法的具体用法?Java TreebankLangParserParams.collinizer怎么用?Java TreebankLangParserParams.collinizer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.stanford.nlp.parser.lexparser.TreebankLangParserParams
的用法示例。
在下文中一共展示了TreebankLangParserParams.collinizer方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: IncrementalSemanticsPerformance
import edu.stanford.nlp.parser.lexparser.TreebankLangParserParams; //导入方法依赖的package包/类
public IncrementalSemanticsPerformance()
{
predResultMap = new TreeMap<Integer, EvalResult>();
predWithSenseResultMap = new TreeMap<Integer, EvalResult>();
argWordResultMap = new TreeMap<Integer, EvalResult>(); // Unlabelled Argument score (UAS)
argRoleResultMap = new TreeMap<Integer, EvalResult>();
argPredWordResultMap = new TreeMap<Integer, EvalResult>(); // Unlabelled Prediction score (UPS)
incompleteTripleMap = new TreeMap<Integer, EvalResult>(); // Unlabelled Incomplete score (UIS)
srlResultMap = new TreeMap<Integer, EvalResult>(); // Combined Incremental SRL (CIS) score
predResult = new EvalResult();
argsResult = new EvalResult();
srlResult = new EvalResult();
evalbF1Map = new TreeMap<Integer, Double>();
evalbNumExamplesMap = new HashMap<Integer, Double>();
fullSentEvalb = new EvalbImpl("Evalb LP/LR", true);
partialEvalb = new EvalbImpl("Evalb LP/LR", true);
TreebankLangParserParams tlpp = Languages.getLanguageParams(Languages.Language.English);
tlpp.setInputEncoding("UTF-8");
treeCollinizer = tlpp.collinizer();
}
示例2: SemanticsPerformance
import edu.stanford.nlp.parser.lexparser.TreebankLangParserParams; //导入方法依赖的package包/类
public SemanticsPerformance(Indexer<String> roleIndexer, Map<Integer, Integer> roleFreqs)
{
evalb = new EvalbImpl("Evalb LP/LR", true);
TreebankLangParserParams tlpp = Languages.getLanguageParams(Languages.Language.English);
tlpp.setInputEncoding("UTF-8");
treeCollinizer = tlpp.collinizer();
conllRoleIndexer = roleIndexer;
numOfRoles = roleIndexer.size();
this.roleFreqs = roleFreqs;
counts = new int[numOfRoles + 1][numOfRoles + 1];
correctCounts = new int[numOfRoles];
goldCounts = new int[numOfRoles];
srlResult = new EvalResult();
predResult = new EvalResult();
argsResult = new EvalResult();
errorsMap = new MultiValueMap<String, String>();
}
示例3: BracketPerformance
import edu.stanford.nlp.parser.lexparser.TreebankLangParserParams; //导入方法依赖的package包/类
public BracketPerformance()
{
evalb = new EvalbImpl("Evalb LP/LR", true);
TreebankLangParserParams tlpp = Languages.getLanguageParams(Language.English);
tlpp.setInputEncoding("UTF-8");
treeCollinizer = tlpp.collinizer();
}
示例4: BracketPerformanceOracle
import edu.stanford.nlp.parser.lexparser.TreebankLangParserParams; //导入方法依赖的package包/类
public BracketPerformanceOracle()
{
evalb = new EvalbImpl("Evalb LP/LR", true);
curEvalb = new EvalbImpl("Evalb LP/LR", true);
TreebankLangParserParams tlpp = Languages.getLanguageParams(Language.English);
tlpp.setInputEncoding("UTF-8");
treeCollinizer = tlpp.collinizer();
}
示例5: IncrementalBracketPerformance
import edu.stanford.nlp.parser.lexparser.TreebankLangParserParams; //导入方法依赖的package包/类
public IncrementalBracketPerformance()
{
evalbF1Map = new TreeMap<Integer, Double>();
evalbNumExamplesMap = new HashMap<Integer, Double>();
fullSentEvalb = new EvalbImpl("Evalb LP/LR", true);
partialEvalb = new EvalbImpl("Evalb LP/LR", true);
TreebankLangParserParams tlpp = Languages.getLanguageParams(Languages.Language.English);
tlpp.setInputEncoding("UTF-8");
treeCollinizer = tlpp.collinizer();
}
示例6: SemanticsOraclePerformance
import edu.stanford.nlp.parser.lexparser.TreebankLangParserParams; //导入方法依赖的package包/类
public SemanticsOraclePerformance(Indexer<String> roleIndexer, Map<Integer, Integer> roleFreqs)
{
super(roleIndexer, roleFreqs);
curEvalb = new EvalbImpl("Evalb LP/LR", true);
TreebankLangParserParams tlpp = Languages.getLanguageParams(Languages.Language.English);
tlpp.setInputEncoding("UTF-8");
treeCollinizer = tlpp.collinizer();
}
示例7: main
import edu.stanford.nlp.parser.lexparser.TreebankLangParserParams; //导入方法依赖的package包/类
/**
* Execute with no arguments for usage.
*/
public static void main(String[] args) {
if(!validateCommandLine(args)) {
System.err.println(usage);
System.exit(-1);
}
final TreebankLangParserParams tlpp = Languages.getLanguageParams(LANGUAGE);
final PrintWriter pwOut = tlpp.pw();
final Treebank guessTreebank = tlpp.diskTreebank();
guessTreebank.loadPath(guessFile);
pwOut.println("GUESS TREEBANK:");
pwOut.println(guessTreebank.textualSummary());
final Treebank goldTreebank = tlpp.diskTreebank();
goldTreebank.loadPath(goldFile);
pwOut.println("GOLD TREEBANK:");
pwOut.println(goldTreebank.textualSummary());
final LeafAncestorEval metric = new LeafAncestorEval("LeafAncestor");
final TreeTransformer tc = tlpp.collinizer();
//The evalb ref implementation assigns status for each tree pair as follows:
//
// 0 - Ok (yields match)
// 1 - length mismatch
// 2 - null parse e.g. (()).
//
//In the cases of 1,2, evalb does not include the tree pair in the LP/LR computation.
final Iterator<Tree> goldItr = goldTreebank.iterator();
final Iterator<Tree> guessItr = guessTreebank.iterator();
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++;
// Check that we should evaluate this tree
if(goldYield.size() > MAX_GOLD_YIELD) {
skippedGuessTrees++;
continue;
}
// Only trees with equal yields can be evaluated
if(goldYield.size() != guessYield.size()) {
pwOut.printf("Yield mismatch gold: %d tokens vs. guess: %d tokens (lines: gold %d guess %d)%n", goldYield.size(), guessYield.size(), goldLineId, guessLineId);
skippedGuessTrees++;
continue;
}
final Tree evalGuess = tc.transformTree(guessTree);
final Tree evalGold = tc.transformTree(goldTree);
metric.evaluate(evalGuess, evalGold, ((VERBOSE) ? pwOut : null));
}
if(guessItr.hasNext() || goldItr.hasNext()) {
System.err.printf("Guess/gold files do not have equal lengths (guess: %d gold: %d)%n.", guessLineId, goldLineId);
}
pwOut.println("================================================================================");
if(skippedGuessTrees != 0) pwOut.printf("%s %d guess trees\n", "Unable to evaluate", skippedGuessTrees);
metric.display(true, pwOut);
pwOut.close();
}