kz209 commited on
Commit
4fb58cc
1 Parent(s): e302f12

add overall score

Browse files
Files changed (1) hide show
  1. pages/batch_evaluation.py +4 -2
pages/batch_evaluation.py CHANGED
@@ -2,7 +2,7 @@ from dotenv import load_dotenv
2
  import gradio as gr
3
  import random
4
 
5
- import markdown
6
 
7
  from utils.model import Model
8
  from utils.data import dataset
@@ -13,7 +13,9 @@ from pages.summarization_playground import model, generate_answer
13
  load_dotenv()
14
 
15
  def display_results(response_list):
16
- html_output = ""
 
 
17
 
18
  for i, item in enumerate(response_list, 1):
19
  dialogue = item['dialogue']
 
2
  import gradio as gr
3
  import random
4
 
5
+ import numpy as np
6
 
7
  from utils.model import Model
8
  from utils.data import dataset
 
13
  load_dotenv()
14
 
15
  def display_results(response_list):
16
+ overall_score = np.mean([r['metric_score']['rouge_score'] for r in response_list])
17
+
18
+ html_output = f"<h2>Overall Score: {overall_score:.2f}</h2>"
19
 
20
  for i, item in enumerate(response_list, 1):
21
  dialogue = item['dialogue']