File size: 1,019 Bytes
83f44c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Configuration file for Yahoo Finance News Sentiment Analyzer

# Yahoo Finance URLs
YAHOO_FINANCE_BASE_URL = "https://finance.yahoo.com"
YAHOO_FINANCE_NEWS_URL = "https://finance.yahoo.com/news/"

# Model Configuration
GEMMA_MODEL_NAME = "google/gemma-2-2b-it"  # ใช้ gemma-2-2b แทน เพราะ 4b ไม่มีใน Hugging Face
SENTIMENT_MODEL_NAME = "ProsusAI/finbert"  # Model สำหรับ financial sentiment

# Headers for web scraping
HEADERS = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
}

# Sentiment mapping
SENTIMENT_LABELS = {
    'positive': '😊 Positive',
    'negative': '😟 Negative',
    'neutral': '😐 Neutral'
}

# Score mapping
SCORE_RANGES = {
    'very_positive': (0.8, 1.0),
    'positive': (0.6, 0.8),
    'neutral': (0.4, 0.6),
    'negative': (0.2, 0.4),
    'very_negative': (0.0, 0.2)
}

# Default settings
MAX_NEWS_ITEMS = 10
DEFAULT_SEARCH_QUERY = "stock market"