Skip to content

Commit

Permalink
add api doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Harold-lkk committed Feb 17, 2023
1 parent be6c17e commit dda766e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/en/api/metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ Metrics
ConnectivityError
DOTAMeanAP
ROUGE
OneMinusNormEditDistance
1 change: 1 addition & 0 deletions docs/zh_cn/api/metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ Metrics
ConnectivityError
DOTAMeanAP
ROUGE
OneMinusNormEditDistance
5 changes: 5 additions & 0 deletions tests/test_metrics/test_one_minus_norm_edit_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ def test_one_minus_norm_edit_distance_metric(letter_case, expected):
metric = OneMinusNormEditDistance(letter_case=letter_case)
res = metric(['helL', 'HEL'], ['hello', 'HELLO'])
assert abs(res['1-N.E.D'] - expected) < 1e-7
metric.reset()
for pred, label in zip(['helL', 'HEL'], ['hello', 'HELLO']):
metric.add([pred], [label])
res = metric.compute()
assert abs(res['1-N.E.D'] - expected) < 1e-7

0 comments on commit dda766e

Please sign in to comment.