Convert a list of sequences into a matrix.

    Convert a list of sequences into a matrix.

    sequences_to_matrix(
      tokenizer,
      sequences,
      mode = c("binary", "count", "tfidf", "freq")
    )

    Arguments

    tokenizer

    Tokenizer

    sequences

    List of sequences (a sequence is a list of integer word indices).

    mode

    one of "binary", "count", "tfidf", "freq".

    Value

    A matrix

    See also