How tonao1/ufcstyles works
The UFC Style Embedding Engine turns historical fight statistics into leak-free fighter snapshots, trains and evaluates embeddings for style-versus-quality separation, then serves fighter similarity and matchup estimates. Its domain stages are data collection and scope analysis, feature construction and labeling, model training and evaluation, and deployment/inference. src/models/common.py is a shared internal training/export layer; the serving handler dispatches API requests to NumPy inference and DynamoDB-backed fighter records. Some subsystem links follow the README workflow because their source was not sampled.
Main entry points: harness.py Evaluation harness · handler.py API handler · fetch_ufcstats.py UFCStats scraper · contrastive.py Contrastive model
Components 22
Data ingestion
- UFCStats scraper
src/scrape/fetch_ufcstats.py - Scope analysis
src/analysis/scope_count.py - Pipeline config
configs/v1.yaml
Features and labels
- Snapshot builder
src/features/snapshots.py - Background labels
src/labeling/fetch_wiki_background.py - Probe labels
data/labels
Training and evaluation
- Evaluation harness
src/eval/harness.py - Autoencoder
src/models/autoencoder.py - Contrastive model
src/models/contrastive.py - Shared training
src/models/common.py - Evaluation data
data/eval
Serving
- Serving export
src/serve/export.py - Record loader
src/serve/load_dynamodb.py - API handler
src/serve/handler.py - NumPy inference
src/serve/inference.py - Similarity results
- Matchup estimate
Other components
- Pipeline operator
- UFCStats
- Wikipedia
- API Gateway
- DynamoDB
Connections 34
- Pipeline operator → UFCStats scraper: runs
- UFCStats scraper → UFCStats: fetches statistics
- UFCStats scraper → Scope analysis: raw tables
- Pipeline operator → Scope analysis: runs
- Scope analysis → Pipeline config: informs decisions
- Pipeline operator → Snapshot builder: runs
- Pipeline config → Snapshot builder: configures
- UFCStats scraper → Snapshot builder: raw tables
- Snapshot builder → Evaluation data: builds snapshots
- Pipeline operator → Background labels: runs
- Background labels → Wikipedia: fetches text
- Background labels → Probe labels: writes labels
- Pipeline operator → Evaluation harness: runs baselines
- Evaluation data → Evaluation harness: evaluates
- Probe labels → Evaluation harness: probe labels
- Pipeline operator → Autoencoder: trains
- Pipeline operator → Contrastive model: trains
- Autoencoder → Shared training: uses training
- Contrastive model → Shared training: uses training
- Autoencoder → Evaluation harness: evaluates embeddings
- Contrastive model → Evaluation harness: evaluates embeddings
- Evaluation harness → Evaluation data: writes scores
- Pipeline operator → Serving export: exports model
- Contrastive model → Serving export: provides model
- Serving export → Record loader: produces records
- Pipeline operator → Record loader: loads records
- Record loader → DynamoDB: writes records
- API Gateway → API handler: dispatches requests
- API handler → DynamoDB: reads fighter records
- API handler → NumPy inference: calls inference
- NumPy inference → Similarity results: computes neighbors
- NumPy inference → Matchup estimate: computes probability
- API handler → Similarity results: returns response
- API handler → Matchup estimate: returns response