File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
paddle/gserver/evaluators
python/paddle/trainer_config_helpers Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -162,9 +162,9 @@ class ChunkEvaluator : public Evaluator {
162162 getSegments (label, length, labelSegments_);
163163 size_t i = 0 , j = 0 ;
164164 while (i < outputSegments_.size () && j < labelSegments_.size ()) {
165- if (outputSegments_[i] == labelSegments_[j]) {
166- if ( excludedChunkTypes_.count (outputSegments_[i].type ) != 1 )
167- ++numCorrect_;
165+ if (outputSegments_[i] == labelSegments_[j] &&
166+ excludedChunkTypes_.count (outputSegments_[i].type ) != 1 ) {
167+ ++numCorrect_;
168168 }
169169 if (outputSegments_[i].end < labelSegments_[j].end ) {
170170 ++i;
Original file line number Diff line number Diff line change @@ -437,8 +437,6 @@ message EvaluatorConfig {
437437 optional string chunk_scheme = 4 ;
438438 // number of chunk types other than "other"
439439 optional int32 num_chunk_types = 5 ;
440- // chunk of these types are not counted
441- repeated int32 excluded_chunk_types = 12 ;
442440
443441 // Used by PrecisionRecallEvaluator and ClassificationErrorEvaluator
444442 // For multi binary labels: true if output > classification_threshold
@@ -458,7 +456,9 @@ message EvaluatorConfig {
458456 // whether to delimit the sequence in the seq_text_printer
459457 optional bool delimited = 11 [default = true ];
460458
461- // NOTE: 12 has been occupied by excluded_chunk_types
459+ // Used by ChunkEvaluator
460+ // chunk of these types are not counted
461+ repeated int32 excluded_chunk_types = 12 ;
462462}
463463
464464message LinkConfig {
Original file line number Diff line number Diff line change @@ -381,7 +381,7 @@ def chunk_evaluator(
381381 :param name: The Evaluator name, it is optional.
382382 :type name: basename|None
383383 :param excluded_chunk_types: chunks of these types are not considered
384- :type excluded_chunk_types: list of integer|[]
384+ :type excluded_chunk_types: list of integer|None
385385 """
386386 evaluator_base (
387387 name = name ,
You can’t perform that action at this time.
0 commit comments