calc_prod_all_envs

corpustools.prod.pred_of_dist.calc_prod_all_envs(corpus_context, seg1, seg2, all_info=False, stop_check=None, call_back=None)[source]

Main function for calculating predictability of distribution for two segments over a corpus, regardless of environment.

Parameters
corpus_contextCorpusContext

Context manager for a corpus

seg1str

The first segment

seg2str

The second segment

all_infobool

If true, all the intermediate numbers for calculating predictability of distribution will be returned. If false, only the final entropy will be returned. Defaults to False.

stop_checkcallable, optional

Optional function to check whether to gracefully terminate early

call_backcallable, optional

Optional function to supply progress information during the function

Returns
float or list

A list of [entropy, frequency of environment, frequency of seg1, frequency of seg2] if all_info is True, or just entropy if all_info is False.