todlong2 / config.py
cwpkd's picture
Create config.py
83f44c4 verified
# 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"