Spaces:
Runtime error
Runtime error
Heiko Hotz commited on
Commit ·
291e845
1
Parent(s): 6f26bdf
Add application file
Browse files
app.py
CHANGED
|
@@ -3,11 +3,11 @@ from rouge_score import rouge_scorer
|
|
| 3 |
|
| 4 |
def calc_rouge_score(summary, reference):
|
| 5 |
scorer = rouge_scorer.RougeScorer(['rouge1', 'rouge2', 'rougeL', 'rougeLsum'], use_stemmer=True)
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
return text
|
| 12 |
|
| 13 |
iface = gr.Interface(
|
|
|
|
| 3 |
|
| 4 |
def calc_rouge_score(summary, reference):
|
| 5 |
scorer = rouge_scorer.RougeScorer(['rouge1', 'rouge2', 'rougeL', 'rougeLsum'], use_stemmer=True)
|
| 6 |
+
scores = scorer.score(summary, reference)
|
| 7 |
+
|
| 8 |
+
text = f""
|
| 9 |
+
for s in scores:
|
| 10 |
+
text += f"The {s}-score is {scores[s].fmeasure}\n"
|
| 11 |
return text
|
| 12 |
|
| 13 |
iface = gr.Interface(
|