Text::NSP::Measures::3D::MI::tmi

Text::NSP::Measures::3D::MI::tmi is a Perl implementation for True Mutual Information for trigrams.
Download

Text::NSP::Measures::3D::MI::tmi Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Text::NSP::Measures::3D::MI::tmi team
  • Publisher web site:
  • http://search.cpan.org/~tpederse/Text-NSP-1.03/lib/Text/NSP/Measures/3D/MI/tmi.pm

Text::NSP::Measures::3D::MI::tmi Tags


Text::NSP::Measures::3D::MI::tmi Description

Text::NSP::Measures::3D::MI::tmi is a Perl implementation for True Mutual Information for trigrams. Text::NSP::Measures::3D::MI::tmi is a Perl implementation for True Mutual Information for trigrams.SYNOPSISBasic Usage use Text::NSP::Measures::3D::MI::tmi; $tmi_value = calculateStatistic( n111=>10, n1pp=>40, np1p=>45, npp1=>42, n11p=>20, n1p1=>23, np11=>21, nppp=>100); if( ($errorCode = getErrorCode())) { print STDERR $erroCode." - ".getErrorMessage()."n"; } else { print getStatisticName."value for bigram is ".$tmi_value."n"; }True Mutual Information (tmi) is defined as the weighted average of the pointwise mutual informations for all the observed and expected value pairs. tmi = PMI = log (n111/m111)Here n111 represents the observed value for the cell (1,1,1) and m111 represents the expected value for that cell. The expected values for the internal cells are calculated by taking the product of their associated marginals and dividing by the sample size, for example: n1pp * np1p * npp1 m111= -------------------- npppMethodscalculateStatistic($count_values) - This method calculates the tmi valueINPUT PARAMS : $count_values .. Reference of an hash containing the count values computed by the count.pl program.RETURN VALUES : $tmi .. TMI value for this trigram.getStatisticName() - Returns the name of this statisticINPUT PARAMS : noneRETURN VALUES : $name .. Name of the measure.Requirements:· Perl Requirements: · Perl


Text::NSP::Measures::3D::MI::tmi Related Software