Skip to content

Commit

Permalink
Update ArSarcasm BLOOMZ asset (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaramHasanain authored Oct 2, 2023
1 parent a78efe8 commit 3082672
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from llmebench.datasets import ArSarcasmDataset

from llmebench.models import PetalsModel

from llmebench.tasks import SarcasmTask


Expand All @@ -28,9 +26,10 @@ def config():

def prompt(input_sample):
prompt_string = (
f"Predict whether the tweet is sarcastic or not. If it is sarcastic, respond with 'TRUE'. If it is not sarcastic, respond with 'FALSE'.\n\n"
f"text: {input_sample}\n"
f"label: "
'Predict whether the following "tweet" is sarcastic. Return "yes" if the tweet is sarcastic and "no" if the tweet is not sarcastic. Provide only label.\n\ntweet: '
+ input_sample
+ "\n"
"label: \n"
)
return {
"prompt": prompt_string,
Expand All @@ -41,9 +40,9 @@ def post_process(response):
label = response["outputs"].strip().lower()
label = label.replace("<s>", "").replace("</s>", "")

if label == "true":
if label == "yes":
return "TRUE"
elif label == "false":
elif label == "no":
return "FALSE"
else:
return None

0 comments on commit 3082672

Please sign in to comment.