File size: 5,026 Bytes
6ddce18
 
 
 
 
 
 
 
 
 
 
 
 
e4963d6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a1f4b2d
e4963d6
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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
---
title: Nursing Language Translator
emoji: πŸ₯
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: "4.44.0"
app_file: app.py
pinned: false
license: apache-2.0
short_description: Translate NHS clinical shorthand to formal language
---

# πŸ₯ Nursing Language Translator

[![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/NurseCitizenDeveloper/Nursing-Language-Translator)
[![Model](https://img.shields.io/badge/%F0%9F%A4%97%20Model-NurseEmbed--300M-orange)](https://huggingface.co/NurseCitizenDeveloper/NurseEmbed-300M)
[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)

**Translate NHS clinical shorthand to formal language using AI.**

Powered by [NurseEmbed-300M](https://huggingface.co/NurseCitizenDeveloper/NurseEmbed-300M), a clinical embedding model fine-tuned on NHS nursing terminology.

## πŸš€ Try It Now

**Live Demo:** https://huggingface.co/spaces/NurseCitizenDeveloper/Nursing-Language-Translator

## ✨ Features

| Feature | Description |
|---------|-------------|
| πŸ”€ **170+ NHS Abbreviations** | SOB, NEWS2, NOF, UTI, COPD, AF, LMWH, etc. |
| ⚠️ **NEWS2 Interpretation** | Automatic risk scoring with clinical actions |
| 🧠 **Semantic Matching** | AI-powered translation, not just string matching |
| πŸ“Š **Confidence Scores** | See how confident the model is in each translation |
| πŸ“š **Reference Guide** | Browse all abbreviations by category |

## πŸ“ Example

**Input:**
```
72M c/o SOB, NEWS2 score is 7, PMH: COPD, AF. Started on Salbutamol NEB and LMWH.
```

**Output:**

| Term | Translation | Category |
|------|------------|----------|
| `72M` | 72-year-old Male | Demographics |
| `c/o` | complaining of | Assessment |
| `SOB` | Shortness of Breath | Respiratory |
| `NEWS2 7` | πŸ”΄ High risk - Emergency response required | Assessment |
| `PMH` | Past Medical History | History |
| `COPD` | Chronic Obstructive Pulmonary Disease | Respiratory |
| `AF` | Atrial Fibrillation | Cardiovascular |
| `NEB` | Nebuliser | Route |
| `LMWH` | Low Molecular Weight Heparin | Medication |

## πŸ› οΈ Local Installation

```bash
# Clone the repository
git clone https://github.com/Clinical-Quality-Artifical-Intelligence/nursing-language-translator.git
cd nursing-language-translator

# Install dependencies
pip install -r requirements.txt

# Run the app
python app.py
```

Open http://localhost:7860 in your browser.

## πŸ“ Project Structure

```
nursing-language-translator/
β”œβ”€β”€ app.py                  # Main Gradio application
β”œβ”€β”€ knowledge_base.json     # 170+ NHS abbreviations database
β”œβ”€β”€ requirements.txt        # Python dependencies
└── README.md               # This file
```

## 🧠 How It Works

1. **Input Parsing**: Extracts individual terms and phrases from clinical text
2. **Semantic Embedding**: Uses NurseEmbed-300M to create vector representations
3. **Knowledge Base Matching**: Finds the closest matching abbreviation in the database
4. **NEWS2 Detection**: Automatically identifies and interprets Early Warning Scores
5. **Translation Generation**: Produces formal clinical language with confidence scores

## πŸ“Š Model Performance

NurseEmbed-300M was trained using a two-stage hybrid approach:

| Stage | Dataset | Samples | Performance |
|-------|---------|---------|-------------|
| Stage 1 (Medical) | `miriad-4.4M-split` | 10,000 | 81.3% Acc@1 |
| Stage 2 (Nursing) | Custom NHS dataset | 200 | 95.4% Acc@10 |

## 🏷️ Abbreviation Categories

- **Assessment**: NEWS2, MUST, Waterlow, AVPU, GCS
- **Respiratory**: SOB, COPD, URTI, LRTI, O2 sats
- **Cardiovascular**: AF, MI, PE, DVT, CCF
- **Medications**: LMWH, GTN, PRN, STAT, OD/BD/TDS
- **Routes**: IV, IM, SC, PO, PR, NEB
- **Investigations**: CXR, ECG, FBC, U&E, CT, MRI
- **Locations**: A&E, AMU, ITU, HDU, CCU
- **And 10+ more categories...**

## 🀝 Contributing

Contributions are welcome! To add new abbreviations:

1. Fork the repository
2. Edit `knowledge_base.json` to add new entries
3. Submit a pull request

## πŸ“„ License

This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.

## πŸ‘¨β€βš•οΈ Author

**Lincoln Gombedza** ([@NurseCitizenDeveloper](https://huggingface.co/NurseCitizenDeveloper))

- πŸ₯ Registered Learning Disability Nurse
- πŸŽ“ Practice Educator
- πŸ’» Co-Chair, Digital & Technology Working Group NHS Professional Strategy for Nursing and Midwifery
- πŸš€ Founder, Nursing Citizen Development Movement

## πŸ”— Related Projects

- [NurseEmbed-300M](https://huggingface.co/NurseCitizenDeveloper/NurseEmbed-300M) - The embedding model
- [NurseSim-Triage](https://huggingface.co/spaces/NurseCitizenDeveloper/NurseSim-Triage) - AI triage training
- [The Virtual Ward](https://huggingface.co/spaces/NurseCitizenDeveloper/The-Virtual-Ward) - RL environment for ward management

---

<p align="center">
  Built with ❀️ for NHS Nurses
</p>