Add sentiment_engine with CryptoSentimentCalibrator fixes - improved keyword lists, lowered FinBERT threshold, added neutral handling
This commit is contained in:
27
sentiment_engine/fix_false_positives.py
Normal file
27
sentiment_engine/fix_false_positives.py
Normal file
@@ -0,0 +1,27 @@
|
||||
with open('src/sentiment_engine/nlp/entity_extraction.py', 'r') as f:
|
||||
lines = f.readlines()
|
||||
|
||||
new_lines = []
|
||||
for line in lines:
|
||||
stripped = line.strip()
|
||||
if stripped == '"MOVING", "HARD", "SOFT", "FAST", "SLOW", "BIG", "SMALL",':
|
||||
new_lines.append(' "MOVING", "HARD", "SOFT", "FAST", "SLOW", "BIG", "SMALL",\n')
|
||||
elif stripped == '"LONG", "SHORT", "HIGH", "LOW", "OPEN", "CLOSE",':
|
||||
new_lines.append(' "LONG", "SHORT", "HIGH", "LOW", "OPEN", "CLOSE",\n')
|
||||
elif stripped == '"BULL", "BEAR", "FLAT", "VOL", "VOLS",':
|
||||
new_lines.append(' "BULL", "BEAR", "FLAT", "VOL", "VOLS",\n')
|
||||
elif stripped == '"BID", "ASK", "MID", "VWAP", "TWAP",':
|
||||
new_lines.append(' "BID", "ASK", "MID", "VWAP", "TWAP",\n')
|
||||
elif stripped == '"RSI", "MACD", "BB", "EMA", "SMA", "WMA",':
|
||||
new_lines.append(' "RSI", "MACD", "BB", "EMA", "SMA", "WMA",\n')
|
||||
elif stripped == '"ATR", "ADX", "CCI", "STOCH", "RSI",':
|
||||
new_lines.append(' "ATR", "ADX", "CCI", "STOCH", "RSI",\n')
|
||||
elif stripped == '"K", "M", "B", "T", "MM", "BB", "TT",':
|
||||
new_lines.append(' "K", "M", "B", "T", "MM", "BB", "TT",\n')
|
||||
else:
|
||||
new_lines.append(line)
|
||||
|
||||
with open('src/sentiment_engine/nlp/entity_extraction.py', 'w') as f:
|
||||
f.writelines(new_lines)
|
||||
|
||||
print('Fixed indentation')
|
||||
Reference in New Issue
Block a user