Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass string as input #4

Open
girishpillai17 opened this issue Sep 17, 2020 · 0 comments
Open

How to pass string as input #4

girishpillai17 opened this issue Sep 17, 2020 · 0 comments

Comments

@girishpillai17
Copy link

girishpillai17 commented 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)

# 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.

@girishpillai17 girishpillai17 changed the title How to pass string as input in json How to pass string as input Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant