hackquest logo

AI agents Vietbuild

NLP Prediction Market MVP is a demo combining NLP, ML, and trading. It predicts outcomes, simulates markets, and runs a Kelly-based agent. Fast, simple, and extensible.

Videos

Description

Project Intro

NLP Prediction Market MVP is a demo-ready, full‑stack prototype that combines lightweight market mechanics with an online ML model and NLP feature extraction. It’s designed as a polished demo you can run locally or deploy (Vercel frontend + FastAPI backend) to showcase an AI-driven prediction market for news and macro events.

Key goals

  • Demonstrate a complete demo flow: ingest events (single + batch), extract features, predict outcome probabilities, show a simple LMSR market maker, and run a decision agent (Kelly-based).

  • Be easy to run locally for demos and iterative development.

  • Be extensible: swap feature extractors (FinBERT, LLMs), improve the model, or migrate parts serverless.

What’s included

  • Backend: app — FastAPI service with endpoints for ingestion, batch ingestion, prediction, market price/trading, decision logic, config, and health.

  • Feature extraction: features.py — rule-based features by default, with optional FinBERT integration if transformers + torch are installed.

  • Model & market logic: models.py, market.py, execution.py — online logistic model, LMSR market maker, Kelly fraction logic.

  • Frontend: frontend — minimal Next.js app scaffold that connects to the backend (env var NEXT_PUBLIC_API_URL).

  • Scripts: scripts — helpers for batch ingestion (ingest_batch.py), demo runner (run_demo.py), and PowerShell helpers to start dev servers.

  • Sample data: news_samples.csv (CSV) and support for .xlsx in the ingest script.

  • Dev tooling: preconfigured formatters, tests, and CI-friendly pieces.

Core features (high-level)

  • Single ingest (POST /ingest) — extract features, optionally update the online model when a label is present.

  • Batch ingest (POST /ingest_batch) — submit many events at once (CSV/XLSX via script).

  • Predict (POST /predict) — return feature vector + predicted probability.

  • Market (GET /market/price, POST /market/trade) — view price, execute trades against LMSR.

  • Decision agent (POST /run/decision) — recommend hold/trade using model vs market price and Kelly sizing.

  • Health & management (GET /health, POST /config) — runtime checks and runtime parameter tuning.

Tech stack

  • Backend: Python 3.10+, FastAPI, Uvicorn

  • Model / NLP: small online logistic classifier (pure Python); FinBERT via transformers (optional)

  • Frontend: Next.js (React)

  • Packaging / tooling: venv, npm, simple PowerShell helpers, Docker-compose (optional)

  • Tests: pytest (backend), basic smoke tests provided

Progress During Hackathon

mvp

Tech Stack

React
Python
AI

Fundraising Status

0%

Team Leader
TThông Võ Hoàng
Sector
AI