edu.stanford.nlp.ie.merge
Class AbstractInstanceMerger

java.lang.Object
  |
  +--edu.stanford.nlp.ie.merge.AbstractInstanceMerger
All Implemented Interfaces:
InstanceMerger, Serializable
Direct Known Subclasses:
GenericMerger

public abstract class AbstractInstanceMerger
extends Object
implements InstanceMerger, Serializable

Class for combining together partial instances of (presumeably) the same entity.

See Also:
Serialized Form

Constructor Summary
AbstractInstanceMerger()
           
 
Method Summary
protected abstract  double getMergedRank(edu.unika.aifb.kaon.Instance i1, edu.unika.aifb.kaon.Instance i2, Confidence c1, Confidence c2)
          Returns the rank of the resulting Instance arising from merging the two input Instances.
protected abstract  double getRank(edu.unika.aifb.kaon.Instance i, Confidence c)
          Returns the rank of an Instance, which should measure how good a description of the entity the Instance is.
protected  boolean isEmpty(edu.unika.aifb.kaon.Instance i)
          Indicates whether the Instance has no fields that contain relational information.
protected abstract  edu.unika.aifb.kaon.Instance merge(edu.unika.aifb.kaon.Instance i1, edu.unika.aifb.kaon.Instance i2, Confidence c1, Confidence c2, Confidence resultingConfidence)
          Merges the two Instances.
 void storeMerger(File out)
          Serializes this FieldExtractor to the given output file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.stanford.nlp.ie.merge.InstanceMerger
compatibleConcept, getBestInstance, getMergedInstances
 

Constructor Detail

AbstractInstanceMerger

public AbstractInstanceMerger()
Method Detail

isEmpty

protected boolean isEmpty(edu.unika.aifb.kaon.Instance i)
Indicates whether the Instance has no fields that contain relational information. This class can be overridden if there are, for example, certain fields that always contain information that should be ignored.

Parameters:
i - the Instance to check for emptiness
Returns:
true if the Instance contains no instantiated relations

getRank

protected abstract double getRank(edu.unika.aifb.kaon.Instance i,
                                  Confidence c)
Returns the rank of an Instance, which should measure how good a description of the entity the Instance is. For example, this can be based on the number of relational fields that are filled. Higher ranked Instances indicate better descriptions.

Parameters:
i - the Instance to check
c - the parallel Confidence object that stores field-level confidence rankings for the particular object
Returns:
a number indicating the rank of the Instance

getMergedRank

protected abstract double getMergedRank(edu.unika.aifb.kaon.Instance i1,
                                        edu.unika.aifb.kaon.Instance i2,
                                        Confidence c1,
                                        Confidence c2)
Returns the rank of the resulting Instance arising from merging the two input Instances. Note this is not the same as applying getRank on the resulting Instance, because presumeably conflicting fields between the two Instances should have a negative impact.


merge

protected abstract edu.unika.aifb.kaon.Instance merge(edu.unika.aifb.kaon.Instance i1,
                                                      edu.unika.aifb.kaon.Instance i2,
                                                      Confidence c1,
                                                      Confidence c2,
                                                      Confidence resultingConfidence)
Merges the two Instances. The resulting Instance should be described by the resultingConfidence object, i.e., a modified resultingConfidence is implicitly returned as well.

Parameters:
i1 - one Instance to merge
i2 - the other Instance to merge
c1 - the Confidence corresponding to i1
c2 - the Confidence corresponding to i2
resultingConfidence - the Confidence corresponding to the returned Instance; this must be passed in initialized
Returns:
the new Instance created by merging

storeMerger

public void storeMerger(File out)
                 throws IOException
Serializes this FieldExtractor to the given output file.

Specified by:
storeMerger in interface InstanceMerger
Throws:
an - IOException if there is a problem with serialization (e.g. if it can't get write permission to the given File.
IOException


Stanford NLP Group