@@ -49,10 +49,10 @@ class EditDistanceOpMaker : public framework::OpProtoAndCheckerMaker {
49
49
EditDistanceOpMaker (OpProto *proto, OpAttrChecker *op_checker)
50
50
: OpProtoAndCheckerMaker(proto, op_checker) {
51
51
AddInput (" Hyps" ,
52
- " (2-D LoDTensor<int >, 2nd dim. equal to 1) "
52
+ " (2-D LoDTensor<int64_t >, 2nd dim. equal to 1) "
53
53
" The indices for hypothesis strings." );
54
54
AddInput (" Refs" ,
55
- " (2-D LoDTensor<int >, 2nd dim. equal to 1) "
55
+ " (2-D LoDTensor<int64_t >, 2nd dim. equal to 1) "
56
56
" The indices for reference strings." );
57
57
AddAttr<bool >(" normalized" ,
58
58
" (bool, default false) Indicated whether to normalize "
@@ -66,22 +66,22 @@ class EditDistanceOpMaker : public framework::OpProtoAndCheckerMaker {
66
66
EditDistance operator computes the edit distances between a batch of hypothesis
67
67
strings and their references.
68
68
69
- Edit distance, also called Levenshtein distance, measures how dissimilar two strings
70
- are by counting the minimum number of operations to transform one string into anthor.
71
- Here the operations include insertion, deletion, and substitution. For example,
72
- given hypothesis string A = "kitten" and reference B = "sitting", the edit distance
73
- is 3 for A will be transformed into B at least after two substitutions and one
69
+ Edit distance, also called Levenshtein distance, measures how dissimilar two strings
70
+ are by counting the minimum number of operations to transform one string into anthor.
71
+ Here the operations include insertion, deletion, and substitution. For example,
72
+ given hypothesis string A = "kitten" and reference B = "sitting", the edit distance
73
+ is 3 for A will be transformed into B at least after two substitutions and one
74
74
insertion:
75
-
75
+
76
76
"kitten" -> "sitten" -> "sittin" -> "sitting"
77
77
78
- Input(Hyps) is a LoDTensor consisting of all the hypothesis strings with the total
79
- number denoted by `batch_size`, and the separation is specified by the LoD information.
80
- And the `batch_size` reference strings are arranged in order in the same way in the
78
+ Input(Hyps) is a LoDTensor consisting of all the hypothesis strings with the total
79
+ number denoted by `batch_size`, and the separation is specified by the LoD information.
80
+ And the `batch_size` reference strings are arranged in order in the same way in the
81
81
LoDTensor Input(Refs).
82
82
83
- Output(Out) contains the `batch_size` results and each stands for the edit stance
84
- for a pair of strings respectively. If Attr(normalized) is true, the edit distance
83
+ Output(Out) contains the `batch_size` results and each stands for the edit stance
84
+ for a pair of strings respectively. If Attr(normalized) is true, the edit distance
85
85
will be divided by the length of reference string.
86
86
)DOC" );
87
87
}
0 commit comments