Spaces:
Paused
Paused
Download utils/models.py from MuhammadTechxone/heedxai: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/spaces/MuhammadTechxone/heedxai/resolve/main/utils/models.py
- Command line
-
hf download hf://spaces/MuhammadTechxone/heedxai/utils/models.py
-
curl -L -o models.py https://huggingface.co/spaces/MuhammadTechxone/heedxai/resolve/main/utils/models.py
1.07 kB
| from django.db import models | |
| from django.contrib.auth.models import User | |
| class CheckIn(models.Model): | |
| """Stores a single mental health assessment session.""" | |
| user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True) | |
| created_at = models.DateTimeField(auto_now_add=True) | |
| # Aggregated Results | |
| primary_indicator = models.CharField(max_length=50) | |
| primary_percentage = models.FloatField() | |
| risk_level = models.CharField(max_length=50) | |
| # Raw Data and Distributions (PostgreSQL JSONField recommended) | |
| responses = models.JSONField() | |
| distribution = models.JSONField() | |
| def __str__(self): | |
| return f"Check-in {self.id} - {self.primary_indicator} ({self.created_at.date()})" | |
| class SentenceAnalysis(models.Model): | |
| """Granular sentence-level analysis for the UI.""" | |
| checkin = models.ForeignKey(CheckIn, related_name='sentences', on_delete=models.CASCADE) | |
| text = models.TextField() | |
| label = models.CharField(max_length=50) | |
| confidence = models.FloatField() |