ebowwa/human-biases
收藏Hugging Face2024-05-26 更新2024-06-15 收录
下载链接:
https://hf-mirror.com/datasets/ebowwa/human-biases
下载链接
链接失效反馈官方服务:
资源简介:
---
license: apache-2.0
---
```
from datasets import load_dataset, Dataset
# Load and preprocess the dataset
def formatting_prompts_func(examples):
"""
This function takes a dataset of examples and formats them into a list of text prompts.
Args:
examples (pandas.DataFrame): A DataFrame containing the dataset of examples.
Returns:
dict: A dictionary with a 'text' key containing the list of formatted text prompts.
"""
texts = [
# Create a formatted text prompt for each example
f"Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.\n\n### Bias Category:\n{bias_category}\n### Type:\n{type}\n### Real-World Examples:\n{real_world_example}\n### Relevant Disciplines:\n{relevant_discipline}\n### Bias Subtype:\n{bias_subtype}\n### Underlying Mechanism:\n{underlying_mechanism}\n### Debiasing Strategies:\n{debiasing_strategy}\n### Practical Applications:\n{practical_application}\n### Bias Strength:\n{bias_strength}\n### Decision-Making Stage:\n{decision_making_stage}\n### Consequences:\n{consequence}\n### Mitigation Techniques:\n{mitigation_technique}\n### Cognitive Process Involved:\n{cognitive_process_involved}\n### Potential Causes:\n{potential_cause}\n### Valence:\n{valence}\n### Domain:\n{domain}\n### Response:\n"
for bias_category, type, real_world_example, relevant_discipline, bias_subtype, underlying_mechanism, debiasing_strategy, practical_application, bias_strength, decision_making_stage, consequence, mitigation_technique, cognitive_process_involved, potential_cause, valence, domain in zip(
examples["Bias Category"],
examples["Type"],
examples["Real-World Examples"],
examples["Relevant Disciplines"],
examples["Bias Subtype"],
examples["Underlying Mechanism"],
examples["Debiasing Strategies"],
examples["Practical Applications"],
examples["Bias Strength"],
examples["Decision-Making Stage"],
examples["Consequences"],
examples["Mitigation Techniques"],
examples["Cognitive Process Involved"],
examples["Potential Causes"],
examples["Valence"],
examples["Domain"],
)
]
# Print the first example prompt
print(texts[0])
return {"text": texts}
# Load the dataset
dataset = load_dataset("ebowwa/human-biases")
dataset = dataset.map(formatting_prompts_func, batched=True)
```
提供机构:
ebowwa
原始信息汇总
数据集概述
数据集加载与预处理
- 加载函数:
load_dataset("ebowwa/human-biases") - 预处理函数:
formatting_prompts_func
预处理函数详情
- 功能: 将数据集中的示例格式化为文本提示列表。
- 输入参数:
examples(类型:pandas.DataFrame) - 返回值: 包含格式化文本提示的字典,键为 text。
格式化文本提示的结构
- Bias Category: 偏见类别
- Type: 类型
- Real-World Examples: 现实世界示例
- Relevant Disciplines: 相关学科
- Bias Subtype: 偏见子类型
- Underlying Mechanism: 潜在机制
- Debiasing Strategies: 去偏见策略
- Practical Applications: 实际应用
- Bias Strength: 偏见强度
- Decision-Making Stage: 决策阶段
- Consequences: 后果
- Mitigation Techniques: 缓解技术
- Cognitive Process Involved: 涉及的认知过程
- Potential Causes: 潜在原因
- Valence: 效价
- Domain: 领域
- Response: 响应



