Information Gain

Computation of mutual information gain
! [ -e /content ] && pip install -Uqq xcube # upgrade xcube on colab

This module contains the all classes and functions needed to compute mutual information gain for the tokens and labels. This mutual information is then used to bootstrap a L2R model from xml text data. Please follow the Boot L2R to understand how this module is used.


source

BatchLbsChunkify

 BatchLbsChunkify (chnk_st, chnk_end)

A transform that always take tuples as items


source

MutualInfoGain

 MutualInfoGain (df, bs=8, chnk_sz=200, device=None, lbs_desc=None)

Initialize self. See help(type(self)) for accurate signature.

@property
@patch
def lbs_frqs(self:MutualInfoGain):
    f = ColReader('labels', label_delim=';')
    self._frqs = Counter()
    for o in self.df.itertuples(): self._frqs.update(f(o))
    return self._frqs

source

MutualInfoGain.show

 MutualInfoGain.show (*args, save_as=None, **kwargs)