/
CorefAlgorithm.java
43 lines (36 loc) · 1.6 KB
/
CorefAlgorithm.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package edu.stanford.nlp.coref;
import java.util.Properties;
import edu.stanford.nlp.coref.CorefProperties.CorefAlgorithmType;
import edu.stanford.nlp.coref.data.Dictionaries;
import edu.stanford.nlp.coref.data.Document;
//import edu.stanford.nlp.coref.hybrid.HybridCorefSystem;
import edu.stanford.nlp.coref.neural.NeuralCorefAlgorithm;
//import edu.stanford.nlp.coref.statistical.ClusteringCorefAlgorithm;
//import edu.stanford.nlp.coref.statistical.StatisticalCorefAlgorithm;
/**
* A CorefAlgorithms makes coreference decisions on the provided {@link Document} after
* mention detection has been performed
* @author Kevin Clark
*/
public interface CorefAlgorithm {
public void runCoref(Document document);
/*public static CorefAlgorithm fromProps(Properties props, Dictionaries dictionaries) {
CorefAlgorithmType algorithm = CorefProperties.algorithm(props);
if (algorithm == CorefAlgorithmType.CLUSTERING) {
return new ClusteringCorefAlgorithm(props, dictionaries);
} else if (algorithm == CorefAlgorithmType.STATISTICAL) {
return new StatisticalCorefAlgorithm(props, dictionaries);
} else if (algorithm == CorefAlgorithmType.NEURAL) {
return new NeuralCorefAlgorithm(props, dictionaries);
} else {
try {
return new HybridCorefSystem(props, dictionaries);
} catch (Exception e) {
throw new RuntimeException("Error creating hybrid coref system", e);
}
}
}*/
public static CorefAlgorithm fromProps(Properties props, Dictionaries dictionaries) {
return new NeuralCorefAlgorithm(props, dictionaries);
}
}