prhegde/preference-data-math-stack-exchange
收藏资源简介:
--- license: apache-2.0 --- The preference dataset is derived from the [stack exchange dataset](https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences) which contains questions and answers from the Stack Overflow Data Dump. This contains questions and answers for various topics. For this work, we used only question and answers from [math.stackexchange.com](https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences/tree/main/data/math.meta.stackexchange.com) sub-folder. The questions are grouped with answers that are assigned a score corresponding to the Anthropic paper: ``` score = log2 (1 + upvotes) rounded to the nearest integer, plus 1 if the answer was accepted by the questioner (we assign a score of −1 if the number of upvotes is negative). ``` We performed following processing to derive the final dataset. 1) Basic pre-processing ([code](https://github.com/PraveenSH/dpo-arithmo-mistral-7B/blob/main/src/data_processing/stack_exchange_data.py)) to clean the text 2) Filter Mathematical question using regex based detector ([code](https://github.com/PraveenSH/dpo-arithmo-mistral-7B/blob/main/src/data_processing/stack_exchange_data.py)) 3) For each question, extract 2 answers - one with highest score and one with the lowest score. Former is used as Preferred response and latter is used as the rejected response ## References ``` @online{h4stackexchange, author = {Lambert, Nathan and Tunstall, Lewis and Rajani, Nazneen and Thrush, Tristan}, title = {HuggingFace H4 Stack Exchange Preference Dataset}, year = 2023, url = {https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences}, } ```
许可证:Apache-2.0 本偏好数据集源自**堆叠交换数据集(Stack Exchange Dataset)**,该数据集包含来自Stack Overflow数据转储的问答内容,涵盖多类主题。本研究仅使用了其中`math.stackexchange.com`子文件夹下的问答数据,对应链接为:https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences/tree/main/data/math.meta.stackexchange.com。 问答会根据Anthropic论文中的规则为答案分配分数: score = log₂(1 + 点赞数),并取最接近的整数;若答案被提问者采纳,则额外加1分(若点赞数为负,则将分数设为-1)。 我们通过以下流程处理得到最终数据集: 1. 基础文本清洗预处理(代码链接:https://github.com/PraveenSH/dpo-arithmo-mistral-7B/blob/main/src/data_processing/stack_exchange_data.py) 2. 基于正则表达式检测器过滤数学类问题(代码链接:https://github.com/PraveenSH/dpo-arithmo-mistral-7B/blob/main/src/data_processing/stack_exchange_data.py) 3. 为每个问题提取两个答案:分别为最高分答案与最低分答案。前者作为优选响应,后者作为拒选响应。 参考文献: @online{h4stackexchange, author = {Lambert, Nathan and Tunstall, Lewis and Rajani, Nazneen and Thrush, Tristan}, title = {HuggingFace H4 堆叠交换偏好数据集}, year = 2023, url = {https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences}, }
数据集概述
数据来源
- 该数据集源自Stack Exchange数据集,该数据集包含Stack Overflow数据转储中的问题和答案。
- 本数据集特别提取了math.stackexchange.com子文件夹中的问题和答案。
数据处理
- 预处理: 进行了基本的文本清洗,具体代码可见此处。
- 过滤: 使用基于正则表达式的检测器过滤出数学问题,相关代码同样位于上述链接。
- 答案选择: 对于每个问题,提取两个答案——一个最高分答案和一个最低分答案。最高分答案作为首选响应,最低分答案作为拒绝响应。
评分机制
- 答案的分数计算公式为:
score = log2(1 + upvotes),四舍五入到最近的整数。如果答案被提问者接受,则加1;如果upvotes为负数,则分数为-1。
许可证
- 本数据集遵循Apache-2.0许可证。




