Created
September 19, 2022 08:58
-
-
Save Steboss89/e4a7c868b0b7ee5e67b9f763c17dce6c to your computer and use it in GitHub Desktop.
Streamlit Dashboard for calling the SageMaker endpoint
This file contains hidden or 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 | |
# define a block where the tweet can be written | |
text = st.text_input("Insert tweet here") | |
# codify the input text in a compatible SageMaker json | |
input_df = pd.DataFrame({"text":text}, index=[0]).to_json(orient="split") | |
# here we are printing out results | |
st.subheader("Sentiment:") | |
# and here we are calling the endpoint | |
st.write( query_endpoint(app_name=app_name, input_json=input_df)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment