Learn R Programming

RBERT (version 0.1.11)

InputFeatures: Construct objects of class InputFeatures

Description

An InputFeatures object is a single set of features of data.

Usage

InputFeatures(
  input_ids,
  input_mask,
  segment_ids,
  label_id,
  is_real_example = TRUE
)

Arguments

input_ids

Integer Tensor; the sequence of token ids in this example.

input_mask

Integer Tensor; sequence of 1s (for "real" tokens) and 0s (for padding tokens).

segment_ids

Integer Tensor; aka token_type_ids. Indicators for which sentence (or sequence each token belongs to). Classical BERT supports only 0s and 1s (for first and second sentence, respectively).

label_id

Integer; represents training example classification labels.

is_real_example

Logical; later on this is used as a flag for whether to "count" this example for calculating accuracy and loss.

Value

An object of class InputFeatures.

Examples

Run this code
# NOT RUN {
features <- InputFeatures(input_ids, input_mask, segment_ids, label_id)
# }

Run the code above in your browser using DataLab