Spaces:
Runtime error
Runtime error
Jeffrey Rathgeber Jr
commited on
Milestone3begin
Browse files
app.py
CHANGED
@@ -2,8 +2,17 @@ import streamlit as st
|
|
2 |
import tensorflow as tf
|
3 |
from transformers import pipeline
|
4 |
from textblob import TextBlob
|
|
|
|
|
|
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
textIn = st.text_input("Input Text Here:", "I really like the color of your car!")
|
9 |
|
|
|
2 |
import tensorflow as tf
|
3 |
from transformers import pipeline
|
4 |
from textblob import TextBlob
|
5 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
6 |
+
import torch
|
7 |
+
import torch.nn.functional as F
|
8 |
|
9 |
+
model_name = "distilbert-base-uncased-finetuned-sst-2-english"
|
10 |
+
|
11 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
12 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
13 |
+
|
14 |
+
classifier = pipeline(task="sentiment-analysis", model=model, tokenizer=tokenizer)
|
15 |
+
# classifier = pipeline(task="sentiment-analysis")
|
16 |
|
17 |
textIn = st.text_input("Input Text Here:", "I really like the color of your car!")
|
18 |
|