Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
63fc48b0
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看板
提交
63fc48b0
编写于
7月 19, 2017
作者:
C
Cao Ying
提交者:
GitHub
7月 19, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #170 from livc/fix
fix bug in sequence_tagging_for_ner.
上级
63a80a32
fb240d2f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
4 deletion
+9
-4
sequence_tagging_for_ner/data/download.sh
sequence_tagging_for_ner/data/download.sh
+5
-1
sequence_tagging_for_ner/reader.py
sequence_tagging_for_ner/reader.py
+2
-2
sequence_tagging_for_ner/train.py
sequence_tagging_for_ner/train.py
+2
-1
未找到文件。
sequence_tagging_for_ner/data/download.sh
浏览文件 @
63fc48b0
wget http://cs224d.stanford.edu/assignment2/assignment2.zip
if
[
-f
assignment2.zip
]
;
then
echo
"data exist"
else
wget http://cs224d.stanford.edu/assignment2/assignment2.zip
fi
if
[
$?
-eq
0
]
;
then
unzip assignment2.zip
...
...
sequence_tagging_for_ner/reader.py
浏览文件 @
63fc48b0
...
...
@@ -21,7 +21,7 @@ def canonicalize_word(word, wordset=None, digits=True):
if
(
wordset
!=
None
)
and
(
word
in
wordset
):
return
word
word
=
canonicalize_digits
(
word
)
# try to canonicalize numbers
if
(
wordset
==
None
)
or
(
word
in
wordset
):
return
word
else
:
return
"
<UNK>
"
# unknown token
else
:
return
"
UUUNKKK
"
# unknown token
def
data_reader
(
data_file
,
word_dict
,
label_dict
):
...
...
@@ -35,7 +35,7 @@ def data_reader(data_file, word_dict, label_dict):
"""
def
reader
():
UNK_IDX
=
word_dict
[
"
<UNK>
"
]
UNK_IDX
=
word_dict
[
"
UUUNKKK
"
]
sentence
=
[]
labels
=
[]
...
...
sequence_tagging_for_ner/train.py
浏览文件 @
63fc48b0
...
...
@@ -106,4 +106,5 @@ if __name__ == "__main__":
test_data_file
=
"data/test"
,
vocab_file
=
"data/vocab.txt"
,
target_file
=
"data/target.txt"
,
emb_file
=
"data/wordVectors.txt"
)
emb_file
=
"data/wordVectors.txt"
,
model_save_dir
=
"model/"
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录