Team Ai
Apppublic

Donlapark/sample-text-classification

sourceHugging Faceafl-3.0updated 3y agoView on Hugging Face
0likes
app.py17 linesDownload Raw Back to root
1import streamlit as st2from transformers import pipeline3 4classifier = pipeline("sentiment-analysis", model="Donlapark/finetuned_yelp")5def main():6    st.title("Yelp review")7 8    with st.form("text_field"):9        text = st.text_area('enter some text:')10        # clicked==True only when the button is clicked11        clicked = st.form_submit_button("Submit text")12        if clicked:13          results = classifier([text])14          st.json(results)15 16if __name__ == "__main__":17    main()