Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

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

Date Added: November 25, 2010  |  Visits: 692

Text::NSP::Measures::3D::MI::pmi is a Perl module that implements Pointwise Mutual Information for trigrams. SYNOPSIS Basic 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= -------------------- nppp Pointwise 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) Methods initializeStatistic() -Initialization of the pmi_exp parameter if required INPUT PARAMS : none RETURN VALUES : none calculateStatistic() - This method calculates the pmi value INPUT 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 statistic INPUT PARAMS : none RETURN VALUES : \$name .. Name of the measure..

 Requirements: No special requirements Platforms: Linux Keyword: Information,  Input,  Input Params,  Mutual,  Mutual Information,  Nsp,  Perl Module,  Pmi,  Pointwise,  Pointwise Mutual Information,  Return,  Return Values,  Value,  Values Users rating: 0/10