Skip to content

Instantly share code, notes, and snippets.

@agastidukare
Last active August 9, 2020 04:40
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/ef053bcf653b8af1b39e90246b2dde12 to your computer and use it in GitHub Desktop.
Save agastidukare/ef053bcf653b8af1b39e90246b2dde12 to your computer and use it in GitHub Desktop.
data_clas = (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_from_df(cols='airline_sentiment')
#specify the label column
.databunch(bs=48))
#Create databunch
data_clas.show_batch()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment