license:apache-2.0 region:us
---
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)
```