text_one_hot: One-hot encode a text into a list of word indexes in a...

Description Usage Arguments Value See Also

View source: R/preprocessing.R

Description

One-hot encode a text into a list of word indexes in a vocabulary of size n.

Usage

1
2
3
text_one_hot(text, n,
  filters = "!\"#$%&()*+,-./:;<=>[email protected][\\]^_`{|}~\t\n",
  lower = TRUE, split = " ")

Arguments

text

Input text (string).

n

Size of vocabulary (integer)

filters

Sequence of characters to filter out such as punctuation. Default includes basic punctuation, tabs, and newlines.

lower

Whether to convert the input to lowercase.

split

Sentence split marker (string).

Value

List of integers in [1, n]. Each integer encodes a word (unicity non-guaranteed).

See Also

Other text preprocessing: make_sampling_table, pad_sequences, skipgrams, text_hashing_trick, text_to_word_sequence


keras documentation built on Oct. 9, 2019, 1:04 a.m.