diff --git a/fluid/PaddleNLP/machine_reading_comprehension/dataset.py b/fluid/PaddleNLP/machine_reading_comprehension/dataset.py index 9ed3b483cd43ed24b4a60ba6d135c19885989793..c732ce041c5e82ea5e1471ba422f5b056a7cba8f 100644 --- a/fluid/PaddleNLP/machine_reading_comprehension/dataset.py +++ b/fluid/PaddleNLP/machine_reading_comprehension/dataset.py @@ -23,6 +23,7 @@ import json import logging import numpy as np from collections import Counter +import io class BRCDataset(object): @@ -67,7 +68,7 @@ class BRCDataset(object): Args: data_path: the data file to load """ - with open(data_path, 'r', encoding='utf-8') as fin: + with io.open(data_path, 'r', encoding='utf-8') as fin: data_set = [] for lidx, line in enumerate(fin): sample = json.loads(line.strip())