diff --git a/doc/fluid/user_guides/nlp_case/understand_sentiment/README.cn.md b/doc/fluid/user_guides/nlp_case/understand_sentiment/README.cn.md index 8f35f06c73998b3822f6a7c2e53cd14fc5e6b3f5..ce9cd776d6d4b726065f511abf720757764e8fe2 100644 --- a/doc/fluid/user_guides/nlp_case/understand_sentiment/README.cn.md +++ b/doc/fluid/user_guides/nlp_case/understand_sentiment/README.cn.md @@ -268,12 +268,12 @@ print("Loading IMDB word dict....") word_dict = paddle.dataset.imdb.word_dict() print ("Reading training data....") -train_reader = paddle.batch( - paddle.reader.shuffle( +train_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.imdb.train(word_dict), buf_size=25000), batch_size=BATCH_SIZE) print("Reading testing data....") -test_reader = paddle.batch( +test_reader = fluid.io.batch( paddle.dataset.imdb.test(word_dict), batch_size=BATCH_SIZE) ``` word_dict是一个字典序列,是词和label的对应关系,运行下一行可以看到具体内容: diff --git a/doc/fluid/user_guides/nlp_case/understand_sentiment/README.md b/doc/fluid/user_guides/nlp_case/understand_sentiment/README.md index 4a91a5c39927466f2e8ea6b90017496986f30473..5e18077cec00eae50663f4523841dfbb6eeb9aca 100644 --- a/doc/fluid/user_guides/nlp_case/understand_sentiment/README.md +++ b/doc/fluid/user_guides/nlp_case/understand_sentiment/README.md @@ -257,12 +257,12 @@ print("Loading IMDB word dict....") word_dict = paddle.dataset.imdb.word_dict() print ("Reading training data....") -train_reader = paddle.batch( - paddle.reader.shuffle( +train_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.imdb.train(word_dict), buf_size=25000), batch_size=BATCH_SIZE) print("Reading testing data....") -test_reader = paddle.batch( +test_reader = fluid.io.batch( paddle.dataset.imdb.test(word_dict), batch_size=BATCH_SIZE) ``` Word_dict is a dictionary sequence, which is the correspondence between words and labels. You can see it specifically by running the next code: diff --git a/doc/fluid/user_guides/nlp_case/understand_sentiment/index.cn.html b/doc/fluid/user_guides/nlp_case/understand_sentiment/index.cn.html index 7c551554a1b94f934af0897c6847222e77873068..4af2290740ecebcdedff52a383408aa50e13fdf0 100644 --- a/doc/fluid/user_guides/nlp_case/understand_sentiment/index.cn.html +++ b/doc/fluid/user_guides/nlp_case/understand_sentiment/index.cn.html @@ -310,12 +310,12 @@ print("Loading IMDB word dict....") word_dict = paddle.dataset.imdb.word_dict() print ("Reading training data....") -train_reader = paddle.batch( - paddle.reader.shuffle( +train_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.imdb.train(word_dict), buf_size=25000), batch_size=BATCH_SIZE) print("Reading testing data....") -test_reader = paddle.batch( +test_reader = fluid.io.batch( paddle.dataset.imdb.test(word_dict), batch_size=BATCH_SIZE) ``` word_dict是一个字典序列,是词和label的对应关系,运行下一行可以看到具体内容: diff --git a/doc/fluid/user_guides/nlp_case/understand_sentiment/index.html b/doc/fluid/user_guides/nlp_case/understand_sentiment/index.html index c363ba148af0835c623ddee7068eb05f0b4b7e0d..45604f13c72ae2a40f6b5f971ea27ee2f65f1048 100644 --- a/doc/fluid/user_guides/nlp_case/understand_sentiment/index.html +++ b/doc/fluid/user_guides/nlp_case/understand_sentiment/index.html @@ -299,12 +299,12 @@ print("Loading IMDB word dict....") word_dict = paddle.dataset.imdb.word_dict() print ("Reading training data....") -train_reader = paddle.batch( - paddle.reader.shuffle( +train_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.imdb.train(word_dict), buf_size=25000), batch_size=BATCH_SIZE) print("Reading testing data....") -test_reader = paddle.batch( +test_reader = fluid.io.batch( paddle.dataset.imdb.test(word_dict), batch_size=BATCH_SIZE) ``` Word_dict is a dictionary sequence, which is the correspondence between words and labels. You can see it specifically by running the next code: diff --git a/doc/fluid/user_guides/nlp_case/understand_sentiment/train_conv.py b/doc/fluid/user_guides/nlp_case/understand_sentiment/train_conv.py index 765db3f12a85f5957cbbc4b9093e9c6e7a1523f2..74547461500e5532e44208ef2d589984a20320e8 100644 --- a/doc/fluid/user_guides/nlp_case/understand_sentiment/train_conv.py +++ b/doc/fluid/user_guides/nlp_case/understand_sentiment/train_conv.py @@ -88,16 +88,16 @@ def train(use_cuda, params_dirname): print("Reading training data....") if args.enable_ce: - train_reader = paddle.batch( + train_reader = fluid.io.batch( paddle.dataset.imdb.train(word_dict), batch_size=BATCH_SIZE) else: - train_reader = paddle.batch( - paddle.reader.shuffle( + train_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.imdb.train(word_dict), buf_size=25000), batch_size=BATCH_SIZE) print("Reading testing data....") - test_reader = paddle.batch( + test_reader = fluid.io.batch( paddle.dataset.imdb.test(word_dict), batch_size=BATCH_SIZE) feed_order = ['words', 'label'] diff --git a/doc/fluid/user_guides/nlp_case/understand_sentiment/train_dyn_rnn.py b/doc/fluid/user_guides/nlp_case/understand_sentiment/train_dyn_rnn.py index c28b7b668026b533ecce5a4a3f45fe1adb74acbc..78f3d64b43dc50efe195615016d5e92f2d40e9e5 100644 --- a/doc/fluid/user_guides/nlp_case/understand_sentiment/train_dyn_rnn.py +++ b/doc/fluid/user_guides/nlp_case/understand_sentiment/train_dyn_rnn.py @@ -79,16 +79,16 @@ def train(use_cuda, params_dirname): print("Reading training data....") if args.enable_ce: - train_reader = paddle.batch( + train_reader = fluid.io.batch( paddle.dataset.imdb.train(word_dict), batch_size=BATCH_SIZE) else: - train_reader = paddle.batch( - paddle.reader.shuffle( + train_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.imdb.train(word_dict), buf_size=25000), batch_size=BATCH_SIZE) print("Reading testing data....") - test_reader = paddle.batch( + test_reader = fluid.io.batch( paddle.dataset.imdb.test(word_dict), batch_size=BATCH_SIZE) feed_order = ['words', 'label'] diff --git a/doc/fluid/user_guides/nlp_case/understand_sentiment/train_stacked_lstm.py b/doc/fluid/user_guides/nlp_case/understand_sentiment/train_stacked_lstm.py index e7635ccfe894b4bd954ac2c01c2edd22475ca228..5878c7f738557e756e816b78d24af0c16b2b48bd 100644 --- a/doc/fluid/user_guides/nlp_case/understand_sentiment/train_stacked_lstm.py +++ b/doc/fluid/user_guides/nlp_case/understand_sentiment/train_stacked_lstm.py @@ -99,11 +99,11 @@ def train(use_cuda, params_dirname): print("Reading training data....") if args.enable_ce: - train_reader = paddle.batch( + train_reader = fluid.io.batch( paddle.dataset.imdb.train(word_dict), batch_size=BATCH_SIZE) else: - train_reader = paddle.batch( - paddle.reader.shuffle( + train_reader = fluid.io.batch( + fluid.io.shuffle( paddle.dataset.imdb.train(word_dict), buf_size=25000), batch_size=BATCH_SIZE)