edu.stanford.nlp.ie
Class Confidence

java.lang.Object
  |
  +--edu.stanford.nlp.ie.Confidence

public class Confidence
extends Object

Meant to serve as a parallel structure to the KAON Instance. Confidence ratings are specifically used when two potentially compatible Instances are merged together but contain conflicting information -- if the confidence rating for field A is high in Instance X but low in Instance Y, then one might choose to use X's version of A over Y's.

To use a Confidence object, initialize it when the Instance is created. Confidence ratings for individual fields can be set by refering to the relation or the relation name. In addition, two global metrics per Confidence are supported -- a penalty and a global ranking -- neither of which are field-specific. The penalty can be used to keep track of things like field conflicts, while the overall ranking can keep track of search rank, for example. The paradigm is set up such that the overall "score" of a Confidence object (which is the overall score of the corresponding Instance) is the sum of the confidence rankings for each field, plus the global ranking, minus the penalty.


Constructor Summary
Confidence(edu.unika.aifb.kaon.Instance i)
          Creates a Confidence object based on the Instance passed in.
 
Method Summary
 double getConfidence(edu.unika.aifb.kaon.Relation r)
          Returns the confidence ranking for the particular field.
 double getConfidence(String relationName)
          Returns the confidence ranking for the particular field.
 double getConfidenceSum()
          Returns the sum of getConfidence called on all relations.
 double getGlobalRanking()
          The Confidence object can store an additional global confidence ranking, as decided by the merging functionality.
 double getPenalty()
          Similar to the global ranking, the penalty can be another piece of information relevant to the entire Instance rather than a particular field.
 void setConfidence(edu.unika.aifb.kaon.Relation r, double ranking)
          Set the confidence ranking for a field, specified by Relation.
 void setConfidence(String relationName, double ranking)
          Set the confidence ranking for a field, specified by Relation.
 void setGlobalRanking(double ranking)
          Sets the global confidence ranking field.
 void setPenalty(double p)
          Sets the penalty field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Confidence

public Confidence(edu.unika.aifb.kaon.Instance i)
           throws org.w3c.rdf.model.ModelException,
                  edu.unika.aifb.sitris.exception.NotSupportedException
Creates a Confidence object based on the Instance passed in. All relations, including inheritted ones, are extracted from the Instance's Concept and are stored in the Confidence object by their English labels along with space for a double. All confidence rankings are initialized to 0.

Method Detail

setConfidence

public void setConfidence(edu.unika.aifb.kaon.Relation r,
                          double ranking)
Set the confidence ranking for a field, specified by Relation. Should probably be (0.0, 1.0], but can conceivably be some other value. Any previous ranking is overwritten.

Parameters:
r - the Relation corresponding to the field that was filled in the parallel Instance
ranking - the confidence ranking

setConfidence

public void setConfidence(String relationName,
                          double ranking)
Set the confidence ranking for a field, specified by Relation. Should probably be (0.0, 1.0], but can conceivably be some other value. Any previous ranking is overwritten.

Parameters:
relationName - the Relation corresponding to the field that was filled in the parallel Instance
ranking - the confidence ranking

getConfidence

public double getConfidence(edu.unika.aifb.kaon.Relation r)
Returns the confidence ranking for the particular field.

Parameters:
r - the Relation to get the confidence value for
Returns:
the ranking or 0 if the relation doesn't exist or has not been ranked

getConfidence

public double getConfidence(String relationName)
Returns the confidence ranking for the particular field.

Parameters:
relationName - the English name of the relation to get the confidence value for
Returns:
the ranking or 0 if the relation doesn't exist or has not been ranked

getConfidenceSum

public double getConfidenceSum()
Returns the sum of getConfidence called on all relations.


getGlobalRanking

public double getGlobalRanking()
The Confidence object can store an additional global confidence ranking, as decided by the merging functionality. This does not necessarily have to depend on the individual field confidences, but rather can be the result of some meta-level criterion; for instance, if information is extracted from a web page, then the global ranking could be the page relevance according to a search service. Thus, the Confidence object does not calculate this itself, so the only way for the global ranking to be different from the default 0 is to explicitly set it using setGlobalRanking.

Returns:
the overall confidence ranking

setGlobalRanking

public void setGlobalRanking(double ranking)
Sets the global confidence ranking field.

Parameters:
ranking - the value to set the overall confidence ranking to

getPenalty

public double getPenalty()
Similar to the global ranking, the penalty can be another piece of information relevant to the entire Instance rather than a particular field. The penalty was specifically designed to work with Instance merging as a way to store the scoring penalty associated with merging two instances with conflicting fields. The default penalty is 0.

Returns:
the overall penalty

setPenalty

public void setPenalty(double p)
Sets the penalty field.

Parameters:
p - the value to set the penalty to


Stanford NLP Group