Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleHub
提交
b71e406d
P
PaddleHub
项目概览
PaddlePaddle
/
PaddleHub
大约 2 年 前同步成功
通知
285
Star
12117
Fork
2091
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
200
列表
看板
标记
里程碑
合并请求
4
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleHub
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
200
Issue
200
列表
看板
标记
里程碑
合并请求
4
合并请求
4
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b71e406d
编写于
5月 28, 2019
作者:
S
Steffy-zxf
提交者:
wuzewu
5月 28, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix encoding format (#42)
* Fix the encoding format
上级
9892aa7e
变更
77
隐藏空白更改
内联
并排
Showing
77 changed file
with
126 addition
and
27 deletion
+126
-27
demo/elmo/elmo_finetune.py
demo/elmo/elmo_finetune.py
+1
-0
demo/image-classification/img_classifier.py
demo/image-classification/img_classifier.py
+1
-0
demo/image-classification/predict.py
demo/image-classification/predict.py
+1
-0
demo/lac/lac_demo.py
demo/lac/lac_demo.py
+14
-2
demo/senta/predict.py
demo/senta/predict.py
+1
-0
demo/senta/senta_demo.py
demo/senta/senta_demo.py
+14
-2
demo/senta/senta_finetune.py
demo/senta/senta_finetune.py
+1
-0
demo/sequence-labeling/predict.py
demo/sequence-labeling/predict.py
+1
-0
demo/sequence-labeling/sequence_label.py
demo/sequence-labeling/sequence_label.py
+1
-0
demo/ssd/ssd_demo.py
demo/ssd/ssd_demo.py
+1
-0
demo/text-classification/predict.py
demo/text-classification/predict.py
+1
-0
demo/text-classification/simple_demo.py
demo/text-classification/simple_demo.py
+1
-0
demo/text-classification/text_classifier.py
demo/text-classification/text_classifier.py
+1
-0
paddlehub/__init__.py
paddlehub/__init__.py
+6
-7
paddlehub/commands/__init__.py
paddlehub/commands/__init__.py
+1
-0
paddlehub/commands/base_command.py
paddlehub/commands/base_command.py
+1
-0
paddlehub/commands/clear.py
paddlehub/commands/clear.py
+1
-0
paddlehub/commands/cml_utils.py
paddlehub/commands/cml_utils.py
+1
-0
paddlehub/commands/download.py
paddlehub/commands/download.py
+1
-0
paddlehub/commands/help.py
paddlehub/commands/help.py
+1
-0
paddlehub/commands/hub.py
paddlehub/commands/hub.py
+9
-1
paddlehub/commands/install.py
paddlehub/commands/install.py
+1
-0
paddlehub/commands/list.py
paddlehub/commands/list.py
+1
-0
paddlehub/commands/run.py
paddlehub/commands/run.py
+3
-1
paddlehub/commands/search.py
paddlehub/commands/search.py
+1
-0
paddlehub/commands/show.py
paddlehub/commands/show.py
+1
-0
paddlehub/commands/uninstall.py
paddlehub/commands/uninstall.py
+1
-0
paddlehub/commands/version.py
paddlehub/commands/version.py
+1
-0
paddlehub/common/__init__.py
paddlehub/common/__init__.py
+1
-0
paddlehub/common/arg_helper.py
paddlehub/common/arg_helper.py
+1
-0
paddlehub/common/dir.py
paddlehub/common/dir.py
+1
-0
paddlehub/common/downloader.py
paddlehub/common/downloader.py
+1
-0
paddlehub/common/hub_server.py
paddlehub/common/hub_server.py
+1
-0
paddlehub/common/logger.py
paddlehub/common/logger.py
+1
-0
paddlehub/common/paddle_helper.py
paddlehub/common/paddle_helper.py
+1
-0
paddlehub/common/utils.py
paddlehub/common/utils.py
+1
-0
paddlehub/dataset/__init__.py
paddlehub/dataset/__init__.py
+1
-0
paddlehub/dataset/base_cv_dataset.py
paddlehub/dataset/base_cv_dataset.py
+1
-0
paddlehub/dataset/chnsenticorp.py
paddlehub/dataset/chnsenticorp.py
+1
-0
paddlehub/dataset/dataset.py
paddlehub/dataset/dataset.py
+1
-0
paddlehub/dataset/dogcat.py
paddlehub/dataset/dogcat.py
+1
-0
paddlehub/dataset/flowers.py
paddlehub/dataset/flowers.py
+1
-0
paddlehub/dataset/food101.py
paddlehub/dataset/food101.py
+1
-0
paddlehub/dataset/indoor67.py
paddlehub/dataset/indoor67.py
+1
-0
paddlehub/dataset/lcqmc.py
paddlehub/dataset/lcqmc.py
+1
-0
paddlehub/dataset/msra_ner.py
paddlehub/dataset/msra_ner.py
+1
-1
paddlehub/dataset/nlpcc_dbqa.py
paddlehub/dataset/nlpcc_dbqa.py
+1
-0
paddlehub/dataset/stanford_dogs.py
paddlehub/dataset/stanford_dogs.py
+1
-0
paddlehub/finetune/__init__.py
paddlehub/finetune/__init__.py
+1
-0
paddlehub/finetune/checkpoint.py
paddlehub/finetune/checkpoint.py
+1
-0
paddlehub/finetune/checkpoint_pb2.py
paddlehub/finetune/checkpoint_pb2.py
+1
-0
paddlehub/finetune/config.py
paddlehub/finetune/config.py
+1
-0
paddlehub/finetune/evaluate.py
paddlehub/finetune/evaluate.py
+1
-0
paddlehub/finetune/finetune.py
paddlehub/finetune/finetune.py
+1
-0
paddlehub/finetune/optimization.py
paddlehub/finetune/optimization.py
+1
-0
paddlehub/finetune/regularizer.py
paddlehub/finetune/regularizer.py
+1
-0
paddlehub/finetune/strategy.py
paddlehub/finetune/strategy.py
+1
-0
paddlehub/finetune/task.py
paddlehub/finetune/task.py
+1
-0
paddlehub/io/__init__.py
paddlehub/io/__init__.py
+1
-0
paddlehub/io/augmentation.py
paddlehub/io/augmentation.py
+1
-0
paddlehub/io/parser.py
paddlehub/io/parser.py
+1
-0
paddlehub/io/type.py
paddlehub/io/type.py
+1
-0
paddlehub/module/__init__.py
paddlehub/module/__init__.py
+1
-0
paddlehub/module/base_processor.py
paddlehub/module/base_processor.py
+1
-0
paddlehub/module/check_info_pb2.py
paddlehub/module/check_info_pb2.py
+1
-0
paddlehub/module/checker.py
paddlehub/module/checker.py
+1
-0
paddlehub/module/manager.py
paddlehub/module/manager.py
+1
-0
paddlehub/module/module.py
paddlehub/module/module.py
+1
-0
paddlehub/module/module_desc_pb2.py
paddlehub/module/module_desc_pb2.py
+1
-0
paddlehub/module/signature.py
paddlehub/module/signature.py
+1
-0
paddlehub/reader/__init__.py
paddlehub/reader/__init__.py
+1
-0
paddlehub/reader/batching.py
paddlehub/reader/batching.py
+1
-0
paddlehub/reader/cv_reader.py
paddlehub/reader/cv_reader.py
+1
-0
paddlehub/reader/nlp_reader.py
paddlehub/reader/nlp_reader.py
+4
-10
paddlehub/version.py
paddlehub/version.py
+1
-0
requirements.txt
requirements.txt
+0
-1
setup.py
setup.py
+7
-2
未找到文件。
demo/elmo/elmo_finetune.py
浏览文件 @
b71e406d
#coding:utf-8
import
argparse
import
ast
import
io
...
...
demo/image-classification/img_classifier.py
浏览文件 @
b71e406d
#coding:utf-8
import
argparse
import
os
...
...
demo/image-classification/predict.py
浏览文件 @
b71e406d
#coding:utf-8
import
argparse
import
os
...
...
demo/lac/lac_demo.py
浏览文件 @
b71e406d
#coding:utf-8
from
__future__
import
print_function
import
json
import
os
import
six
import
paddlehub
as
hub
if
__name__
==
"__main__"
:
...
...
@@ -12,5 +18,11 @@ if __name__ == "__main__":
# execute predict and print the result
results
=
lac
.
lexical_analysis
(
data
=
inputs
)
for
result
in
results
:
print
(
result
[
'word'
])
print
(
result
[
'tag'
])
if
six
.
PY2
:
print
(
json
.
dumps
(
result
[
'word'
],
encoding
=
"utf8"
,
ensure_ascii
=
False
))
print
(
json
.
dumps
(
result
[
'tag'
],
encoding
=
"utf8"
,
ensure_ascii
=
False
))
else
:
print
(
result
[
'word'
])
print
(
result
[
'tag'
])
demo/senta/predict.py
浏览文件 @
b71e406d
#coding:utf-8
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
...
...
demo/senta/senta_demo.py
浏览文件 @
b71e406d
# coding: utf-8
#coding:utf-8
from
__future__
import
print_function
import
json
import
os
import
six
import
paddlehub
as
hub
if
__name__
==
"__main__"
:
...
...
@@ -11,5 +16,12 @@ if __name__ == "__main__":
input_dict
=
{
"text"
:
test_text
}
results
=
senta
.
sentiment_classify
(
data
=
input_dict
)
for
index
,
text
in
enumerate
(
test_text
):
results
[
index
][
"text"
]
=
text
for
index
,
result
in
enumerate
(
results
):
print
(
test_text
[
index
],
result
[
'sentiment_key'
])
if
six
.
PY2
:
print
(
json
.
dumps
(
results
[
index
],
encoding
=
"utf8"
,
ensure_ascii
=
False
))
else
:
print
(
results
[
index
])
demo/senta/senta_finetune.py
浏览文件 @
b71e406d
#coding:utf-8
import
argparse
import
ast
...
...
demo/sequence-labeling/predict.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
...
...
demo/sequence-labeling/sequence_label.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
...
...
demo/ssd/ssd_demo.py
浏览文件 @
b71e406d
#coding:utf-8
import
os
import
paddlehub
as
hub
...
...
demo/text-classification/predict.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
...
...
demo/text-classification/simple_demo.py
浏览文件 @
b71e406d
#coding:utf-8
import
paddle.fluid
as
fluid
import
paddlehub
as
hub
...
...
demo/text-classification/text_classifier.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
...
...
paddlehub/__init__.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
@@ -12,10 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#coding:utf-8
import
six
if
six
.
PY2
:
import
sys
reload
(
sys
)
sys
.
setdefaultencoding
(
"UTF-8"
)
from
.
import
module
from
.
import
common
from
.
import
io
...
...
@@ -47,8 +51,3 @@ from .finetune.config import RunConfig
from
.finetune.strategy
import
AdamWeightDecayStrategy
from
.finetune.strategy
import
DefaultStrategy
from
.finetune.strategy
import
DefaultFinetuneStrategy
if
six
.
PY2
:
import
sys
reload
(
sys
)
sys
.
setdefaultencoding
(
"UTF-8"
)
paddlehub/commands/__init__.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/commands/base_command.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/commands/clear.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/commands/cml_utils.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/commands/download.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/commands/help.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/commands/hub.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
@@ -16,6 +17,7 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
six
import
sys
from
paddlehub.common.logger
import
logger
...
...
@@ -60,4 +62,10 @@ def main():
if
__name__
==
"__main__"
:
command
.
execute
(
sys
.
argv
[
1
:])
argv
=
[]
for
item
in
sys
.
argv
:
if
six
.
PY2
:
argv
.
append
(
item
.
decode
(
sys
.
stdin
.
encoding
).
decode
(
"utf8"
))
else
:
argv
.
append
(
item
)
command
.
execute
(
argv
[
1
:])
paddlehub/commands/install.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/commands/list.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/commands/run.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
@@ -17,6 +18,7 @@ from __future__ import division
from
__future__
import
print_function
import
argparse
import
json
import
os
import
sys
...
...
@@ -172,7 +174,7 @@ class RunCommand(BaseCommand):
results
=
module
(
sign_name
=
self
.
args
.
signature
,
data
=
input_data
,
**
config
)
if
six
.
PY2
:
print
(
repr
(
results
).
decode
(
'string_escape'
))
print
(
json
.
dumps
(
results
,
encoding
=
"utf8"
,
ensure_ascii
=
False
))
else
:
print
(
results
)
...
...
paddlehub/commands/search.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/commands/show.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/commands/uninstall.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/commands/version.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/common/__init__.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/common/arg_helper.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/common/dir.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/common/downloader.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/common/hub_server.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/common/logger.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/common/paddle_helper.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/common/utils.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/dataset/__init__.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
...
...
paddlehub/dataset/base_cv_dataset.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/dataset/chnsenticorp.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/dataset/dataset.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/dataset/dogcat.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/dataset/flowers.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/dataset/food101.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/dataset/indoor67.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/dataset/lcqmc.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/dataset/msra_ner.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
@@ -20,7 +21,6 @@ import os
import
codecs
import
csv
import
json
import
six
from
collections
import
namedtuple
from
paddlehub.dataset
import
InputExample
,
HubDataset
...
...
paddlehub/dataset/nlpcc_dbqa.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/dataset/stanford_dogs.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/finetune/__init__.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/finetune/checkpoint.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/finetune/checkpoint_pb2.py
浏览文件 @
b71e406d
#coding:utf-8
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: checkpoint.proto
...
...
paddlehub/finetune/config.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/finetune/evaluate.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/finetune/finetune.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/finetune/optimization.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
...
...
paddlehub/finetune/regularizer.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/finetune/strategy.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/finetune/task.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/io/__init__.py
浏览文件 @
b71e406d
#coding:utf-8
paddlehub/io/augmentation.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/io/parser.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/io/type.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/module/__init__.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/module/base_processor.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/module/check_info_pb2.py
浏览文件 @
b71e406d
#coding:utf-8
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: check_info.proto
...
...
paddlehub/module/checker.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/module/manager.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/module/module.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/module/module_desc_pb2.py
浏览文件 @
b71e406d
#coding:utf-8
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: module_desc.proto
...
...
paddlehub/module/signature.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/reader/__init__.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/reader/batching.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
...
...
paddlehub/reader/cv_reader.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
paddlehub/reader/nlp_reader.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -20,6 +21,7 @@ import csv
import
json
import
platform
import
six
import
sys
from
collections
import
namedtuple
import
paddle
...
...
@@ -31,12 +33,6 @@ from .batching import pad_batch_data
import
paddlehub
as
hub
def
get_encoding
():
if
platform
.
platform
().
lower
().
startswith
(
"windows"
):
return
"gbk"
return
"utf8"
class
BaseReader
(
object
):
def
__init__
(
self
,
dataset
,
...
...
@@ -426,15 +422,13 @@ class LACClassifyReader(object):
def
preprocess
(
text
):
data_dict
=
{
self
.
feed_key
:
[
text
]}
processed
=
self
.
lac
.
lexical_analysis
(
data
=
data_dict
)
for
data
in
processed
:
for
index
,
word
in
enumerate
(
data
[
'word'
]):
if
six
.
PY2
and
type
(
word
)
==
str
:
data
[
'word'
][
index
]
=
word
.
decode
(
get_encoding
())
processed
=
[
self
.
vocab
[
word
]
for
word
in
processed
[
0
][
'word'
]
if
word
in
self
.
vocab
]
if
len
(
processed
)
==
0
:
if
six
.
PY2
:
text
=
text
.
encode
(
sys
.
stdout
.
encoding
)
logger
.
warning
(
"The words in text %s can't be found in the vocabulary."
%
(
text
))
...
...
paddlehub/version.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
requirements.txt
浏览文件 @
b71e406d
...
...
@@ -6,4 +6,3 @@ pyyaml
numpy
>= 1.12.0
Pillow
six
>= 1.10.0
chardet
== 3.0.4
setup.py
浏览文件 @
b71e406d
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
...
...
@@ -30,8 +31,12 @@ def python_version():
max_version
,
mid_version
,
min_version
=
python_version
()
REQUIRED_PACKAGES
=
[
'numpy >= 1.12.0'
,
'six >= 1.10.0'
,
'protobuf >= 3.1.0'
,
'pyyaml'
,
'Pillow'
,
"visualdl >= 1.3.0"
,
"chardet == 3.0.4"
'numpy >= 1.12.0'
,
'six >= 1.10.0'
,
'protobuf >= 3.1.0'
,
'pyyaml'
,
'Pillow'
,
"visualdl >= 1.3.0"
,
]
if
max_version
<
3
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录