Spaces:
Build error
Build error
File size: 807 Bytes
90afd57 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import streamlit as st
from .sa import predictor
def write():
st.markdown(
"""
# Arabic Sarcasm Detection
This is a simple sarcasm detection app that uses the [MARBERT](https://huggingface.co/UBC-NLP/MARBERT) model trained on [ArSarcasm](https://github.com/iabufarha/ArSarcasm)
"""
)
input_text = st.text_input(
"Enter your text here:",
)
if st.button("Predict"):
with st.spinner("Predicting..."):
prediction, scores = predictor.get_preds_from_sarcasm([input_text])
st.write(f"Result: {prediction[0]}")
detailed_score = {
"Sarcastic": scores[0][0],
"Not_Sarcastic": scores[0][1],
}
st.write("All scores:")
st.write(detailed_score)
|