nba

package
v0.0.0-...-676aefe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package nba provides facilities for vectorizing NBA data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertPlayers

func InsertPlayers(ctx context.Context, conn *pgx.Conn, ps []Player) error

InsertPlayers inserts players into a database.

Types

type Player

type Player struct {
	Embedding pgvector.Vector
	// contains filtered or unexported fields
}

A Player represents an NBA player.

func NearestPlayer

func NearestPlayer(ctx context.Context, c *api.Client, conn *pgx.Conn, question string) (Player, error)

NearestPlayer returns the player whose embedding is closest to the given question.

func NewPlayer

func NewPlayer(fields, row []string) (Player, error)

NewPlayer returns a new Player from the given fields and row.

func (*Player) GenerateEmbeddings

func (p *Player) GenerateEmbeddings(ctx context.Context, c *api.Client) error

GenerateEmbeddings generates player embeddings.

func (Player) String

func (p Player) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL