Skip to content

Instantly share code, notes, and snippets.

@Steboss89
Created September 19, 2022 08:58
Show Gist options
  • Save Steboss89/e4a7c868b0b7ee5e67b9f763c17dce6c to your computer and use it in GitHub Desktop.
Save Steboss89/e4a7c868b0b7ee5e67b9f763c17dce6c to your computer and use it in GitHub Desktop.
Streamlit Dashboard for calling the SageMaker endpoint
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