public class SieveCoreferenceSystem extends Object
The main entry point for API is coref(Document document). The output is a map from CorefChain ID to corresponding CorefChain.
Modifier and Type | Field and Description |
---|---|
String |
conllMentionEvalScript
Path for the official CoNLL scorer
|
static Logger |
logger |
Constructor and Description |
---|
SieveCoreferenceSystem(Properties props) |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkClusters(Logger logger,
String tag,
Document document) |
Map<Integer,CorefChain> |
coref(Document document)
Extracts coreference clusters.
|
static void |
debugPrintMentions(PrintStream out,
String tag,
List<List<Mention>> mentions) |
Dictionaries |
dictionaries() |
boolean |
doScore() |
static List<List<Mention>> |
filterMentionsWithSingletonClusters(Document document,
List<List<Mention>> mentions)
Remove singleton clusters
|
static String |
formatPennTree(Tree parseTree)
For printing tree in a better format
|
static String |
getConllEvalSummary(String conllMentionEvalScript,
String goldFile,
String predictFile) |
static List<Pair<IntTuple,IntTuple>> |
getLinks(Map<Integer,CorefChain> result) |
static LogisticClassifier<String,String> |
getSingletonPredictorFromSerializedFile(String serializedFile) |
static String |
initializeAndRunCoref(Properties props)
Returns the name of the log file that this method writes.
|
void |
initScorers() |
static void |
main(String[] args)
Needs the following properties:
-props 'Location of coref.properties'
|
void |
optimizeSieveOrdering(MentionExtractor mentionExtractor,
Properties props,
String timestamp)
Given a set of sieves, select an optimal ordering for the sieves
by iterating over sieves, and selecting the one that gives the best score and
adding sieves one at a time until no more sieves left
|
static void |
printConllOutput(Document document,
PrintWriter writer,
boolean gold) |
static void |
printConllOutput(Document document,
PrintWriter writer,
boolean gold,
boolean filterSingletons) |
static void |
printConllOutput(Document document,
PrintWriter writer,
List<List<Mention>> orderedMentions,
boolean gold) |
void |
printF1(boolean printF1First) |
protected static void |
printList(Logger logger,
String... args) |
static void |
printRawDoc(Document document,
boolean gold)
Print raw document for analysis
|
void |
printTopK(Logger logger,
Document document,
Semantics semantics)
Print logs for error analysis
|
static double |
runAndScoreCoref(SieveCoreferenceSystem corefSystem,
MentionExtractor mentionExtractor,
Properties props,
String timeStamp) |
static void |
runAndScoreCorefDist(String runDistCmd,
Properties props,
String propsFile)
Run and score coref distributed
|
static void |
runConllEval(String conllMentionEvalScript,
String goldFile,
String predictFile,
String evalFile,
String errFile) |
Semantics |
semantics() |
String |
sieveClassName(int sieveIndex) |
static String |
signature(Properties props) |
public static final Logger logger
public final String conllMentionEvalScript
public SieveCoreferenceSystem(Properties props) throws Exception
Exception
public static String signature(Properties props)
public void initScorers()
public boolean doScore()
public Dictionaries dictionaries()
public Semantics semantics()
public String sieveClassName(int sieveIndex)
public static void main(String[] args) throws Exception
Exception
public static String initializeAndRunCoref(Properties props) throws Exception
Exception
public static double runAndScoreCoref(SieveCoreferenceSystem corefSystem, MentionExtractor mentionExtractor, Properties props, String timeStamp) throws Exception
Exception
public static void runAndScoreCorefDist(String runDistCmd, Properties props, String propsFile) throws Exception
Exception
public void optimizeSieveOrdering(MentionExtractor mentionExtractor, Properties props, String timestamp) throws Exception
Exception
public Map<Integer,CorefChain> coref(Document document) throws Exception
Exception
public static LogisticClassifier<String,String> getSingletonPredictorFromSerializedFile(String serializedFile)
public static List<List<Mention>> filterMentionsWithSingletonClusters(Document document, List<List<Mention>> mentions)
public static void runConllEval(String conllMentionEvalScript, String goldFile, String predictFile, String evalFile, String errFile) throws IOException
IOException
public static String getConllEvalSummary(String conllMentionEvalScript, String goldFile, String predictFile) throws IOException
IOException
public void printTopK(Logger logger, Document document, Semantics semantics)
public void printF1(boolean printF1First)
public static String formatPennTree(Tree parseTree)
public static void printConllOutput(Document document, PrintWriter writer, boolean gold)
public static void printConllOutput(Document document, PrintWriter writer, boolean gold, boolean filterSingletons)
public static void printConllOutput(Document document, PrintWriter writer, List<List<Mention>> orderedMentions, boolean gold)
public static void printRawDoc(Document document, boolean gold) throws FileNotFoundException
FileNotFoundException
public static void debugPrintMentions(PrintStream out, String tag, List<List<Mention>> mentions)