Skip to content

Instantly share code, notes, and snippets.

Avatar

Agasti Kishor Dukare agastidukare

View GitHub Profile
View result.py
learn.predict("I love traveling with Vistara Airways!!!! Awesome service.. Thank you!!")
View accu.py
pred_fwd,lbl_fwd = learn.get_preds(ordered=True)
accuracy(pred_fwd, lbl_fwd)
View forward.py
learn.fit_one_cycle(5, slice(1e-3/(2.6**4),1e-3), moms=(0.8,0.7))
learn.save('fwd_clas')
View final.py
learn.unfreeze()
learn.lr_find()
learn.recorder.plot(skip_end=15)
View third.py
learn.freeze_to(-3)
learn.fit_one_cycle(4, slice(5e-3/(2.6**4),5e-3), moms=(0.8,0.7))
View second.py
learn.freeze_to(-2)
learn.fit_one_cycle(4, slice(1e-3/(2.6**4), 1e-3), moms=(0.8,0.7))
View first.py
learn.fit_one_cycle(4, 5e-2, moms=(0.8,0.7))
View learningrate.py
learn.lr_find()
learn.recorder.plot(skip_end=15)
View pretrained.py
learn = text_classifier_learner(data_clas, AWD_LSTM, drop_mult=0.5)
learn.load_encoder('fine_tuned_enc')
View textlist.py
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()
You can’t perform that action at this time.