Spaces:
Running
Running
Upload src/feature_extraction.py with huggingface_hub
Browse files- src/feature_extraction.py +10 -0
src/feature_extraction.py
CHANGED
|
@@ -123,6 +123,12 @@ POSITIVE_SENTIMENT_SIGNALS = [
|
|
| 123 |
),
|
| 124 |
]
|
| 125 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
COMPLEXITY_KEYWORDS = [
|
| 127 |
'integration', 'migration', 'sso', 'bulk', 'setup', 'configure', 'synchronization',
|
| 128 |
'permissions', 'architecture', 'implementation', 'customization',
|
|
@@ -218,6 +224,10 @@ class FeatureExtractor:
|
|
| 218 |
|
| 219 |
score = max(min(score + adjustment + positive_adjustment, 1.0), -1.0)
|
| 220 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 221 |
if score <= -0.55 or any(e.startswith(('frustration', 'trust_risk')) for e in evidence):
|
| 222 |
label = 'frustrated'
|
| 223 |
elif score <= -0.20 or evidence:
|
|
|
|
| 123 |
),
|
| 124 |
]
|
| 125 |
|
| 126 |
+
LEXICON_SENTIMENT_CUES = [
|
| 127 |
+
'wrong', 'broken', 'error', 'failed', 'failing', 'issue', 'problem',
|
| 128 |
+
'invalid', 'locked out', 'cannot access', "can't access", 'not working',
|
| 129 |
+
'frustrated', 'disappointed', 'difficult', 'unacceptable',
|
| 130 |
+
]
|
| 131 |
+
|
| 132 |
COMPLEXITY_KEYWORDS = [
|
| 133 |
'integration', 'migration', 'sso', 'bulk', 'setup', 'configure', 'synchronization',
|
| 134 |
'permissions', 'architecture', 'implementation', 'customization',
|
|
|
|
| 224 |
|
| 225 |
score = max(min(score + adjustment + positive_adjustment, 1.0), -1.0)
|
| 226 |
|
| 227 |
+
if raw_score <= -0.20 and not evidence:
|
| 228 |
+
lexicon_hits = [cue for cue in LEXICON_SENTIMENT_CUES if cue in tl]
|
| 229 |
+
evidence.extend([f'lexicon_sentiment: {cue}' for cue in lexicon_hits[:3]])
|
| 230 |
+
|
| 231 |
if score <= -0.55 or any(e.startswith(('frustration', 'trust_risk')) for e in evidence):
|
| 232 |
label = 'frustrated'
|
| 233 |
elif score <= -0.20 or evidence:
|