• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CategoryWordTagFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中edu.stanford.nlp.ling.CategoryWordTagFactory的典型用法代码示例。如果您正苦于以下问题:Java CategoryWordTagFactory类的具体用法?Java CategoryWordTagFactory怎么用?Java CategoryWordTagFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CategoryWordTagFactory类属于edu.stanford.nlp.ling包,在下文中一共展示了CategoryWordTagFactory类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: TreeAnnotatorAndBinarizer

import edu.stanford.nlp.ling.CategoryWordTagFactory; //导入依赖的package包/类
public TreeAnnotatorAndBinarizer(HeadFinder annotationHF, HeadFinder binarizationHF, TreebankLangParserParams tlpParams, boolean forceCNF, boolean insideFactor, boolean doSubcategorization) {
  if (doSubcategorization) {
    annotator = new TreeAnnotator(annotationHF, tlpParams);
  } else {
    annotator = new TreeNullAnnotator(annotationHF);
  }
  binarizer = new TreeBinarizer(binarizationHF, tlpParams.treebankLanguagePack(), insideFactor, Train.markovFactor, Train.markovOrder, Train.compactGrammar() > 0, Train.compactGrammar() > 1, Train.HSEL_CUT, Train.markFinalStates);
  if (Train.selectivePostSplit) {
    postSplitter = new PostSplitter(tlpParams);
  }
  this.tf = new LabeledScoredTreeFactory(new CategoryWordTagFactory());
  this.tlp = tlpParams.treebankLanguagePack();
  this.forceCNF = forceCNF;
  if (Train.printAnnotatedRuleCounts) {
    annotatedRuleCounts = new ClassicCounter<Tree>();
  }
  if (Train.printAnnotatedStateCounts) {
    annotatedStateCounts = new ClassicCounter<String>();
  }
}
 
开发者ID:FabianFriedrich,项目名称:Text2Process,代码行数:21,代码来源:TreeAnnotatorAndBinarizer.java


示例2: TreeAnnotatorAndBinarizer

import edu.stanford.nlp.ling.CategoryWordTagFactory; //导入依赖的package包/类
public TreeAnnotatorAndBinarizer(HeadFinder annotationHF, HeadFinder binarizationHF, TreebankLangParserParams tlpParams, boolean forceCNF, boolean insideFactor, boolean doSubcategorization, Options op) {
  this.trainOptions = op.trainOptions;
  if (doSubcategorization) {
    annotator = new TreeAnnotator(annotationHF, tlpParams, op);
  } else {
    annotator = new TreeNullAnnotator(annotationHF);
  }
  binarizer = new TreeBinarizer(binarizationHF, tlpParams.treebankLanguagePack(), insideFactor, trainOptions.markovFactor, trainOptions.markovOrder, trainOptions.compactGrammar() > 0, trainOptions.compactGrammar() > 1, trainOptions.HSEL_CUT, trainOptions.markFinalStates, trainOptions.simpleBinarizedLabels, trainOptions.noRebinarization);
  if (trainOptions.selectivePostSplit) {
    postSplitter = new PostSplitter(tlpParams, op);
  }
  this.tf = new LabeledScoredTreeFactory(new CategoryWordTagFactory());
  this.tlp = tlpParams.treebankLanguagePack();
  this.forceCNF = forceCNF;
  if (trainOptions.printAnnotatedRuleCounts) {
    annotatedRuleCounts = new ClassicCounter<Tree>();
  }
  if (trainOptions.printAnnotatedStateCounts) {
    annotatedStateCounts = new ClassicCounter<String>();
  }
}
 
开发者ID:paulirwin,项目名称:Stanford.NER.Net,代码行数:22,代码来源:TreeAnnotatorAndBinarizer.java


示例3: ExhaustiveDependencyParser

import edu.stanford.nlp.ling.CategoryWordTagFactory; //导入依赖的package包/类
public ExhaustiveDependencyParser(DependencyGrammar dg, Lexicon lex, Options op) {
  this.dg = dg;
  this.lex = lex;
  this.op = op;
  this.tlp = op.langpack();
  tf = new LabeledScoredTreeFactory(new CategoryWordTagFactory());
}
 
开发者ID:FabianFriedrich,项目名称:Text2Process,代码行数:8,代码来源:ExhaustiveDependencyParser.java


示例4: depScoreTree

import edu.stanford.nlp.ling.CategoryWordTagFactory; //导入依赖的package包/类
/** Use the DependencyGrammar to score the tree.
 *
 * @param tr A binarized tree (as returned by the PCFG parser
 * @return The score for the tree according to the grammar
 */
private double depScoreTree(Tree tr) {
  // System.err.println("Here's our tree:");
  // tr.pennPrint();
  // System.err.println(Trees.toDebugStructureString(tr));
  Tree cwtTree = tr.deepCopy(new LabeledScoredTreeFactory(), new CategoryWordTagFactory());
  cwtTree.percolateHeads(binHeadFinder);
  // System.err.println("Here's what it went to:");
  // cwtTree.pennPrint();
  List<IntDependency> deps = MLEDependencyGrammar.treeToDependencyList(cwtTree, wordIndex, tagIndex);
  // System.err.println("Here's the deps:\n" + deps);
  return dg.scoreAll(deps);
}
 
开发者ID:benblamey,项目名称:stanford-nlp,代码行数:18,代码来源:FastFactoredParser.java


示例5: TreeAnnotator

import edu.stanford.nlp.ling.CategoryWordTagFactory; //导入依赖的package包/类
public TreeAnnotator(HeadFinder hf, TreebankLangParserParams tlpp) {
  this.tlpParams = tlpp;
  this.hf = hf;
  this.tf = new LabeledScoredTreeFactory(new CategoryWordTagFactory());
}
 
开发者ID:FabianFriedrich,项目名称:Text2Process,代码行数:6,代码来源:TreeAnnotator.java


示例6: LabeledScoredTreeReaderFactory

import edu.stanford.nlp.ling.CategoryWordTagFactory; //导入依赖的package包/类
/**
 * Create a new TreeReaderFactory with CategoryWordTag labels.
 */
public LabeledScoredTreeReaderFactory() {
  lf = new CategoryWordTagFactory();
  tm = new BobChrisTreeNormalizer();
}
 
开发者ID:FabianFriedrich,项目名称:Text2Process,代码行数:8,代码来源:LabeledScoredTreeReaderFactory.java



注:本文中的edu.stanford.nlp.ling.CategoryWordTagFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ConvertBufferedImage类代码示例发布时间:2022-05-22
下一篇:
Java SimpleAttributeModifier类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap