classification2 / app.py
Anna-UoC's picture
Create app.py
7be31a1
raw
history blame contribute delete
353 Bytes
import streamlit as st
import transformers
from transformers import pipeline
st.title("Text Classification using BERT")
text = st.text_input("Enter your text")
classifier = pipeline('text-classification', model='bert-base-uncased', tokenizer='bert-base-uncased')
if st.button("Classify"):
result = classifier(text)
st.write(result[0]['label'])