edu.stanford.nlp.ie.machinereading.structure
Class ExtractionObject

java.lang.Object
  extended by edu.stanford.nlp.ie.machinereading.structure.ExtractionObject
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
EntityMention, RelationMention

public class ExtractionObject
extends java.lang.Object
implements java.io.Serializable

Represents any object that can be extracted - entity, relation, event

Author:
Andrey Gusev, Mihai
See Also:
Serialized Form

Field Summary
protected  CoreMap attributeMap
          This stores any optional attributes of ExtractionObjects
protected  Span extentTokenSpan
          Maximal token span relevant for this object, e.g., the largest NP for an entity mention The offsets are relative to the sentence that contains this object
protected  java.lang.String objectId
          Unique identifier of the object in its document
protected  CoreMap sentence
          Sentence that contains this object This assumes that each extraction object is intra-sentential (true in ACE, Roth, BioNLP, MR)
protected  java.lang.String subType
          Subtype, if available, e.g., GPE.CITY
protected  java.lang.String type
          Type of this mention, e.g., GPE
protected  Counter<java.lang.String> typeProbabilities
          Probabilities associated with this object We report probability values for each possible type for this object
 
Constructor Summary
ExtractionObject(java.lang.String objectId, CoreMap sentence, Span span, java.lang.String type, java.lang.String subtype)
           
 
Method Summary
 CoreMap attributeMap()
           
static java.lang.String concatenateTypes(java.lang.String t1, java.lang.String t2)
          Concatenates two types
 boolean equals(java.lang.Object other)
           
 java.lang.String getDocumentId()
           
 Span getExtent()
           
 java.lang.String getExtentString()
           
 int getExtentTokenEnd()
           
 int getExtentTokenStart()
           
 java.lang.String getFullValue()
          Always returns the text corresponding to the extent of this object, even when getValue is overridden by subclass.
 java.lang.String getObjectId()
           
 CoreMap getSentence()
           
static Span getSpan(ExtractionObject... objs)
          Returns the smallest span that covers the extent of all these objects
 java.lang.String getSubType()
           
 java.lang.String getType()
           
 Counter<java.lang.String> getTypeProbabilities()
           
 java.lang.String getValue()
          Returns the text corresponding to the extent of this object
 boolean printableObject(double beam, java.lang.String nilLabel)
          Returns true if it's worth saving/printing this object This happens in two cases: 1.
 void setExtent(Span s)
           
 void setSentence(CoreMap sent)
           
 void setType(java.lang.String t)
           
 void setTypeProbabilities(Counter<java.lang.String> probs)
           
static void sortByExtent(java.util.List<ExtractionObject> objects)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

objectId

protected final java.lang.String objectId
Unique identifier of the object in its document


sentence

protected CoreMap sentence
Sentence that contains this object This assumes that each extraction object is intra-sentential (true in ACE, Roth, BioNLP, MR)


type

protected java.lang.String type
Type of this mention, e.g., GPE


subType

protected final java.lang.String subType
Subtype, if available, e.g., GPE.CITY


extentTokenSpan

protected Span extentTokenSpan
Maximal token span relevant for this object, e.g., the largest NP for an entity mention The offsets are relative to the sentence that contains this object


attributeMap

protected CoreMap attributeMap
This stores any optional attributes of ExtractionObjects


typeProbabilities

protected Counter<java.lang.String> typeProbabilities
Probabilities associated with this object We report probability values for each possible type for this object

Constructor Detail

ExtractionObject

public ExtractionObject(java.lang.String objectId,
                        CoreMap sentence,
                        Span span,
                        java.lang.String type,
                        java.lang.String subtype)
Method Detail

getObjectId

public java.lang.String getObjectId()

getDocumentId

public java.lang.String getDocumentId()

getSentence

public CoreMap getSentence()

setSentence

public void setSentence(CoreMap sent)

getExtentTokenStart

public int getExtentTokenStart()

getExtentTokenEnd

public int getExtentTokenEnd()

getExtent

public Span getExtent()

setExtent

public void setExtent(Span s)

getExtentString

public java.lang.String getExtentString()

getType

public java.lang.String getType()

getSubType

public java.lang.String getSubType()

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

sortByExtent

public static void sortByExtent(java.util.List<ExtractionObject> objects)

getSpan

public static Span getSpan(ExtractionObject... objs)
Returns the smallest span that covers the extent of all these objects

Parameters:
objs -

getValue

public java.lang.String getValue()
Returns the text corresponding to the extent of this object


getFullValue

public final java.lang.String getFullValue()
Always returns the text corresponding to the extent of this object, even when getValue is overridden by subclass.


setType

public void setType(java.lang.String t)

concatenateTypes

public static java.lang.String concatenateTypes(java.lang.String t1,
                                                java.lang.String t2)
Concatenates two types

Parameters:
t1 -
t2 -

attributeMap

public CoreMap attributeMap()

setTypeProbabilities

public void setTypeProbabilities(Counter<java.lang.String> probs)

getTypeProbabilities

public Counter<java.lang.String> getTypeProbabilities()

printableObject

public boolean printableObject(double beam,
                               java.lang.String nilLabel)
Returns true if it's worth saving/printing this object This happens in two cases: 1. The type of the object is not nilLabel 2. The type of the object is nilLabel but the second ranked label is within the given beam (0 -- 100) of the first choice

Parameters:
beam -
nilLabel -


Stanford NLP Group