SHARE
TWEET

Untitled

a guest Sep 20th, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # loading the tokenizer and vocab processors
  2. processor = get_roberta_processor(tokenizer=fastai_tokenizer, vocab=fastai_roberta_vocab)
  3.  
  4. # creating our databunch
  5. data = ItemLists(".", RobertaTextList.from_df(train, ".", cols=feat_cols, processor=processor),
  6.                       RobertaTextList.from_df(val, ".", cols=feat_cols, processor=processor)
  7.                 ) \
  8.        .label_from_df(cols=label_cols, label_cls=CategoryList) \
  9.        .add_test(RobertaTextList.from_df(test, ".", cols=feat_cols, processor=processor)) \
  10.        .databunch(bs=4,pad_first=False)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top