#include <ReportRank.h>
Public Member Functions | |
| ReportRank (void) | |
| ~ReportRank () | |
| void | report_sentence (Handle) |
| void | report_parse (Handle) |
| void | report_document (const std::deque< Handle > &) |
Private Member Functions | |
| bool | report_parse_f (Handle) |
| bool | count_word (Handle) |
| bool | count_sense (Handle, Handle) |
| bool | renorm_parse (Handle) |
| bool | renorm_word (Handle) |
| bool | renorm_sense (Handle, Handle) |
Private Attributes | |
| int | parse_cnt |
| int | word_count |
| double | normalization |
| double | sense_count |
| double | choosen_sense_count |
| double | hi_score |
| const char * | hi_sense |
Definition at line 20 of file ReportRank.h.
| ReportRank::ReportRank | ( | void | ) |
| ReportRank::~ReportRank | ( | ) |
Definition at line 29 of file ReportRank.cc.
| bool ReportRank::report_parse_f | ( | Handle | h | ) | [private] |
Definition at line 116 of file ReportRank.cc.
References report_parse().

| bool ReportRank::count_word | ( | Handle | h | ) | [private] |
Definition at line 122 of file ReportRank.cc.
References count_sense(), opencog::foreach_word_sense_of_inst(), and word_count.

Definition at line 147 of file ReportRank.cc.
References opencog::TLB::getAtom(), opencog::TruthValue::getCount(), opencog::Atom::getTruthValue(), normalization, and sense_count.

| bool opencog::ReportRank::renorm_parse | ( | Handle | ) | [private] |
| bool ReportRank::renorm_word | ( | Handle | h | ) | [private] |
Definition at line 129 of file ReportRank.cc.
References opencog::foreach_word_sense_of_inst(), opencog::get_dict_word_of_word_instance(), opencog::TLB::getAtom(), opencog::Node::getName(), hi_score, hi_sense, and renorm_sense().

Definition at line 156 of file ReportRank.cc.
References choosen_sense_count, SPCTools::f, opencog::TLB::getAtom(), opencog::TruthValue::getCount(), opencog::Node::getName(), opencog::Atom::getTruthValue(), hi_score, hi_sense, normalization, SPCTools::score, and opencog::Atom::setTruthValue().

| void ReportRank::report_sentence | ( | Handle | h | ) |
For each parse of the sentence, make a report.
Definition at line 36 of file ReportRank.cc.
References opencog::foreach_parse(), parse_cnt, and report_parse_f().
| void ReportRank::report_parse | ( | Handle | h | ) |
Same as report_document, but done only for one parse
Definition at line 97 of file ReportRank.cc.
References choosen_sense_count, count_word(), opencog::foreach_word_instance(), normalization, parse_cnt, renorm_word(), and sense_count.

| void ReportRank::report_document | ( | const std::deque< Handle > & | parse_list | ) |
Renormalize the distribution of senses for this document, store result in the truth values.
After running the graph algo, scores will have flowed to different senses, with many senses getting a strong boost, others loosing out. This code renormalizes the scores so that they are expressed as a deviation from a mean. This is done in two (conceptual) steps: 1) renormalize so that the mean score is 1.0 2) subtract 1.0 from all scores. The result of doing this is that unlikely senses get netgative scores, likely senses get strong positive scores. It appears that "typical" distributions seem to go from -0.8 to +3.5 or there-abouts.
Definition at line 57 of file ReportRank.cc.
References choosen_sense_count, count_word(), opencog::foreach_word_instance(), normalization, renorm_word(), sense_count, and word_count.

int opencog::ReportRank::parse_cnt [private] |
Definition at line 23 of file ReportRank.h.
int opencog::ReportRank::word_count [private] |
Definition at line 28 of file ReportRank.h.
double opencog::ReportRank::normalization [private] |
Definition at line 29 of file ReportRank.h.
double opencog::ReportRank::sense_count [private] |
Definition at line 30 of file ReportRank.h.
double opencog::ReportRank::choosen_sense_count [private] |
Definition at line 31 of file ReportRank.h.
double opencog::ReportRank::hi_score [private] |
Definition at line 36 of file ReportRank.h.
const char* opencog::ReportRank::hi_sense [private] |
Definition at line 37 of file ReportRank.h.
1.5.6