提交 52358613 编写于 作者: Y Yu Yang 提交者: GitHub

Merge pull request #909 from pengli09/add-label-to-chunk_evaluator

Add an extra parameter label to chunk_evaluator.
...@@ -74,7 +74,8 @@ sum_evaluator( ...@@ -74,7 +74,8 @@ sum_evaluator(
chunk_evaluator( chunk_evaluator(
name="chunk_f1", name="chunk_f1",
input=[crf_decoding, chunk], input=crf_decoding,
label=chunk,
chunk_scheme="IOB", chunk_scheme="IOB",
num_chunk_types=11, ) num_chunk_types=11, )
......
...@@ -112,7 +112,8 @@ sum_evaluator( ...@@ -112,7 +112,8 @@ sum_evaluator(
chunk_evaluator( chunk_evaluator(
name="chunk_f1", name="chunk_f1",
input=[crf_decoding, chunk], input=crf_decoding,
label=chunk,
chunk_scheme="IOB", chunk_scheme="IOB",
num_chunk_types=11, ) num_chunk_types=11, )
......
...@@ -327,9 +327,10 @@ def ctc_error_evaluator( ...@@ -327,9 +327,10 @@ def ctc_error_evaluator(
@wrap_name_default() @wrap_name_default()
def chunk_evaluator( def chunk_evaluator(
input, input,
name=None, label,
chunk_scheme=None, chunk_scheme,
num_chunk_types=None, ): num_chunk_types,
name=None, ):
""" """
Chunk evaluator is used to evaluate segment labelling accuracy for a Chunk evaluator is used to evaluate segment labelling accuracy for a
sequence. It calculates the chunk detection F1 score. sequence. It calculates the chunk detection F1 score.
...@@ -363,22 +364,24 @@ def chunk_evaluator( ...@@ -363,22 +364,24 @@ def chunk_evaluator(
.. code-block:: python .. code-block:: python
eval = chunk_evaluator(input) eval = chunk_evaluator(input, label, chunk_scheme, num_chunk_types)
:param input: The input layers. :param input: The input layers.
:type input: LayerOutput :type input: LayerOutput
:param name: The Evaluator name, it is not necessary. :param label: An input layer containing the ground truth label.
:type name: basename|None :type label: LayerOutput
:param chunk_scheme: The labelling schemes support 4 types. It is one of :param chunk_scheme: The labelling schemes support 4 types. It is one of
"IOB", "IOE", "IOBES", "plain".This Evaluator must "IOB", "IOE", "IOBES", "plain". It is required.
contain this chunk_scheme.
:type chunk_scheme: basestring :type chunk_scheme: basestring
:param num_chunk_types: number of chunk types other than "other" :param num_chunk_types: number of chunk types other than "other"
:param name: The Evaluator name, it is optional.
:type name: basename|None
""" """
evaluator_base( evaluator_base(
name=name, name=name,
type="chunk", type="chunk",
input=input, input=input,
label=label,
chunk_scheme=chunk_scheme, chunk_scheme=chunk_scheme,
num_chunk_types=num_chunk_types) num_chunk_types=num_chunk_types)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册