Skip to content

Instantly share code, notes, and snippets.

@agastidukare
Last active August 9, 2020 04:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agastidukare/6996c42d9da78bfd2eb1850fb5a89d41 to your computer and use it in GitHub Desktop.
Save agastidukare/6996c42d9da78bfd2eb1850fb5a89d41 to your computer and use it in GitHub Desktop.
data_lm = (TextList
.from_csv(path, 'Tweets.csv', cols='text')
#Where are the text? Column 'text' of tweets.csv
.split_by_rand_pct(0.2)
#How to split it? Randomly with the default 20% in valid
.label_for_lm()
#Label it for a language model
.databunch(bs=48))
#Finally we convert to a DataBunch
data_lm.show_batch()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment