EurekaPotato commited on
Commit
e453bf9
Β·
verified Β·
1 Parent(s): 1bc8c61

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. handler.py +1 -0
  2. text_features.py +3 -3
handler.py CHANGED
@@ -34,6 +34,7 @@ from fastapi.responses import JSONResponse
34
  from pydantic import BaseModel
35
  from typing import Optional, List, Dict
36
  import traceback
 
37
 
38
  # ──────────────────────────────────────────────────────────────────────── #
39
  # Constants & Defaults
 
34
  from pydantic import BaseModel
35
  from typing import Optional, List, Dict
36
  import traceback
37
+ import numpy as np
38
 
39
  # ──────────────────────────────────────────────────────────────────────── #
40
  # Constants & Defaults
text_features.py CHANGED
@@ -43,6 +43,9 @@ class TextFeatureExtractor:
43
  self.coherence_model = SentenceTransformer('all-MiniLM-L6-v2')
44
  print("[OK] Coherence model loaded")
45
 
 
 
 
46
  # Intent classification model (NEW - understands context!)
47
  if self.use_intent_model:
48
  try:
@@ -56,9 +59,6 @@ class TextFeatureExtractor:
56
  print(f"[WARN] Intent classifier failed to load: {e}")
57
  print(" Falling back to pattern matching")
58
  self.use_intent_model = False
59
- self._setup_patterns()
60
- else:
61
- self._setup_patterns()
62
 
63
  def _setup_patterns(self):
64
  """Setup pattern-based matching as fallback"""
 
43
  self.coherence_model = SentenceTransformer('all-MiniLM-L6-v2')
44
  print("[OK] Coherence model loaded")
45
 
46
+ # Always setup patterns β€” busy_keywords is needed by extract_marker_counts()
47
+ self._setup_patterns()
48
+
49
  # Intent classification model (NEW - understands context!)
50
  if self.use_intent_model:
51
  try:
 
59
  print(f"[WARN] Intent classifier failed to load: {e}")
60
  print(" Falling back to pattern matching")
61
  self.use_intent_model = False
 
 
 
62
 
63
  def _setup_patterns(self):
64
  """Setup pattern-based matching as fallback"""