Spaces:
Sleeping
Sleeping
Create README.md
Browse files
README.md
CHANGED
|
@@ -1,88 +1,59 @@
|
|
| 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 |
-
"epochs": 3,
|
| 62 |
-
"evaluation_steps": 0,
|
| 63 |
-
"evaluator": "NoneType",
|
| 64 |
-
"max_grad_norm": 1,
|
| 65 |
-
"optimizer_class": "<class 'torch.optim.adamw.AdamW'>",
|
| 66 |
-
"optimizer_params": {
|
| 67 |
-
"lr": 2e-05
|
| 68 |
-
},
|
| 69 |
-
"scheduler": "WarmupLinear",
|
| 70 |
-
"steps_per_epoch": null,
|
| 71 |
-
"warmup_steps": 100,
|
| 72 |
-
"weight_decay": 0.01
|
| 73 |
-
}
|
| 74 |
-
```
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
## Full Model Architecture
|
| 78 |
-
```
|
| 79 |
-
SentenceTransformer(
|
| 80 |
-
(0): Transformer({'max_seq_length': 256, 'do_lower_case': False}) with Transformer model: BertModel
|
| 81 |
-
(1): Pooling({'word_embedding_dimension': 384, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False})
|
| 82 |
-
(2): Normalize()
|
| 83 |
-
)
|
| 84 |
-
```
|
| 85 |
-
|
| 86 |
-
## Citing & Authors
|
| 87 |
-
|
| 88 |
-
<!--- Describe where people can find more information -->
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Construction Scope Validator
|
| 3 |
+
emoji: ποΈ
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# Construction Scope Validator API
|
| 11 |
+
|
| 12 |
+
FastAPI service that validates and enriches LLM-generated construction scope of work with database-verified stages, tasks, and materials.
|
| 13 |
+
|
| 14 |
+
## Features
|
| 15 |
+
|
| 16 |
+
- π― Stage name validation and matching
|
| 17 |
+
- π Task recommendation based on stage and context
|
| 18 |
+
- π¨ Material suggestion with pricing
|
| 19 |
+
- π Confidence scores for all matches
|
| 20 |
+
- π Fast embedding-based search
|
| 21 |
+
|
| 22 |
+
## API Endpoints
|
| 23 |
+
|
| 24 |
+
- `GET /` - Service info
|
| 25 |
+
- `GET /health` - Health check
|
| 26 |
+
- `POST /validate` - Main validation endpoint
|
| 27 |
+
- `POST /match-stage` - Test stage matching
|
| 28 |
+
- `POST /match-room` - Test room matching
|
| 29 |
+
|
| 30 |
+
## Usage
|
| 31 |
+
```python
|
| 32 |
+
import requests
|
| 33 |
+
|
| 34 |
+
response = requests.post(
|
| 35 |
+
"https://YOUR-SPACE-NAME.hf.space/validate",
|
| 36 |
+
json={
|
| 37 |
+
"scope_of_work": [
|
| 38 |
+
{
|
| 39 |
+
"area": "Living Room",
|
| 40 |
+
"items": [
|
| 41 |
+
{
|
| 42 |
+
"stage": "Demolition",
|
| 43 |
+
"task": "Remove walls",
|
| 44 |
+
"material": "Demolition tools",
|
| 45 |
+
"quantity": 1,
|
| 46 |
+
"unit": "set"
|
| 47 |
+
}
|
| 48 |
+
]
|
| 49 |
+
}
|
| 50 |
+
]
|
| 51 |
+
}
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
print(response.json())
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
## Model
|
| 58 |
+
|
| 59 |
+
Uses fine-tuned Sentence Transformer (all-MiniLM-L6-v2) with 89.4% accuracy for stage-task-material matching.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|