Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PALM
提交
36bbc8e7
P
PALM
项目概览
PaddlePaddle
/
PALM
通知
4
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PALM
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
36bbc8e7
编写于
2月 18, 2020
作者:
W
wangxiao1021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bugs
上级
cae26c4c
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
14 addition
and
21 deletion
+14
-21
examples/classification/run.py
examples/classification/run.py
+2
-2
examples/matching/README.md
examples/matching/README.md
+1
-1
examples/matching/run.py
examples/matching/run.py
+2
-2
examples/mrc/run.py
examples/mrc/run.py
+1
-1
examples/multi-task/README.md
examples/multi-task/README.md
+1
-1
examples/multi-task/predict-intent.py
examples/multi-task/predict-intent.py
+2
-2
examples/multi-task/predict-slot.py
examples/multi-task/predict-slot.py
+2
-2
examples/predict/run.py
examples/predict/run.py
+2
-2
examples/tagging/run.py
examples/tagging/run.py
+1
-1
paddlepalm/head/mrc.py
paddlepalm/head/mrc.py
+0
-7
未找到文件。
examples/classification/run.py
浏览文件 @
36bbc8e7
...
...
@@ -90,10 +90,10 @@ if __name__ == '__main__':
# step 5: build forward graph with backbone and task head
trainer
.
build_predict_forward
(
pred_ernie
,
cls_pred_head
)
# step 6: load
pretrained model
# step 6: load
checkpoint
# model_path = './outputs/ckpt.step'+str(save_steps)
model_path
=
'./outputs/ckpt.step'
+
str
(
11980
)
pred_ckpt
=
trainer
.
load_ckpt
(
model_path
)
trainer
.
load_ckpt
(
model_path
)
# step 7: fit prepared reader and data
trainer
.
fit_reader
(
predict_cls_reader
,
phase
=
'predict'
)
...
...
examples/matching/README.md
浏览文件 @
36bbc8e7
...
...
@@ -5,7 +5,7 @@ This task is a sentence pair matching task. The following sections detail model
#### Download Pre-trained Model
The pre-training model of this mission is:
[
ernie
-en-base
](
https://github.com/PaddlePaddle/PALM/tree/r0.3-api
)
.
The pre-training model of this mission is:
[
ERNIE-v2
-en-base
](
https://github.com/PaddlePaddle/PALM/tree/r0.3-api
)
.
Make sure you have downloaded the required pre-training model in the current folder.
...
...
examples/matching/run.py
浏览文件 @
36bbc8e7
...
...
@@ -93,8 +93,8 @@ if __name__ == '__main__':
# step 5: build forward graph with backbone and task head
trainer
.
build_predict_forward
(
pred_ernie
,
match_pred_head
)
# step 6: load
pretrained model
pred_ckpt
=
trainer
.
load_ckpt
(
pred_model_path
)
# step 6: load
checkpoint
trainer
.
load_ckpt
(
pred_model_path
)
# step 7: fit prepared reader and data
trainer
.
fit_reader
(
predict_match_reader
,
phase
=
'predict'
)
...
...
examples/mrc/run.py
浏览文件 @
36bbc8e7
...
...
@@ -89,7 +89,7 @@ if __name__ == '__main__':
# step 5: build forward graph with backbone and task head
trainer
.
build_predict_forward
(
pred_ernie
,
mrc_pred_head
)
# step 6: load
pretrained model
# step 6: load
checkpoint
pred_model_path
=
'./outputs/ckpt.step'
+
str
(
12160
)
trainer
.
load_ckpt
(
pred_model_path
)
...
...
examples/multi-task/README.md
浏览文件 @
36bbc8e7
...
...
@@ -5,7 +5,7 @@ This task is a slot filling task. During training, the task uses intent determin
#### Pre-trianed Model
The pre-training model of this mission is:
[
ernie
-en-base
](
https://github.com/PaddlePaddle/PALM/tree/r0.3-api
)
.
The pre-training model of this mission is:
[
ERNIE-v2
-en-base
](
https://github.com/PaddlePaddle/PALM/tree/r0.3-api
)
.
Make sure you have downloaded the required pre-training model in the current folder.
...
...
examples/multi-task/predict-intent.py
浏览文件 @
36bbc8e7
...
...
@@ -45,9 +45,9 @@ if __name__ == '__main__':
# step 5-2: build forward graph with backbone and task head
trainer
.
build_predict_forward
(
pred_ernie
,
cls_pred_head
)
# step 6: load
pretrained model
# step 6: load
checkpoint
pred_model_path
=
'./outputs/ckpt.step4641'
pred_ckpt
=
trainer
.
load_ckpt
(
pred_model_path
)
trainer
.
load_ckpt
(
pred_model_path
)
# step 7: fit prepared reader and data
trainer
.
fit_reader
(
predict_cls_reader
,
phase
=
'predict'
)
...
...
examples/multi-task/predict-slot.py
浏览文件 @
36bbc8e7
...
...
@@ -46,9 +46,9 @@ if __name__ == '__main__':
# step 5-2: build forward graph with backbone and task head
trainer_seq_label
.
build_predict_forward
(
pred_ernie
,
seq_label_pred_head
)
# step 6: load
pretrained model
# step 6: load
checkpoint
pred_model_path
=
'./outputs/ckpt.step4641'
pred_ckpt
=
trainer_seq_label
.
load_ckpt
(
pred_model_path
)
trainer_seq_label
.
load_ckpt
(
pred_model_path
)
# step 7: fit prepared reader and data
trainer_seq_label
.
fit_reader
(
predict_seq_label_reader
,
phase
=
'predict'
)
...
...
examples/predict/run.py
浏览文件 @
36bbc8e7
...
...
@@ -42,8 +42,8 @@ if __name__ == '__main__':
# step 5-2: build forward graph with backbone and task head
trainer
.
build_predict_forward
(
pred_ernie
,
cls_pred_head
)
# step 6: load
pretrained model
pred_model
=
trainer
.
load_predict_model
(
pre_params
)
# step 6: load
checkpoint
trainer
.
load_predict_model
(
pre_params
)
# step 7: fit prepared reader and data
trainer
.
fit_reader
(
predict_cls_reader
,
phase
=
'predict'
)
...
...
examples/tagging/run.py
浏览文件 @
36bbc8e7
...
...
@@ -93,7 +93,7 @@ if __name__ == '__main__':
# step 5: build forward graph with backbone and task head
trainer
.
build_predict_forward
(
pred_ernie
,
seq_label_pred_head
)
# step 6: load
pretrained model
# step 6: load
checkpoint
pred_model_path
=
'./outputs/ckpt.step'
+
str
(
save_steps
)
trainer
.
load_ckpt
(
pred_model_path
)
...
...
paddlepalm/head/mrc.py
浏览文件 @
36bbc8e7
...
...
@@ -22,14 +22,7 @@ import math
import
six
import
paddlepalm.tokenizer.ernie_tokenizer
as
tokenization
import
json
import
sys
import
io
if
sys
.
version
[
0
]
==
'2'
:
reload
(
sys
)
sys
.
setdefaultencoding
(
'utf-8'
)
else
:
import
importlib
importlib
.
reload
(
sys
)
RawResult
=
collections
.
namedtuple
(
"RawResult"
,
[
"unique_id"
,
"start_logits"
,
"end_logits"
])
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录