Spaces:
Sleeping
Sleeping
from transformers import AutoTokenizer, AutoModelForSequenceClassification ,pipeline | |
tokenizer = AutoTokenizer.from_pretrained("avichr/heBERT_sentiment_analysis") | |
model = AutoModelForSequenceClassification.from_pretrained("avichr/heBERT_sentiment_analysis") | |
sentiment_analysis = pipeline( | |
"sentiment-analysis", | |
model="avichr/heBERT_sentiment_analysis", | |
tokenizer="avichr/heBERT_sentiment_analysis", | |
return_all_scores = True | |
) | |
import gradio as gr | |
def sme(text): | |
return sentiment_analysis(text) | |
demo = gr.Interface(fn=sme, inputs="text", outputs="json") | |
demo.launch(share=True) |