diff --git a/doc/ABTEST_IN_PADDLE_SERVING.md b/doc/ABTEST_IN_PADDLE_SERVING.md index f2302e611bc68607ed68f45f81cd833a91938ae6..23bf7d98ed408ce608b858f71b437c6495a8885e 100644 --- a/doc/ABTEST_IN_PADDLE_SERVING.md +++ b/doc/ABTEST_IN_PADDLE_SERVING.md @@ -21,7 +21,7 @@ The following Python code will process the data `test_data/part-0` and write to [//file]:#process.py ``` python -from imdb_reader import IMDBDataset +from paddle_serving_app.reader import IMDBDataset imdb_dataset = IMDBDataset() imdb_dataset.load_resource('imdb.vocab') @@ -78,7 +78,7 @@ with open('processed.data') as f: feed = {"words": word_ids} fetch = ["acc", "cost", "prediction"] [fetch_map, tag] = client.predict(feed=feed, fetch=fetch, need_variant_tag=True) - if (float(fetch_map["prediction"][1]) - 0.5) * (float(label[0]) - 0.5) > 0: + if (float(fetch_map["prediction"][0][1]) - 0.5) * (float(label[0]) - 0.5) > 0: cnt[tag]['acc'] += 1 cnt[tag]['total'] += 1 diff --git a/doc/ABTEST_IN_PADDLE_SERVING_CN.md b/doc/ABTEST_IN_PADDLE_SERVING_CN.md index 7ba4e5d7dbe643d87fc15e783afea2955b98fa1e..43bb702bd8b0317d7449313c0e1362953ed87744 100644 --- a/doc/ABTEST_IN_PADDLE_SERVING_CN.md +++ b/doc/ABTEST_IN_PADDLE_SERVING_CN.md @@ -20,7 +20,7 @@ sh get_data.sh 下面Python代码将处理`test_data/part-0`的数据,写入`processed.data`文件中。 ```python -from imdb_reader import IMDBDataset +from paddle_serving_app.reader import IMDBDataset imdb_dataset = IMDBDataset() imdb_dataset.load_resource('imdb.vocab') @@ -76,7 +76,7 @@ with open('processed.data') as f: feed = {"words": word_ids} fetch = ["acc", "cost", "prediction"] [fetch_map, tag] = client.predict(feed=feed, fetch=fetch, need_variant_tag=True) - if (float(fetch_map["prediction"][1]) - 0.5) * (float(label[0]) - 0.5) > 0: + if (float(fetch_map["prediction"][0][1]) - 0.5) * (float(label[0]) - 0.5) > 0: cnt[tag]['acc'] += 1 cnt[tag]['total'] += 1