CoolFace
Datasetpublic

mteb/banking77

Banking77Classification An MTEB dataset Massive Text Embedding Benchmark Dataset composed of online banking queries annotated with their corresponding intents. Task category t2c Domains Written Reference https://arxiv.org/abs/2003.04807 How to evaluate on this task You can evaluate an embedding model on this dataset using the following code: import mteb task = mteb.get_tasks(["Banking77Classification"]) evaluator = mteb.MTEB(task) model =… See the full description on the dataset page: https://huggingface.co/datasets/mteb/banking77.

sourceHugging Facemitupdated 1y agoView on Hugging Face
17likes24kdownloads
prepare_data.py23 linesDownload Raw Back to root
1from datasets import load_dataset2import json3import os4from huggingface_hub import create_repo, upload_file5 6dataset = load_dataset("banking77")7id2label = dataset['train'].features['label'].names8 9repo_name = "banking77"10create_repo(repo_name, organization="mteb", repo_type="dataset")11for split in ['train', 'test']:12    savepath = f'{os.path.dirname(__file__)}/{split}.jsonl'13    with open(savepath, 'w') as fOut:14        rows = list(dataset[split])15        if split == 'test' and 'validation' in dataset:16            rows += list(dataset['validation'])17            18        for id, row in rows:19            fOut.write(json.dumps({'text': row['text'], 'label': row['label'], 'label_text': id2label[row['label']]})+"\n")20    21    upload_file(savepath, path_in_repo=f"{split}.jsonl", repo_id="mteb/" + repo_name, repo_type="dataset")22    os.system(f"rm {savepath}")23