提交 ff97d6b3 编写于 作者: Z Zeyu Chen

Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleHub into develop

......@@ -54,9 +54,9 @@ $ hub search
```
## 深入了解PaddleHub
* [命令行功能](https://github.com/PaddlePaddle/PaddleHub/wiki/PaddleHub-%E5%91%BD%E4%BB%A4%E8%A1%8C%E6%8E%A5%E5%8F%A3)
* [命令行工具](https://github.com/PaddlePaddle/PaddleHub/wiki/PaddleHub%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%B7%A5%E5%85%B7)
* [Finetune API与迁移学习](https://github.com/PaddlePaddle/PaddleHub/wiki/PaddleHub%E4%B8%8E%E8%BF%81%E7%A7%BB%E5%AD%A6%E4%B9%A0)
* [API](https://github.com/PaddlePaddle/PaddleHub/wiki/PaddleHub-Fine-tune-API)
* [API](https://github.com/PaddlePaddle/PaddleHub/wiki/PaddleHub-Finetune-API)
## 答疑
......
export CUDA_VISIBLE_DEVICES=3
export CUDA_VISIBLE_DEVICES=0
# User can select chnsenticorp, nlpcc_dbqa, lcqmc for different task
DATASET="chnsenticorp"
......
......@@ -11,6 +11,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#coding:utf-8
import six
from . import module
from . import common
from . import io
......@@ -41,3 +45,8 @@ from .finetune.finetune import finetune_and_eval
from .finetune.config import RunConfig
from .finetune.strategy import AdamWeightDecayStrategy
from .finetune.strategy import DefaultStrategy
if six.PY2:
import sys
reload(sys)
sys.setdefaultencoding("UTF-8")
\ No newline at end of file
......@@ -17,6 +17,7 @@ from __future__ import division
from __future__ import print_function
from collections import namedtuple
import codecs
import os
import csv
......@@ -79,7 +80,7 @@ class ChnSentiCorp(HubDataset):
def _read_tsv(self, input_file, quotechar=None):
"""Reads a tab separated value file."""
with open(input_file, "r") as f:
with codecs.open(input_file, "r", encoding="UTF-8") as f:
reader = csv.reader(f, delimiter="\t", quotechar=quotechar)
examples = []
seq_id = 0
......
......@@ -17,6 +17,7 @@ from __future__ import division
from __future__ import print_function
from collections import namedtuple
import codecs
import os
import csv
......@@ -75,7 +76,7 @@ class LCQMC(HubDataset):
def _read_tsv(self, input_file, quotechar=None):
"""Reads a tab separated value file."""
with open(input_file, "r") as f:
with codecs.open(input_file, "r", encoding="UTF-8") as f:
reader = csv.reader(f, delimiter="\t", quotechar=quotechar)
examples = []
seq_id = 0
......
......@@ -17,8 +17,10 @@ from __future__ import division
from __future__ import print_function
import os
import codecs
import csv
import json
import six
from collections import namedtuple
from paddlehub.dataset import InputExample, HubDataset
......@@ -85,7 +87,7 @@ class MSRA_NER(HubDataset):
def _read_tsv(self, input_file, quotechar=None):
"""Reads a tab separated value file."""
with open(input_file, "r") as f:
with codecs.open(input_file, "r", encoding="UTF-8") as f:
reader = csv.reader(f, delimiter="\t", quotechar=quotechar)
examples = []
seq_id = 0
......
......@@ -17,6 +17,7 @@ from __future__ import division
from __future__ import print_function
from collections import namedtuple
import codecs
import os
import csv
......@@ -81,7 +82,7 @@ class NLPCC_DBQA(HubDataset):
def _read_tsv(self, input_file, quotechar=None):
"""Reads a tab separated value file."""
with open(input_file, "r") as f:
with codecs.open(input_file, "r", encoding="UTF-8") as f:
reader = csv.reader(f, delimiter="\t", quotechar=quotechar)
examples = []
seq_id = 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册