Help: How to fix dls File Not Found from my kaggle Pizza Hut dataset

Hi everyone!
I’m trying to learn how to use text transfer learning to train a model based on sentiment analysis. I’m using a dataset of Pizza Hut Reviews that I downloaded from Kaggle, but I’m having trouble with the DLS bacause my code can’t find the path. Would anyone be able to look over my code and give me feedback on how to fix it?

Quick code context:

  • I am referencing the following fastai tutorial: fastai - Text transfer learning
  • I am using Google Colab to practice
  • My kaggle crendentials are running and i downloaded successfully the data set using:
    !kaggle datasets download -d abhi10699/pizza-hut-reviews

Training a text classifier from a pre-trained model
Here is my code:

path = Path(‘/path/to/pizza_hut_reviews’)
dls = TextDataLoaders.from_folder(path, valid=‘test’)

(After running the code, i get the following text)

FileNotFoundError Traceback (most recent call last)
in <cell line: 1>()
----> 1 dls = TextDataLoaders.from_folder(path, valid=‘test’)

5 frames
/usr/lib/python3.9/ in mkdir(self, mode, parents, exist_ok)
1321 “”"
1322 try:
→ 1323 self._accessor.mkdir(self, mode)
1324 except FileNotFoundError:
1325 if not parents or self.parent == self:

FileNotFoundError: [Errno 2] No such file or directory: ‘/path/to/pizza_hut_reviews_tok’

Thank you so much in advance!

You may want to double check whether your path is correct.

You’re saying your code has path/to/pizza_hut_reviews, however your error message is saying /path/to/pizza_hut_reviews_tok.

Also, a handy tip: to make your code more readable, put 3 backticks (the ` symbol) before and after your code block.


thank you so much that solved the issue

1 Like