Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/jais evaluation on NER and QA #261

Merged
merged 12 commits into from
Jan 31, 2024
7 changes: 6 additions & 1 deletion assets/ar/QA/ARCD_JAIS13b_ZeroShot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def metadata():
"author": "Arabic Language Technologies, QCRI, HBKU",
"model": "Jais-13b-chat",
"description": "Locally hosted Jais-13b-chat model using FastChat.",
"scores": {"F1": "0.546"},
}


Expand All @@ -16,11 +17,15 @@ def config():
"dataset": ARCDDataset,
"task": QATask,
"model": FastChatModel,
"model_args": {
"max_tries": 3,
},
}


def prompt(input_sample):
base_prompt = f"مهمتك هي الإجابة على الأسئلة باللغة العربية بناءً على سياق معين.\nملاحظة: يجب أن تكون إجاباتك مستخرجة من السياق المحدد دون أي اضافات.\nلست بحاجة إلى تقديم إجابة كاملة.\nالسياق: {input_sample['context']}\n السؤال: {input_sample['question']}\n الجواب:"
base_prompt = f"Your task is to answer questions in Arabic based on a given context.\nNote: Your answers should be spans extracted from the given context without any illustrations.\nYou don't need to provide a complete answer\nContext:{input_sample['context']}\nQuestion:{input_sample['question']}\nAnswer:"

return [
{
"role": "user",
Expand Down
4 changes: 3 additions & 1 deletion assets/ar/QA/MLQA_JAIS13b_ZeroShot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def metadata():
"author": "Arabic Language Technologies, QCRI, HBKU",
"model": "Jais-13b-chat",
"description": "Locally hosted Jais-13b-chat model using FastChat.",
"scores": {"F1": "0.540"},
}


Expand All @@ -17,13 +18,14 @@ def config():
"task": QATask,
"model": FastChatModel,
"model_args": {
"max_tries": 50,
"max_tries": 3,
},
}


def prompt(input_sample):
base_prompt = f"Your task is to answer questions in Arabic based on a given context.\nNote: Your answers should be spans extracted from the given context without any illustrations.\nYou don't need to provide a complete answer\nContext:{input_sample['context']}\nQuestion:{input_sample['question']}\nAnswer:"

return [
{
"role": "user",
Expand Down
4 changes: 3 additions & 1 deletion assets/ar/QA/TyDiQA_JAIS13b_ZeroShot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def metadata():
"author": "Arabic Language Technologies, QCRI, HBKU",
"model": "Jais-13b-chat",
"description": "Locally hosted Jais-13b-chat model using FastChat.",
"scores": {"F1": "0.724"},
}


Expand All @@ -17,14 +18,15 @@ def config():
"task": QATask,
"model": FastChatModel,
"model_args": {
"max_tries": 50,
"max_tries": 3,
},
"general_args": {"test_split": "dev"},
}


def prompt(input_sample):
base_prompt = f"Your task is to answer questions in Arabic based on a given context.\nNote: Your answers should be spans extracted from the given context without any illustrations.\nYou don't need to provide a complete answer\nContext:{input_sample['context']}\nQuestion:{input_sample['question']}\nAnswer:"

return [
{
"role": "user",
Expand Down
4 changes: 3 additions & 1 deletion assets/ar/QA/XQuAD_JAIS13b_ZeroShot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def metadata():
"author": "Arabic Language Technologies, QCRI, HBKU",
"model": "Jais-13b-chat",
"description": "Locally hosted Jais-13b-chat model using FastChat.",
"scores": {"F1": "0.636"},
}


Expand All @@ -17,13 +18,14 @@ def config():
"task": QATask,
"model": FastChatModel,
"model_args": {
"max_tries": 50,
"max_tries": 3,
},
}


def prompt(input_sample):
base_prompt = f"Your task is to answer questions in Arabic based on a given context.\nNote: Your answers should be spans extracted from the given context without any illustrations.\nYou don't need to provide a complete answer\nContext:{input_sample['context']}\nQuestion:{input_sample['question']}\nAnswer:"

return [
{
"role": "user",
Expand Down
Loading