Views
No views yet
1from datasets import load_dataset
2public = load_dataset("nguyenthanhdo/zac2023-math", split="train")
3
4prompt_template = (
5 "Below is an instruction that describes a task. "
6 "Write a response that appropriately completes the request.\n\n"
7 "### Instruction:\n{instruction}\n\n### Response:\n"
8)
9
10def form_instruction(example):
11 question = example["question"]
12 choices = example["choices"]
13 choices = "\n".join(choices).strip()
14 instruction_template = (
15 "Dưới đây là một câu hỏi trắc nghiệm toán học. "
16 "Bạn cần phải đưa ra lời giải từng bước trong vòng 200 chữ. "
17 'Cuối cùng lựa chọn một đáp án viết dưới dạng "Đáp án: <chữ cái đáp án>".\n'
18 "Câu hỏi: {question}\n"
19 "{choices}\nBài giải:"
20 )
21 instruction = instruction_template.format(question=question, choices=choices)
22 return instruction
23
24example = public[88]
25example_instruction = form_instruction(example)
26example_prompt = prompt_template.format(instruction=example_instruction)
27print(example_prompt)
28"""
29Below is an instruction that describes a task. Write a response that appropriately completes the request.
30
31### Instruction:
32Dưới đây là một câu hỏi trắc nghiệm toán học. Bạn cần phải đưa ra lời giải từng bước trong vòng 200 chữ. Cuối cùng lựa chọn một đáp án viết dưới dạng "Đáp án: <chữ cái đáp án>".
33Câu hỏi: Số nào dưới đây có cùng giá trị với 0,08?
34A. 0,800
35B. 8,00
36C. 0,80
37D. 0,080
38Bài giải:
39
40### Response:
41"""