text_html_output_1.png
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

train = pd.read_csv('../input/train.tsv', sep='\t')
test = pd.read_csv('../input/test.tsv', sep='\t')
train['Sentiment'] = train['Sentiment'].apply(str)

data = TextList.from_df(train, cols='Phrase').split_by_rand_pct(0.2).label_for_lm().databunch(bs=48)

test_datalist = TextList.from_df(test, cols='Phrase', vocab=data.vocab)
data_clas = TextList.from_df(train, cols='Phrase', vocab=data.vocab).split_by_rand_pct(0.2).label_from_df(cols='Sentiment', classes=['1', '2', '3', '4', '0'], label_cls=CategoryList).add_test(test_datalist).databunch(bs=32)

learn_classifier = text_classifier_learner(data_clas, AWD_LSTM, drop_mult=0.5)
learn_classifier.load_encoder('fine_tuned_enc')
learn_classifier.freeze()

learn_classifier.lr_find()