entity

package
v0.0.0-...-10bcf21 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultEntityTypes = []string{"organization", "person", "policy", "bill", "geo", "event", "role", "electorate"}

Functions

This section is empty.

Types

type Data

type Data struct {
	prompts.PromptData
	EntityTypes []string
	InputText   string
}

type Entity

type Entity struct {
	Name        string
	Description string
	Embedding   []float32
	// contains filtered or unexported fields
}

func (*Entity) NodeID

func (e *Entity) NodeID() string

func (*Entity) String

func (e *Entity) String() string

func (*Entity) Type

func (e *Entity) Type() string

type EntityExtractor

type EntityExtractor struct {
	ExtractionPrompt string
	EntityTypes      []string
	MaxGleanings     int
	// contains filtered or unexported fields
}

func NewEntityExtractor

func NewEntityExtractor(llm llm.LLM, opts ...Option) *EntityExtractor

func (*EntityExtractor) Extract

func (ee *EntityExtractor) Extract(ctx context.Context, text string) ([]Record, error)

type Option

type Option func(*EntityExtractor)

func WithEntityTypes

func WithEntityTypes(types []string) Option

type Record

type Record interface {
	NodeID() string
	Type() string
	// contains filtered or unexported methods
}

type Relationship

type Relationship struct {
	Entity1  string
	Relation string
	Entity2  string
	Keyword  string
	Weight   int
	// contains filtered or unexported fields
}

func (*Relationship) NodeID

func (e *Relationship) NodeID() string

func (*Relationship) String

func (r *Relationship) String() string

func (*Relationship) Type

func (r *Relationship) Type() string

Jump to

Keyboard shortcuts

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