Minseok Bae commited on
Commit
dbcffd4
1 Parent(s): f0b90cf

Updated about.py

Browse files
Files changed (1) hide show
  1. src/display/about.py +39 -27
src/display/about.py CHANGED
@@ -30,78 +30,90 @@ This leaderboard evaluates how often an LLM introduces hallucinations when summa
30
 
31
  # Which evaluations are you running? how can people reproduce what you have?
32
  LLM_BENCHMARKS_TEXT = """
33
- ## How it works
 
 
34
 
35
- Using Vectara's H2EM (Hughes Hallucination Evaluation Model), we evaluate how often an LLM introduces hallucinations when summarizing a document.
 
 
36
 
 
 
37
  The model card for H2EM can be found [here](https://huggingface.co/vectara/hallucination_evaluation_model).
38
- Given a document and a summary generated by an LLM, H2EM outputs a hallucination score between 0 and 1, where 0 means hallucination and 1 indicates no hallucination, or perfect factual consistency with the document.
39
 
40
- Our evaluation dataset is composed of 1006 documents from multiple public datasets, primarily [CNN/Daily Mail Corpus](https://huggingface.co/datasets/cnn_dailymail/viewer/1.0.0/test).
 
 
41
  We generate summaries for each of these documents using submitted LLMs and compute hallucination scores for each pair of document and generated summary. (Check the prompt we used [here](https://huggingface.co/spaces/vectara/Hallucination-evaluation-leaderboard))
42
 
43
- ## Understand each metric
44
- - Hallucination Rate: The percentage of summaries that have a hallucination score below 0.5
45
- - Factual Consistency Rate: (1 - Hallucination Rate) * 100 (%)
46
- - Answer Rate: The percentage of summaries that are non-empty. This is either the model refuses to generate a response or throws an error due to various reasons. (e.g. the model believes that the document includes inappropriate content)
47
- - Average Summary Length: The average number of words in the generated summaries
48
 
49
  ## Note on non-Hugging Face models
50
  On H2EM leaderboard, There are currently models such as GPT variants that are not available on the Hugging Face model hub. We ran the evaluations for these models on our own and uploaded the results to the leaderboard.
51
  If you would like to submit your model that is not available on the Hugging Face model hub, please contact us at minseok@vectara.com.
52
 
53
- ## Reproducibility
 
 
54
  ### For models not available on the Hugging Face model hub:
55
- You can access the generated summaries we used to evaluate models [here](https://github.com/vectara/hallucination-leaderboard) under a file named "leaderboard_summaries.csv".
56
- In the same Github repository, you can also find the prompt we used to generate the summaries under "Prompt Used" section in the README file.
57
- For the models that are not available on the Hugging Face model hub, we also provide the information on how we ran the evaluations under "API Integration Details" section.
58
 
59
  ### For models available on the Hugging Face model hub:
60
- To reproduce the result for your model, you can follow the steps below:
61
- - 1) Clone the repository
 
62
  ```python
63
  git lfs install
64
  git clone https://huggingface.co/spaces/vectara/leaderboard
65
  ```
66
- - 2) Install the requirements
67
  ```python
68
  pip install -r requirements.txt
69
  ```
70
- - 3) Set up your Hugging Face token
71
  ```python
72
  export HF_TOKEN=your_token
73
  ```
74
- - 4) Run the evaluation script
75
  ```python
76
  python main_backend.py --model your_model_id --precision float16
77
  ```
78
- - 5) Wait for the evaluation to finish (it may take a while)
 
79
 
80
- Once the evaluation is finished, a file named "results.json" will be generated under the folder "eval-results-bk/your_model_id".
81
- The result has the following JSON format:
82
  ```python
83
  {
84
  "config": {
85
- "model_dtype": precision,
86
- "model_name": your_model_id,
87
  "model_sha": "main"
88
  },
89
  "results": {
90
  "hallucination_rate": {
91
- "hallucination_rate":
92
  },
93
  "factual_consistency_rate": {
94
- "factual_consistency_rate":
95
  },
96
  "answer_rate": {
97
- "answer_rate":
98
  },
99
  "average_summary_length": {
100
- "average_summary_length":
101
  }
102
  }
103
  }
104
  ```
 
105
  """
106
 
107
  EVALUATION_QUEUE_TEXT = """
 
30
 
31
  # Which evaluations are you running? how can people reproduce what you have?
32
  LLM_BENCHMARKS_TEXT = """
33
+ ## Introduction
34
+
35
+ The Hughes Hallucination Evaluation Model (H2EM) Leaderboard is dedicated to assessing the frequency of hallucinations in document summaries generated by Large Language Models (LLMs).
36
 
37
+ Hallucinations refer to instances where a model introduces factually incorrect or unrelated content in its summaries.
38
+
39
+ ## How it works
40
 
41
+ Using Vectara's H2EM, we measure the occurrence of hallucinations in generated summaries.
42
+ Given a source document and a summary generated by an LLM, H2EM outputs a hallucination score between 0 and 1, with 0 indicating complete hallucination and 1 representing perfect factual consistency.
43
  The model card for H2EM can be found [here](https://huggingface.co/vectara/hallucination_evaluation_model).
 
44
 
45
+ ## Evaluation Dataset
46
+
47
+ Our evaluation dataset consists of 1006 documents from multiple public datasets, primarily [CNN/Daily Mail Corpus](https://huggingface.co/datasets/cnn_dailymail/viewer/1.0.0/test).
48
  We generate summaries for each of these documents using submitted LLMs and compute hallucination scores for each pair of document and generated summary. (Check the prompt we used [here](https://huggingface.co/spaces/vectara/Hallucination-evaluation-leaderboard))
49
 
50
+ ## Metrics Explained
51
+ - Hallucination Rate: Percentage of summaries with a hallucination score below 0.5
52
+ - Factual Consistency Rate: The complement of the hallucination rate, expressed as a percentage.
53
+ - Answer Rate: Percentage of summaries that are non-empty. This is either the model refuses to generate a response or throws an error due to various reasons. (e.g. the model believes that the document includes inappropriate content)
54
+ - Average Summary Length: The average word count of generated summaries
55
 
56
  ## Note on non-Hugging Face models
57
  On H2EM leaderboard, There are currently models such as GPT variants that are not available on the Hugging Face model hub. We ran the evaluations for these models on our own and uploaded the results to the leaderboard.
58
  If you would like to submit your model that is not available on the Hugging Face model hub, please contact us at minseok@vectara.com.
59
 
60
+ ## Model Submissions and Reproducibility
61
+ You can submit your model for evaluation, whether it's hosted on the Hugging Face model hub or not. (Though it is recommended to host your model on the Hugging Face)
62
+
63
  ### For models not available on the Hugging Face model hub:
64
+ 1) Access generated summaries used for evaluation [here](https://github.com/vectara/hallucination-leaderboard) in "leaderboard_summaries.csv".
65
+ 2) The text generation prompt is available under "Prompt Used" section in the repository's README.
66
+ 3) Details on API Integration for evaluations are under "API Integration Details".
67
 
68
  ### For models available on the Hugging Face model hub:
69
+ To replicate the evaluation result for a Hugging Face model:
70
+
71
+ 1) Clone the Repository
72
  ```python
73
  git lfs install
74
  git clone https://huggingface.co/spaces/vectara/leaderboard
75
  ```
76
+ 2) Install the Requirements
77
  ```python
78
  pip install -r requirements.txt
79
  ```
80
+ 3) Set Up Your Hugging Face Token
81
  ```python
82
  export HF_TOKEN=your_token
83
  ```
84
+ 4) Run the Evaluation Script
85
  ```python
86
  python main_backend.py --model your_model_id --precision float16
87
  ```
88
+ 5) Check Results
89
+ After the evaluation, results are saved in "eval-results-bk/your_model_id/results.json".
90
 
91
+ ## Results Format
92
+ The results are structured in JSON as follows:
93
  ```python
94
  {
95
  "config": {
96
+ "model_dtype": "float16",
97
+ "model_name": "your_model_id",
98
  "model_sha": "main"
99
  },
100
  "results": {
101
  "hallucination_rate": {
102
+ "hallucination_rate": ...
103
  },
104
  "factual_consistency_rate": {
105
+ "factual_consistency_rate": ...
106
  },
107
  "answer_rate": {
108
+ "answer_rate": ...
109
  },
110
  "average_summary_length": {
111
+ "average_summary_length": ...
112
  }
113
  }
114
  }
115
  ```
116
+ For additional queries or model submissions, please contact minseok@vectara.com.
117
  """
118
 
119
  EVALUATION_QUEUE_TEXT = """