Views
No views yet
MindScan/
├── app.py Flask backend — start here
├── predict.py Prediction logic (all 12 models)
├── requirements.txt Python dependencies
├── README.md This file
├── templates/
│ └── index.html UI (served by Flask at localhost:5000)
├── models/
│ ├── classical/ Download from Google Drive (see below)
│ └── transformers/ Download from Google Drive (see below)
└── notebooks/
├── DA_Notebook_One.ipynb Classical model training
└── DA_2_Notebook.ipynb XLM-RoBERTa + comparisonMindScan_Models/ from Google Drive and place the contents like this:
https://drive.google.com/drive/folders/16jfsPUcdekDWqtk4evTjQHQO2YoKJdpQ?usp=sharingmodels/
├── classical/
│ ├── le_d1.pkl, le_d2.pkl, le_d3.pkl
│ ├── tfidf_d1.pkl, tfidf_d2.pkl, tfidf_d3.pkl
│ ├── logistic_regression_d1.pkl, _d2.pkl, _d3.pkl
│ ├── svm_d1.pkl, _d2.pkl, _d3.pkl
│ └── xgboost_d1.pkl, _d2.pkl, _d3.pkl
└── transformers/
├── xlmr_d1_final/
├── xlmr_d2_final/
└── xlmr_d3_final/1python -m venv venv
2
3# Mac/Linux
4source venv/bin/activate
5
6# Windows
7venv\Scripts\activatepip install -r requirements.txtpython app.pyhttp://localhost:5000| Dataset | Source | Size | Task | |
|---|---|---|---|---|
| D1 | Nusrat et al. (2024) | Zenodo 14233292 | 14,983 tweets | 6-class depression type |
| D2 | albertobellardini | Kaggle | 10,314 tweets | Binary depression |
| D3 | nikhileswarkomati | Kaggle | 50,000 Reddit posts | Binary suicide risk |
| Dataset | Best Model | Macro F1 | Cohen's Kappa |
|---|---|---|---|
| D1 Depression Type | SVM | 0.9269 | 0.9072 |
| D2 Binary Depression | XLM-RoBERTa | 0.9993 | 0.9986 |
| D3 Suicide Risk | XLM-RoBERTa | 0.9810 | 0.9620 |
1// Request
2{ "text": "your text here" }
3
4// Response
5{
6 "dataset1": {
7 "task": "Depression Type (6 Classes)",
8 "models": {
9 "Logistic Regression": { "label": "postpartum", "confidence": 0.958 },
10 "SVM": { "label": "postpartum", "confidence": 0.828 },
11 "XGBoost": { "label": "postpartum", "confidence": 0.999 },
12 "XLM-RoBERTa": { "label": "postpartum", "confidence": 0.997 }
13 },
14 "winner_model": "XGBoost",
15 "winner_prediction": "postpartum",
16 "winner_confidence": 0.999,
17 "class_probs": { "postpartum": 0.997, "bipolar": 0.001, ... }
18 },
19 "dataset2": { ... },
20 "dataset3": { ... },
21 "risk_flag": false,
22 "suicide_votes": "0/4 models flagged suicide risk",
23 "processing_time_ms": 2341
24}{ "status": "ok", "models_ready": true }