Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a bug in pretrained models in nlp part #4743

Merged
merged 2 commits into from
May 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions docs/practices/nlp/pretrained_word_embeddings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"source": [
"## 二、数据载入\n",
"\n",
"在这个示例中,将使用 Paddle 2.2.0-rc0 完成针对 Imdb 数据集(电影评论情感二分类数据集)的分类训练和测试。Imdb 将直接调用自 Paddle 2.2.0-rc0,同时,\n",
"在这个示例中,将使用 Paddle 2.3.0 完成针对 Imdb 数据集(电影评论情感二分类数据集)的分类训练和测试。Imdb 将直接调用自 Paddle 2.3.0,同时,\n",
"利用预训练的词向量([GloVe embedding](http://nlp.stanford.edu/projects/glove/))完成任务。"
]
},
Expand Down Expand Up @@ -85,8 +85,7 @@
"collapsed": false
},
"source": [
"\n",
"由于 Paddle 2.2 提供了经过处理的Imdb数据集,可以方便地调用所需要的数据实例,省去了数据预处理的麻烦。目前, Paddle 2.2 以及内置的高质量\n",
"由于 Paddle 2.3 提供了经过处理的Imdb数据集,可以方便地调用所需要的数据实例,省去了数据预处理的麻烦。目前, Paddle 2.3 以及内置的高质量\n",
"数据集包括 Conll05st、Imdb、Imikolov、Movielens、HCIHousing、WMT14、WMT16、ViterbiDecoder、viterbi_decode 等,未来还将提供更多常用数据集的调用接口。\n",
"\n",
"以下定义了调用 Imdb 训练集合测试集的方法。其中,cutoff 定义了构建词典的截止大小,即数据集中出现频率在 cutoff 以下的不予考虑;mode 定义了返回的数据用于何种用途(test: 测试集,train: 训练集)。\n",
Expand Down Expand Up @@ -227,8 +226,7 @@
},
"outputs": [],
"source": [
"# glove_path = \"./glove.6B.100d.txt\"\r\n",
"glove_path = \"data/data42051/glove.6B.100d.txt\"\r\n",
"glove_path = \"./glove.6B.100d.txt\"\r\n",
"embeddings = {}"
]
},
Expand Down Expand Up @@ -494,7 +492,7 @@
},
"source": [
"### 4.3 读取数据,进行训练\n",
"可以利用 Paddle2.2 的io.Dataset模块来构建一个数据的读取器,方便地将数据进行分批训练。"
"可以利用 Paddle2.3 的io.Dataset模块来构建一个数据的读取器,方便地将数据进行分批训练。"
]
},
{
Expand Down