make_examples_simple: Easily make examples for BERT

View source: R/extract_features.R

make_examples_simpleR Documentation

Easily make examples for BERT

Description

A simple wrapper function to turn a list of text (as a character vector or list) into a list of examples suitable for use with RBERT. If the input is a flat list or vector of characters, the examples will be single-segment, with NULL for the second segment. If the input contains length-2 sublists or vectors, those examples will be two-segment sequences, e.g. for doing sentence-pair classification.

Usage

make_examples_simple(seq_list)

Arguments

seq_list

Character vector or list; text to turn into examples.

Value

A list of InputExample_EF objects.

Examples

input_ex <- make_examples_simple(c(
  "Here are some words.",
  "Here are some more words."
))
input_ex2 <- make_examples_simple(list(
  c(
    "First sequence, first segment.",
    "First sequence, second segment."
  ),
  c(
    "Second sequence, first segment.",
    "Second sequence, second segment."
  )
))

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