You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My model takes website url as input and predicts its category and give the output as category name. when i am trying to pass
data = {"url" : "www.google.com"}
I get response as 400
And also my model takes list as input
For example it takes model.predict(['www.google.com'])
so in the app.py file how should I pass my function.
currently it is
`def predict():
# get data
data = request.get_json(force=True)
# convert data into dataframe
#data = data.update(data.items())
#data_df = pd.DataFrame.from_dict(data)
# predictions
result = model.predict([data])
# send back to browser
output = {'results': (result)}
# return data
return jsonify(results=output)`
Thanks.
The text was updated successfully, but these errors were encountered:
girishpillai17
changed the title
How to pass string as input in json
How to pass string as input
Sep 17, 2020
My model takes website url as input and predicts its category and give the output as category name. when i am trying to pass
data = {"url" : "www.google.com"}
I get response as 400
And also my model takes list as input
For example it takes
model.predict(['www.google.com'])
so in the app.py file how should I pass my function.
currently it is
`def predict():
# get data
data = request.get_json(force=True)
Thanks.
The text was updated successfully, but these errors were encountered: