From 2b666b3cba7d629a2f192c7d9c66fadcc9f0c363 Mon Sep 17 00:00:00 2001 From: bentrevett Date: Fri, 12 Mar 2021 13:25:47 +0000 Subject: [PATCH] update to torchtext 0.9 --- 1 - Simple Sentiment Analysis.ipynb | 6 +++--- 2 - Upgraded Sentiment Analysis.ipynb | 7 +++---- 3 - Faster Sentiment Analysis.ipynb | 6 +++--- 4 - Convolutional Sentiment Analysis.ipynb | 6 +++--- 5 - Multi-class Sentiment Analysis.ipynb | 6 +++--- 6 - Transformers for Sentiment Analysis.ipynb | 6 +++--- A - Using TorchText with Your Own Datasets.ipynb | 6 +++--- B - A Closer Look at Word Embeddings.ipynb | 2 +- C - Loading, Saving and Freezing Embeddings.ipynb | 6 +++--- 9 files changed, 25 insertions(+), 26 deletions(-) diff --git a/1 - Simple Sentiment Analysis.ipynb b/1 - Simple Sentiment Analysis.ipynb index 40fac69..ba28a4b 100644 --- a/1 - Simple Sentiment Analysis.ipynb +++ b/1 - Simple Sentiment Analysis.ipynb @@ -53,7 +53,7 @@ "outputs": [], "source": [ "import torch\n", - "from torchtext import data\n", + "from torchtext.legacy import data\n", "\n", "SEED = 1234\n", "\n", @@ -80,7 +80,7 @@ "metadata": {}, "outputs": [], "source": [ - "from torchtext import datasets\n", + "from torchtext.legacy import datasets\n", "\n", "train_data, test_data = datasets.IMDB.splits(TEXT, LABEL)" ] @@ -823,4 +823,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/2 - Upgraded Sentiment Analysis.ipynb b/2 - Upgraded Sentiment Analysis.ipynb index 3926817..46973ae 100644 --- a/2 - Upgraded Sentiment Analysis.ipynb +++ b/2 - Upgraded Sentiment Analysis.ipynb @@ -49,8 +49,7 @@ ], "source": [ "import torch\n", - "from torchtext import data\n", - "from torchtext import datasets\n", + "from torchtext.legacy import data\n", "\n", "SEED = 1234\n", "\n", @@ -86,7 +85,7 @@ } ], "source": [ - "from torchtext import datasets\n", + "from torchtext.legacy import datasets\n", "\n", "train_data, test_data = datasets.IMDB.splits(TEXT, LABEL)" ] @@ -884,4 +883,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/3 - Faster Sentiment Analysis.ipynb b/3 - Faster Sentiment Analysis.ipynb index 03e4a7c..37e0e04 100644 --- a/3 - Faster Sentiment Analysis.ipynb +++ b/3 - Faster Sentiment Analysis.ipynb @@ -89,8 +89,8 @@ ], "source": [ "import torch\n", - "from torchtext import data\n", - "from torchtext import datasets\n", + "from torchtext.legacy import data\n", + "from torchtext.legacy import datasets\n", "\n", "SEED = 1234\n", "\n", @@ -737,4 +737,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/4 - Convolutional Sentiment Analysis.ipynb b/4 - Convolutional Sentiment Analysis.ipynb index a5f387a..572ea9d 100644 --- a/4 - Convolutional Sentiment Analysis.ipynb +++ b/4 - Convolutional Sentiment Analysis.ipynb @@ -52,8 +52,8 @@ ], "source": [ "import torch\n", - "from torchtext import data\n", - "from torchtext import datasets\n", + "from torchtext.legacy import data\n", + "from torchtext.legacy import datasets\n", "import random\n", "import numpy as np\n", "\n", @@ -837,4 +837,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/5 - Multi-class Sentiment Analysis.ipynb b/5 - Multi-class Sentiment Analysis.ipynb index f3cba72..8dd951c 100644 --- a/5 - Multi-class Sentiment Analysis.ipynb +++ b/5 - Multi-class Sentiment Analysis.ipynb @@ -37,8 +37,8 @@ ], "source": [ "import torch\n", - "from torchtext import data\n", - "from torchtext import datasets\n", + "from torchtext.legacy import data\n", + "from torchtext.legacy import datasets\n", "import random\n", "\n", "SEED = 1234\n", @@ -719,4 +719,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/6 - Transformers for Sentiment Analysis.ipynb b/6 - Transformers for Sentiment Analysis.ipynb index 566e881..36934cd 100644 --- a/6 - Transformers for Sentiment Analysis.ipynb +++ b/6 - Transformers for Sentiment Analysis.ipynb @@ -298,7 +298,7 @@ } ], "source": [ - "from torchtext import data\n", + "from torchtext.legacy import data\n", "\n", "TEXT = data.Field(batch_first = True,\n", " use_vocab = False,\n", @@ -334,7 +334,7 @@ } ], "source": [ - "from torchtext import datasets\n", + "from torchtext.legacy import datasets\n", "\n", "train_data, test_data = datasets.IMDB.splits(TEXT, LABEL)\n", "\n", @@ -1042,4 +1042,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/A - Using TorchText with Your Own Datasets.ipynb b/A - Using TorchText with Your Own Datasets.ipynb index 81e53d4..cbc38de 100644 --- a/A - Using TorchText with Your Own Datasets.ipynb +++ b/A - Using TorchText with Your Own Datasets.ipynb @@ -53,8 +53,8 @@ "metadata": {}, "outputs": [], "source": [ - "from torchtext import data\n", - "from torchtext import datasets\n", + "from torchtext.legacy import data\n", + "from torchtext.legacy import datasets\n", "\n", "NAME = data.Field()\n", "SAYING = data.Field()\n", @@ -449,4 +449,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/B - A Closer Look at Word Embeddings.ipynb b/B - A Closer Look at Word Embeddings.ipynb index ba9f286..d05ee64 100644 --- a/B - A Closer Look at Word Embeddings.ipynb +++ b/B - A Closer Look at Word Embeddings.ipynb @@ -911,4 +911,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/C - Loading, Saving and Freezing Embeddings.ipynb b/C - Loading, Saving and Freezing Embeddings.ipynb index 23b9da0..6166e89 100644 --- a/C - Loading, Saving and Freezing Embeddings.ipynb +++ b/C - Loading, Saving and Freezing Embeddings.ipynb @@ -56,7 +56,7 @@ "outputs": [], "source": [ "import torch\n", - "from torchtext import data\n", + "from torchtext.legacy import data\n", "\n", "SEED = 1234\n", "\n", @@ -80,7 +80,7 @@ "metadata": {}, "outputs": [], "source": [ - "from torchtext import datasets\n", + "from torchtext.legacy import datasets\n", "import random\n", "\n", "train_data, test_data = datasets.IMDB.splits(TEXT, LABEL)\n", @@ -960,4 +960,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file