RamiIbrahim
commited on
Commit
•
ea775d8
1
Parent(s):
f5fb067
Update app.py
Browse files
app.py
CHANGED
@@ -46,37 +46,53 @@ formatted_examples = [
|
|
46 |
# Create Gradio interface
|
47 |
iface = gr.Interface(
|
48 |
fn=predict_sentiment,
|
49 |
-
inputs=gr.Textbox(lines=3, placeholder="Enter
|
50 |
outputs=[
|
51 |
-
gr.Label(label="Predicted Sentiment"),
|
52 |
-
gr.Label(label="Confidence Score"),
|
53 |
-
gr.Textbox(label="Explanation")
|
54 |
],
|
55 |
examples=formatted_examples,
|
56 |
-
title="Tunisian Arabiz Sentiment Analysis",
|
57 |
description="""
|
58 |
<div style="text-align: center; margin-bottom: 20px;">
|
59 |
-
<img src="cover.png" alt="Cover picture" style="width:300px;"/>
|
60 |
</div>
|
61 |
-
This model predicts the sentiment of Tunisian
|
62 |
|
63 |
-
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
69 |
|
70 |
-
Try the examples below or enter your own text
|
|
|
71 |
""",
|
72 |
article="""
|
73 |
-
<h3>About the Model
|
74 |
-
<p>This sentiment analysis model was trained on a dataset
|
75 |
It uses TF-IDF vectorization for feature extraction and Logistic Regression for classification.</p>
|
76 |
-
|
77 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
<p>The model may not perform well on very colloquial expressions or new slang terms not present in the training data.
|
79 |
-
|
|
|
|
|
|
|
80 |
"""
|
81 |
)
|
82 |
|
|
|
46 |
# Create Gradio interface
|
47 |
iface = gr.Interface(
|
48 |
fn=predict_sentiment,
|
49 |
+
inputs=gr.Textbox(lines=3, placeholder="أدخل النص هنا... / Enter your text here..."),
|
50 |
outputs=[
|
51 |
+
gr.Label(label="Predicted Sentiment / التوقع"),
|
52 |
+
gr.Label(label="Confidence Score / نسبة الثقة"),
|
53 |
+
gr.Textbox(label="Explanation / الشرح")
|
54 |
],
|
55 |
examples=formatted_examples,
|
56 |
+
title="Tunisian Arabiz & Arabic Sentiment Analysis / تحليل المشاعر للهجة التونسية",
|
57 |
description="""
|
58 |
<div style="text-align: center; margin-bottom: 20px;">
|
59 |
+
<img src="/cover.png" alt="Cover picture" style="width:300px;"/>
|
60 |
</div>
|
61 |
+
<p>This model predicts the sentiment of Tunisian text as either Positive or Negative. It works with both Tunisian Arabiz and standard Arabic script.</p>
|
62 |
|
63 |
+
<p>هذا النموذج يتوقع مشاعر النص التونسي إما إيجابية أو سلبية. يعمل مع كل من الكتابة العربيزية التونسية والنص العربي القياسي.</p>
|
64 |
|
65 |
+
<h4>What is Tunisian Arabiz? / ما هي العربيزية التونسية؟</h4>
|
66 |
+
<p>Tunisian Arabiz is a way of writing the Tunisian dialect using Latin characters and numbers. For example:</p>
|
67 |
+
<ul>
|
68 |
+
<li>"3ajbetni" means "I liked it" / تعني "أعجبتني"</li>
|
69 |
+
<li>"7aja" means "thing" / تعني "حاجة"</li>
|
70 |
+
<li>"a3tini 9ahwa" means "give me a coffee" / تعني "أعطيني قهوة"</li>
|
71 |
+
</ul>
|
72 |
|
73 |
+
<p>Try the examples below or enter your own text!</p>
|
74 |
+
<p>!جرب الأمثلة أدناه أو أدخل نصك الخاص</p>
|
75 |
""",
|
76 |
article="""
|
77 |
+
<h3>About the Model / حول النموذج</h3>
|
78 |
+
<p>This sentiment analysis model was trained on a combined dataset from TuniziDataset and the Tunisian Dialect Corpus.
|
79 |
It uses TF-IDF vectorization for feature extraction and Logistic Regression for classification.</p>
|
80 |
+
|
81 |
+
<p>تم تدريب نموذج تحليل المشاعر هذا على مجموعة بيانات مجمعة من TuniziDataset ومجموعة اللهجة التونسية.
|
82 |
+
يستخدم التجزئة TF-IDF لاستخراج الميزات والانحدار اللوجستي للتصنيف.</p>
|
83 |
+
|
84 |
+
<p>The model accepts both Tunisian Arabiz and standard Arabic script.</p>
|
85 |
+
<p>يقبل النموذج كلاً من النص العربيزي التونسي والنص العربي القياسي.</p>
|
86 |
+
|
87 |
+
<h3>Limitations / القيود</h3>
|
88 |
+
<p>Due to dataset limitations, neutral sentiment data was removed to achieve maximum performance.
|
89 |
+
This model is open-source, and contributions of additional datasets are welcome to improve its capabilities.</p>
|
90 |
+
|
91 |
<p>The model may not perform well on very colloquial expressions or new slang terms not present in the training data.
|
92 |
+
Sentiment can be nuanced and context-dependent, which may not always be captured accurately by this model.</p>
|
93 |
+
|
94 |
+
<p>قد لا يؤدي النموذج بشكل جيد مع التعبيرات العامية جدًا أو المصطلحات الجديدة غير الموجودة في بيانات التدريب.
|
95 |
+
يمكن أن تكون المشاعر دقيقة ومعتمدة على السياق، وهو ما قد لا يتم التقاطه بدقة دائمًا بواسطة هذا النموذج.</p>
|
96 |
"""
|
97 |
)
|
98 |
|