OPTCG Card Explorer

Semantic search and similarity browser for One Piece Card Game cards, powered by Qwen3-Embedding vectors.

4372 cards 51 sets 290 leaders latest ST29 1024-dim Qwen3

Dataset: t22000t/optcg-en-card-embeddings  ·  Code: github.com/timothy22000/optcg-cards

Three ways to explore:

  1. Search by description - type plain English describing the card you're imagining ("low cost red blocker with draw", "leader that punishes wide boards"). The query is encoded with the same Qwen3-Embedding model used on the corpus, then ranked by cosine similarity. Top-k results appear in the table and are highlighted on the map.

  2. Browse / find similar - pick any card from the dropdown to see its full details and the 10 most mechanically similar cards in embedding space. Useful for finding swap candidates with comparable mechanics.

  3. Synergy inspector - pick a Leader card to see recommendations that are color-legal under it, sorted by mechanical similarity with a bonus for cards in the leader's family/archetype. The cost curve shows the distribution of recommendations across costs - useful when sketching a deck shape.

Tips

  • Search and browse rank by raw cosine similarity. Synergy adds OPTCG deckbuilding constraints on top: color legality (must share at least one color with the leader) and a +0.10 family bonus for archetype matches.
  • Score is cosine similarity in [-1, 1]. Anything above ~0.55 is usually a strong match; below ~0.35 the model is reaching.
  • Mix mechanical keywords (Blocker, Rush, Counter, On Play) with constraints (color, cost, power) for tighter search results.
  • The UMAP is a 2-D projection of the same 1024-dim space - clusters tend to share color and card type.
5 25
Try one of these

Top matches

The map shows all 4372 cards projected to 2-D. After a search, the top-k hits are drawn on top with larger black-bordered markers.

How it works

Each of the 4372 cards is encoded as a single vector by Qwen/Qwen3-Embedding-0.6B (1024-dim, L2-normalized). The encoding strategy follows the proven minimaxir/mtg-embeddings recipe: serialize the mechanically-relevant fields as a prettified JSON document, replace the card's own name with ~ to neutralize self-references, then prepend a task instruction string so the model knows what kind of similarity matters (gameplay mechanics, not flavor text).

When you submit a query, the same instruction wrapper is applied and the resulting vector is compared by dot product against the precomputed corpus matrix. UMAP coordinates are precomputed in the dataset and just rendered here.

The task instruction comes from the dataset's provenance.json rather than being hardcoded, so the Space stays in sync if the upstream embedding ever changes.

Dataset

t22000t/optcg-en-card-embeddings - 4372 cards across 51 sets, latest pack ST29. Sister dataset t22000t/optcg-en-cards carries the structured fields without the embedding column.

What this Space deliberately does not show

No card images. The Space is text and structured-data only. See the parent project README for the IP rationale.

Source

Card data comes from the official One Piece Card Game site via the vegapull scraper. Pipeline code is at github.com/timothy22000/optcg-cards. This Space is at github.com/timothy22000/optcg-cards (sibling repo optcg-explorer-space).

Built with Gradio. Embeddings: Qwen/Qwen3-Embedding-0.6B. Card data via vegapull. Not affiliated with Bandai or the One Piece Card Game.