entity

package
v0.0.0-...-b2170da Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Each sample contains some sentences and at least one assigned class.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrainInterface

type BrainInterface interface {
	GetID() int64
	GetName() string
	GetDescription() string
}

type ClassInterface

type ClassInterface interface {
	GetID() int64
	GetLabel() string
}

type ClassSizeMap

type ClassSizeMap map[int64]int64

This map contains classes size in the training dataset. The key of map is a Class ID and values is a total tokens count in the each class.

type HumanizedPrediction

type HumanizedPrediction struct {
	Probabilities map[string]float64 `json:"probabilities"`
	Duration      float64            `json:"duration"`
}

HumanizedPrediction describes structure which contains class labels and their probabilities

func NewHumanizedPrediction

func NewHumanizedPrediction(probabilities map[string]float64, duration time.Duration) HumanizedPrediction

NewHumanizedPrediction is a constructor

func (HumanizedPrediction) JSON

func (hp HumanizedPrediction) JSON() (string, error)

JSON helps to convert structure to string

type Prediction

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

Prediction represents results of predictor

func NewPrediction

func NewPrediction(probabilities map[int64]float64) Prediction

NewPrediction is a constructor

func (*Prediction) GetClassIDs

func (p *Prediction) GetClassIDs() []int64

GetClassIDs Returns identifiers list of predicted classes

func (*Prediction) GetClassProbability

func (p *Prediction) GetClassProbability(classID int64) float64

GetClassProbability returns identifiers list of predicted classes

type Sample

type Sample struct {
	Sentence string
	Classes  []string
}

type TokenInterface

type TokenInterface interface {
	GetID() int64
	GetText() string
}

type TrainedModel

type TrainedModel struct {
	SamplesCount      int64
	UniqueTokensCount int64
	ClassFrequency    result.ClassFrequency
	ClassSize         ClassSizeMap
	TokenFrequency    result.TokenFrequency
}

func (TrainedModel) GetClassFrequency

func (m TrainedModel) GetClassFrequency() result.ClassFrequency

func (TrainedModel) GetClassSizes

func (m TrainedModel) GetClassSizes() ClassSizeMap

func (TrainedModel) GetSamplesCount

func (m TrainedModel) GetSamplesCount() int64

func (TrainedModel) GetTokenFrequency

func (m TrainedModel) GetTokenFrequency() result.TokenFrequency

func (TrainedModel) GetUniqueTokensCount

func (m TrainedModel) GetUniqueTokensCount() int64

Jump to

Keyboard shortcuts

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