src/English/confidences/en_ConfidenceEstimator.cpp
/**
 * Note: There are some extra steps in this method to handle the fact that the Mentions 
 * contained by the EntitySet are copies of the Mentions in the sentence-level
 * MentionSets (to allow for multiple theories). Here we explicitly set the confidence 
 * values for both copies of the Mention. This could cause unpredictable behavior if we
 * were to use a beam with multiple MentionSets, but we currently never do that.  
 */
There are some extra steps in this method to handle the fact that the Mentions
contained by the EntitySet are copies of the Mentions in the sentence-level
MentionSets (to allow for multiple theories). Here we explicitly set the confidence
values for both copies of the Mention. This could cause unpredictable behavior if we
were to use a beam with multiple MentionSets, but we currently never do that.
There are some extra steps in this method to handle the fact that the Mentions contained by the EntitySet are copies of the Mentions in the sentence - level MentionSets ( to allow for multiple theories ) . Here we explicitly set the confidence values for both copies of the Mention . This could cause unpredictable behavior if we were to use a beam with multiple MentionSets but we currently never do that .
void EnglishConfidenceEstimator::addMentionConfidenceScores(const Entity *entity, const DocTheory *docTheory) const {
	const Mention* canonical = getBestMention(entity, docTheory);
	EntitySet *entitySet = docTheory->getEntitySet();
	for (int i = 0; i < entity->getNMentions(); i++) {
		Mention* mention = entitySet->getMention(entity->getMention(i));
		SentenceTheory *sentTheory = docTheory->getSentenceTheory(mention->getSentenceNumber());
		Mention *sentenceLevelMention = sentTheory->getMentionSet()->getMention(mention->getUID());
		double confidence = calculateConfidenceScore(mention, docTheory);
		mention->setConfidence((float)confidence);
		sentenceLevelMention->setConfidence((float)confidence);
		if (canonical->getMentionType() == Mention::NAME) {
			double link_confidence = calculateLinkConfidenceScore(mention, canonical, docTheory);
			mention->setLinkConfidence((float)link_confidence);
			sentenceLevelMention->setLinkConfidence((float)link_confidence);
		}
	}
}
void EnglishConfidenceEstimator :: addMentionConfidenceScores ( const Entity * entity , const DocTheory * docTheory ) const { const Mention * canonical = getBestMention ( entity , docTheory ) ; EntitySet * entitySet = docTheory -> getEntitySet ( ) ; for ( int i = 0 ; i < entity -> getNMentions ( ) ; i ++ ) { Mention * mention = entitySet -> getMention ( entity -> getMention ( i ) ) ; SentenceTheory * sentTheory = docTheory -> getSentenceTheory ( mention -> getSentenceNumber ( ) ) ; Mention * sentenceLevelMention = sentTheory -> getMentionSet ( ) -> getMention ( mention -> getUID ( ) ) ; double confidence = calculateConfidenceScore ( mention , docTheory ) ; mention -> setConfidence ( ( float ) confidence ) ; sentenceLevelMention -> setConfidence ( ( float ) confidence ) ; if ( canonical -> getMentionType ( ) == Mention :: NAME ) { double link_confidence = calculateLinkConfidenceScore ( mention , canonical , docTheory ) ; mention -> setLinkConfidence ( ( float ) link_confidence ) ; sentenceLevelMention -> setLinkConfidence ( ( float ) link_confidence ) ; } } }
Note: There are some extra steps in this method to handle the fact that the Mentions
 contained by the EntitySet are copies of the Mentions in the sentence-level
 MentionSets (to allow for multiple theories).
Note : There are some extra steps in this method to handle the fact that the Mentions contained by the EntitySet are copies of the Mentions in the sentence - level MentionSets ( to allow for multiple theories ) .
// Mention confidence
 // Link confidence - only produced for entities with a canonical name
