diff --git a/paddle/gserver/evaluators/ChunkEvaluator.cpp b/paddle/gserver/evaluators/ChunkEvaluator.cpp index 15e0e9520654bebee27ca56068c36594a7f4af2f..13f02e51fe9e3831103982130bfdaa3255e1d174 100644 --- a/paddle/gserver/evaluators/ChunkEvaluator.cpp +++ b/paddle/gserver/evaluators/ChunkEvaluator.cpp @@ -162,9 +162,9 @@ public: getSegments(label, length, labelSegments_); size_t i = 0, j = 0; while (i < outputSegments_.size() && j < labelSegments_.size()) { - if (outputSegments_[i] == labelSegments_[j]) { - if (excludedChunkTypes_.count(outputSegments_[i].type) != 1) - ++numCorrect_; + if (outputSegments_[i] == labelSegments_[j] && + excludedChunkTypes_.count(outputSegments_[i].type) != 1) { + ++numCorrect_; } if (outputSegments_[i].end < labelSegments_[j].end) { ++i; diff --git a/proto/ModelConfig.proto b/proto/ModelConfig.proto index e24ed21fbbcf6e6d4d30570c9c0d3fe171506d03..be4d0041f91cf7d0306d14338b43bb25e052fd58 100644 --- a/proto/ModelConfig.proto +++ b/proto/ModelConfig.proto @@ -437,8 +437,6 @@ message EvaluatorConfig { optional string chunk_scheme = 4; // number of chunk types other than "other" optional int32 num_chunk_types = 5; - // chunk of these types are not counted - repeated int32 excluded_chunk_types = 12; // Used by PrecisionRecallEvaluator and ClassificationErrorEvaluator // For multi binary labels: true if output > classification_threshold @@ -458,7 +456,9 @@ message EvaluatorConfig { // whether to delimit the sequence in the seq_text_printer optional bool delimited = 11 [default = true]; - // NOTE: 12 has been occupied by excluded_chunk_types + // Used by ChunkEvaluator + // chunk of these types are not counted + repeated int32 excluded_chunk_types = 12; } message LinkConfig { diff --git a/python/paddle/trainer_config_helpers/evaluators.py b/python/paddle/trainer_config_helpers/evaluators.py index 731e30d36742737a3d3440ed10ed7c309b53c03d..bd247ea9af9d8dfb2d476cdc62638bd65c11add5 100644 --- a/python/paddle/trainer_config_helpers/evaluators.py +++ b/python/paddle/trainer_config_helpers/evaluators.py @@ -381,7 +381,7 @@ def chunk_evaluator( :param name: The Evaluator name, it is optional. :type name: basename|None :param excluded_chunk_types: chunks of these types are not considered - :type excluded_chunk_types: list of integer|[] + :type excluded_chunk_types: list of integer|None """ evaluator_base( name=name,