Last active
June 27, 2021 21:39
-
-
Save nbertagnolli/3d08215e0b29a5f964e1b70dddb960b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
import requests | |
import json | |
url = "http://localhost:8000/review/predict" | |
# Write out the header for the page | |
st.write("# Movie Review Analyzer") | |
# Accept user text input | |
review_text = st.text_input("Paste your movie review here.") | |
# Make a post request with the text and get a response | |
response = requests.post(url, headers={}, data={"text": review_text}) | |
review_pred = json.loads(response.text)["sentiment"] | |
# Display the predicted review | |
st.success(review_pred) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment