Learn R Programming

RBERT (version 0.1.11)

.convert_single_example_EF: Convert a single InputExample_EF into a single InputFeatures_EF

Description

Converts a single InputExample_EF into a single InputFeatures_EF. Very similar to convert_single_example from run_classifier.R. (RBERT issue #28.)

Usage

.convert_single_example_EF(ex_index, example, seq_length, tokenizer)

Arguments

ex_index

Integer; the index of this example. This is used to determine whether or not to print out some log info (for debugging or runtime confirmation). It is assumed this starts with 1 (in R).

example

The InputExample_EF to convert.

seq_length

Integer; the maximum number of tokens that will be considered together.

tokenizer

A tokenizer object to use (e.g. object of class FullTokenizer).

Value

An object of class InputFeatures_EF.