size_categories:n<1K format:parquet modality:text library:datasets library:pandas library:mlcroissant library:polars region:us
---
dataset_info:
  features:
  - name: dataset_name
    dtype: string
  - name: intent
    dtype: string
  - name: path
    dtype: string
  - name: transcription
    dtype: string
  - name: emotion
    dtype: string
  - name: transcription_entity
    dtype: string
  splits:
  - name: train
    num_bytes: 203188
    num_examples: 563
  download_size: 54148
  dataset_size: 203188
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
---

```python
from datasets import load_dataset

# Load datasets
dataset2 = load_dataset("WhissleAI/minds14-train-annotated")["train"]
mydataset = load_dataset("PolyAI/minds14", name="en-US", split="train")

# Define a function to merge columns based on the key "path"
def merge_columns(example):
    # Find the corresponding example in dataset2 based on the "path" key
    matching_example = next((ex for ex in dataset2 if ex["path"] == example["path"]), None)
    if matching_example:
        # Merge columns from dataset2 to mydataset
        example["intent"] = matching_example["intent"]
        example["emotion"] = matching_example["emotion"]
        example["transcription_entity"] = matching_example["transcription_entity"]
    return example

# Apply the merge_columns function to each example in mydataset
merged_dataset = mydataset.map(merge_columns)

# Display the first few examples of the merged dataset
print(merged_dataset[:5])
