遇见数据集

WhissleAI/minds14-ner-emotion

收藏
Hugging Face2024-05-08 更新2025-04-08 收录
官方服务:

资源简介:

--- 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])

提供机构:
WhissleAI
二维码
社区交流群
二维码
科研交流群
商业服务