Duplicate from MedRAG/textbooks
Browse filesCo-authored-by: MedRAG <MedRAG@users.noreply.huggingface.co>
Files changed (20)
- .gitattributesAdded+56
- README.mdAdded+72
- chunk/Anatomy_Gray.jsonlAdded+3
- chunk/Biochemistry_Lippincott.jsonlAdded+3
- chunk/Cell_Biology_Alberts.jsonlAdded+3
- chunk/First_Aid_Step1.jsonlAdded+3
- chunk/First_Aid_Step2.jsonlAdded+3
- chunk/Gynecology_Novak.jsonlAdded+3
- chunk/Histology_Ross.jsonlAdded+3
- chunk/Immunology_Janeway.jsonlAdded+3
- chunk/InternalMed_Harrison.jsonlAdded+3
- chunk/Neurology_Adams.jsonlAdded+3
- chunk/Obstentrics_Williams.jsonlAdded+3
- chunk/Pathology_Robbins.jsonlAdded+3
- chunk/Pathoma_Husain.jsonlAdded+3
- chunk/Pediatrics_Nelson.jsonlAdded+3
- chunk/Pharmacology_Katzung.jsonlAdded+3
- chunk/Physiology_Levy.jsonlAdded+3
- chunk/Psichiatry_DSM-5.jsonlAdded+3
- chunk/Surgery_Schwartz.jsonlAdded+3
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ckpt filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.lz4 filter=lfs diff=lfs merge=lfs -text*.mlmodel filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.npy filter=lfs diff=lfs merge=lfs -text*.npz filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pickle filter=lfs diff=lfs merge=lfs -text*.pkl filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -text*.safetensors filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tar filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.wasm filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text# Audio files - uncompressed*.pcm filter=lfs diff=lfs merge=lfs -text*.sam filter=lfs diff=lfs merge=lfs -text*.raw filter=lfs diff=lfs merge=lfs -text# Audio files - compressed*.aac filter=lfs diff=lfs merge=lfs -text*.flac filter=lfs diff=lfs merge=lfs -text*.mp3 filter=lfs diff=lfs merge=lfs -text*.ogg filter=lfs diff=lfs merge=lfs -text*.wav filter=lfs diff=lfs merge=lfs -text# Image files - uncompressed*.bmp filter=lfs diff=lfs merge=lfs -text*.gif filter=lfs diff=lfs merge=lfs -text*.png filter=lfs diff=lfs merge=lfs -text*.tiff filter=lfs diff=lfs merge=lfs -text# Image files - compressed*.jpg filter=lfs diff=lfs merge=lfs -text*.jpeg filter=lfs diff=lfs merge=lfs -text*.webp filter=lfs diff=lfs merge=lfs -text*.jsonl filter=lfs diff=lfs merge=lfs -text123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172---task_categories:- question-answeringlanguage:- entags:- medical- question answering- large language model- retrieval-augmented generationsize_categories:- 100K<n<1M---# The Textbooks Corpus in MedRAG
This HF dataset contains the chunked snippets from the Textbooks corpus used in [MedRAG](https://arxiv.org/abs/2402.13178). It can be used for medical Retrieval-Augmented Generation (RAG).
## Dataset Details
### Dataset Descriptions
[Textbooks](https://github.com/jind11/MedQA) is a collection of 18 widely used medical textbooks, which are important references for students taking the United States Medical Licensing Examination (USLME).In MedRAG, the textbooks are processed as chunks with no more than 1000 characters. We used the RecursiveCharacterTextSplitter from [LangChain](https://www.langchain.com/) to perform the chunking. This HF dataset contains our ready-to-use chunked snippets for the Textbooks corpus, including 125,847 snippets with an average of 182 tokens.
### Dataset StructureEach row is a snippet of Textbooks, which includes the following features:
- id: a unique identifier of the snippet- title: the title of the textbook from which the snippet is collected- content: the content of the snippet- contents: a concatenation of 'title' and 'content', which will be used by the [BM25](https://github.com/castorini/pyserini) retriever
## Uses
<!-- Address questions around how the dataset is intended to be used. -->
### Direct Use
<!-- This section describes suitable use cases for the dataset. -->
```shellgit clone https://huggingface.co/datasets/MedRAG/textbooks```
### Use in MedRAG
```python>> from src.medrag import MedRAG
>> question = "A lesion causing compression of the facial nerve at the stylomastoid foramen will cause ipsilateral">> options = { "A": "paralysis of the facial muscles.", "B": "paralysis of the facial muscles and loss of taste.", "C": "paralysis of the facial muscles, loss of taste and lacrimation.", "D": "paralysis of the facial muscles, loss of taste, lacrimation and decreased salivation."}
>> medrag = MedRAG(llm_name="OpenAI/gpt-3.5-turbo-16k", rag=True, retriever_name="MedCPT", corpus_name="Textbooks")>> answer, snippets, scores = medrag.answer(question=question, options=options, k=32) # scores are given by the retrieval system```
## Citation```shell@article{xiong2024benchmarking, title={Benchmarking Retrieval-Augmented Generation for Medicine}, author={Guangzhi Xiong and Qiao Jin and Zhiyong Lu and Aidong Zhang}, journal={arXiv preprint arXiv:2402.13178}, year={2024}}```123version https://git-lfs.github.com/spec/v1oid sha256:7ee624233f9bd0e1db499233dab824e396398f1c9b5b1a9a391be4aa61c1990bsize 5189523123version https://git-lfs.github.com/spec/v1oid sha256:baeb945f0b84cb073dfe286af5f9eb4c558a029f1c65a519e74ff425d51cabf6size 3190628123version https://git-lfs.github.com/spec/v1oid sha256:e281aaf151aac1bc2e893e89f5a28bb52c4e0fd29ce94a323940d47b23909f5dsize 11366263123version https://git-lfs.github.com/spec/v1oid sha256:9b6b3e1256d09481cd6caacf70732aa1ef58c934ff957a7228efa0f2a3a2af81size 1603285123version https://git-lfs.github.com/spec/v1oid sha256:49e1a4436f4c72ec94e890e95e16357d6d07e8a4b89cc6490742d621476396c8size 2502076123version https://git-lfs.github.com/spec/v1oid sha256:75123830fe5c6293b7af05446926d8dc4cf2d2f14b5fd4fc540ef94365902c3esize 13255943123version https://git-lfs.github.com/spec/v1oid sha256:2c68dcf3e903e648f79c6ef624b0ddfe23c98d8311d7341a005628d67386e57dsize 7045917123version https://git-lfs.github.com/spec/v1oid sha256:8c256fecfb8dfdbc8afad1966ba879994009f623bf2b28beb3caf444cd05f47bsize 7887983123version https://git-lfs.github.com/spec/v1oid sha256:c0f3523c74e99c152cf51aad91928c811dc30918ca9d1c68a24691525ea6bcbbsize 52628209123version https://git-lfs.github.com/spec/v1oid sha256:7fe80c8c8d0dab2c6645a00166fdf8dce73a717e2fcf155736f1ecf5a13abfa2size 19461783123version https://git-lfs.github.com/spec/v1oid sha256:d8f53df6626566e3b0a8dc30ba76fe4fe3af1995333afcf55f7f569e1ba991fbsize 15223023123version https://git-lfs.github.com/spec/v1oid sha256:bc8d58dce0b5b94a42fafc2f47e6c3f2e0f3d86a5842d8fd2e60dc8a835e5045size 8653804123version https://git-lfs.github.com/spec/v1oid sha256:827ed8c8a6fb99fe863b230a231208fd2ad62effc3753ba8d17fce31cf8ba2a2size 983408123version https://git-lfs.github.com/spec/v1oid sha256:701fefb07537888d5062bc6873a5ac7e746867f8eda9c0fc6e14aaeeba96fce3size 6836659123version https://git-lfs.github.com/spec/v1oid sha256:47b79061f05293173787205e89a083350e0372beb197aceb92d2e3381c4b8334size 11923357123version https://git-lfs.github.com/spec/v1oid sha256:95c7b1972afef628228efd43a032ac83c6101a60b918b835fe24fff5b6b275dbsize 6973357123version https://git-lfs.github.com/spec/v1oid sha256:3a7b2232b2dbb642c06fdf8ea8926c8a69aeb05f76b43b7e71d79081b29f7171size 6732065123version https://git-lfs.github.com/spec/v1oid sha256:e1d682541c9e4704db5fe48d61944a115e204f693e0ca360171c41e44fc3b2c0size 30102070.gitattributesAdded+56
README.mdAdded+72
chunk/Anatomy_Gray.jsonlAdded+3
chunk/Biochemistry_Lippincott.jsonlAdded+3
chunk/Cell_Biology_Alberts.jsonlAdded+3
chunk/First_Aid_Step1.jsonlAdded+3
chunk/First_Aid_Step2.jsonlAdded+3
chunk/Gynecology_Novak.jsonlAdded+3
chunk/Histology_Ross.jsonlAdded+3
chunk/Immunology_Janeway.jsonlAdded+3
chunk/InternalMed_Harrison.jsonlAdded+3
chunk/Neurology_Adams.jsonlAdded+3
chunk/Obstentrics_Williams.jsonlAdded+3
chunk/Pathology_Robbins.jsonlAdded+3
chunk/Pathoma_Husain.jsonlAdded+3
chunk/Pediatrics_Nelson.jsonlAdded+3
chunk/Pharmacology_Katzung.jsonlAdded+3
chunk/Physiology_Levy.jsonlAdded+3
chunk/Psichiatry_DSM-5.jsonlAdded+3
chunk/Surgery_Schwartz.jsonlAdded+3