Skip to content

Commit 2081030

Browse files
authored
Update text_sentiment_ngrams_tutorial.py
Creating .data folder.
1 parent b0d9128 commit 2081030

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

beginner_source/text_sentiment_ngrams_tutorial.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
import torchtext
4343
from torchtext.datasets import text_classification
4444
NGRAMS = 2
45+
mport os
46+
if not os.path.isdir('./.data'):
47+
os.mkdir('./.data')
4548
train_dataset, test_dataset = text_classification.DATASETS['AG_NEWS'](
4649
root='./.data', ngrams=NGRAMS, vocab=None)
4750
BATCH_SIZE = 16

0 commit comments

Comments
 (0)