Update vips_classifier.py
Browse files- vips_classifier.py +3 -9
vips_classifier.py
CHANGED
|
@@ -6,9 +6,7 @@ from config import Config
|
|
| 6 |
logger = logging.getLogger(__name__)
|
| 7 |
|
| 8 |
|
| 9 |
-
|
| 10 |
-
# SHARED COMPONENTS
|
| 11 |
-
# ==========================================================
|
| 12 |
|
| 13 |
_VIPS_DEFINITIONS = """VIPS categories:
|
| 14 |
V (Valbefinnande): pain, fatigue, nausea, dizziness, sleep, mood, anxiety, appetite, physical symptoms
|
|
@@ -24,9 +22,7 @@ _RULES = """RULES:
|
|
| 24 |
- Output the four VIPS lines in plain text, no markdown, no numbering"""
|
| 25 |
|
| 26 |
|
| 27 |
-
|
| 28 |
-
# THREE INDEPENDENT PROMPT STRATEGIES
|
| 29 |
-
# ==========================================================
|
| 30 |
|
| 31 |
def build_prompt_zero_shot(text: str) -> str:
|
| 32 |
"""Strategy 1: Pure task instruction with explicit format anchor."""
|
|
@@ -149,9 +145,7 @@ def format_vips_for_display(vips: dict) -> str:
|
|
| 149 |
for k in ["V", "I", "P", "S"])
|
| 150 |
|
| 151 |
|
| 152 |
-
|
| 153 |
-
# MAIN - three SEPARATE API calls + DEBUG LOGGING
|
| 154 |
-
# ==========================================================
|
| 155 |
|
| 156 |
def classify_all(english_text: str, mistral_client) -> dict:
|
| 157 |
"""
|
|
|
|
| 6 |
logger = logging.getLogger(__name__)
|
| 7 |
|
| 8 |
|
| 9 |
+
|
|
|
|
|
|
|
| 10 |
|
| 11 |
_VIPS_DEFINITIONS = """VIPS categories:
|
| 12 |
V (Valbefinnande): pain, fatigue, nausea, dizziness, sleep, mood, anxiety, appetite, physical symptoms
|
|
|
|
| 22 |
- Output the four VIPS lines in plain text, no markdown, no numbering"""
|
| 23 |
|
| 24 |
|
| 25 |
+
|
|
|
|
|
|
|
| 26 |
|
| 27 |
def build_prompt_zero_shot(text: str) -> str:
|
| 28 |
"""Strategy 1: Pure task instruction with explicit format anchor."""
|
|
|
|
| 145 |
for k in ["V", "I", "P", "S"])
|
| 146 |
|
| 147 |
|
| 148 |
+
|
|
|
|
|
|
|
| 149 |
|
| 150 |
def classify_all(english_text: str, mistral_client) -> dict:
|
| 151 |
"""
|