pokemon-embeddings / README.md
minimaxir's picture
Update README.md
8651d03 verified
metadata
license: mit

A dataset consisting of Pokémon embeddings: text embeddings encoded from large amount of Pokémon metadata using nomic-ai/nomic-embed-text-v1.5, and image embeddings encoded from the official Pokémon artwork using nomic-ai/nomic-embed-vision-v1.5.

No other metadata besides the Pokémon ID is present to avoid invoking the Nintendo Ninjas. To see how to retrieve additional metadata, see the "Get More Metadata" section.

Fields

  • id: Pokémon National Dex ID, which maps to PokeAPI. "Special" Pokemon will have an id > 10000.
  • text_embedding: 768D unit-normalized embedding of Pokémon metadata.
  • image_embedding: 768D unit-normalized embedding of Pokémon images.
  • umap_2d_x: x-coordinate value of a UMAP projection to 2D by concatenating the embeddings.
  • umap_2d_y: y-coordinate value of a UMAP projection to 2D by concatenating the embeddings.

Get More Metadata

You can retrieve more metadata using PokeAPI. An example to get the id and name of all Pokémon:

import requests

graphql_query = """
{
  pokemon_v2_pokemon(order_by: {id: asc}) {
    id
    name
  }
}
"""

r = requests.post(
    "https://beta.pokeapi.co/graphql/v1beta",
    json={
        "query": graphql_query,
    },
)

pokemon = r.json()["data"]["pokemon_v2_pokemon"]
pokemon[0:10]

# [{'id': 1, 'name': 'bulbasaur'},
# {'id': 2, 'name': 'ivysaur'},
# {'id': 3, 'name': 'venusaur'},
# ...