Skip to content

Commit

Permalink
fix style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Peng Li committed Dec 20, 2016
1 parent 8fe3a3a commit 6e405a1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions paddle/gserver/evaluators/ChunkEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ class ChunkEvaluator : public Evaluator {
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;
Expand Down
6 changes: 3 additions & 3 deletions proto/ModelConfig.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/trainer_config_helpers/evaluators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6e405a1

Please sign in to comment.