Alex Martin
Create app.py
62872aa unverified
raw
history blame
914 Bytes
import streamlit as st
import pandas as pd
import numpy as np
from transformers import pipeline
from PIL import Image
st.title("Toxic Tweets Sentiment Analysis")
words = "Take that, you funking cat-dragon! You smell really bad!"
text = st.text_area("Insert text for analysis below.", words)
model_list = ["distilbert-base-uncased-finetuned-sst-2-english", "bert-base-cased", "openai/clip-vit-base-patch32", "emilyalsentzer/Bio_ClinicalBERT",
"sentence-transformers/all-mpnet-base-v2", "facebook/bart-large-cnn", "openai/clip-vit-base-patch16", "speechbrain/spkrec-ecapa-voxceleb",
"albert-base-v2"]
model = st.selectbox("", model_list)
sub = st.write("Pick the model to use for analyzing the text!")
button = st.button("Analyze!")
pipe = pipeline("text-classification")
if(button):
pipe = pipeline("text-classification", model)
results = pipe(text)
st.write(results)