View source: R/num_tokens_file.R
num_tokens_file | R Documentation |
The function batch-wise computes the total number of tokens in a text file. The function returns a numeric value indicating the total number of tokens in the file. The function can be used on very large text files.
num_tokens_file(filename, batch_size = 1000, encoding = "cl100k_base")
filename |
character string indicating the name of the text file to read in |
batch_size |
integer indicating the number of lines to read in per batch (default is 1000) |
encoding |
character string indicating the encoding to use (default is "cl100k_base") |
a numeric value indicating the total number of tokens in the text file
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.