ilsp/flores200_en-el
收藏数据集概述
基本信息
- 语言: 英语 (en) 和 希腊语 (el)
- 许可证: cc-by-sa-4.0
- 大小类别: 1K<n<10K
- 任务类别: 翻译
数据集结构
- 特征:
en: 字符串类型el: 字符串类型
- 分割:
validation: 406555 字节, 997 个样本test: 427413 字节, 1012 个样本
- 下载大小: 481524 字节
- 数据集大小: 833968 字节
配置
- 默认配置:
validation: 数据路径为data/validation-*test: 数据路径为data/test-*
数据集内容
- 示例数量: 1012
- 提示变体:
- 英语到希腊语:
EN: [English Sentence] EL:English: [English Sentence] Ελληνικά:
- 希腊语到英语:
EL: [Greek Sentence] EL:Ελληνικά: [Greek Sentence] English:
- 英语到希腊语:
加载数据集
python from datasets import load_dataset
input_file = flores200.en2el.test.0-shot.json dataset = load_dataset( json, data_files=input_file, field=examples, split=train )
生成翻译结果
python from multiprocessing import cpu_count
def generate_translations(datapoint, config, config_name): for idx, variant in enumerate(datapoint["prompts_results"]): result = generate(variant["prompt"], config=config) datapoint["prompts_results"][idx].update({config_name: result}) return datapoint
dataset = dataset.map( function=generate_translations, fn_kwargs={"config": config, "config_name": config_name}, keep_in_memory=False, num_proc=min(len(dataset), cpu_count()), )
推送更新数据集
python from huggingface_hub import HfApi
input_file = "flores200.en2el.test.0-shot.json" model_name = "meltemi-v0.2" output_file = input_file.replace(".json", ".{}.json".format(model_name)
dataset.to_json(output_file, force_ascii=False, indent=4, orient="index")
api = HfApi()
api.upload_file( path_or_fileobj=output_file, path_in_repo="results/{}/{}".format(model_name, output_file) repo_id="ilsp/flores200-en-el-prompt", repo_type="dataset", )



