R/RcppExports.R

Defines functions wordpiece_encode_as_subwords spc_decode_subwords spc_decode_ids spc_encode_as_ids_nbest spc_encode_as_subwords_nbest spc_encode_as_ids_sample spc_encode_as_subwords_sample spc_encode_as_ids spc_encode_as_subwords spc_load_model spc_train

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

spc_train <- function(args) {
    .Call('_sentencepiece_spc_train', PACKAGE = 'sentencepiece', args)
}

spc_load_model <- function(file) {
    .Call('_sentencepiece_spc_load_model', PACKAGE = 'sentencepiece', file)
}

spc_encode_as_subwords <- function(model, x) {
    .Call('_sentencepiece_spc_encode_as_subwords', PACKAGE = 'sentencepiece', model, x)
}

spc_encode_as_ids <- function(model, x) {
    .Call('_sentencepiece_spc_encode_as_ids', PACKAGE = 'sentencepiece', model, x)
}

spc_encode_as_subwords_sample <- function(model, x, nbest_size = -1L, alpha = 1) {
    .Call('_sentencepiece_spc_encode_as_subwords_sample', PACKAGE = 'sentencepiece', model, x, nbest_size, alpha)
}

spc_encode_as_ids_sample <- function(model, x, nbest_size = -1L, alpha = 1) {
    .Call('_sentencepiece_spc_encode_as_ids_sample', PACKAGE = 'sentencepiece', model, x, nbest_size, alpha)
}

spc_encode_as_subwords_nbest <- function(model, x, nbest_size = -1L) {
    .Call('_sentencepiece_spc_encode_as_subwords_nbest', PACKAGE = 'sentencepiece', model, x, nbest_size)
}

spc_encode_as_ids_nbest <- function(model, x, nbest_size = -1L) {
    .Call('_sentencepiece_spc_encode_as_ids_nbest', PACKAGE = 'sentencepiece', model, x, nbest_size)
}

spc_decode_ids <- function(model, x) {
    .Call('_sentencepiece_spc_decode_ids', PACKAGE = 'sentencepiece', model, x)
}

spc_decode_subwords <- function(model, x) {
    .Call('_sentencepiece_spc_decode_subwords', PACKAGE = 'sentencepiece', model, x)
}

wordpiece_encode_as_subwords <- function(x, vocabulary, unk_token = "[UNK]", max_input_chars_per_word = 100L) {
    .Call('_sentencepiece_wordpiece_encode_as_subwords', PACKAGE = 'sentencepiece', x, vocabulary, unk_token, max_input_chars_per_word)
}

Try the sentencepiece package in your browser

Any scripts or data that you put into this service are public.

sentencepiece documentation built on Nov. 13, 2022, 5:05 p.m.