Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -5,6 +5,117 @@ colorFrom: blue
|
|
| 5 |
colorTo: gray
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
|
|
|
| 8 |
---
|
|
|
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
colorTo: gray
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
+
license: apache-2.0
|
| 9 |
---
|
| 10 |
+
# MVT Community Value Model API
|
| 11 |
|
| 12 |
+
This API powers the **MyVillage Token (MVT)** scoring system.
|
| 13 |
+
It evaluates real-world community actions and predicts:
|
| 14 |
+
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
## 1. Estimated Dollar Value
|
| 18 |
+
How financially impactful the action is.
|
| 19 |
+
|
| 20 |
+
## 2. Impact Level
|
| 21 |
+
Overall significance of the action (0–1 scaled).
|
| 22 |
+
|
| 23 |
+
## 3. Category Strength Scores (0–1)
|
| 24 |
+
Each action is analyzed across 10 categories:
|
| 25 |
+
|
| 26 |
+
- **Family**
|
| 27 |
+
- **Community**
|
| 28 |
+
- **Education**
|
| 29 |
+
- **Health**
|
| 30 |
+
- **Environment**
|
| 31 |
+
- **Business**
|
| 32 |
+
- **Finance**
|
| 33 |
+
- **History / Heritage**
|
| 34 |
+
- **Spirituality**
|
| 35 |
+
- **Innovation**
|
| 36 |
+
- **Impact (standalone model)**
|
| 37 |
+
|
| 38 |
+
These models were trained using a custom dataset of **2,000+ human-created community actions**, labeled by the MVT team.
|
| 39 |
+
|
| 40 |
+
---
|
| 41 |
+
|
| 42 |
+
# How the API Works
|
| 43 |
+
|
| 44 |
+
Each model is stored separately on the HuggingFace Hub.
|
| 45 |
+
This Space loads:
|
| 46 |
+
|
| 47 |
+
- A universal text embedder
|
| 48 |
+
- 12 linear regression models trained on SentenceTransformer embeddings
|
| 49 |
+
- Outputs predictions for a single input sentence
|
| 50 |
+
|
| 51 |
+
---
|
| 52 |
+
|
| 53 |
+
# API Usage
|
| 54 |
+
|
| 55 |
+
## POST /predict
|
| 56 |
+
|
| 57 |
+
### Input:
|
| 58 |
+
```json
|
| 59 |
+
{
|
| 60 |
+
"text": "I helped my neighbor fix her fence after the storm."
|
| 61 |
+
}
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
### Output:
|
| 65 |
+
```json
|
| 66 |
+
{
|
| 67 |
+
"input": "I helped my neighbor fix her fence after the storm.",
|
| 68 |
+
"predictions": {
|
| 69 |
+
"estimated_value": 42.18,
|
| 70 |
+
"impact_level": 0.67,
|
| 71 |
+
"impact": 0.61,
|
| 72 |
+
"family": 0.20,
|
| 73 |
+
"community": 0.88,
|
| 74 |
+
"education": 0.05,
|
| 75 |
+
"health": 0.11,
|
| 76 |
+
"environment": 0.22,
|
| 77 |
+
"business": 0.03,
|
| 78 |
+
"finance": 0.02,
|
| 79 |
+
"history": 0.01,
|
| 80 |
+
"spirituality": 0.04,
|
| 81 |
+
"innovation": 0.08
|
| 82 |
+
}
|
| 83 |
+
}
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
---
|
| 87 |
+
|
| 88 |
+
# Running Locally
|
| 89 |
+
|
| 90 |
+
```
|
| 91 |
+
uvicorn app:app --reload --host 0.0.0.0 --port 7860
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
Then open:
|
| 95 |
+
|
| 96 |
+
```
|
| 97 |
+
http://localhost:7860/docs
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
---
|
| 101 |
+
|
| 102 |
+
# Models Used
|
| 103 |
+
|
| 104 |
+
Each model is individually hosted under the `ClergeF/` namespace:
|
| 105 |
+
|
| 106 |
+
- `value-impact-model`
|
| 107 |
+
- `impact-model`
|
| 108 |
+
- `family-model`
|
| 109 |
+
- `community-model`
|
| 110 |
+
- `education-model`
|
| 111 |
+
- `health-model`
|
| 112 |
+
- `environment-model`
|
| 113 |
+
- `business-model`
|
| 114 |
+
- `finance-model`
|
| 115 |
+
- `history-model`
|
| 116 |
+
- `spirituality-model`
|
| 117 |
+
- `innovation-model`
|
| 118 |
+
|
| 119 |
+
Embedder sourced from:
|
| 120 |
+
|
| 121 |
+
- `MVT-models/universal_embedder`
|