Question
To start, implement the `update_model` function in the [Naive Bayes Block](#Naive-Bayes-Block). Make sure to read the function comments so you know what to update. Also
To start, implement the `update_model` function in the [Naive Bayes Block](#Naive-Bayes-Block). Make sure to read the function comments so you know what to update. Also review the `NaiveBayes` class variables in the `def __init__` method of the `NaiveBayes class` to get a sense of which statistics are important to keep track of. Once you have implemented `update_model`, run the train model function using the code below. nb = NaiveBayes(PATH_TO_DATA, tokenizer=tokenize_doc) nb.train_model() if len(nb.vocab) == 251637: print ("Great! The vocabulary size is {}".format(251637)) else: print ("Oh no! Something seems off. Double check your code before continuing. Maybe a mistake in update_model?")
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started