Update README.md
Browse files
README.md
CHANGED
|
@@ -1,202 +1,128 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
base_model: Qwen/Qwen3-4B
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
-
#
|
| 7 |
|
| 8 |
-
|
| 9 |
|
|
|
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
- **Developed by:** [More Information Needed]
|
| 21 |
-
- **Funded by [optional]:** [More Information Needed]
|
| 22 |
-
- **Shared by [optional]:** [More Information Needed]
|
| 23 |
-
- **Model type:** [More Information Needed]
|
| 24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 25 |
-
- **License:** [More Information Needed]
|
| 26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 27 |
-
|
| 28 |
-
### Model Sources [optional]
|
| 29 |
-
|
| 30 |
-
<!-- Provide the basic links for the model. -->
|
| 31 |
-
|
| 32 |
-
- **Repository:** [More Information Needed]
|
| 33 |
-
- **Paper [optional]:** [More Information Needed]
|
| 34 |
-
- **Demo [optional]:** [More Information Needed]
|
| 35 |
-
|
| 36 |
-
## Uses
|
| 37 |
-
|
| 38 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 39 |
-
|
| 40 |
-
### Direct Use
|
| 41 |
-
|
| 42 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
| 43 |
-
|
| 44 |
-
[More Information Needed]
|
| 45 |
-
|
| 46 |
-
### Downstream Use [optional]
|
| 47 |
-
|
| 48 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
| 49 |
-
|
| 50 |
-
[More Information Needed]
|
| 51 |
-
|
| 52 |
-
### Out-of-Scope Use
|
| 53 |
-
|
| 54 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
| 55 |
-
|
| 56 |
-
[More Information Needed]
|
| 57 |
-
|
| 58 |
-
## Bias, Risks, and Limitations
|
| 59 |
-
|
| 60 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 61 |
-
|
| 62 |
-
[More Information Needed]
|
| 63 |
-
|
| 64 |
-
### Recommendations
|
| 65 |
-
|
| 66 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 67 |
-
|
| 68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 69 |
-
|
| 70 |
-
## How to Get Started with the Model
|
| 71 |
-
|
| 72 |
-
Use the code below to get started with the model.
|
| 73 |
-
|
| 74 |
-
[More Information Needed]
|
| 75 |
|
| 76 |
## Training Details
|
| 77 |
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
-
|
| 149 |
-
-
|
| 150 |
-
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 174 |
-
|
| 175 |
-
**BibTeX:**
|
| 176 |
-
|
| 177 |
-
[More Information Needed]
|
| 178 |
-
|
| 179 |
-
**APA:**
|
| 180 |
-
|
| 181 |
-
[More Information Needed]
|
| 182 |
-
|
| 183 |
-
## Glossary [optional]
|
| 184 |
-
|
| 185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 186 |
-
|
| 187 |
-
[More Information Needed]
|
| 188 |
-
|
| 189 |
-
## More Information [optional]
|
| 190 |
-
|
| 191 |
-
[More Information Needed]
|
| 192 |
-
|
| 193 |
-
## Model Card Authors [optional]
|
| 194 |
-
|
| 195 |
-
[More Information Needed]
|
| 196 |
-
|
| 197 |
-
## Model Card Contact
|
| 198 |
-
|
| 199 |
-
[More Information Needed]
|
| 200 |
-
### Framework versions
|
| 201 |
-
|
| 202 |
-
- PEFT 0.15.2
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
base_model: Qwen/Qwen3-4B
|
| 4 |
+
tags:
|
| 5 |
+
- boolean-queries
|
| 6 |
+
- systematic-review
|
| 7 |
+
- information-retrieval
|
| 8 |
+
- pubmed
|
| 9 |
+
- reinforcement-learning
|
| 10 |
+
- grpo
|
| 11 |
+
- chain-of-thought
|
| 12 |
+
library_name: transformers
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# AutoBool-Qwen4b-Reasoning
|
| 16 |
|
| 17 |
+
This model is part of the **AutoBool** framework, a reinforcement learning approach for training large language models to generate high-quality Boolean queries for systematic literature reviews.
|
| 18 |
|
| 19 |
+
## Model Description
|
| 20 |
|
| 21 |
+
This variant uses **explicit chain-of-thought reasoning**. The model is instructed to provide detailed reasoning about the query construction process inside `<think></think>` tags before generating the final Boolean query.
|
| 22 |
|
| 23 |
+
- **Base Model:** Qwen/Qwen2.5-4B
|
| 24 |
+
- **Training Method:** GRPO (Group Relative Policy Optimization) with LoRA fine-tuning
|
| 25 |
+
- **Prompt Strategy:** Chain-of-thought reasoning
|
| 26 |
+
- System instruction: "Your reasoning process should be enclosed within `<think></think>`, and the final Boolean query must be enclosed within `<answer></answer>` tags"
|
| 27 |
+
- Output format: `<think>[Detailed step-by-step reasoning explaining the query construction process]</think><answer>[Boolean query]</answer>`
|
| 28 |
+
- Provides full explanation of term selection, MeSH terms, field tags, wildcards, and Boolean logic
|
| 29 |
+
- **Domain:** Biomedical literature search (PubMed)
|
| 30 |
+
- **Task:** Boolean query generation for high-recall retrieval
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
## Training Details
|
| 33 |
|
| 34 |
+
The model was trained using:
|
| 35 |
+
- **Optimization:** GRPO (Group Relative Policy Optimization)
|
| 36 |
+
- **Fine-tuning:** LoRA (Low-Rank Adaptation)
|
| 37 |
+
- **Dataset:** wshuai190/pubmed-pmc-sr-filtered
|
| 38 |
+
- **Reward Function:** Combines syntactic validity, format correctness, and retrieval effectiveness
|
| 39 |
+
- **Reasoning Approach:** Explicit thinking process with structured tags
|
| 40 |
+
|
| 41 |
+
## Intended Use
|
| 42 |
+
|
| 43 |
+
This model is designed for:
|
| 44 |
+
- Generating Boolean queries for systematic literature reviews
|
| 45 |
+
- High-recall biomedical information retrieval
|
| 46 |
+
- Supporting evidence synthesis in healthcare and biomedical research
|
| 47 |
+
- Applications where reasoning transparency is valuable
|
| 48 |
+
|
| 49 |
+
## How to Use
|
| 50 |
+
|
| 51 |
+
```python
|
| 52 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 53 |
+
import re
|
| 54 |
+
|
| 55 |
+
model_name = "ielabgroup/Autobool-Qwen4b-Reasoning"
|
| 56 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 57 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 58 |
+
|
| 59 |
+
# Define your systematic review topic
|
| 60 |
+
topic = "Diagnostic accuracy of endoscopic ultrasonography (EUS) for the preoperative locoregional staging of primary gastric cancer"
|
| 61 |
+
|
| 62 |
+
# Construct the prompt with system and user messages
|
| 63 |
+
messages = [
|
| 64 |
+
{"role": "system", "content": "You are an expert systematic review information specialist.\nYou are tasked to formulate a systematic review Boolean query in response to a research topic.\nYour reasoning process should be enclosed within <think></think>, and the final Boolean query must be enclosed within <answer></answer> tags. Do not include anything outside of these tags."},
|
| 65 |
+
{"role": "user", "content": f'You are given a systematic review research topic, with the topic title "{topic}".\nYour task is to generate a highly effective Boolean query in MEDLINE format for PubMed.\nThe query should balance **high recall** (capturing all relevant studies) with **reasonable precision** (avoiding irrelevant results):\n- Use both free-text terms and MeSH terms (e.g., chronic pain[tiab], Pain[mh]).\n- **Do not wrap terms or phrases in double quotes**, as this disables automatic term mapping (ATM).\n- Combine synonyms or related terms within a concept using OR.\n- Combine different concepts using AND.\n- Use wildcards (*) to capture word variants (e.g., vaccin* → vaccine, vaccination):\n - Terms must have ≥4 characters before the * (e.g., colo*)\n - Wildcards work with field tags (e.g., breastfeed*[tiab]).\n- Field tags limit the search to specific fields and disable ATM.\n- Do not include date limits.\n- Tag terms using appropriate fields (e.g., covid-19[ti] vaccine[ti] children[ti]) when needed.\n**Only use the following allowed field tags:**\nTitle: [ti], Abstract: [ab], Title/Abstract: [tiab]\nMeSH: [mh], Major MeSH: [majr], Supplementary Concept: [nm]\nText Words: [tw], All Fields: [all]\nPublication Type: [pt], Language: [la]\n\nOutput your full reasoning inside <think></think>.\nOutput the final Boolean query inside <answer></answer>.\nDo not include any content outside these tags.'}
|
| 66 |
+
]
|
| 67 |
+
|
| 68 |
+
# Generate the query
|
| 69 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 70 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 71 |
+
outputs = model.generate(**inputs, max_length=4096)
|
| 72 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 73 |
+
|
| 74 |
+
# Extract reasoning and query
|
| 75 |
+
reasoning_match = re.search(r'<think>(.*?)</think>', response, re.DOTALL)
|
| 76 |
+
query_match = re.search(r'<answer>(.*?)</answer>', response, re.DOTALL)
|
| 77 |
+
|
| 78 |
+
if reasoning_match and query_match:
|
| 79 |
+
reasoning = reasoning_match.group(1).strip()
|
| 80 |
+
query = query_match.group(1).strip()
|
| 81 |
+
print("Reasoning:", reasoning)
|
| 82 |
+
print("\nQuery:", query)
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
The model will generate output with reasoning:
|
| 86 |
+
```
|
| 87 |
+
<think>
|
| 88 |
+
[Detailed step-by-step reasoning explaining the query construction process,
|
| 89 |
+
including term selection, MeSH terms, field tags, wildcards, and Boolean logic]
|
| 90 |
+
</think>
|
| 91 |
+
<answer>
|
| 92 |
+
[Final Boolean query]
|
| 93 |
+
</answer>
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
## Advantages
|
| 97 |
+
|
| 98 |
+
- Provides interpretable reasoning process
|
| 99 |
+
- Can help understand query construction decisions
|
| 100 |
+
- May improve query quality through structured thinking
|
| 101 |
+
|
| 102 |
+
## Limitations
|
| 103 |
+
|
| 104 |
+
- Optimized specifically for PubMed Boolean query syntax
|
| 105 |
+
- Performance may vary on non-biomedical domains
|
| 106 |
+
- Requires domain knowledge for effective prompt engineering
|
| 107 |
+
|
| 108 |
+
## Citation
|
| 109 |
+
|
| 110 |
+
If you use this model, please cite:
|
| 111 |
+
|
| 112 |
+
```bibtex
|
| 113 |
+
@inproceedings{autobool2026,
|
| 114 |
+
title={AutoBool: Reinforcement Learning for Boolean Query Generation in Systematic Reviews},
|
| 115 |
+
author={Shuai Wang, Harrisen Scells, Bevan Koopman, Guido Zuccon},
|
| 116 |
+
booktitle={Proceedings of the 2026 Conference of the European Chapter of the Association for Computational Linguistics (EACL)},
|
| 117 |
+
year={2026}
|
| 118 |
+
}
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
## More Information
|
| 122 |
+
|
| 123 |
+
- **GitHub Repository:** [https://github.com/ielab/AutoBool](https://github.com/ielab/AutoBool)
|
| 124 |
+
- **Paper:** Accepted at EACL 2026
|
| 125 |
+
|
| 126 |
+
## License
|
| 127 |
+
|
| 128 |
+
Apache 2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|