Closed
Description
Hi,
In the project, at Step 6 (again) - Deploy the model for the web app, at the function def test_reviews(data_dir='../data/aclImdb', stop=250):,
# Read in the review and convert to 'utf-8' for transmission via HTTP review_input = review.read().encode('utf-8') # Send the review to the predictor and store the results results.append(int(predictor.predict(review_input)))
I think the last line should be:
results.append(round(float(predictor.predict(review_input))))
The output from predictor.predict is in byte type, that is b' ', so we need to use float() to convert to real number and use round to round it to the nearest integer (int() is not correct in this case because it rounds all numbers from 0-1 down to 0 only).
Metadata
Metadata
Assignees
Labels
No labels