View source: R/run_classifier.R
| convert_examples_to_features | R Documentation |
InputExamples to InputFeaturesConverts a set of InputExamples to a list of InputFeatures.
convert_examples_to_features(examples, label_list, max_seq_length, tokenizer)
examples |
List of |
label_list |
Character (or integer?); possible labels for examples. |
max_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). |
A list of InputFeatures.
## Not run:
tokenizer <- FullTokenizer("vocab.txt")
input_ex1 <- InputExample(
guid = 1L,
text_a = "Some text to classify.",
text_b = "More wordy words.",
label = "good"
)
input_ex2 <- InputExample(
guid = 2L,
text_a = "This is another example.",
text_b = "So many words.",
label = "bad"
)
feat <- convert_examples_to_features(
examples = list(input_ex1, input_ex2),
label_list = c("good", "bad"),
max_seq_length = 15L,
tokenizer = tokenizer
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.