Spaces:
Runtime error
Runtime error
Pedot
Speed Phase 2: disk cache survives restart, reduced feeds/articles, Groq 20→12, enhanced skeleton UI
43af6e8 Download config.py from Tengkolok/CommoditySentiment: direct link, hf CLI and curl.
- Browser
- Download file 13.3 kB
-
https://huggingface.co/spaces/Tengkolok/CommoditySentiment/resolve/main/config.py
- Command line
-
hf download hf://spaces/Tengkolok/CommoditySentiment/config.py
-
curl -L -o config.py https://huggingface.co/spaces/Tengkolok/CommoditySentiment/resolve/main/config.py
13.3 kB
| COMMODITY_CONFIGS = { | |
| "gold": { | |
| "display_name": "XAU/USD Gold", | |
| "ticker": "GC=F", | |
| "price_label": "XAU/USD", | |
| "score_key": "xauusd", | |
| "currency": "$", | |
| "keywords": { | |
| "xauusd": ["XAU/USD", "GOLD", "Gold price", "gold spot", "xauusd"], | |
| "dxy": ["DXY", "US Dollar Index", "dollar index"], | |
| "usd": ["US Dollar", "USD", "greenback"], | |
| "fed": ["Fed", "Federal Reserve", "Powell", "Jerome Powell", "FOMC"], | |
| "inflation": ["Inflation", "CPI", "Core CPI", "PCE", "PPI"], | |
| "employment": ["NFP", "Non-Farm", "Nonfarm", "Unemployment", "Jobless Claims", "ADP"], | |
| "rates": ["Rate Cut", "Rate Hike", "Interest Rate", "rate decision", "rate path"], | |
| "geopolitical": ["Geopolitical", "War", "Conflict", "Tension", "Sanctions", "Escalate", "Middle East", "Ukraine", "Russia", "China Taiwan", "Iran", "Israel", "Hamas", "Nuclear", "OPEC", "tariff", "trade war"], | |
| }, | |
| "rss_feeds": [ | |
| "https://www.reuters.com/rssFeed/businessNews", | |
| "https://www.forexlive.com/feed/", | |
| "https://www.marketwatch.com/rss/topstories", | |
| "https://news.google.com/rss/search?q=gold+xau+usd+dxy+fed+inflation&hl=en-US&gl=US&ceid=US:en", | |
| ], | |
| "news_feeds": [ | |
| "https://news.google.com/rss/search?q=XAU+USD+gold+price&hl=en-US&gl=US&ceid=US:en", | |
| "https://news.google.com/rss/search?q=DXY+US+dollar+index&hl=en-US&gl=US&ceid=US:en", | |
| "https://news.google.com/rss/search?q=federal+reserve+rate+cut+hike&hl=en-US&gl=US&ceid=US:en", | |
| "https://news.google.com/rss/search?q=geopolitical+conflict+war+2026&hl=en-US&gl=US&ceid=US:en", | |
| ], | |
| "web_queries": [ | |
| "gold price XAU USD today", | |
| "DXY US dollar index today", | |
| "Federal Reserve rate decision latest", | |
| "geopolitical tensions latest", | |
| ], | |
| "bullish_phrases": [ | |
| "safe haven", "flight to safety", "risk off", "risk-off", "gold rises", | |
| "gold surges", "gold jumps", "gold climbs", "gold rallies", "gold higher", | |
| "buy gold", "bullish gold", "support for gold", "gold demand", "haven bid", | |
| "tensions escalate", "conflict intensifies", "war risk", "geopolitical risk", | |
| "rate cut", "cuts rates", "dovish", "pivot dovish", "easing cycle", | |
| "inflation rises", "inflation hot", "cpi above", "higher inflation", | |
| "dollar weakens", "dxy falls", "dollar slides", "dollar drops", | |
| "trade war", "sanctions", "retaliation", | |
| "gold breakout", "resistance broken", "above resistance", | |
| ], | |
| "bearish_phrases": [ | |
| "gold falls", "gold drops", "gold slides", "gold declines", "gold lower", | |
| "sell gold", "bearish gold", "gold pressure", "gold under pressure", | |
| "risk on", "risk-on", "equities rally", "stock market high", | |
| "rate hike", "hikes rates", "hawkish", "more hawkish", "higher for longer", | |
| "inflation eases", "inflation falls", "cpi below", "disinflation", | |
| "dollar strengthens", "dxy rises", "dollar rallies", "dollar firm", | |
| "gold breaks support", "below support", | |
| "gold sell-off", "liquidation", "profit taking", | |
| ], | |
| "fear_keywords": [ | |
| "war", "conflict", "escalat", "attack", "invasion", "nuclear", "missile", | |
| "sanctions", "retaliation", "military", "troops", "strike", "ceasefire", | |
| "iran", "israel", "hamas", "hezbollah", "ukraine", "russia", "china taiwan", | |
| "tension", "crisis", "threat", "opec", "embargo", "supply disruption", | |
| "pandem", "outbreak", "emergency", "alert", | |
| ], | |
| "fed_dovish": [ | |
| "rate cut", "cut rates", "dovish", "easing", "pivot", "pause", | |
| "no hike", "lower rates", "stimulus", "accommodative", "support growth", | |
| ], | |
| "fed_hawkish": [ | |
| "rate hike", "hike rates", "hawkish", "tightening", "higher for longer", | |
| "restrictive", "fight inflation", "no cut", "delay cut", "push back", | |
| "patient", "watch data", "not yet", "premature to cut", | |
| ], | |
| }, | |
| "wti": { | |
| "display_name": "WTI Crude Oil", | |
| "ticker": "CL=F", | |
| "price_label": "WTI/USD", | |
| "score_key": "wti", | |
| "currency": "$", | |
| "keywords": { | |
| "wti": ["WTI", "crude oil", "West Texas", "CL=F", "oil price", "brent crude"], | |
| "dxy": ["DXY", "US Dollar Index", "dollar index"], | |
| "usd": ["US Dollar", "USD", "greenback"], | |
| "fed": ["Fed", "Federal Reserve", "Powell", "Jerome Powell", "FOMC"], | |
| "inflation": ["Inflation", "CPI", "Core CPI", "PCE", "PPI"], | |
| "employment": ["NFP", "Non-Farm", "Nonfarm", "Unemployment", "Jobless Claims", "ADP"], | |
| "rates": ["Rate Cut", "Rate Hike", "Interest Rate", "rate decision", "rate path"], | |
| "supply": ["OPEC", "OPEC+", "production cut", "output cut", "production increase", "inventory draw", "inventory build", "EIA", "crude inventories", "rig count", "shale", "refinery", "demand destruction", "supply disruption"], | |
| "geopolitical": ["Geopolitical", "War", "Conflict", "Tension", "Sanctions", "Escalate", "Middle East", "Ukraine", "Russia", "Iran", "Israel", "Hamas", "Nuclear", "OPEC", "tariff", "trade war", "Strait of Hormuz", "Red Sea", "Suez Canal"], | |
| }, | |
| "rss_feeds": [ | |
| "https://www.reuters.com/rssFeed/businessNews", | |
| "https://www.forexlive.com/feed/", | |
| "https://www.marketwatch.com/rss/topstories", | |
| "https://news.google.com/rss/search?q=crude+oil+WTI+OPEC+energy&hl=en-US&gl=US&ceid=US:en", | |
| ], | |
| "news_feeds": [ | |
| "https://news.google.com/rss/search?q=WTI+crude+oil+price&hl=en-US&gl=US&ceid=US:en", | |
| "https://news.google.com/rss/search?q=OPEC+production+cut+oil&hl=en-US&gl=US&ceid=US:en", | |
| "https://news.google.com/rss/search?q=EIA+crude+inventories+oil&hl=en-US&gl=US&ceid=US:en", | |
| "https://news.google.com/rss/search?q=geopolitical+middle+east+supply&hl=en-US&gl=US&ceid=US:en", | |
| ], | |
| "web_queries": [ | |
| "WTI crude oil price today", | |
| "OPEC production decision latest", | |
| "EIA crude oil inventory data", | |
| "Middle East oil supply latest", | |
| ], | |
| "bullish_phrases": [ | |
| "oil rises", "crude surges", "oil jumps", "crude climbs", "oil rallies", | |
| "bullish oil", "buy crude", "oil demand", "demand recovery", | |
| "OPEC cut", "production cut", "output reduction", "supply disruption", | |
| "inventory draw", "crude inventories drop", "strategic reserves release", | |
| "rate cut", "dovish", "easing cycle", "dollar weakens", "dxy falls", | |
| "Middle East tension", "Strait of Hormuz", "sanctions oil", "supply squeeze", | |
| "China demand", "refinery restart", "above resistance", "breakout", | |
| "geopolitical risk", "war risk oil", "oil pipeline attack", | |
| ], | |
| "bearish_phrases": [ | |
| "oil falls", "crude drops", "oil slides", "crude declines", "oil lower", | |
| "sell crude", "bearish oil", "oil pressure", "crude under pressure", | |
| "risk on", "risk-on", "equities rally", | |
| "OPEC increase", "production increase", "output hike", "unleash supply", | |
| "inventory build", "crude stockpiles rise", "demand destruction", | |
| "rate hike", "hawkish", "higher for longer", "dollar strengthens", | |
| "recession fear", "demand slump", "China slowdown", | |
| "oil breaks support", "below support", "profit taking", | |
| "ceasefire", "peace deal", " Iran deal", | |
| ], | |
| "fear_keywords": [ | |
| "war", "conflict", "escalat", "attack", "invasion", "nuclear", "missile", | |
| "sanctions", "retaliation", "military", "troops", "strike", | |
| "iran", "israel", "hamas", "hezbollah", "ukraine", "russia", | |
| "strait of hormuz", "red sea", "suez canal", "pipeline attack", | |
| "tension", "crisis", "threat", "opec", "embargo", "supply disruption", | |
| "outbreak", "emergency", "alert", | |
| ], | |
| "fed_dovish": [ | |
| "rate cut", "cut rates", "dovish", "easing", "pivot", "pause", | |
| "no hike", "lower rates", "stimulus", "accommodative", "support growth", | |
| ], | |
| "fed_hawkish": [ | |
| "rate hike", "hike rates", "hawkish", "tightening", "higher for longer", | |
| "restrictive", "fight inflation", "no cut", "delay cut", "push back", | |
| "patient", "watch data", "not yet", "premature to cut", | |
| ], | |
| }, | |
| "fcpo": { | |
| "display_name": "FCPO Crude Palm Oil", | |
| "ticker": "FCPOc1.KL", | |
| "price_label": "FCPO/MYR", | |
| "score_key": "fcpo", | |
| "currency": "RM", | |
| "keywords": { | |
| "fcpo": ["FCPO", "CPO", "crude palm oil", "palm oil futures", "bursa derivatives", "palm oil price"], | |
| "supply": ["MPOB", "stock", "inventory", "production", "FFB", "OER", "output", "yield", "crop", "supply"], | |
| "demand": ["export", "India import", "China import", "biodiesel", "B20", "B40", "POGO", "blending", "import demand"], | |
| "weather": ["El Niño", "La Niña", "drought", "monsoon", "rainfall", "flood", "dry spell", "weather"], | |
| "policy": ["DMO", "export levy", "export ban", "EUDR", "RSPO", "MSPO", "tariff", "quota"], | |
| "competing": ["soybean oil", "CBOT", "rapeseed", "sunflower oil", "differential", "spread"], | |
| "myr": ["MYR", "Ringgit", "Malaysian ringgit", "forex", "currency"], | |
| "geopolitical": ["Geopolitical", "War", "Conflict", "Tension", "Sanctions", "Russia", "Ukraine", "tariff", "trade war"], | |
| }, | |
| "rss_feeds": [ | |
| "https://www.reuters.com/rssFeed/businessNews", | |
| "https://www.cnbc.com/id/100003114/device/rss/rss.html", | |
| "https://news.google.com/rss/search?q=palm+oil+FCPO+Bursa+Malaysia&hl=en-MY&gl=MY&ceid=MY:en", | |
| ], | |
| "news_feeds": [ | |
| "https://news.google.com/rss/search?q=MPOB+crude+palm+oil+stock+export&hl=en-MY&gl=MY&ceid=MY:en", | |
| "https://news.google.com/rss/search?q=Indonesia+palm+oil+DMO+export+policy&hl=en&gl=id&ceid=ID:en", | |
| "https://news.google.com/rss/search?q=soybean+oil+CBOT+vs+palm+oil+POGO&hl=en-US&gl=US&ceid=US:en", | |
| "https://news.google.com/rss/search?q=palm+oil+biodiesel+mandate+B40+B20&hl=en&gl=MY&ceid=MY:en", | |
| ], | |
| "web_queries": [ | |
| "FCPO palm oil futures Bursa Malaysia today", | |
| "MPOB crude palm oil stock export data latest", | |
| "Indonesia palm oil export policy DMO latest", | |
| "palm oil biodiesel mandate Indonesia Malaysia latest", | |
| "soybean oil vs palm oil POGO spread latest", | |
| ], | |
| "bullish_phrases": [ | |
| "stocks decline", "lower stockpiles", "production drop", "lower output", | |
| "strong export demand", "India raises import", "export quota reduced", | |
| "B40 mandate", "biodiesel blending increase", "higher biodiesel", | |
| "El Niño impact", "drought stress", "lower FFB yield", "dry weather", | |
| "CPO premium widens", "rival oils rally", "soybean oil higher", | |
| "DMO tightening", "export levy raised", "supply tightness", | |
| "festival demand", "Ramadan stockpiling", "China restocking", | |
| "plantations output declines", "tighter supplies", "supply squeeze", | |
| ], | |
| "bearish_phrases": [ | |
| "stockpiles surge", "inventory build-up", "record stocks", "higher stockpiles", | |
| "exports slump", "India cuts imports", "demand destruction", | |
| "biodiesel mandate delayed", "blending program on hold", "delayed B40", | |
| "favorable weather", "bumper crop", "harvest peak", "good rainfall", | |
| "CPO discount narrows", "soybean oil cheaper", "POGO spread squeezes", | |
| "labor shortage eases", "plantations fully staffed", "higher production", | |
| "DMO relaxed", "export levy lowered", "oversupply", "output surge", | |
| "demand weakens", "recession demand", "consumption declines", | |
| ], | |
| "fear_keywords": [ | |
| "war", "conflict", "escalat", "attack", "sanctions", "trade war", | |
| "tension", "crisis", "threat", "embargo", "supply disruption", | |
| "El Niño", "drought", "flood", "extreme weather", "crop failure", | |
| "eu deforestation", "export ban", "food security", "stockpile", | |
| "outbreak", "emergency", "alert", | |
| ], | |
| "fed_dovish": [ | |
| "rate cut", "cut rates", "dovish", "easing", "pivot", "pause", | |
| "no hike", "lower rates", "stimulus", "accommodative", "support growth", | |
| ], | |
| "fed_hawkish": [ | |
| "rate hike", "hike rates", "hawkish", "tightening", "higher for longer", | |
| "restrictive", "fight inflation", "no cut", "delay cut", "push back", | |
| "patient", "watch data", "not yet", "premature to cut", | |
| ], | |
| }, | |
| } | |
| REFRESH_INTERVAL_SECONDS = 300 |