shuyuej/MetaMathQA
收藏Hugging Face2024-01-25 更新2024-03-04 收录
下载链接:
https://hf-mirror.com/datasets/shuyuej/MetaMathQA
下载链接
链接失效反馈官方服务:
资源简介:
---
license: apache-2.0
---
# MetaMath Dataset with "{"question": question, "answer": answer}" pairs.
# 💻 Dataset Usage
Run the following command to load the data:
```python
from datasets import load_dataset
dataset = load_dataset("shuyuej/MetaMathQA")
dataset = dataset['train']
print(dataset)
```
# 📝 Dataset modification codes
```python
# coding=utf-8
import jsonlines
from datasets import load_dataset
# Load the dataset
dataset = load_dataset("meta-math/MetaMathQA")
dataset = dataset["train"]
data = []
for example in dataset:
question = example['query']
answer = example['response']
data.append({"question": question, "answer": answer})
# Save the modified data to a jsonl file
output_file = 'MetaMathQA.jsonl'
with jsonlines.open(output_file, 'w') as writer:
writer.write_all(data)
print(f"Modified data saved to {output_file}")
```
提供机构:
shuyuej
原始信息汇总
MetaMath Dataset with "{"question": question, "answer": answer}" pairs.
数据集使用
运行以下命令加载数据: python from datasets import load_dataset
dataset = load_dataset("shuyuej/MetaMathQA") dataset = dataset[train] print(dataset)
数据集修改代码
python
coding=utf-8
import jsonlines from datasets import load_dataset
加载数据集
dataset = load_dataset("meta-math/MetaMathQA") dataset = dataset["train"]
data = [] for example in dataset: question = example[query] answer = example[response]
data.append({"question": question, "answer": answer})
保存修改后的数据到jsonl文件
output_file = MetaMathQA.jsonl with jsonlines.open(output_file, w) as writer: writer.write_all(data)
print(f"Modified data saved to {output_file}")



