training

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClassServiceInterface

type ClassServiceInterface interface {
	FindOrCreate(brainID int64, label string) (entity.ClassInterface, error)
}

ClassServiceInterface defines dependency

type ResultsRepositoryInterface

type ResultsRepositoryInterface interface {
	SaveResult(brainID int64, res result.TrainingResult) error
}

ResultsRepositoryInterface defines dependency

type Service

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

Service provides functionality to brain's training

func NewTrainingService

func NewTrainingService(
	classService ClassServiceInterface,
	resultsRepository ResultsRepositoryInterface,
	tokenizer TokenizerInterface,
	tokenService TokenServiceInterface,
) *Service

NewTrainingService is a constructor for TrainingService

func (Service) Train

func (service Service) Train(brainID int64, samples []entity.Sample) error

Train accepts samples and returns the training result

type TextServiceCache

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

func NewTextServiceCache

func NewTextServiceCache(service TokenServiceInterface) TextServiceCache

func (TextServiceCache) FindOrCreate

func (c TextServiceCache) FindOrCreate(brainID int64, text string) int64

type TokenServiceInterface

type TokenServiceInterface interface {
	FindOrCreate(brainID int64, text string) int64
}

TokenServiceInterface defines dependency

type TokenizerInterface

type TokenizerInterface interface {
	Tokenize(string) []string
}

TokenizerInterface defines dependency

Directories

Path Synopsis
This package contains data types for the training results representation.
This package contains data types for the training results representation.

Jump to

Keyboard shortcuts

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