• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java DefaultPaths类的典型用法和代码示例

java 2次浏览

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

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

示例1: features

点赞 3

import edu.stanford.nlp.pipeline.DefaultPaths; //导入依赖的package包/类
public static Counter<String> features(KBPInput input) {
  // Ensure RegexNER Tags!
  input.sentence.regexner(DefaultPaths.DEFAULT_KBP_REGEXNER_CASED, false);
  input.sentence.regexner(DefaultPaths.DEFAULT_KBP_REGEXNER_CASELESS, true);

  // Get useful variables
  ClassicCounter<String> feats = new ClassicCounter<>();
  if (Span.overlaps(input.subjectSpan, input.objectSpan) || input.subjectSpan.size() == 0 || input.objectSpan.size() == 0) {
    return new ClassicCounter<>();
  }

  // Actually featurize
  denseFeatures(input, input.sentence, feats);
  surfaceFeatures(input, input.sentence, feats);
  dependencyFeatures(input, input.sentence, feats);
  relationSpecificFeatures(input, input.sentence, feats);

  return feats;
}
 

开发者ID:intel-analytics,
项目名称:InformationExtraction,
代码行数:20,
代码来源:KBPStatisticalExtractor.java

示例2: Dictionaries

点赞 3

import edu.stanford.nlp.pipeline.DefaultPaths; //导入依赖的package包/类
public Dictionaries(Properties props) {
  this(props.getProperty(Constants.DEMONYM_PROP, DefaultPaths.DEFAULT_DCOREF_DEMONYM),
      props.getProperty(Constants.ANIMATE_PROP, DefaultPaths.DEFAULT_DCOREF_ANIMATE),
      props.getProperty(Constants.INANIMATE_PROP, DefaultPaths.DEFAULT_DCOREF_INANIMATE),
      props.getProperty(Constants.MALE_PROP, DefaultPaths.DEFAULT_DCOREF_MALE),
      props.getProperty(Constants.NEUTRAL_PROP, DefaultPaths.DEFAULT_DCOREF_NEUTRAL),
      props.getProperty(Constants.FEMALE_PROP, DefaultPaths.DEFAULT_DCOREF_FEMALE),
      props.getProperty(Constants.PLURAL_PROP, DefaultPaths.DEFAULT_DCOREF_PLURAL),
      props.getProperty(Constants.SINGULAR_PROP, DefaultPaths.DEFAULT_DCOREF_SINGULAR),
      props.getProperty(Constants.STATES_PROP, DefaultPaths.DEFAULT_DCOREF_STATES),
      props.getProperty(Constants.GENDER_NUMBER_PROP, DefaultPaths.DEFAULT_DCOREF_GENDER_NUMBER),
      props.getProperty(Constants.COUNTRIES_PROP, DefaultPaths.DEFAULT_DCOREF_COUNTRIES),
      props.getProperty(Constants.STATES_PROVINCES_PROP, DefaultPaths.DEFAULT_DCOREF_STATES_AND_PROVINCES),
      props.getProperty(Constants.EXTRA_GENDER_PROP, DefaultPaths.DEFAULT_DCOREF_EXTRA_GENDER),
      Boolean.parseBoolean(props.getProperty(Constants.BIG_GENDER_NUMBER_PROP, "false")) ||
      Boolean.parseBoolean(props.getProperty(Constants.REPLICATECONLL_PROP, "false")),
      props.getProperty(Constants.SIEVES_PROP, Constants.SIEVEPASSES).contains("CorefDictionaryMatch"),
      new String[]{DefaultPaths.DEFAULT_DCOREF_DICT1, DefaultPaths.DEFAULT_DCOREF_DICT2,
        DefaultPaths.DEFAULT_DCOREF_DICT3, DefaultPaths.DEFAULT_DCOREF_DICT4},
      DefaultPaths.DEFAULT_DCOREF_DICT1,
      DefaultPaths.DEFAULT_DCOREF_NE_SIGNATURES);
}
 

开发者ID:benblamey,
项目名称:stanford-nlp,
代码行数:23,
代码来源:Dictionaries.java

示例3: create

点赞 3

import edu.stanford.nlp.pipeline.DefaultPaths; //导入依赖的package包/类
@Override
public Annotator create() {
  String mapping = properties.getProperty("regexner.mapping", DefaultPaths.DEFAULT_REGEXNER_RULES);
  String ignoreCase = properties.getProperty("regexner.ignorecase", "false");
  String validPosPattern = properties.getProperty("regexner.validpospattern", RegexNERSequenceClassifier.DEFAULT_VALID_POS);
  return new RegexNERAnnotator(mapping, Boolean.valueOf(ignoreCase), validPosPattern);
}
 

开发者ID:westei,
项目名称:stanbol-stanfordnlp,
代码行数:8,
代码来源:LangPipeline.java

示例4: loadModel

点赞 2

import edu.stanford.nlp.pipeline.DefaultPaths; //导入依赖的package包/类
private void loadModel(String modelFile)
{
    if (modelFile.equals("") || modelFile == null) {
        parser = LexicalizedParser.loadModel(DefaultPaths.DEFAULT_PARSER_MODEL, new String[]{});
    }
    else {
        parser = LexicalizedParser.loadModel(modelFile, new String[]{});
    }
}
 

开发者ID:dmnapolitano,
项目名称:stanford-thrift,
代码行数:10,
代码来源:StanfordParserThrift.java

示例5: signature

点赞 2

import edu.stanford.nlp.pipeline.DefaultPaths; //导入依赖的package包/类
public static String signature(Properties props) {
  StringBuilder os = new StringBuilder();
  os.append(Constants.DEMONYM_PROP + ":" +
          props.getProperty(Constants.DEMONYM_PROP,
                  DefaultPaths.DEFAULT_DCOREF_DEMONYM));
  os.append(Constants.ANIMATE_PROP + ":" +
          props.getProperty(Constants.ANIMATE_PROP,
                  DefaultPaths.DEFAULT_DCOREF_ANIMATE));
  os.append(Constants.INANIMATE_PROP + ":" +
          props.getProperty(Constants.INANIMATE_PROP,
                  DefaultPaths.DEFAULT_DCOREF_INANIMATE));
  os.append(Constants.MALE_PROP + ":" +
          props.getProperty(Constants.MALE_PROP,
                  DefaultPaths.DEFAULT_DCOREF_MALE));
  os.append(Constants.NEUTRAL_PROP + ":" +
          props.getProperty(Constants.NEUTRAL_PROP,
                  DefaultPaths.DEFAULT_DCOREF_NEUTRAL));
  os.append(Constants.FEMALE_PROP + ":" +
          props.getProperty(Constants.FEMALE_PROP,
                  DefaultPaths.DEFAULT_DCOREF_FEMALE));
  os.append(Constants.PLURAL_PROP + ":" +
          props.getProperty(Constants.PLURAL_PROP,
                  DefaultPaths.DEFAULT_DCOREF_PLURAL));
  os.append(Constants.SINGULAR_PROP + ":" +
          props.getProperty(Constants.SINGULAR_PROP,
                  DefaultPaths.DEFAULT_DCOREF_SINGULAR));
  os.append(Constants.STATES_PROP + ":" +
          props.getProperty(Constants.STATES_PROP,
                  DefaultPaths.DEFAULT_DCOREF_STATES));
  os.append(Constants.GENDER_NUMBER_PROP + ":" +
          props.getProperty(Constants.GENDER_NUMBER_PROP,
                  DefaultPaths.DEFAULT_DCOREF_GENDER_NUMBER));
  os.append(Constants.COUNTRIES_PROP + ":" +
          props.getProperty(Constants.COUNTRIES_PROP,
                  DefaultPaths.DEFAULT_DCOREF_COUNTRIES));
  os.append(Constants.STATES_PROVINCES_PROP + ":" +
          props.getProperty(Constants.STATES_PROVINCES_PROP,
                  DefaultPaths.DEFAULT_DCOREF_STATES_AND_PROVINCES));
  os.append(Constants.EXTRA_GENDER_PROP + ":" +
          props.getProperty(Constants.EXTRA_GENDER_PROP,
                  DefaultPaths.DEFAULT_DCOREF_EXTRA_GENDER));
  os.append(Constants.BIG_GENDER_NUMBER_PROP + ":" +
          props.getProperty(Constants.BIG_GENDER_NUMBER_PROP,
                  "false"));
  os.append(Constants.REPLICATECONLL_PROP + ":" +
          props.getProperty(Constants.REPLICATECONLL_PROP,
                  "false"));
  return os.toString();
}
 

开发者ID:benblamey,
项目名称:stanford-nlp,
代码行数:50,
代码来源:Dictionaries.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)