Skip to content

Commit

Permalink
Add a new asset for ArSAS sentiment with Arabic prompt (#178)
Browse files Browse the repository at this point in the history
* Added a zero shot arabic asset for ArSAS

* added zero shot arabic asset for sentiment analysis

* Update asset with metadata and remove obsolete code

---------

Co-authored-by: Fahim Imaduddin Dalvi <[email protected]>
  • Loading branch information
baselmousi and fdalvi authored Oct 2, 2023
1 parent 8655a86 commit 080aa34
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ def metadata():
return {
"author": "Arabic Language Technologies, QCRI, HBKU",
"model": "gpt-4-32k (version 0314)",
"description": "GPT4 32k tokens model hosted on Azure, using the ChatCompletion API. API version '2023-03-15-preview'.",
"scores": {"Macro-F1": "0.569"},
"description": "GPT4 32k tokens model hosted on Azure, using the ChatCompletion API. API version '2023-03-15-preview'. Uses an prompt specified in Arabic.",
"scores": {"Macro-F1": "0.547"},
}


Expand All @@ -17,10 +17,6 @@ def config():
"dataset": ArSASDataset,
"task": SentimentTask,
"model": OpenAIModel,
"model_args": {
"class_labels": ["Positive", "Negative", "Neutral", "Mixed"],
"max_tries": 3,
},
}


Expand All @@ -32,7 +28,7 @@ def prompt(input_sample):
},
{
"role": "user",
"content": f"Choose only one sentiment between: Positive, Negative, Neutral, or Mixed for this Arabic sentence: \n {input_sample}",
"content": f'وصف المهمّة: مهمّتك هي تحديد الشعور الذي يعكسه نص معيّن باللغة العربيّة. وسيكون الإدخال نصًا باللغة العربيّة بينما يمكن أن تتمثّل المخرجات بواحدة من الفئات التالية ."Positive", "Negative", "Neutral", "Mixed": ملاحظة: يجب أن تنحسر المخرجات بواحدة من الفئات المذكورة من دون أي توضيح أو تفاصيل إضافيّة.\nInput: {input_sample}\nLabel: ',
},
]

Expand Down

0 comments on commit 080aa34

Please sign in to comment.