{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "Access token is needed for reading this data (contact Lavita's admin: pedram@lavita.ai)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from datasets import load_dataset" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# Reading data from Lavita's Hugging Face\n", "data_hf_name = \"lavita/ChatDoctor-HealthCareMagic-100k\"\n", "dataset = load_dataset(data_hf_name)\n", "\n", "# Converting data to pandas DataFrame\n", "df = dataset['train'].to_pandas()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
instructioninputoutput
0If you are a doctor, please answer the medical...I woke up this morning feeling the whole room ...Hi, Thank you for posting your query. The most...
1If you are a doctor, please answer the medical...My baby has been pooing 5-6 times a day for a ...Hi... Thank you for consulting in Chat Doctor....
2If you are a doctor, please answer the medical...Hello, My husband is taking Oxycodone due to a...Hello, and I hope I can help you today.First, ...
3If you are a doctor, please answer the medical...lump under left nipple and stomach pain (male)...HI. You have two different problems. The lump ...
4If you are a doctor, please answer the medical...I have a 5 month old baby who is very congeste...Thank you for using Chat Doctor. I would sugge...
5If you are a doctor, please answer the medical...I am F 38 in good shape work out (do triathlon...Hi, From history it seems that you might be ha...
6If you are a doctor, please answer the medical...sir, MY uncle has ILD-Interstitial Lung diseas...Thanks for your question on Chat Doctor. I can...
7If you are a doctor, please answer the medical...my husband was working on a project in the hou...Hello. It could be a blood collection due to m...
8If you are a doctor, please answer the medical...hi my nine year old son had a cough and flu sy...Hi, If the symptoms persist that long this sug...
9If you are a doctor, please answer the medical...gyno problemsfor the past few months, I have b...Dear Friend. Welcome to Chat Doctor. I am Chat...
\n", "
" ], "text/plain": [ " instruction \\\n", "0 If you are a doctor, please answer the medical... \n", "1 If you are a doctor, please answer the medical... \n", "2 If you are a doctor, please answer the medical... \n", "3 If you are a doctor, please answer the medical... \n", "4 If you are a doctor, please answer the medical... \n", "5 If you are a doctor, please answer the medical... \n", "6 If you are a doctor, please answer the medical... \n", "7 If you are a doctor, please answer the medical... \n", "8 If you are a doctor, please answer the medical... \n", "9 If you are a doctor, please answer the medical... \n", "\n", " input \\\n", "0 I woke up this morning feeling the whole room ... \n", "1 My baby has been pooing 5-6 times a day for a ... \n", "2 Hello, My husband is taking Oxycodone due to a... \n", "3 lump under left nipple and stomach pain (male)... \n", "4 I have a 5 month old baby who is very congeste... \n", "5 I am F 38 in good shape work out (do triathlon... \n", "6 sir, MY uncle has ILD-Interstitial Lung diseas... \n", "7 my husband was working on a project in the hou... \n", "8 hi my nine year old son had a cough and flu sy... \n", "9 gyno problemsfor the past few months, I have b... \n", "\n", " output \n", "0 Hi, Thank you for posting your query. The most... \n", "1 Hi... Thank you for consulting in Chat Doctor.... \n", "2 Hello, and I hope I can help you today.First, ... \n", "3 HI. You have two different problems. The lump ... \n", "4 Thank you for using Chat Doctor. I would sugge... \n", "5 Hi, From history it seems that you might be ha... \n", "6 Thanks for your question on Chat Doctor. I can... \n", "7 Hello. It could be a blood collection due to m... \n", "8 Hi, If the symptoms persist that long this sug... \n", "9 Dear Friend. Welcome to Chat Doctor. I am Chat... " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.head(10)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "qa-env", "language": "python", "name": "qa-env" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.18" } }, "nbformat": 4, "nbformat_minor": 4 }