Search in sources :

Example 1 with Dataset

use of edu.stanford.nlp.coref.CorefProperties.Dataset in project CoreNLP by stanfordnlp.

the class FastNeuralCorefDataExporter method main.

public static void main(String[] args) throws Exception {
    Properties props = StringUtils.argsToProperties(args);
    props.setProperty("coref.maxMentionDistance", "50");
    props.setProperty("coref.maxMentionDistanceWithStringMatch", "1000");
    props.setProperty("coref.conllOutputPath", "/Users/kevinclark/Programming/research/coref/conll-2012/output");
    props.setProperty("coref.data", "/Users/kevinclark/Programming/research/coref/conll-2012");
    props.setProperty("coref.scorer", "/Users/kevinclark/Programming/research/coref/conll-2012/scorer/v8.01/scorer.pl");
    Dictionaries dictionaries = new Dictionaries(props);
    String outputPath = "/Users/kevinclark/Programming/research/coref/data";
    String dataPath = outputPath + "/raw/";
    String goldClusterPath = outputPath + "/gold/";
    String compressorPath = outputPath + "/";
    IOUtils.ensureDir(new File(outputPath));
    IOUtils.ensureDir(new File(dataPath));
    IOUtils.ensureDir(new File(goldClusterPath));
    IOUtils.ensureDir(new File(compressorPath));
    Compressor<String> compressor = new Compressor<String>();
    for (Dataset dataset : Arrays.asList(Dataset.TRAIN, Dataset.DEV, Dataset.TEST)) {
        CorefProperties.setInput(props, dataset);
        System.out.println(CorefProperties.getInputPath(props));
        new FastNeuralCorefDataExporter(props, dictionaries, compressor, dataPath + dataset.toString().toLowerCase(), goldClusterPath + dataset.toString().toLowerCase()).run(props, dictionaries);
    }
    writeCompressor(compressor, compressorPath + "/compression");
}
Also used : Dictionaries(edu.stanford.nlp.coref.data.Dictionaries) Dataset(edu.stanford.nlp.coref.CorefProperties.Dataset) Compressor(edu.stanford.nlp.coref.statistical.Compressor) Properties(java.util.Properties) StatisticalCorefProperties(edu.stanford.nlp.coref.statistical.StatisticalCorefProperties) CorefProperties(edu.stanford.nlp.coref.CorefProperties) File(java.io.File)

Aggregations

CorefProperties (edu.stanford.nlp.coref.CorefProperties)1 Dataset (edu.stanford.nlp.coref.CorefProperties.Dataset)1 Dictionaries (edu.stanford.nlp.coref.data.Dictionaries)1 Compressor (edu.stanford.nlp.coref.statistical.Compressor)1 StatisticalCorefProperties (edu.stanford.nlp.coref.statistical.StatisticalCorefProperties)1 File (java.io.File)1 Properties (java.util.Properties)1