3kmfi6hp/scratch-bucket / finbert_sentiment.py
3kmfi6hp's picture
download
raw
1.55 kB
import urllib.request, json, sys
api = 'https://3kmfi6hp-twitter-finbert-sentiment-api.hf.space/predict'
markets = [
("Uzbekistan", "Will Uzbekistan win the 2026 FIFA World Cup? This market resolves for the national team winning the tournament. Uzbekistan is a huge underdog at 0.05\u00a2."),
("New Zealand", "Will New Zealand win the 2026 FIFA World Cup? This market resolves for the national team winning the tournament. New Zealand is very unlikely to win at 0.05\u00a2."),
("Curacao", "Will Curacao win the 2026 FIFA World Cup? This market resolves for the national team winning the tournament. Curacao has near-zero probability."),
("Spain", "Will Spain win the 2026 FIFA World Cup? Spain is a strong traditional contender priced at 13.9\u00a2 with rising momentum."),
("Argentina", "Will Argentina win the 2026 FIFA World Cup? Argentina is the defending champion priced at 15.7\u00a2 with strong current form."),
("France", "Will France win the 2026 FIFA World Cup? France is one of the strongest squads in the tournament priced at 19.4\u00a2, the current favorite."),
]
for c, t in markets:
p = json.dumps({"text": t}).encode()
r = urllib.request.Request(api, data=p, headers={"Content-Type": "application/json"}, method="POST")
try:
with urllib.request.urlopen(r, timeout=30) as resp:
d = json.loads(resp.read().decode())
print(f"=== {c} ===")
print(json.dumps(d, indent=2))
except Exception as e:
print(f"=== {c} === ERROR: {e}")
print()

Xet Storage Details

Size:
1.55 kB
·
Xet hash:
4572ca28194aedbc5c32183566a763e97819d75a84aa48a5859f873486272568

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.