contextualstringembeddings

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

Implementation of the "Contextual String Embeddings" of words (Akbik et al., 2018). https://www.aclweb.org/anthology/C18-1139/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MergeType

type MergeType int
const (
	Concat MergeType = iota // The outputs are concatenated together (the default)
	Sum                     // The outputs are added together
	Prod                    // The outputs are multiplied element-wise together
	Avg                     // The average of the outputs is taken
)

type Model

type Model struct {
	LeftToRight *charlm.Model
	RightToLeft *charlm.Model
	MergeMode   MergeType
	StartMarker rune
	EndMarker   rune
}

func New

func New(leftToRight, rightToLeft *charlm.Model, merge MergeType, startMarker, endMarker rune) *Model

func (*Model) NewProc

func (m *Model) NewProc(ctx nn.Context) nn.Processor

type Processor

type Processor struct {
	nn.BaseProcessor
	// contains filtered or unexported fields
}

func (Processor) Encode

func (p Processor) Encode(words []string) []ag.Node

func (Processor) Forward

func (p Processor) Forward(_ ...ag.Node) []ag.Node

Jump to

Keyboard shortcuts

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