Text::NSP::Measures::3D::MI::pmi

Text::NSP::Measures::3D::MI::pmi is a Perl module that implements Pointwise Mutual Information for trigrams.
Download

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

Advertisement

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

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


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

Text::NSP::Measures::3D::MI::pmi is a Perl module that implements Pointwise Mutual Information for trigrams. Text::NSP::Measures::3D::MI::pmi is a Perl module that implements Pointwise Mutual Information for trigrams.SYNOPSISBasic Usage use Text::NSP::Measures::3D::MI::pmi; $pmi_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 ".$pmi_value."n"; }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= -------------------- npppPointwise Mutual Information (pmi) is defined as the log of the devitation between the observed frequency of a trigram (n111) and the probability of that trigram if it were independent (m111). PMI = log (n111/m111)MethodsinitializeStatistic() -Initialization of the pmi_exp parameter if requiredINPUT PARAMS : noneRETURN VALUES : nonecalculateStatistic() - This method calculates the pmi valueINPUT PARAMS : $count_values .. Reference of a hash containing the count values computed by the count.pl program.RETURN VALUES : $pmi .. PMI value for this trigram.getStatisticName() - Returns the name of this statisticINPUT PARAMS : noneRETURN VALUES : $name .. Name of the measure. Requirements: · Perl


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