Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
a2668240
M
models
项目概览
PaddlePaddle
/
models
大约 1 年 前同步成功
通知
222
Star
6828
Fork
2962
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
602
列表
看板
标记
里程碑
合并请求
255
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
602
Issue
602
列表
看板
标记
里程碑
合并请求
255
合并请求
255
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a2668240
编写于
9月 28, 2018
作者:
Q
qiuxuezhong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename files
上级
67832a8c
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
20 addition
and
58 deletion
+20
-58
fluid/machine_reading_comprehesion/README.md
fluid/machine_reading_comprehesion/README.md
+0
-0
fluid/machine_reading_comprehesion/args.py
fluid/machine_reading_comprehesion/args.py
+16
-57
fluid/machine_reading_comprehesion/data/download.sh
fluid/machine_reading_comprehesion/data/download.sh
+0
-0
fluid/machine_reading_comprehesion/data/md5sum.txt
fluid/machine_reading_comprehesion/data/md5sum.txt
+0
-0
fluid/machine_reading_comprehesion/dataset.py
fluid/machine_reading_comprehesion/dataset.py
+0
-0
fluid/machine_reading_comprehesion/rc_model.py
fluid/machine_reading_comprehesion/rc_model.py
+0
-0
fluid/machine_reading_comprehesion/run.py
fluid/machine_reading_comprehesion/run.py
+0
-0
fluid/machine_reading_comprehesion/run.sh
fluid/machine_reading_comprehesion/run.sh
+0
-0
fluid/machine_reading_comprehesion/utils/__init__.py
fluid/machine_reading_comprehesion/utils/__init__.py
+0
-0
fluid/machine_reading_comprehesion/utils/download_thirdparty.sh
...machine_reading_comprehesion/utils/download_thirdparty.sh
+0
-0
fluid/machine_reading_comprehesion/utils/dureader_eval.py
fluid/machine_reading_comprehesion/utils/dureader_eval.py
+0
-0
fluid/machine_reading_comprehesion/utils/get_vocab.py
fluid/machine_reading_comprehesion/utils/get_vocab.py
+0
-0
fluid/machine_reading_comprehesion/utils/marco_tokenize_data.py
...machine_reading_comprehesion/utils/marco_tokenize_data.py
+0
-0
fluid/machine_reading_comprehesion/utils/marcov1_to_dureader.py
...machine_reading_comprehesion/utils/marcov1_to_dureader.py
+0
-0
fluid/machine_reading_comprehesion/utils/marcov2_to_v1_tojsonl.py
...chine_reading_comprehesion/utils/marcov2_to_v1_tojsonl.py
+0
-0
fluid/machine_reading_comprehesion/utils/preprocess.py
fluid/machine_reading_comprehesion/utils/preprocess.py
+0
-0
fluid/machine_reading_comprehesion/utils/run_marco2dureader_preprocess.sh
...ading_comprehesion/utils/run_marco2dureader_preprocess.sh
+0
-0
fluid/machine_reading_comprehesion/vocab.py
fluid/machine_reading_comprehesion/vocab.py
+4
-1
未找到文件。
fluid/machine_reading_comprehesion/
DuReader/
README.md
→
fluid/machine_reading_comprehesion/README.md
浏览文件 @
a2668240
文件已移动
fluid/machine_reading_comprehesion/
DuReader/
args.py
→
fluid/machine_reading_comprehesion/args.py
浏览文件 @
a2668240
...
...
@@ -26,16 +26,11 @@ def parse_args():
'--prepare'
,
action
=
'store_true'
,
help
=
'create the directories, prepare the vocabulary and embeddings'
)
parser
.
add_argument
(
'--train'
,
action
=
'store_true'
,
help
=
'train the model'
)
parser
.
add_argument
(
'--train'
,
action
=
'store_true'
,
help
=
'train the model'
)
parser
.
add_argument
(
'--evaluate'
,
action
=
'store_true'
,
help
=
'evaluate the model on dev set'
)
'--evaluate'
,
action
=
'store_true'
,
help
=
'evaluate the model on dev set'
)
parser
.
add_argument
(
'--predict'
,
'--predict'
,
action
=
'store_true'
,
help
=
'predict the answers for test set with trained model'
)
parser
.
add_argument
(
...
...
@@ -96,55 +91,19 @@ def parse_args():
default
=
1000
,
help
=
"cal dev loss every n batches."
"(default: %(default)d)"
)
parser
.
add_argument
(
'--optim'
,
default
=
'adam'
,
help
=
'optimizer type'
)
parser
.
add_argument
(
'--trainset'
,
nargs
=
'+'
,
help
=
'train dataset'
)
parser
.
add_argument
(
'--devset'
,
nargs
=
'+'
,
help
=
'dev dataset'
)
parser
.
add_argument
(
'--testset'
,
nargs
=
'+'
,
help
=
'test dataset'
)
parser
.
add_argument
(
'--vocab_dir'
,
help
=
'dict'
)
parser
.
add_argument
(
'--max_p_num'
,
type
=
int
,
default
=
5
)
parser
.
add_argument
(
'--max_a_len'
,
type
=
int
,
default
=
200
)
parser
.
add_argument
(
'--max_p_len'
,
type
=
int
,
default
=
500
)
parser
.
add_argument
(
'--max_q_len'
,
type
=
int
,
default
=
9
)
parser
.
add_argument
(
'--doc_num'
,
type
=
int
,
default
=
5
)
parser
.
add_argument
(
'--para_print'
,
action
=
'store_true'
)
parser
.
add_argument
(
'--drop_rate'
,
type
=
float
,
default
=
0.0
)
parser
.
add_argument
(
'--random_seed'
,
type
=
int
,
default
=
123
)
parser
.
add_argument
(
'--optim'
,
default
=
'adam'
,
help
=
'optimizer type'
)
parser
.
add_argument
(
'--trainset'
,
nargs
=
'+'
,
help
=
'train dataset'
)
parser
.
add_argument
(
'--devset'
,
nargs
=
'+'
,
help
=
'dev dataset'
)
parser
.
add_argument
(
'--testset'
,
nargs
=
'+'
,
help
=
'test dataset'
)
parser
.
add_argument
(
'--vocab_dir'
,
help
=
'dict'
)
parser
.
add_argument
(
'--max_p_num'
,
type
=
int
,
default
=
5
)
parser
.
add_argument
(
'--max_a_len'
,
type
=
int
,
default
=
200
)
parser
.
add_argument
(
'--max_p_len'
,
type
=
int
,
default
=
500
)
parser
.
add_argument
(
'--max_q_len'
,
type
=
int
,
default
=
9
)
parser
.
add_argument
(
'--doc_num'
,
type
=
int
,
default
=
5
)
parser
.
add_argument
(
'--para_print'
,
action
=
'store_true'
)
parser
.
add_argument
(
'--drop_rate'
,
type
=
float
,
default
=
0.0
)
parser
.
add_argument
(
'--random_seed'
,
type
=
int
,
default
=
123
)
parser
.
add_argument
(
'--log_path'
,
help
=
'path of the log file. If not set, logs are printed to console'
)
...
...
fluid/machine_reading_comprehesion/
DuReader/
data/download.sh
→
fluid/machine_reading_comprehesion/data/download.sh
浏览文件 @
a2668240
文件已移动
fluid/machine_reading_comprehesion/
DuReader/
data/md5sum.txt
→
fluid/machine_reading_comprehesion/data/md5sum.txt
浏览文件 @
a2668240
文件已移动
fluid/machine_reading_comprehesion/
DuReader/
dataset.py
→
fluid/machine_reading_comprehesion/dataset.py
浏览文件 @
a2668240
文件已移动
fluid/machine_reading_comprehesion/
DuReader/
rc_model.py
→
fluid/machine_reading_comprehesion/rc_model.py
浏览文件 @
a2668240
文件已移动
fluid/machine_reading_comprehesion/
DuReader/
run.py
→
fluid/machine_reading_comprehesion/run.py
浏览文件 @
a2668240
文件已移动
fluid/machine_reading_comprehesion/
DuReader/
run.sh
→
fluid/machine_reading_comprehesion/run.sh
浏览文件 @
a2668240
文件已移动
fluid/machine_reading_comprehesion/
DuReader/
utils/__init__.py
→
fluid/machine_reading_comprehesion/utils/__init__.py
浏览文件 @
a2668240
文件已移动
fluid/machine_reading_comprehesion/
DuReader/
utils/download_thirdparty.sh
→
fluid/machine_reading_comprehesion/utils/download_thirdparty.sh
浏览文件 @
a2668240
文件已移动
fluid/machine_reading_comprehesion/
DuReader/
utils/dureader_eval.py
→
fluid/machine_reading_comprehesion/utils/dureader_eval.py
浏览文件 @
a2668240
文件已移动
fluid/machine_reading_comprehesion/
DuReader/
utils/get_vocab.py
→
fluid/machine_reading_comprehesion/utils/get_vocab.py
浏览文件 @
a2668240
文件已移动
fluid/machine_reading_comprehesion/
DuReader/
utils/marco_tokenize_data.py
→
fluid/machine_reading_comprehesion/utils/marco_tokenize_data.py
浏览文件 @
a2668240
文件已移动
fluid/machine_reading_comprehesion/
DuReader/
utils/marcov1_to_dureader.py
→
fluid/machine_reading_comprehesion/utils/marcov1_to_dureader.py
浏览文件 @
a2668240
文件已移动
fluid/machine_reading_comprehesion/
DuReader/
utils/marcov2_to_v1_tojsonl.py
→
fluid/machine_reading_comprehesion/utils/marcov2_to_v1_tojsonl.py
浏览文件 @
a2668240
文件已移动
fluid/machine_reading_comprehesion/
DuReader/
utils/preprocess.py
→
fluid/machine_reading_comprehesion/utils/preprocess.py
浏览文件 @
a2668240
文件已移动
fluid/machine_reading_comprehesion/
DuReader/
utils/run_marco2dureader_preprocess.sh
→
fluid/machine_reading_comprehesion/utils/run_marco2dureader_preprocess.sh
浏览文件 @
a2668240
文件已移动
fluid/machine_reading_comprehesion/
DuReader/
vocab.py
→
fluid/machine_reading_comprehesion/vocab.py
浏览文件 @
a2668240
...
...
@@ -25,6 +25,7 @@ class Vocab(object):
"""
Implements a vocabulary to store the tokens in the data, with their corresponding embeddings.
"""
def
__init__
(
self
,
filename
=
None
,
initial_tokens
=
None
,
lower
=
False
):
self
.
id2token
=
{}
self
.
token2id
=
{}
...
...
@@ -117,7 +118,9 @@ class Vocab(object):
Args:
min_cnt: tokens with frequency less than min_cnt is filtered
"""
filtered_tokens
=
[
token
for
token
in
self
.
token2id
if
self
.
token_cnt
[
token
]
>=
min_cnt
]
filtered_tokens
=
[
token
for
token
in
self
.
token2id
if
self
.
token_cnt
[
token
]
>=
min_cnt
]
# rebuild the token x id map
self
.
token2id
=
{}
self
.
id2token
=
{}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录