Goodreads-Score / app.py
snoopy731's picture
add streamlit
106c0d7
raw
history blame contribute delete
No virus
729 Bytes
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import streamlit as st
import torch
import requests
from bs4 import BeautifulSoup
import re
import pandas as pd
import numpy as np
st.title("Hugging Face Sentiment Analysis Spaces Example")
st.subheader("What framework would you like to use for Sentiment Analysis")
#tokenizer to break the text into tokens to feed into the model
tokenizer = AutoTokenizer.from_pretrained('nlptown/bert-base-multilingual-uncased-sentiment')
#model actually processing and using the transformer
model = AutoModelForSequenceClassification.from_pretrained("nlptown/bert-base-multilingual-uncased-sentiment")
#pipeline to predict review score
# def predict(review):