Yah216's picture
Update app.py
0861c0d
raw history blame
No virus
899 Bytes
import streamlit as st
import tensorflow as tf
from transformers import pipeline
model_ckpt = "Yah216/Sentiment_Analysis_CAMelBERT_msa_sixteenth_HARD"
pipe = pipeline("text-classification", model_ckpt)
#from transformers import AutoTokenizer, TFAutoModelForSequenceClassification
#tokenizer = AutoTokenizer.from_pretrained("Yah216/Sentiment_Analysis_CAMelBERT_msa_sixteenth_HARD")
#model = TFAutoModelForSequenceClassification.from_pretrained("Yah216/Sentiment_Analysis_CAMelBERT_msa_sixteenth_HARD")
#labels= model.config.label2id
text = st.text_area("Enter some text in arabic language!")
if text:
#out = tf.math.softmax(model(tokenizer(text, padding=True, truncation=True, return_tensors="np")).logits, axis = -1)
# res = out.numpy()
# labels['NEGATIVE'] = res[0,0]
#labels['NEUTRAL'] = res[0,1]
#labels['POSITIVE'] = res[0,2]
# st.json(labels)
st.json(pipe(text))