Add sentiment_engine with CryptoSentimentCalibrator fixes - improved keyword lists, lowered FinBERT threshold, added neutral handling

This commit is contained in:
Codex
2026-09-14 13:30:05 +02:00
parent 19a7812094
commit a276aeaded
149 changed files with 35226 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
# Patch for labeling_pipeline.py - fix depeg pattern
import re
# Read the file
with open('/mnt/dolphinng5_predict/sentiment_engine/labeling_pipeline.py', 'r') as f:
content = f.read()
# Fix depeg pattern to match depegs, depegged, depegging
old_depeg = r'r"\b(hack|exploit|drain|stolen|rug|rugpull|scam|depeg|depegged)\b"'
new_depeg = r'r"\b(hack|exploit|drain|stolen|rug|rugpull|scam|depeg|depegged|depegs|depegging)\b"'
content = content.replace(old_depeg, new_depeg)
# Also add profit/arbitrage to bullish for completeness (but they're not necessarily bullish in context)
# Actually profit/arbitrage can be neutral or bullish depending on context, let's not add them
# Also add more regulatory keywords that are bearish
old_regulatory = r'r"\b(sec|lawsuit|enforcement|regulation|regulatory|cftc|ban|delist)\b"'
new_regulatory = r'r"\b(sec|lawsuit|enforcement|regulation|regulatory|cftc|ban|delist|crackdown|subpoena|investigation|charges|sues)\b"'
content = content.replace(old_regulatory, new_regulatory)
# Also add stablecoin/peg loss as bearish
old_bearish2 = r'r"\b(death.cross|breakdown|capitulation|liquidation)\b"'
new_bearish2 = r'r"\b(death.cross|breakdown|capitulation|liquidation|peg.loss|depeg|depegged|depegs)\b"'
content = content.replace(old_bearish2, new_bearish2)
# Write the patched file
with open('/mnt/dolphinng5_predict/sentiment_engine/labeling_pipeline.py', 'w') as f:
f.write(content)
print("Patch 2 applied successfully!")