model_unigram: An implementation of the Unigram algorithm

model_unigramR Documentation

An implementation of the Unigram algorithm

Description

An implementation of the Unigram algorithm

An implementation of the Unigram algorithm

Super class

tok::tok_model -> tok_model_unigram

Methods

Public methods


Method new()

Constructor for Unigram Model

Usage
model_unigram$new(vocab = NULL, unk_id = NULL, byte_fallback = FALSE)
Arguments
vocab

A dictionary of string keys and their corresponding relative score. Default: NULL.

unk_id

The unknown token id to be used by the model. Default: NULL.

byte_fallback

Whether to use byte-fallback trick. Default: FALSE.


Method clone()

The objects of this class are cloneable with this method.

Usage
model_unigram$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

Other model: model_bpe, model_wordpiece, tok_model


tok documentation built on Sept. 11, 2024, 5:21 p.m.