edu.illinois.cs.cogcomp.core.utilities.configuration.ResourceManager类的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(73)

本文整理了Java中edu.illinois.cs.cogcomp.core.utilities.configuration.ResourceManager类的一些代码示例,展示了ResourceManager类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ResourceManager类的具体详情如下:
包路径:edu.illinois.cs.cogcomp.core.utilities.configuration.ResourceManager
类名称:ResourceManager

ResourceManager介绍

暂无

代码示例

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-mlner

/**
 * @param nonDefaultConfigValues a configuration file specifying non-default parameters for the
 *        NER model to use
 * @param viewName indicates the view name, and hence the model, that you wish to use. If you
 *        specify {@link ViewNames#NER_CONLL} or {@link ViewNames#NER_ONTONOTES}, This name will
 *        be used when creating Views in TextAnnotation objects.
 */
public NERAnnotator(String nonDefaultConfigValues, String viewName) throws IOException {
  this(new ResourceManager(nonDefaultConfigValues), viewName);
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-corpusreaders

/**
 * ResourceManager must specify the fields {@link CorpusReaderConfigurator}.CORPUS_NAME and
 * .CORPUS_DIRECTORY, plus whatever is required by the derived class for initializeReader().
 *
 * @param rm ResourceManager
 * @throws Exception
 */
public AbstractIncrementalXmlCorpusReader(ResourceManager rm) throws Exception {
  this.resourceManager = rm;
  corpusName = rm.getString(CorpusReaderConfigurator.CORPUS_NAME);
}

代码示例来源:origin: CogComp/cogcomp-nlp

/**
 * Create a new curator client pointing to the specified host and port. The client that this
 * constructor creates will use the names in
 * {@link edu.illinois.cs.cogcomp.core.datastructures.ViewNames} for the various annotators when
 * calling the curator.
 *
 * @param rm The {@link ResourceManager} containing the properties for Curator
 */
public CuratorClient(ResourceManager rm) {
  this.curatorHost = rm.getString(CuratorConfigurator.CURATOR_HOST);
  this.curatorPort = rm.getInt(CuratorConfigurator.CURATOR_PORT);
  this.respectTokenization = rm.getBoolean(CuratorConfigurator.RESPECT_TOKENIZATION);
  this.forceUpdate = rm.getBoolean(CuratorConfigurator.CURATOR_FORCE_UPDATE);
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-datalessclassification

public DatalessClassifierML(ResourceManager config, ConceptTree<T> conceptTree) {
  this.conceptTree = conceptTree;
  this.bottomUp = config.getBoolean(DatalessConfigurator.BottomUp_Inference.key);
  this.classifierThreshold = config.getDouble(DatalessConfigurator.classifierThreshold.key);
  this.classifierLeastK = config.getInt(DatalessConfigurator.classifierLeastK.key);
  this.classifierMaxK = config.getInt(DatalessConfigurator.classifierMaxK.key);
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-phrasesim

private PhraseSim(ResourceManager config ) throws FileNotFoundException {
  loadParagram( config.getString( PhraseSimConfigurator.PARAGRAM_PATH.key ),
      config.getInt( PhraseSimConfigurator.VECTOR_DIM.key ) );
  unknownValue = config.getDouble( PhraseSimConfigurator.UNKNOWN_VALUE.key );
  zeroArray = new double[ dimension ];
  Arrays.fill( zeroArray, 0.0 );
}

代码示例来源:origin: CogComp/cogcomp-nlp

public LLMStringSim(String config) {
  try {
    rm_ = new ResourceManager(config);
    llm = new LlmStringComparator(rm_);
  } catch (IllegalArgumentException | IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
  ResourceManager fullRm = new SimConfigurator().getConfig(rm_);
  preprocess = new Preprocess();
  if (fullRm.getBoolean(SimConfigurator.USE_NE_COMPARISON.key)) {
    preprocess.initializeNER();
  }
  String phrases = fullRm.getString(SimConfigurator.PHRASE_DICT.key);
  list = new PhraseList(phrases);
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-ner

/**
 * Default behavior is to use lazy initialization; override with ResourceManager entry per the
 * Configurator property {@link AnnotatorConfigurator#IS_LAZILY_INITIALIZED}
 *
 * @param nonDefaultRm specify properties to override defaults, including lazy initialization
 * @param viewName name of the view to add to the TextAnnotation (and for client to request)
 */
public NERAnnotator(ResourceManager nonDefaultRm, String viewName) {
  super(viewName, new String[]{}, nonDefaultRm.getBoolean(
      AnnotatorConfigurator.IS_LAZILY_INITIALIZED.key, Configurator.TRUE), nonDefaultRm);
}

代码示例来源:origin: CogComp/cogcomp-nlp

/**
 * reads parameters from configuration file named by m_propertiesFile loads
 * stopwords, sets xmlrpc client if appropriate
 * 
 * @throws IllegalArgumentException
 * @throws IOException
 */
protected void configure(ResourceManager rm_) throws IllegalArgumentException, IOException {
  // boolean useWordSim = rm_.getBoolean(Constants.USE_WORDSIM); // if
  // false, use WNSim (older
  // package)
  entailmentThreshold = rm_.getDouble(SimConfigurator.WORD_ENTAILMENT_THRESHOLD.key);
  computeSimpleScore = rm_.getBoolean(SimConfigurator.USE_SIMPLE_SCORE.key);
  String wordComparator = rm_.getString(SimConfigurator.WORD_METRIC);
  wordSim = new WordSim(rm_, wordComparator);
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-comparison

/**
 * the preferred way to instantiate an object of this class. Specify any non-default values in the
 *    resourceManager argument, and the remaining values will be set using RteReaderConfigurator.
 *
 * @param nonDefaultConfig
 */
public RteCorpusHandler( ResourceManager nonDefaultConfig )
{
  ResourceManager fullConfig = new RteReaderConfigurator().getConfig( nonDefaultConfig );
  String corpusId = fullConfig.getString( RteReaderConfigurator.CORPUS_NAME );
  Set<String> props = fullConfig.getProperties().stringPropertyNames();
  Map<String,String> rteTags = new HashMap<String, String>();
  for ( String key : props )
    rteTags.put( key, fullConfig.getString( key ) );
  initialize( corpusId, rteTags );
}

代码示例来源:origin: CogComp/cogcomp-nlp

public MemoryBasedESA(ResourceManager config) {
  this(config.getInt(ESADatalessConfigurator.ESA_DIM));
}

代码示例来源:origin: CogComp/cogcomp-nlp

public double getDouble(Property property) {
  return getDouble(property.key);
}

代码示例来源:origin: CogComp/cogcomp-nlp

public CommaProperties() throws IOException {
  super(new CommaSRLConfigurator().getDefaultConfig().getProperties());
}

代码示例来源:origin: CogComp/cogcomp-nlp

/**
 * Default behavior is to use lazy initialization; override with ResourceManager entry per the
 * Configurator property {@link AnnotatorConfigurator#IS_LAZILY_INITIALIZED}
 *
 * @param nonDefaultRm specify properties to override defaults, including lazy initialization
 * @param viewName name of the view to add to the TextAnnotation (and for client to request)
 */
public NERAnnotator(ResourceManager nonDefaultRm, String viewName) {
  super(viewName, new String[]{}, nonDefaultRm.getBoolean(
      AnnotatorConfigurator.IS_LAZILY_INITIALIZED.key, Configurator.TRUE), nonDefaultRm);
}

代码示例来源:origin: CogComp/cogcomp-nlp

public DatalessClassifierML(ResourceManager config, ConceptTree<T> conceptTree) {
  this.conceptTree = conceptTree;
  this.bottomUp = config.getBoolean(DatalessConfigurator.BottomUp_Inference.key);
  this.classifierThreshold = config.getDouble(DatalessConfigurator.classifierThreshold.key);
  this.classifierLeastK = config.getInt(DatalessConfigurator.classifierLeastK.key);
  this.classifierMaxK = config.getInt(DatalessConfigurator.classifierMaxK.key);
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-core-utilities

public int getInt(Property property) {
  return getInt(property.key);
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-core-utilities

public double getDouble(Property property) {
  return getDouble(property.key);
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-comma

public CommaProperties() throws IOException {
  super(new CommaSRLConfigurator().getDefaultConfig().getProperties());
}

代码示例来源:origin: CogComp/cogcomp-nlp

/**
 * explicitly declare whether lazy initialization should be used
 * 
 * @param viewName The name of the View this annotator will populate. This will be used to
 *        access the created view from the TextAnnotation holding it.
 * @param requiredViews The views that must be populated for this new view to be created.
 * @param isLazilyInitialized if 'true', defers the initialization of the derived class until
 *        getView() is called.
 */
public Annotator(String viewName, String[] requiredViews, boolean isLazilyInitialized) {
  this(viewName, requiredViews, isLazilyInitialized, new ResourceManager(new Properties()));
}

代码示例来源:origin: CogComp/cogcomp-nlp

/**
 * define some commonly used config value getters
 */
public String getCuratorHost() {
  return getString(CoreConfigNames.CURATOR_HOST);
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-curator

/**
 * Create a new curator client pointing to the specified host and port. The client that this
 * constructor creates will use the names in
 * {@link edu.illinois.cs.cogcomp.core.datastructures.ViewNames} for the various annotators when
 * calling the curator.
 *
 * @param rm The {@link ResourceManager} containing the properties for Curator
 */
public CuratorClient(ResourceManager rm) {
  this.curatorHost = rm.getString(CuratorConfigurator.CURATOR_HOST);
  this.curatorPort = rm.getInt(CuratorConfigurator.CURATOR_PORT);
  this.respectTokenization = rm.getBoolean(CuratorConfigurator.RESPECT_TOKENIZATION);
  this.forceUpdate = rm.getBoolean(CuratorConfigurator.CURATOR_FORCE_UPDATE);
}

相关文章