uk.ac.essex.malexa.nlp.dp.GuiTAR
Interface DiscourseModel

All Known Implementing Classes:
DiscourseModelImplementer

public interface DiscourseModel

This interface defines the API of the Discourse Model employed by GuiTAR.

Version:
1.1
Author:
Mijail A. Kabadjov

Method Summary
 Map getAnaphorToAntecedentMap()
          Returns the data structure (Map) that holds the anaphor-to-antecedent mappings.
 Object getAntecedent(Object anaphorId)
          Retrieves the refId of the antecedent of anaphorId.
 Vector getCfs(Utterance utt)
          Returns the forward-looking centers within the given utterance.
 DiscourseEntity getDiscourseEntity(Cf cf)
          Retrieves the Discourse Entity, which cf is a realization of.
 int getDistance(Object refId1, Object refId2, String tagName)
          Returns the distance between the referential expression identified by refId1, and the one identified by refId2.
 Document getDOMDocument()
          Returns the pointer to the DOM Document of this DiscourseModel.
 Set getEquivalenceClass(int classIndex)
          Retrieves the equivalence class corresponding to classIndex.
 Set getEquivalenceClass(Object refId)
          Retrieves the equivalence class to which refId belongs.
 int getEquivalenceClassIndex(Object refId)
          Retrieves the index of the equivalence class to which refId belongs.
 String getEquivalenceClassString(int index)
          Returns all the members of the corresponding equivalence class separated by commas.
 String getEquivalenceClassString(Object refId)
          Returns all the members of the corresponding equivalence class separated by commas.
 DiscourseModel getFlatDM()
          Returns a flat Discourse Model built from the annotation.
 Utterance getNextUtterance(Utterance uttRef)
          Returns the utterance following the reference utterance in this Discourse Model.
 int getNumberOfAnaphoricReferences()
          Returns the number of (anaphoric) referential expressions in the discourse model.
 int getNumberOfEntities()
          Returns the number of entities contained in this discourse model.
 Utterance getPrevUtterance(Utterance uttRef)
          Returns the utterance preceeding the reference utterance in this Discourse Model.
 Segment getRootSegment()
          Returns the root segment of the physical Discourse Model.
 Set getSetOfAnaphors()
          Returns the set of anaphors stored in this discourse model.
 int getTimesMentioned(DiscourseEntity de)
          Returns the number of mentions of a given Discourse Entity, that is number of Cfs in its equivalence class.
 Vector getVectors(Object refId)
          Returns a vector of vectors in which this referential expression features.
 boolean isAnaphoric(Object refId)
          Checks whether the referential expression provided is anaphoric.
 void printEquivalenceClassesStatistics(DiscourseModel dm)
          Computes P/R per equivalence class on the basis of class intersection and with reference to this discourse model.
 void setAnaphoricLink(Object anaphorId, Object anteId)
          Inserts a new anaphoric link into the discourse model.
 void setAnaphoricLink(Object anaphorId, Object anteId, String relation)
          Inserts a new anaphoric link into the discourse model.
 void setFlatDM(DiscourseModel dm)
          Sets the pointer to a flat Discourse Model built from the annotation.
 String toString()
          Converts the Discourse Model contained in this object into a String.
 

Method Detail

isAnaphoric

public boolean isAnaphoric(Object refId)
Checks whether the referential expression provided is anaphoric.

Parameters:
refId - The id of a referential expression
Returns:
boolean True if the NP is anaphoric, false otherwise

getEquivalenceClass

public Set getEquivalenceClass(Object refId)
Retrieves the equivalence class to which refId belongs. If none it returns null.

Parameters:
refId - The id of a referential expression
Returns:
Set The set of refIds, members of the equivalence class being retrieved

getEquivalenceClass

public Set getEquivalenceClass(int classIndex)
Retrieves the equivalence class corresponding to classIndex. If an invalid classIndex has been provided it returns null.

Parameters:
classIndex - The index of the equivalence class to be returned
Returns:
Set The set of refIds, members of the equivalence class being retrieved

getDiscourseEntity

public DiscourseEntity getDiscourseEntity(Cf cf)
Retrieves the Discourse Entity, which cf is a realization of. If no such Discourse Entity, it returns null.

Parameters:
cf - The Cf for which a DE is to be retrieved
Returns:
DiscourseEntity The Discourse Entity corresponding to cf

getTimesMentioned

public int getTimesMentioned(DiscourseEntity de)
Returns the number of mentions of a given Discourse Entity, that is number of Cfs in its equivalence class.

Parameters:
de - The Discourse Entity
Returns:
int The number of mentions

getEquivalenceClassIndex

public int getEquivalenceClassIndex(Object refId)
Retrieves the index of the equivalence class to which refId belongs. If there is no matching class, it returns -1.

Parameters:
refId - The id of a referential expression
Returns:
int The index of the equivalence class to which refId belongs

getAntecedent

public Object getAntecedent(Object anaphorId)
Retrieves the refId of the antecedent of anaphorId.

Parameters:
anaphorId - The id of a referential expression used anaphorically
Returns:
Object The id of the expression which is coreferential with the one identified by anaphorId

getCfs

public Vector getCfs(Utterance utt)
Returns the forward-looking centers within the given utterance.

Parameters:
utt - The Utterance
Returns:
Vector The list of Cfs within the utterance

getNextUtterance

public Utterance getNextUtterance(Utterance uttRef)
Returns the utterance following the reference utterance in this Discourse Model.

Parameters:
uttRef - The reference utterance
Returns:
Utternace The next utterance

getPrevUtterance

public Utterance getPrevUtterance(Utterance uttRef)
Returns the utterance preceeding the reference utterance in this Discourse Model.

Parameters:
uttRef - The reference utterance
Returns:
Utternace The previous utterance

getDistance

public int getDistance(Object refId1,
                       Object refId2,
                       String tagName)
Returns the distance between the referential expression identified by refId1, and the one identified by refId2. The distance can be measured in terms of number of intermediate words (tagName=W), number of intermediate NEs (tagName=ne) or number of intermediate utterances

Parameters:
refId1 - The id of a referential expression
refId2 - The id of a referential expression
tagName - The tag name of the nodes to be accounted for between refId1 and refId2
Returns:
int The distance between the anaphor and the antecedent

getNumberOfEntities

public int getNumberOfEntities()
Returns the number of entities contained in this discourse model.

Returns:
int the number of entities in the discourse model

getNumberOfAnaphoricReferences

public int getNumberOfAnaphoricReferences()
Returns the number of (anaphoric) referential expressions in the discourse model.

Returns:
int the number of anaphoric references

getSetOfAnaphors

public Set getSetOfAnaphors()
Returns the set of anaphors stored in this discourse model.

Returns:
Set The set of anaphors

getVectors

public Vector getVectors(Object refId)
Returns a vector of vectors in which this referential expression features. (Every vector of those vectors matches a specific corpus NE)

Parameters:
refId - An Id of a referentail expression
Returns:
Vector The vector of vectors in which this referential expression features

getAnaphorToAntecedentMap

public Map getAnaphorToAntecedentMap()
Returns the data structure (Map) that holds the anaphor-to-antecedent mappings.

Returns:
Map The anaphor-to-antecedent mappings

getEquivalenceClassString

public String getEquivalenceClassString(Object refId)
Returns all the members of the corresponding equivalence class separated by commas.

Returns:
String Co-referential expressions separated by commas

getEquivalenceClassString

public String getEquivalenceClassString(int index)
Returns all the members of the corresponding equivalence class separated by commas.

Parameters:
index - The index of the equivalence class to be retrieved

printEquivalenceClassesStatistics

public void printEquivalenceClassesStatistics(DiscourseModel dm)
Computes P/R per equivalence class on the basis of class intersection and with reference to this discourse model. Equivalence classes which did not match any of the corpus classes are printed off at the end.

Parameters:
dm - The Discourse Model with which this dicourse model will be intersected

toString

public String toString()
Converts the Discourse Model contained in this object into a String.

Returns:
String A String representation of this Discourse Model

getRootSegment

public Segment getRootSegment()
Returns the root segment of the physical Discourse Model.

Returns:
Segment The root segment

getFlatDM

public DiscourseModel getFlatDM()
Returns a flat Discourse Model built from the annotation. (Used by the gold standard algorithm)

Returns:
DiscourseModel The flat DM

getDOMDocument

public Document getDOMDocument()
Returns the pointer to the DOM Document of this DiscourseModel. (Used by the gold standard algorithm)

Returns:
Document The DOM Document

setAnaphoricLink

public void setAnaphoricLink(Object anaphorId,
                             Object anteId,
                             String relation)
Inserts a new anaphoric link into the discourse model. In the flat version of the discourse model, which is constructed out of the annotation, anaphorId and anteId are usually Strings (i.e. ne237), whereas in the full version of the discourse model, which is to be constructed incrementally, they are object references of type Cf.

Parameters:
anaphorId - The id of the anaphor
anteId - The id of the antecedent of the anaphor
relation - The type of relation that holds between the anaphor and the antecedent (ident, poss-inv, etc.)

setAnaphoricLink

public void setAnaphoricLink(Object anaphorId,
                             Object anteId)
Inserts a new anaphoric link into the discourse model. This is a default version which assumes an "ident" relationship between the anaphor and the antecedent.

Parameters:
anaphorId - The id of the anaphor
anteId - The id of the antecedent of the anaphor

setFlatDM

public void setFlatDM(DiscourseModel dm)
Sets the pointer to a flat Discourse Model built from the annotation. (Used by the gold standard algorithm)

Parameters:
dm - The flat DM