Spaces:
Running
Running
Update model.py
Browse files
model.py
CHANGED
@@ -105,12 +105,17 @@ def assess_churn_risk(sentiment_label, emotion_label):
|
|
105 |
|
106 |
# === Pain Point Extractor ===
|
107 |
def extract_pain_points(text):
|
|
|
|
|
|
|
|
|
108 |
common_issues = [
|
109 |
"slow", "crash", "lag", "expensive", "confusing", "noisy", "poor", "rude",
|
110 |
"unhelpful", "bug", "broken", "unresponsive", "not working", "error", "delay", "disconnect"
|
111 |
]
|
112 |
-
|
113 |
-
|
|
|
114 |
|
115 |
# === Industry Detector ===
|
116 |
def detect_industry(text):
|
|
|
105 |
|
106 |
# === Pain Point Extractor ===
|
107 |
def extract_pain_points(text):
|
108 |
+
"""
|
109 |
+
Returns a list of keyword-based user pain points.
|
110 |
+
Later you can extend with transformer-based aspect mining (KeyBERT, LLMs).
|
111 |
+
"""
|
112 |
common_issues = [
|
113 |
"slow", "crash", "lag", "expensive", "confusing", "noisy", "poor", "rude",
|
114 |
"unhelpful", "bug", "broken", "unresponsive", "not working", "error", "delay", "disconnect"
|
115 |
]
|
116 |
+
text_lower = text.lower()
|
117 |
+
matches = [kw for kw in common_issues if re.search(rf"\b{kw}\b", text_lower)]
|
118 |
+
return list(set(matches))[:5]
|
119 |
|
120 |
# === Industry Detector ===
|
121 |
def detect_industry(text):
|