original_docstring: Load data from the IMDB dataset.
docstring: Load data from the IMDB dataset.
docstring_tokens: Load data from the IMDB dataset .
code: def load_data(limit=0, split=0.8):
      """Load data from the IMDB dataset."""
      # Partition off part of the train data for evaluation
      train_data, _ = thinc.extra.datasets.imdb()
      random.shuffle(train_data)
      train_data = train_data[-limit:]
      texts, labels = zip(*train_data)
      cats = [{"POSITIVE": bool(y), "NEGATIVE": not bool(y)} for y in labels]
      split = int(len(train_data) * split)
      return (texts[:split], cats[:split]), (texts[split:], cats[split:])
code_tokens: def load_data ( limit = 0 , split = 0.8 ) : train_data , _ = thinc . extra . datasets . imdb ( ) random . shuffle ( train_data ) train_data = train_data [ - limit : ] texts , labels = zip ( * train_data ) cats = [ { "POSITIVE" : bool ( y ) , "NEGATIVE" : not bool ( y ) } for y in labels ] split = int ( len ( train_data ) * split ) return ( texts [ : split ] , cats [ : split ] ) , ( texts [ split : ] , cats [ split : ] )
short_docstring: Load data from the IMDB dataset.
short_docstring_tokens: Load data from the IMDB dataset .
comment: """Load data from the IMDB dataset."""$SEP$# Partition off part of the train data for evaluation