Upload README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: albert-base-v2
|
| 3 |
+
tags:
|
| 4 |
+
- safety
|
| 5 |
+
- occupational-safety
|
| 6 |
+
- albert
|
| 7 |
+
- domain-adaptation
|
| 8 |
+
- memory-efficient
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# SafetyALBERT
|
| 12 |
+
|
| 13 |
+
SafetyALBERT is a memory-efficient ALBERT model fine-tuned on occupational safety data. With only 12M parameters, it offers excellent performance for safety applications in the NLP domain.
|
| 14 |
+
|
| 15 |
+
## Quick Start
|
| 16 |
+
|
| 17 |
+
```python
|
| 18 |
+
from transformers import AutoTokenizer, AutoModelForMaskedLM
|
| 19 |
+
|
| 20 |
+
tokenizer = AutoTokenizer.from_pretrained("albert-base-v2")
|
| 21 |
+
model = AutoModelForMaskedLM.from_pretrained("adanish91/safetyalbert")
|
| 22 |
+
|
| 23 |
+
# Example usage
|
| 24 |
+
text = "Chemical [MASK] must be stored properly."
|
| 25 |
+
inputs = tokenizer(text, return_tensors="pt")
|
| 26 |
+
outputs = model(**inputs)
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
## Model Details
|
| 30 |
+
|
| 31 |
+
- **Base Model**: albert-base-v2
|
| 32 |
+
- **Parameters**: 12M (89% smaller than SafetyBERT)
|
| 33 |
+
- **Model Size**: 45MB
|
| 34 |
+
- **Training Data**: Same 2.4M safety documents as SafetyBERT
|
| 35 |
+
- **Advantages**: Fast inference, low memory usage
|
| 36 |
+
|
| 37 |
+
## Performance
|
| 38 |
+
|
| 39 |
+
- 90.3% improvement in pseudo-perplexity over ALBERT-base
|
| 40 |
+
- Competitive with SafetyBERT despite 9x fewer parameters
|
| 41 |
+
- Ideal for production deployment and edge devices
|
| 42 |
+
|
| 43 |
+
## Applications
|
| 44 |
+
|
| 45 |
+
- Occupational safety-related downstream applications
|
| 46 |
+
- Resource-constrained environments
|