Lesson3 data_clas.show_batch() returns different results from what Jeremy had in during course

Hi, I apologize if my question is unclear/silly, I am new in fastai.

I am currently doing a sentiment analysis. After creating a language
model on my train & test set, I created a classification model using TextClasDataBunch. However, when I run data_clas.show_batch(), it returns a tokenized and numericalized text. I understand that this is what I am supposed to have in order to train my classification model, but as the model shows really poor results after training several epochs ( +/- 58% accuracy), I started to doubt that I have done something wrong.

(my results)

(Jeremy’s results)

As it can be seen in the picture, data_clas.show_batch() returns different results from what Jeremy had in class, (tokenized but not numericalized ) I would like to make sure if this is what is causing me trouble to train my model.

I would appreciate any helps, thank you!

I just realized that TextClasDataBunch was the issue. Using TextList returned me the same results as Jeremy had, and the training accuracy jumped to 90% after 1 single epoch.

I am happy that it now works fine, but I am curious to know why TextClasDataBunch went wrong, and when it is supposed to be used.

Thanks

Is there a way to use .show_batch() to display data in the Pycharm Python Console? The HTML output that Jupyter displays so well is great, but I have other situations where I’d like to view data in Pycharm

1 Like

If you have PyCharm professional you can open jupyter notebooks and edit the code with the pycharm UI and render the jupyter notebook and html outputs at the same time.