All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.stanford.nlp.coref.neural.NeuralCorefProperties Maven / Gradle / Ivy

Go to download

Stanford CoreNLP provides a set of natural language analysis tools which can take raw English language text input and give the base forms of words, their parts of speech, whether they are names of companies, people, etc., normalize dates, times, and numeric quantities, mark up the structure of sentences in terms of phrases and word dependencies, and indicate which noun phrases refer to the same entities. It provides the foundational building blocks for higher level text understanding applications.

There is a newer version: 4.5.7
Show newest version
package edu.stanford.nlp.coref.neural;

import java.util.Locale;
import java.util.Properties;

import edu.stanford.nlp.coref.CorefProperties;
import edu.stanford.nlp.util.PropertiesUtils;

/**
 * Manages the properties for training and running neural coreference systems.
 * @author Kevin Clark
 */
public class NeuralCorefProperties {
  public static double greedyness(Properties props) {
    return PropertiesUtils.getDouble(props, "coref.neural.greedyness", 0.5);
  }

  public static String modelPath(Properties props) {
    String defaultPath = "edu/stanford/nlp/models/coref/neural/" +
        (CorefProperties.getLanguage(props) == Locale.CHINESE ? "chinese" : "english") +
        (CorefProperties.conll(props) ? "-model-conll" : "-model-default") + ".ser.gz";
    return PropertiesUtils.getString(props, "coref.neural.modelPath", defaultPath);
  }

  public static String pretrainedEmbeddingsPath(Properties props) {
    String defaultPath = "edu/stanford/nlp/models/coref/neural/" +
        (CorefProperties.getLanguage(props) == Locale.CHINESE ? "chinese" : "english") +
        "-embeddings.ser.gz";
    return PropertiesUtils.getString(props, "coref.neural.embeddingsPath", defaultPath);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy