Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,12 +1,87 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: yellow
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Workplace Safety Risk Predictor
|
| 3 |
+
emoji: π§
|
| 4 |
colorFrom: yellow
|
| 5 |
+
colorTo: red
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 4.0.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# π§ Workplace Safety Risk Prediction Model
|
| 13 |
+
|
| 14 |
+
An AI-powered tool for analyzing workplace scenarios to identify potential hazards, causes of accidents, and injury severity levels.
|
| 15 |
+
|
| 16 |
+
## π― Features
|
| 17 |
+
|
| 18 |
+
- **Hazard Identification**: Identifies potential workplace hazards from scenario descriptions
|
| 19 |
+
- **Cause Analysis**: Classifies the primary cause of workplace accidents
|
| 20 |
+
- **Injury Severity**: Assesses the degree of potential injuries
|
| 21 |
+
- **Structured Output**: Provides results in JSON format for easy integration
|
| 22 |
+
- **Interactive Interface**: User-friendly Gradio web interface
|
| 23 |
+
|
| 24 |
+
## π§ Model Details
|
| 25 |
+
|
| 26 |
+
- **Base Model**: DistilGPT-2
|
| 27 |
+
- **Fine-tuning Method**: LoRA (Low-Rank Adaptation)
|
| 28 |
+
- **Training Data**: OSHA workplace accident reports
|
| 29 |
+
- **Model Size**: ~82M parameters (base) + 589K LoRA parameters
|
| 30 |
+
|
| 31 |
+
## π Output Format
|
| 32 |
+
|
| 33 |
+
The model generates structured predictions in the following format:
|
| 34 |
+
|
| 35 |
+
```json
|
| 36 |
+
{
|
| 37 |
+
"Hazards": ["MECHANICAL POWER PRESS", "AMPUTATION", "FINGER", "GUARD"],
|
| 38 |
+
"Cause of Accident": "Caught in or between caused by Catch Point/Puncture Action",
|
| 39 |
+
"Degree of Injury": "Medium"
|
| 40 |
+
}
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
## π Usage
|
| 44 |
+
|
| 45 |
+
1. Enter a workplace scenario description in the text box
|
| 46 |
+
2. Adjust creativity and response length settings if needed
|
| 47 |
+
3. Click "Analyze Scenario" to generate predictions
|
| 48 |
+
4. View results in the structured output panels
|
| 49 |
+
|
| 50 |
+
## π‘ Example Scenarios
|
| 51 |
+
|
| 52 |
+
- Power press operations with safety hazards
|
| 53 |
+
- Falls from ladders or elevated surfaces
|
| 54 |
+
- Chemical exposure incidents
|
| 55 |
+
- Manual lifting injuries
|
| 56 |
+
- Construction site accidents
|
| 57 |
+
|
| 58 |
+
## β οΈ Important Notice
|
| 59 |
+
|
| 60 |
+
This model is designed for **educational and research purposes only**. Always consult qualified safety professionals for real workplace safety assessments and decisions.
|
| 61 |
+
|
| 62 |
+
## π οΈ Technical Implementation
|
| 63 |
+
|
| 64 |
+
- **Framework**: Hugging Face Transformers + PEFT
|
| 65 |
+
- **Interface**: Gradio
|
| 66 |
+
- **Deployment**: Hugging Face Spaces
|
| 67 |
+
- **Training**: Fine-tuned on OSHA incident reports using LoRA
|
| 68 |
+
|
| 69 |
+
## π Model Performance
|
| 70 |
+
|
| 71 |
+
The model has been trained to recognize common workplace hazards and provide structured safety assessments based on incident descriptions. Performance may vary depending on scenario complexity and domain specificity.
|
| 72 |
+
|
| 73 |
+
## π€ Contributing
|
| 74 |
+
|
| 75 |
+
Issues and suggestions are welcome! This model can be further improved with:
|
| 76 |
+
- Additional training data
|
| 77 |
+
- Domain-specific fine-tuning
|
| 78 |
+
- Enhanced post-processing
|
| 79 |
+
- Multi-language support
|
| 80 |
+
|
| 81 |
+
## π License
|
| 82 |
+
|
| 83 |
+
MIT License - Feel free to use and modify for educational and research purposes.
|
| 84 |
+
|
| 85 |
+
---
|
| 86 |
+
|
| 87 |
+
*Built with β€οΈ using Hugging Face Transformers and Gradio*
|