D Ф m i И i q ц e L Ф y e r commited on
Commit ·
4c9055a
1
Parent(s): 3aaebd6
Fix: NER aggregation_strategy & LIME timeout stability
Browse files
syscred/verification_system.py
CHANGED
|
@@ -175,11 +175,11 @@ class CredibilityVerificationSystem:
|
|
| 175 |
print(f"[SysCRED] ✗ Sentiment model failed: {e}")
|
| 176 |
|
| 177 |
try:
|
| 178 |
-
|
| 179 |
self.ner_pipeline = pipeline(
|
| 180 |
"ner",
|
| 181 |
model="dslim/bert-base-NER",
|
| 182 |
-
grouped_entities=True
|
| 183 |
device=-1,
|
| 184 |
model_kwargs={"low_cpu_mem_usage": True}
|
| 185 |
)
|
|
@@ -344,7 +344,7 @@ class CredibilityVerificationSystem:
|
|
| 344 |
return np.array(probs)
|
| 345 |
|
| 346 |
explanation = self.explainer.explain_instance(
|
| 347 |
-
text[:512], predict_proba, num_features=6
|
| 348 |
)
|
| 349 |
results['sentiment_explanation'] = explanation.as_list()
|
| 350 |
except Exception as e:
|
|
|
|
| 175 |
print(f"[SysCRED] ✗ Sentiment model failed: {e}")
|
| 176 |
|
| 177 |
try:
|
| 178 |
+
# NER pipeline - modèle plus léger
|
| 179 |
self.ner_pipeline = pipeline(
|
| 180 |
"ner",
|
| 181 |
model="dslim/bert-base-NER",
|
| 182 |
+
aggregation_strategy="simple", # <--- CORRECTION ICI (remplace grouped_entities=True)
|
| 183 |
device=-1,
|
| 184 |
model_kwargs={"low_cpu_mem_usage": True}
|
| 185 |
)
|
|
|
|
| 344 |
return np.array(probs)
|
| 345 |
|
| 346 |
explanation = self.explainer.explain_instance(
|
| 347 |
+
text[:512], predict_proba, num_features=6, num_samples=500 # <--- AJOUTER CECI
|
| 348 |
)
|
| 349 |
results['sentiment_explanation'] = explanation.as_list()
|
| 350 |
except Exception as e:
|