MedRAG commited on
Commit
fef61f9
1 Parent(s): d4dbb9a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +74 -2
README.md CHANGED
@@ -1,3 +1,75 @@
1
- # StatPearls
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- According to the [privacy policy](https://www.statpearls.com/home/privacypolicy/) of StatPearls, we are not allowed to distribute the StatPearls content. Please download the raw data from [NCBI Bookshelf](https://www.ncbi.nlm.nih.gov/books/NBK430685/) and use [our code](https://github.com/Teddy-XiongGZ/MedRAG/blob/main/src/data/statpearls.py) for the chunking.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ task_categories:
3
+ - question-answering
4
+ language:
5
+ - en
6
+ tags:
7
+ - medical
8
+ - question answering
9
+ - large language model
10
+ - retrieval-augmented generation
11
+ size_categories:
12
+ - 100K<n<1M
13
+ ---
14
+ # The StatPearls Corpus in MedRAG
15
 
16
+ This HF dataset contains the chunked snippets from the StatPearls corpus used in [MedRAG](https://arxiv.org/abs/2402.13178). It can be used for medical Retrieval-Augmented Generation (RAG).
17
+
18
+ According to the [privacy policy](https://www.statpearls.com/home/privacypolicy/) of StatPearls, **we are not allowed to distribute the StatPearls content**. Please download the raw data from [NCBI Bookshelf](https://www.ncbi.nlm.nih.gov/books/NBK430685/) and use [our code](https://github.com/Teddy-XiongGZ/MedRAG/blob/main/src/data/statpearls.py) for the chunking.
19
+
20
+ ## Dataset Details
21
+
22
+ ### Dataset Descriptions
23
+
24
+ [StatPearls](https://www.statpearls.com/) is a point-of-the-care clinical decision support tool similar to [UpToDate](https://www.uptodate.com/). We use the 9,330 publicly available StatPearl articles through [NCBI Bookshelf](https://www.ncbi.nlm.nih.gov/books/NBK430685/) to construct the StatPearls corpus.
25
+ We chunked StatPearls according to the hierarchical structure, treating each paragraph in an article as a snippet and splicing all the relevant hierarchical headings as the corresponding title.
26
+ Our chunked corpus contains 301,202 snippets with an average of 119 tokens.
27
+
28
+ ### Dataset Structure
29
+ Each row is a snippet of StatPearls, which includes the following features:
30
+
31
+ - id: a unique identifier of the snippet
32
+ - title: the title and subtitles of the StatPearl article from which the snippet is collected
33
+ - content: the content of the snippet
34
+ - contents: a concatenation of 'title' and 'content', which will be used by the [BM25](https://github.com/castorini/pyserini) retriever
35
+
36
+ ## Uses
37
+
38
+ <!-- Address questions around how the dataset is intended to be used. -->
39
+
40
+ ### Direct Use
41
+
42
+ <!-- This section describes suitable use cases for the dataset. -->
43
+
44
+ ```shell
45
+ wget https://ftp.ncbi.nlm.nih.gov/pub/litarch/3d/12/statpearls_NBK430685.tar.gz -P ./corpus/statpearls
46
+ tar -xzvf ./corpus/statpearls/statpearls_NBK430685.tar.gz -C ./corpus/statpearls
47
+ python src/data/statpearls.py
48
+ ```
49
+
50
+ ### Use in MedRAG
51
+
52
+ ```python
53
+ >> from src.medrag import MedRAG
54
+
55
+ >> question = "A lesion causing compression of the facial nerve at the stylomastoid foramen will cause ipsilateral"
56
+ >> options = {
57
+ "A": "paralysis of the facial muscles.",
58
+ "B": "paralysis of the facial muscles and loss of taste.",
59
+ "C": "paralysis of the facial muscles, loss of taste and lacrimation.",
60
+ "D": "paralysis of the facial muscles, loss of taste, lacrimation and decreased salivation."
61
+ }
62
+
63
+ >> medrag = MedRAG(llm_name="OpenAI/gpt-3.5-turbo-16k", rag=True, retriever_name="MedCPT", corpus_name="StatPearls")
64
+ >> answer, snippets, scores = medrag.answer(question=question, options=options, k=32) # scores are given by the retrieval system
65
+ ```
66
+
67
+ ## Citation
68
+ ```shell
69
+ @article{xiong2024benchmarking,
70
+ title={Benchmarking Retrieval-Augmented Generation for Medicine},
71
+ author={Guangzhi Xiong and Qiao Jin and Zhiyong Lu and Aidong Zhang},
72
+ journal={arXiv preprint arXiv:2402.13178},
73
+ year={2024}
74
+ }
75
+ ```