Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
a74060d4
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a74060d4
编写于
5月 16, 2017
作者:
Y
yangyaming
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify usage document of chunk evaluator
上级
8411a73e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
17 deletion
+30
-17
python/paddle/trainer_config_helpers/evaluators.py
python/paddle/trainer_config_helpers/evaluators.py
+30
-17
未找到文件。
python/paddle/trainer_config_helpers/evaluators.py
浏览文件 @
a74060d4
...
...
@@ -347,32 +347,45 @@ def chunk_evaluator(
excluded_chunk_types
=
None
,
):
"""
Chunk evaluator is used to evaluate segment labelling accuracy for a
sequence. It calculates
the chunk detection F1 score
.
sequence. It calculates
precision, recall and F1 score of the chunk detection
.
A chunk is correctly detected if its beginning, end and type are correct.
Other chunk type is ignored.
For each label in the label sequence, we have:
To use chunk evaluator, the construction of label dict should obey the following rules:
(1) Use one of the listed labelling schemes. These schemes differ in ways indicating chunk boundry.
.. code-block:: python
Scheme Begin Inside End Single
plain 0 - - -
IOB 0 1 - -
IOE - 0 1 -
IOBES 0 1 2 3
.. code-block:: python
tagType = label % numTagType
chunkType = label / numTagType
otherChunkType = numChunkTypes
To make it clear, let's illustrate by a NER example.
Assuming that there are two named entity types including ORG and PER which are called 'chunk type' here,
if 'IOB' scheme were used, the label set will be extended to a set including B-ORG, I-ORG, B-PER, I-PER and O,
in which B-ORG for begining of ORG and I-ORG for end of ORG.
Prefixes which are called 'tag type' here are added to chunk types and there are two tag types including B and I.
Of course, the training data should be labeled accordingly.
The total number of different labels is numTagType*numChunkTypes+1.
We support 4 labelling scheme.
The tag type for each of the scheme is shown as follows:
(2) Map can be done correctly by the listed equations.
.. code-block:: python
tagType = label % numTagType
chunkType = label / numTagType
otherChunkType = numChunkTypes
.. code-block:: python
Scheme Begin Inside End Single
plain 0 - - -
IOB 0 1 - -
IOE - 0 1 -
IOBES 0 1 2 3
Continue the NER example, and the label dict should like this to satify above equations:
.. code-block:: python
B-ORG 0
I-ORG 1
B-PER 2
I-PER 3
O 4
.. code-block:: python
'plain' means the whole chunk must contain exactly the same chunk label
.
Realizing that the number of is chunk type is 2 and number of tag type is 2, it is easy to validate this
.
The simple usage is:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录