Skip to content

DictOfFreqs

DictOfFreqs module-attribute

DictOfFreqs: TypeAlias = Mapping[str, Mapping[str, float]]

A mapping of corpus names to word-to-frequency mappings. The mapping is {corpus: {word: frequency}}

Example
dict_of_freqs = {
    "corpus1": {"hi": 1, "hey": 2, "hello": 3},
    "corpus2": {"hi": 2, "hey": 4, "bye": 6}
}

Source