evaluation

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type COTQAEvalChain

type COTQAEvalChain struct {
	*ContextQAEvalChain
}

COTQAEvalChain is a LLM Chain specifically for evaluating QA using chain of thought reasoning.

func NewCOTQAEvalChain

func NewCOTQAEvalChain(llm schema.LLM, optFns ...func(o *COTQAEvalChainOptions)) (*COTQAEvalChain, error)

type COTQAEvalChainOptions

type COTQAEvalChainOptions struct {
	Prompt        *prompt.Template
	QuestionKey   string
	ContextKey    string
	PredictionKey string
}

type ContextQAEvalChain

type ContextQAEvalChain struct {
	// contains filtered or unexported fields
}

ConetxtQAEvalChain is a LLM Chain specifically for evaluating QA w/o GT based on context.

func NewContextQAEvalChain

func NewContextQAEvalChain(llm schema.LLM, optFns ...func(o *ContextQAEvalChainOptions)) (*ContextQAEvalChain, error)

func (*ContextQAEvalChain) Evaluate

func (eval *ContextQAEvalChain) Evaluate(ctx context.Context, examples, predictions []map[string]string) ([]schema.ChainValues, error)

type ContextQAEvalChainOptions

type ContextQAEvalChainOptions struct {
	Prompt        *prompt.Template
	QuestionKey   string
	ContextKey    string
	PredictionKey string
}

type QAEvalChain

type QAEvalChain struct {
	// contains filtered or unexported fields
}

QAEvalChain is a LLM Chain specifically for evaluating question answering.

func NewQAEvalChain

func NewQAEvalChain(llm schema.LLM, optFns ...func(o *QAEvalChainOptions)) (*QAEvalChain, error)

func (*QAEvalChain) AnswerKey

func (eval *QAEvalChain) AnswerKey() string

func (*QAEvalChain) Evaluate

func (eval *QAEvalChain) Evaluate(ctx context.Context, examples, predictions []map[string]string) ([]schema.ChainValues, error)

func (*QAEvalChain) PredictionKey

func (eval *QAEvalChain) PredictionKey() string

func (*QAEvalChain) QuestionKey

func (eval *QAEvalChain) QuestionKey() string

type QAEvalChainOptions

type QAEvalChainOptions struct {
	Prompt        *prompt.Template
	QuestionKey   string
	AnswerKey     string
	PredictionKey string
}

Jump to

Keyboard shortcuts

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