InputFeatures: Construct objects of class 'InputFeatures'

View source: R/run_classifier.R

InputFeaturesR Documentation

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

## Not run: 
features <- InputFeatures(input_ids, input_mask, segment_ids, label_id)

## End(Not run)

jonathanbratt/RBERT documentation built on Jan. 26, 2023, 4:15 p.m.