simplebayes.categories module

class simplebayes.categories.BayesCategories[source]

Bases: object

Acts as a container for various bayes trained categories of content

add_category(name: str) BayesCategory[source]

Adds a bayes category that we can later train

Parameters:

name (str) – name of the category

Returns:

the requested category

Return type:

BayesCategory

delete_category(name: str) None[source]

Deletes an existing category when present.

Parameters:

name (str) – name of the category

get_categories() Dict[str, BayesCategory][source]
Returns:

dict of all categories

Return type:

dict

get_category(name: str) BayesCategory[source]

Returns the expected category. Will KeyError if non existent

Parameters:

name (str) – name of the category

Returns:

the requested category

Return type:

BayesCategory