class_docstr: Billion Word Benchmark (lm1b); see http://www.statmt.org/lm-benchmark/.
class_docstr_tok: ["Billion","Word","Benchmark","(","lm1b",")",";","see","http",":","\/\/www.statmt.org\/lm-benchmark\/","."]
code: def __init__(
      self, split: str = "train", max_examples: Optional[int] = None
  ):
      ds = tfds.load("lm1b", split=split)
      if max_examples is not None:
          # Normally we can just slice the resulting dataset, but lm1b is very large
          # so we can use ds.take() to only load a portion of it.
          ds = ds.take(max_examples)
      raw_examples = list(tfds.as_numpy(ds))
      self._examples = [
          {"text": ex["text"].decode("utf-8")} for ex in raw_examples
      ]
  
file_path: lit/lit_nlp/examples/datasets/lm.py
imports: import glob
  from typing import Optional
  from lit_nlp.api import dataset
  from lit_nlp.api import types
  import tensorflow_datasets
label_desc: Use image node_id 1 to create a new BillionWordBenchmark object from inherited base classes: lit_dataset with example: obj = BillionWordBenchmark(split, max_examples)