From 0197f9a24045067590e5f5217ee54b98b89768fa Mon Sep 17 00:00:00 2001 From: wuzewu Date: Fri, 17 Jan 2020 16:51:02 +0800 Subject: [PATCH] Update reading comprehension predict demo --- demo/reading_comprehension/predict.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/demo/reading_comprehension/predict.py b/demo/reading_comprehension/predict.py index b9247152..a9f8c2f9 100644 --- a/demo/reading_comprehension/predict.py +++ b/demo/reading_comprehension/predict.py @@ -20,20 +20,8 @@ from __future__ import print_function import argparse import ast -import collections -import json -import io -import math -import numpy as np -import os -import six -import sys -import time -import paddle -import paddle.fluid as fluid import paddlehub as hub -from paddlehub.finetune.task.reading_comprehension_task import write_predictions hub.common.logger.logger.setLevel("INFO") @@ -93,4 +81,4 @@ if __name__ == '__main__': # Data to be predicted data = dataset.dev_examples[:10] - reading_comprehension_task.predict(data=data) + print(reading_comprehension_task.predict(data=data, return_result=True)) -- GitLab