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,52 @@
# Patch for labeling_pipeline.py - fix SEC approval vs enforcement distinction
import re
# Read the file
with open('/mnt/dolphinng5_predict/sentiment_engine/labeling_pipeline.py', 'r') as f:
content = f.read()
# Update BULLISH_PATTERNS to include SEC approval
old_bullish = ''' BULLISH_PATTERNS = [
r"\\b(surge|surge|moon|pump|bullish|breakout|ath|all.time.high)\\b",
r"\\b(institutional|adoption|etf|accumulate|long|longing)\\b",
r"\\b(golden.cross|breakout|bullish|rally|surge|rally)\\b",
r"\\b(etf.approval|etf.approved|inflows|institutional.buying|whale.accumulation)\\b",
r"[🚀📈💎🙌🌙]",
]'''
new_bullish = ''' BULLISH_PATTERNS = [
r"\\b(surge|surge|moon|pump|bullish|breakout|ath|all.time.high)\\b",
r"\\b(institutional|adoption|etf|accumulate|long|longing)\\b",
r"\\b(golden.cross|breakout|bullish|rally|surge|rally)\\b",
r"\\b(etf.approval|etf.approved|inflows|institutional.buying|whale.accumulation)\\b",
r"\\b(sec.approves|sec.approved|sec.approval|approved.etf|etf.approved)\\b",
r"[🚀📈💎🙌🌙]",
]'''
content = content.replace(old_bullish, new_bullish)
# Update BEARISH_PATTERNS to be more specific about SEC actions (enforcement vs approval)
old_bearish = ''' BEARISH_PATTERNS = [
r"\\b(crash|crash|dump|bearish|panic|rekt|short|shorting)\\b",
r"\\b(hack|exploit|drain|stolen|rug|rugpull|scam|depeg|depegged|depegs|depegging)\\b",
r"\\b(death.cross|breakdown|capitulation|liquidation|peg.loss|depeg|depegged|depegs)\\b",
r"\\b(sec|lawsuit|enforcement|regulation|regulatory|cftc|ban|delist|crackdown|subpoena|investigation|charges|sues)\\b",
r"[📉😭💀🩸🧻]",
]'''
new_bearish = ''' BEARISH_PATTERNS = [
r"\\b(crash|crash|dump|bearish|panic|rekt|short|shorting)\\b",
r"\\b(hack|exploit|drain|stolen|rug|rugpull|scam|depeg|depegged|depegs|depegging)\\b",
r"\\b(death.cross|breakdown|capitulation|liquidation|peg.loss|depeg|depegged|depegs)\\b",
r"\\b(lawsuit|enforcement|crackdown|subpoena|investigation|charges|sues|sues.sec|sec.sues|sec.charges|cf tc.ban|regulatory.ban)\\b",
r"\\b(regulation|regulatory|cftc|ban|delist)\\b",
r"[📉😭💀🩸🧻]",
]'''
content = content.replace(old_bearish, new_bearish)
# Write the patched file
with open('/mnt/dolphinng5_predict/sentiment_engine/labeling_pipeline.py', 'w') as f:
f.write(content)
print("Patch 3 applied successfully!")