Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
PaddleRec
提交
ec2792b5
P
PaddleRec
项目概览
BaiXuePrincess
/
PaddleRec
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleRec
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleRec
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
ec2792b5
编写于
6月 08, 2020
作者:
T
tangwei12
提交者:
GitHub
6月 08, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into add_fgcnn
上级
d74043eb
c9d9a276
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
13 deletion
+13
-13
README.md
README.md
+3
-2
core/utils/validation.py
core/utils/validation.py
+10
-11
未找到文件。
README.md
浏览文件 @
ec2792b5
...
@@ -35,9 +35,10 @@
...
@@ -35,9 +35,10 @@
| :------: | :-----------------------------------------------------------------------: | :---------: | :---------: | :-----------: |
| :------: | :-----------------------------------------------------------------------: | :---------: | :---------: | :-----------: |
| 内容理解 | [Text-Classifcation](models/contentunderstanding/classification/model.py) | ✓ | x | ✓ |
| 内容理解 | [Text-Classifcation](models/contentunderstanding/classification/model.py) | ✓ | x | ✓ |
| 内容理解 | [TagSpace](models/contentunderstanding/tagspace/model.py) | ✓ | x | ✓ |
| 内容理解 | [TagSpace](models/contentunderstanding/tagspace/model.py) | ✓ | x | ✓ |
|
召回
| [DSSM](models/match/dssm/model.py) | ✓ | x | ✓ |
|
匹配
| [DSSM](models/match/dssm/model.py) | ✓ | x | ✓ |
|
召回
| [MultiView-Simnet](models/match/multiview-simnet/model.py) | ✓ | x | ✓ |
|
匹配
| [MultiView-Simnet](models/match/multiview-simnet/model.py) | ✓ | x | ✓ |
| 召回 | [TDM](models/treebased/tdm/model.py) | ✓ | x | ✓ |
| 召回 | [TDM](models/treebased/tdm/model.py) | ✓ | x | ✓ |
| 召回 | [fasttext](models/recall/fasttext/model.py) | ✓ | x | x |
| 召回 | [Word2Vec](models/recall/word2vec/model.py) | ✓ | x | ✓ |
| 召回 | [Word2Vec](models/recall/word2vec/model.py) | ✓ | x | ✓ |
| 召回 | [SSR](models/recall/ssr/model.py) | ✓ | ✓ | ✓ |
| 召回 | [SSR](models/recall/ssr/model.py) | ✓ | ✓ | ✓ |
| 召回 | [Gru4Rec](models/recall/gru4rec/model.py) | ✓ | ✓ | ✓ |
| 召回 | [Gru4Rec](models/recall/gru4rec/model.py) | ✓ | ✓ | ✓ |
...
...
core/utils/validation.py
浏览文件 @
ec2792b5
...
@@ -16,11 +16,10 @@ from paddlerec.core.utils import envs
...
@@ -16,11 +16,10 @@ from paddlerec.core.utils import envs
class
ValueFormat
:
class
ValueFormat
:
def
__init__
(
self
,
type
,
value
,
value_handler
):
def
__init__
(
self
,
value_
type
,
value
,
value_handler
):
self
.
type
=
type
self
.
value_type
=
value_
type
self
.
value
=
value
self
.
value
=
value
self
.
value_handler
=
value_handler
self
.
value_handler
=
value_handler
self
.
help
=
help
def
is_valid
(
self
,
name
,
value
):
def
is_valid
(
self
,
name
,
value
):
ret
=
self
.
is_type_valid
(
name
,
value
)
ret
=
self
.
is_type_valid
(
name
,
value
)
...
@@ -31,24 +30,24 @@ class ValueFormat:
...
@@ -31,24 +30,24 @@ class ValueFormat:
return
ret
return
ret
def
is_type_valid
(
self
,
name
,
value
):
def
is_type_valid
(
self
,
name
,
value
):
if
self
.
type
==
"int"
:
if
self
.
value_
type
==
"int"
:
if
not
isinstance
(
value
,
int
):
if
not
isinstance
(
value
,
int
):
print
(
"
\n
attr {} should be int, but {} now
\n
"
.
format
(
print
(
"
\n
attr {} should be int, but {} now
\n
"
.
format
(
name
,
self
.
type
))
name
,
self
.
value_
type
))
return
False
return
False
return
True
return
True
elif
self
.
type
==
"str"
:
elif
self
.
value_
type
==
"str"
:
if
not
isinstance
(
value
,
str
):
if
not
isinstance
(
value
,
str
):
print
(
"
\n
attr {} should be str, but {} now
\n
"
.
format
(
print
(
"
\n
attr {} should be str, but {} now
\n
"
.
format
(
name
,
self
.
type
))
name
,
self
.
value_
type
))
return
False
return
False
return
True
return
True
elif
self
.
type
==
"strs"
:
elif
self
.
value_
type
==
"strs"
:
if
not
isinstance
(
value
,
list
):
if
not
isinstance
(
value
,
list
):
print
(
"
\n
attr {} should be list(str), but {} now
\n
"
.
format
(
print
(
"
\n
attr {} should be list(str), but {} now
\n
"
.
format
(
name
,
self
.
type
))
name
,
self
.
value_
type
))
return
False
return
False
for
v
in
value
:
for
v
in
value
:
if
not
isinstance
(
v
,
str
):
if
not
isinstance
(
v
,
str
):
...
@@ -57,10 +56,10 @@ class ValueFormat:
...
@@ -57,10 +56,10 @@ class ValueFormat:
return
False
return
False
return
True
return
True
elif
self
.
type
==
"ints"
:
elif
self
.
value_
type
==
"ints"
:
if
not
isinstance
(
value
,
list
):
if
not
isinstance
(
value
,
list
):
print
(
"
\n
attr {} should be list(int), but {} now
\n
"
.
format
(
print
(
"
\n
attr {} should be list(int), but {} now
\n
"
.
format
(
name
,
self
.
type
))
name
,
self
.
value_
type
))
return
False
return
False
for
v
in
value
:
for
v
in
value
:
if
not
isinstance
(
v
,
int
):
if
not
isinstance
(
v
,
int
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录