diff --git a/paddle/operators/ctc_edit_distance_op.cc b/paddle/operators/ctc_edit_distance_op.cc index d2f4ce67c204aa73210dd41efcd53f1c738faba6..11e9983e243ec4b4646749a8d7976fd5d7c4a930 100644 --- a/paddle/operators/ctc_edit_distance_op.cc +++ b/paddle/operators/ctc_edit_distance_op.cc @@ -58,12 +58,19 @@ class CTCEditDistanceOpMaker : public framework::OpProtoAndCheckerMaker { AddComment(R"DOC( CTCEditDistance operator computes the edit distance of two sequences, one named -hypothesis and another named reference. +hypothesis with length M and another named reference with length N. -Edit distance measures how dissimilar two strings, one is hypothesis and another -is reference, are by counting the minimum number of operations to transform -one string into anthor. +Edit distance, also called Levenshtein distance, measures how dissimilar two strings +are by counting the minimum number of operations to transform one string into anthor. +Here the operations include insertion, deletion, and substitution. For example, +given hypothesis string A = "kitten" and reference B = "sitting", the edit distance +is 3 for A will be transformed into B at least after two substitutions and one +insertion: + + "kitten" -> "sitten" -> "sittin" -> "sitting" +If Attr(normalized) is true, the edit distance will be divided by the length of +reference string N. )DOC"); } };