|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.stanford.nlp.dcoref.MentionExtractor
public class MentionExtractor
Generic mention extractor from a corpus.
| Field Summary | |
|---|---|
protected java.lang.String |
currentDocumentID
|
protected Dictionaries |
dictionaries
|
protected HeadFinder |
headFinder
|
protected int |
maxID
The maximum mention ID: for preventing duplicated mention ID assignment |
CorefMentionFinder |
mentionFinder
|
protected Semantics |
semantics
|
protected LogisticClassifier<java.lang.String,java.lang.String> |
singletonPredictor
|
protected StanfordCoreNLP |
stanfordProcessor
|
static boolean |
VERBOSE
|
| Constructor Summary | |
|---|---|
MentionExtractor(Dictionaries dict,
Semantics semantics)
|
|
| Method Summary | |
|---|---|
Document |
arrange(Annotation anno,
java.util.List<java.util.List<CoreLabel>> words,
java.util.List<Tree> trees,
java.util.List<java.util.List<Mention>> unorderedMentions)
|
java.util.List<java.util.List<Mention>> |
arrange(Annotation anno,
java.util.List<java.util.List<CoreLabel>> words,
java.util.List<Tree> trees,
java.util.List<java.util.List<Mention>> unorderedMentions,
boolean doMergeLabels)
Post-processes the extracted mentions. |
Document |
arrange(Annotation anno,
java.util.List<java.util.List<CoreLabel>> words,
java.util.List<Tree> trees,
java.util.List<java.util.List<Mention>> unorderedMentions,
java.util.List<java.util.List<Mention>> unorderedGoldMentions,
boolean doMergeLabels)
|
static Tree |
findExactMatch(Tree tree,
int first,
int last)
Finds the tree the matches this span exactly |
protected int |
getHeadIndex(Tree t)
|
static void |
initializeUtterance(java.util.List<CoreLabel> tokens)
|
protected static StanfordCoreNLP |
loadStanfordProcessor(java.util.Properties props)
Load Stanford Processor: skip unnecessary annotator |
static void |
mergeLabels(Tree tree,
java.util.List<CoreLabel> sentence)
Sets the label of the leaf nodes to be the CoreLabels in the given sentence The original value() of the Tree nodes is preserved |
Document |
nextDoc()
Extracts the info relevant for coref from the next document in the corpus |
void |
resetDocs()
Reset so that we start at the beginning of the document collection |
void |
setMentionFinder(CorefMentionFinder mentionFinder)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final HeadFinder headFinder
protected java.lang.String currentDocumentID
protected final Dictionaries dictionaries
protected final Semantics semantics
public CorefMentionFinder mentionFinder
protected StanfordCoreNLP stanfordProcessor
protected LogisticClassifier<java.lang.String,java.lang.String> singletonPredictor
protected int maxID
public static final boolean VERBOSE
| Constructor Detail |
|---|
public MentionExtractor(Dictionaries dict,
Semantics semantics)
| Method Detail |
|---|
public void setMentionFinder(CorefMentionFinder mentionFinder)
public Document nextDoc()
throws java.lang.Exception
java.lang.Exceptionpublic void resetDocs()
public Document arrange(Annotation anno,
java.util.List<java.util.List<CoreLabel>> words,
java.util.List<Tree> trees,
java.util.List<java.util.List<Mention>> unorderedMentions)
throws java.lang.Exception
java.lang.Exceptionprotected int getHeadIndex(Tree t)
public Document arrange(Annotation anno,
java.util.List<java.util.List<CoreLabel>> words,
java.util.List<Tree> trees,
java.util.List<java.util.List<Mention>> unorderedMentions,
java.util.List<java.util.List<Mention>> unorderedGoldMentions,
boolean doMergeLabels)
throws java.lang.Exception
java.lang.Exception
public java.util.List<java.util.List<Mention>> arrange(Annotation anno,
java.util.List<java.util.List<CoreLabel>> words,
java.util.List<Tree> trees,
java.util.List<java.util.List<Mention>> unorderedMentions,
boolean doMergeLabels)
throws java.lang.Exception
words - List of words in each sentence, in textual ordertrees - List of trees, one per sentenceunorderedMentions - List of unordered, unprocessed mentions
Each mention MUST have startIndex and endIndex set!
Optionally, if scoring is desired, mentions must have mentionID and originalRef set.
All the other Mention fields are set here.
java.lang.Exception
public static void mergeLabels(Tree tree,
java.util.List<CoreLabel> sentence)
public static Tree findExactMatch(Tree tree,
int first,
int last)
tree - Leaves must be indexed!first - First element in the span (first position has offset 1)last - Last element included in the span (first position has offset 1)protected static StanfordCoreNLP loadStanfordProcessor(java.util.Properties props)
public static void initializeUtterance(java.util.List<CoreLabel> tokens)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||