Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
opencompass
Commits
362c33df
Unverified
Commit
362c33df
authored
Oct 11, 2023
by
Leymore
Committed by
GitHub
Oct 12, 2023
Browse files
fix jieba rouge (#467)
parent
d7ff933a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
opencompass/openicl/icl_evaluator/icl_jieba_rouge_evaluator.py
...ompass/openicl/icl_evaluator/icl_jieba_rouge_evaluator.py
+5
-0
No files found.
opencompass/openicl/icl_evaluator/icl_jieba_rouge_evaluator.py
View file @
362c33df
...
...
@@ -30,6 +30,11 @@ class JiebaRougeEvaluator(BaseEvaluator):
metric
=
Rouge
()
predictions
=
[
' '
.
join
(
jieba
.
cut
(
i
))
for
i
in
predictions
]
references
=
[
' '
.
join
(
jieba
.
cut
(
i
))
for
i
in
references
]
# avoid raising error when empty string encountered
predictions
=
[
i
if
i
else
'__PREDPLACEHOLDER__'
for
i
in
predictions
]
references
=
[
i
if
i
else
'__REFRPLACEHOLDER__'
for
i
in
references
]
score
=
metric
.
get_scores
(
predictions
,
references
,
avg
=
True
)
return
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment