public class SieveCoreferenceSystem
extends java.lang.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 |
---|---|
java.lang.String |
conllMentionEvalScript
Path for the official CoNLL scorer
|
static java.util.logging.Logger |
logger
A logger for this class.
|
Constructor and Description |
---|
SieveCoreferenceSystem(java.util.Properties props) |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkClusters(java.util.logging.Logger logger,
java.lang.String tag,
Document document) |
java.util.Map<java.lang.Integer,CorefChain> |
coref(Document document)
Extracts coreference clusters.
|
java.util.Map<java.lang.Integer,CorefChain> |
corefReturnHybridOutput(Document document) |
static void |
debugPrintMentions(java.io.PrintStream out,
java.lang.String tag,
java.util.List<java.util.List<Mention>> mentions) |
Dictionaries |
dictionaries() |
boolean |
doScore() |
static java.util.List<java.util.List<Mention>> |
filterMentionsWithSingletonClusters(Document document,
java.util.List<java.util.List<Mention>> mentions)
Remove singleton clusters
|
static java.lang.String |
getConllEvalSummary(java.lang.String conllMentionEvalScript,
java.lang.String goldFile,
java.lang.String predictFile) |
static java.util.List<Pair<IntTuple,IntTuple>> |
getLinks(java.util.Map<java.lang.Integer,CorefChain> result) |
static LogisticClassifier<java.lang.String,java.lang.String> |
getSingletonPredictorFromSerializedFile(java.lang.String serializedFile) |
static java.lang.String |
initializeAndRunCoref(java.util.Properties props)
Returns the name of the log file that this method writes.
|
void |
initScorers() |
static void |
main(java.lang.String[] args)
Needs the following properties:
-props 'Location of coref.properties'
|
void |
optimizeSieveOrdering(MentionExtractor mentionExtractor,
java.util.Properties props,
java.lang.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,
java.io.PrintWriter writer,
boolean gold) |
static void |
printConllOutput(Document document,
java.io.PrintWriter writer,
boolean gold,
boolean filterSingletons) |
void |
printF1(boolean printF1First) |
protected static void |
printList(java.util.logging.Logger logger,
java.lang.String... args) |
void |
printTopK(java.util.logging.Logger logger,
Document document,
Semantics semantics)
Print logs for error analysis
|
static double |
runAndScoreCoref(SieveCoreferenceSystem corefSystem,
MentionExtractor mentionExtractor,
java.util.Properties props,
java.lang.String timeStamp) |
static void |
runAndScoreCorefDist(java.lang.String runDistCmd,
java.util.Properties props,
java.lang.String propsFile)
Run and score coref distributed
|
static void |
runConllEval(java.lang.String conllMentionEvalScript,
java.lang.String goldFile,
java.lang.String predictFile,
java.lang.String evalFile,
java.lang.String errFile) |
Semantics |
semantics() |
java.lang.String |
sieveClassName(int sieveIndex) |
public static final java.util.logging.Logger logger
public final java.lang.String conllMentionEvalScript
public SieveCoreferenceSystem(java.util.Properties props) throws java.lang.Exception
java.lang.Exception
public void initScorers()
public boolean doScore()
public Dictionaries dictionaries()
public Semantics semantics()
public java.lang.String sieveClassName(int sieveIndex)
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public static java.lang.String initializeAndRunCoref(java.util.Properties props) throws java.lang.Exception
java.lang.Exception
public static double runAndScoreCoref(SieveCoreferenceSystem corefSystem, MentionExtractor mentionExtractor, java.util.Properties props, java.lang.String timeStamp) throws java.lang.Exception
java.lang.Exception
public static void runAndScoreCorefDist(java.lang.String runDistCmd, java.util.Properties props, java.lang.String propsFile) throws java.lang.Exception
java.lang.Exception
public void optimizeSieveOrdering(MentionExtractor mentionExtractor, java.util.Properties props, java.lang.String timestamp) throws java.lang.Exception
java.lang.Exception
public java.util.Map<java.lang.Integer,CorefChain> coref(Document document) throws java.lang.Exception
java.lang.Exception
public java.util.Map<java.lang.Integer,CorefChain> corefReturnHybridOutput(Document document) throws java.lang.Exception
java.lang.Exception
public static LogisticClassifier<java.lang.String,java.lang.String> getSingletonPredictorFromSerializedFile(java.lang.String serializedFile)
public static java.util.List<java.util.List<Mention>> filterMentionsWithSingletonClusters(Document document, java.util.List<java.util.List<Mention>> mentions)
public static void runConllEval(java.lang.String conllMentionEvalScript, java.lang.String goldFile, java.lang.String predictFile, java.lang.String evalFile, java.lang.String errFile) throws java.io.IOException
java.io.IOException
public static java.lang.String getConllEvalSummary(java.lang.String conllMentionEvalScript, java.lang.String goldFile, java.lang.String predictFile) throws java.io.IOException
java.io.IOException
public void printTopK(java.util.logging.Logger logger, Document document, Semantics semantics)
public void printF1(boolean printF1First)
protected static void printList(java.util.logging.Logger logger, java.lang.String... args)
public static void printConllOutput(Document document, java.io.PrintWriter writer, boolean gold)
public static void printConllOutput(Document document, java.io.PrintWriter writer, boolean gold, boolean filterSingletons)
public static java.util.List<Pair<IntTuple,IntTuple>> getLinks(java.util.Map<java.lang.Integer,CorefChain> result)
public static void debugPrintMentions(java.io.PrintStream out, java.lang.String tag, java.util.List<java.util.List<Mention>> mentions)
public static boolean checkClusters(java.util.logging.Logger logger, java.lang.String tag, Document document)