decoder

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: Apache-2.0 Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BpeDecoder

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

Allows decoding Original BPE by joining all the tokens and then replacing the suffix used to identify end-of-words by whitespaces

func DefaultBpeDecoder

func DefaultBpeDecoder() *BpeDecoder

DefaultBpeDecoder create a new BpeDecoder with default suffix (`</w>`)

func NewBpeDecoder

func NewBpeDecoder(suffix string) *BpeDecoder

NewBpeDecoder creates a new BpeDecoder

func (*BpeDecoder) Decode

func (bd *BpeDecoder) Decode(tokens []string) string

type WordPieceDecoder

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

WordPieceDecoder takes care of decoding a list of wordpiece tokens back into a readable string.

func DefaultWordpieceDecoder

func DefaultWordpieceDecoder() *WordPieceDecoder

DefaultBpeDecoder create a new BpeDecoder with default suffix (`</w>`)

func NewWordPieceDecoder

func NewWordPieceDecoder(prefix string, cleanup bool) *WordPieceDecoder

NewBpeDecoder creates a new BpeDecoder

func (*WordPieceDecoder) Decode

func (wd *WordPieceDecoder) Decode(tokens []string) string

Jump to

Keyboard shortcuts

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