coherence Package

coherence Package

@package eWRT.ws.stat.coherence Determines how strongly two terms are connected to each other

class eWRT.stat.coherence.Coherence(dataSource, cache=True)[source]

Bases: object

@class Coherence abstract class for computing the coherence between terms

static getCoherence(nx, ny, nt)[source]

@param[in] nx counts of term1 @param[in] ny counts of term2 @param[in] nt counts of term1 together with term2 @returns the coherence

getTermCoherence(t1, t2)[source]

@param[in] t1 term1 @param[in] t2 term2 @returns the coherence between these two terms

class eWRT.stat.coherence.DiceCoherence(dataSource, cache=True)[source]

Bases: eWRT.stat.coherence.Coherence

@class DiceCoherence computes the dice coherence for the given terms

static getCoherence(nx, ny, nt)[source]

@param[in] nx counts of term1 @param[in] ny counts of term2 @param[in] nt counts of term1 together with term2 @returns the coherence

class eWRT.stat.coherence.PMICoherence(dataSource, cache=True)[source]

Bases: eWRT.stat.coherence.Coherence

@class PMICoherence computes the coherence based on the pointwise mutual information (PMI)

static getCoherence(nx, ny, nt)[source]

@param[in] nx counts of term1 @param[in] ny counts of term2 @param[in] nt counts of term1 together with term2 @returns the coherence

class eWRT.stat.coherence.TestCoherence(methodName='runTest')[source]

Bases: unittest.case.TestCase

testDice()[source]

tests the computation of the dice coefficient based on the example in

testPMI()[source]

tests the computation of the PMI based on the results from wilson’s paper

testPMIZero()[source]

tests the handling of PMI values of no counts are found