five

JosefAlbers/medmcqa_openbiollm

收藏
Hugging Face2024-05-20 更新2024-06-12 收录
下载链接:
https://hf-mirror.com/datasets/JosefAlbers/medmcqa_openbiollm
下载链接
链接失效反馈
官方服务:
资源简介:
--- license: cc-by-4.0 dataset_info: features: - name: question dtype: string - name: attempt dtype: string - name: answer dtype: string splits: - name: train num_bytes: 810993 num_examples: 1000 download_size: 433748 dataset_size: 810993 configs: - config_name: default data_files: - split: train path: data/train-* --- Source: `openlifescienceai/medmcqa` Model: `aaditya/Llama3-OpenBioLLM-8B` Code: ```python !pip install --upgrade transformers accelerate torch import transformers import accelerate import torch from datasets import load_dataset model_id = "aaditya/OpenBioLLM-Llama3-8B" pipeline = transformers.pipeline( "text-generation", model=model_id, model_kwargs={"torch_dtype": torch.bfloat16}, device="cuda", ) split = "train" dataset = load_dataset("openlifescienceai/medmcqa", split=split)#, streaming=True) dataset = dataset.filter(lambda example: (example['choice_type'] == 'single') and (example['subject_name'] == 'Medicine') and (example['exp'])) dataset = dataset.select(range(1000)) terminators = [ pipeline.tokenizer.eos_token_id, pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>") ] def join_features(example): example['question'] = f"{example['question']}\nA. {example['opa']}\nB. {example['opb']}\nC. {example['opc']}\nD. {example['opd']}" _answer_idx = int(example["cop"]) _answer_str = example['op'+'abcd'[_answer_idx]] example['answer'] = f'Answer: {"ABCD"[_answer_idx]}. {_answer_str}' messages = [ {"role": "system", "content": "You are an expert and experienced from the healthcare and biomedical domain with extensive medical knowledge and practical experience. Your name is OpenBioLLM, and you were developed by Saama AI Labs. who's willing to help answer the user's query with explanation. In your explanation, leverage your deep medical expertise such as relevant anatomical structures, physiological processes, diagnostic criteria, treatment guidelines, or other pertinent medical concepts. Use precise medical terminology while still aiming to make the explanation clear and accessible to a general audience."}, {"role": "user", "content": example['question']}, ] prompt = pipeline.tokenizer.apply_chat_template( messages, tokenize=False, add_generation_prompt=True ) example['attempt'] = pipeline( prompt, max_new_tokens=500, eos_token_id=terminators, do_sample=False, # temperature=0.0, # top_p=0.9, )[0]["generated_text"][len(prompt):] return example dataset = dataset.map(join_features) dataset = dataset.select_columns(['question', 'attempt', 'answer']) dataset.push_to_hub(...) ```
提供机构:
JosefAlbers
原始信息汇总

数据集概述

数据集基本信息

  • 名称: medmcqa
  • 来源: openlifescienceai/medmcqa
  • 许可证: cc-by-4.0

数据集特征

  • 问题: 字符串类型
  • 尝试: 字符串类型
  • 答案: 字符串类型

数据集划分

  • 训练集:
    • 示例数量: 1000
    • 数据大小: 810993字节

数据集大小

  • 下载大小: 433748字节
  • 数据集总大小: 810993字节

配置信息

  • 默认配置:
    • 数据文件路径: data/train-*
    • 划分: 训练集
5,000+
优质数据集
54 个
任务类型
进入经典数据集
二维码
社区交流群

面向社区/商业的数据集话题

二维码
科研交流群

面向高校/科研机构的开源数据集话题

数据驱动未来

携手共赢发展

商业合作