File size: 1,847 Bytes
50231a8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2d0ef3b
 
50231a8
2571402
50231a8
 
 
 
 
2d0ef3b
50231a8
 
 
 
 
 
 
 
 
 
2571402
50231a8
 
 
 
 
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
# Configuration Reference

Configuration is managed with Pydantic Settings.

Evidence:
- `app/core/config.py`
- `.env.example`
- `docker-compose.yml`

## Application settings

| Variable | Default | Purpose |
|---|---|---|
| `APP_NAME` | `Classifier General API` | FastAPI title |
| `ENVIRONMENT` | `development` | environment label |
| `DEBUG` | `false` | debug mode |

## Filesystem settings

| Variable | Default | Purpose |
|---|---|---|
| `STATIC_DIR` | `static` | static root served at `/static` |
| `UPLOAD_SUBDIR` | `uploads` | upload directory under static root |

## Classifier integration settings

| Variable | Default | Purpose |
|---|---|---|
| `CLASSIFIER_MODEL` | `AyoubChLin/bert-base-uncased-zeroshot-nli` | Hugging Face model ID used for local zero-shot NLI classification |
| `ENABLE_MODEL_QUANTIZATION` | `true` | enable dynamic INT8 quantization with automatic fallback |
| `HUGGINGFACE_TOKEN` | empty | optional auth token for client init |
| `CLASSIFIER_ENTAILMENT_LABEL_ID` | empty | optional integer override for entailment logit index when model config does not expose an `entailment` label |

## Language detector settings

| Variable | Default | Purpose |
|---|---|---|
| none | n/a | language detection now uses local `langdetect` |

## Label settings

| Variable | Default | Purpose |
|---|---|---|
| `DEFAULT_LABELS_CSV` | `news,sport,finance,politics` | initial in-memory labels |

## Behavior notes
- Labels are process-local in memory and reset on restart.
- Upload directory is auto-created at app startup.
- If `label2id`/`id2label` does not include an entailment label, the service checks task-specific config, then `CLASSIFIER_ENTAILMENT_LABEL_ID`, then falls back to index `2` for 3-logit generic/missing mappings.

Evidence:
- `app/services/label_service.py`
- `app/models/label_config.py`
- `app/main.py`