Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
ERNIE
提交
0ed92b2d
E
ERNIE
项目概览
PaddlePaddle
/
ERNIE
大约 1 年 前同步成功
通知
109
Star
5997
Fork
1270
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
29
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
ERNIE
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
29
Issue
29
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
0ed92b2d
编写于
6月 19, 2019
作者:
Y
Yibing Liu
提交者:
GitHub
6月 19, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #172 from tianxin1860/develop
fix pyreader return empty array as None in paddle 1.5
上级
da736152
8a11a42c
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
3 addition
and
2 deletion
+3
-2
ELMo/LAC_demo/network.py
ELMo/LAC_demo/network.py
+0
-1
ERNIE/finetune/classifier.py
ERNIE/finetune/classifier.py
+2
-0
ERNIE/reader/task_reader.py
ERNIE/reader/task_reader.py
+1
-1
未找到文件。
ELMo/LAC_demo/network.py
浏览文件 @
0ed92b2d
...
@@ -9,7 +9,6 @@ import paddle.fluid as fluid
...
@@ -9,7 +9,6 @@ import paddle.fluid as fluid
from
paddle.fluid.initializer
import
NormalInitializer
from
paddle.fluid.initializer
import
NormalInitializer
import
paddle.fluid.layers
as
layers
import
paddle.fluid.layers
as
layers
from
bilm
import
elmo_encoder
from
bilm
import
elmo_encoder
import
ipdb
def
lex_net
(
args
,
word_dict_len
,
label_dict_len
):
def
lex_net
(
args
,
word_dict_len
,
label_dict_len
):
...
...
ERNIE/finetune/classifier.py
浏览文件 @
0ed92b2d
...
@@ -177,6 +177,8 @@ def evaluate(exe, test_program, test_pyreader, graph_vars, eval_phase):
...
@@ -177,6 +177,8 @@ def evaluate(exe, test_program, test_pyreader, graph_vars, eval_phase):
total_acc
+=
np
.
sum
(
np_acc
*
np_num_seqs
)
total_acc
+=
np
.
sum
(
np_acc
*
np_num_seqs
)
total_num_seqs
+=
np
.
sum
(
np_num_seqs
)
total_num_seqs
+=
np
.
sum
(
np_num_seqs
)
labels
.
extend
(
np_labels
.
reshape
((
-
1
)).
tolist
())
labels
.
extend
(
np_labels
.
reshape
((
-
1
)).
tolist
())
if
np_qids
is
None
:
np_qids
=
np
.
array
([])
qids
.
extend
(
np_qids
.
reshape
(
-
1
).
tolist
())
qids
.
extend
(
np_qids
.
reshape
(
-
1
).
tolist
())
scores
.
extend
(
np_probs
[:,
1
].
reshape
(
-
1
).
tolist
())
scores
.
extend
(
np_probs
[:,
1
].
reshape
(
-
1
).
tolist
())
np_preds
=
np
.
argmax
(
np_probs
,
axis
=
1
).
astype
(
np
.
float32
)
np_preds
=
np
.
argmax
(
np_probs
,
axis
=
1
).
astype
(
np
.
float32
)
...
...
ERNIE/reader/task_reader.py
浏览文件 @
0ed92b2d
...
@@ -238,7 +238,7 @@ class ClassifyReader(BaseReader):
...
@@ -238,7 +238,7 @@ class ClassifyReader(BaseReader):
batch_labels
=
[
record
.
label_id
for
record
in
batch_records
]
batch_labels
=
[
record
.
label_id
for
record
in
batch_records
]
batch_labels
=
np
.
array
(
batch_labels
).
astype
(
"int64"
).
reshape
([
-
1
,
1
])
batch_labels
=
np
.
array
(
batch_labels
).
astype
(
"int64"
).
reshape
([
-
1
,
1
])
if
batch_records
[
0
].
qid
:
if
batch_records
[
0
].
qid
is
not
None
:
batch_qids
=
[
record
.
qid
for
record
in
batch_records
]
batch_qids
=
[
record
.
qid
for
record
in
batch_records
]
batch_qids
=
np
.
array
(
batch_qids
).
astype
(
"int64"
).
reshape
([
-
1
,
1
])
batch_qids
=
np
.
array
(
batch_qids
).
astype
(
"int64"
).
reshape
([
-
1
,
1
])
else
:
else
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录