yixuantt commited on
Commit
1350777
·
1 Parent(s): b2b7a66
Files changed (1) hide show
  1. app.py +15 -10
app.py CHANGED
@@ -1,7 +1,6 @@
1
  import streamlit as st
2
  import pandas as pd
3
 
4
-
5
  def load_data():
6
  return pd.read_csv("benchmark_data.csv")
7
 
@@ -10,10 +9,11 @@ def case_insensitive_search(data, query, column):
10
  return data[data[column].str.lower().str.contains(query.lower())]
11
  return data
12
 
13
- def display_table(data, rows_per_page=10):
14
  container = st.container()
15
  with container:
16
- height = min(40 + rows_per_page * 38, 800)
 
17
  st.dataframe(data, height=height)
18
 
19
  def main():
@@ -36,22 +36,27 @@ def main():
36
  if frame_query:
37
  data = case_insensitive_search(data, frame_query, 'framework')
38
 
39
- st.write("Displaying results for MRR@10, Hit@10, and Accuracy across different frameworks, embedding models, chat models, and chunks.")
40
- display_table(data)
41
-
42
 
43
- if st.sidebar.checkbox("Show Metrics Distribution"):
44
- st.subheader("Metrics Distribution")
45
- st.bar_chart(data[['MRR@10', 'Hit@10', 'Accuracy']])
46
 
 
 
 
47
 
48
  st.sidebar.header("Citation")
49
  st.sidebar.info(
50
  "Please cite this dataset as:\n"
51
- "Tang, Yixuan, and Yi Yang. MultiHop-RAG: Benchmarking Retrieval-Augmented Generation for Multi-Hop Queries. ArXiv, 2024, /abs/2401.15391."
52
  )
53
  st.markdown("---")
54
  st.caption("For citation, please use: 'Tang, Yixuan, and Yi Yang. MultiHop-RAG: Benchmarking Retrieval-Augmented Generation for Multi-Hop Queries. ArXiv, 2024, /abs/2401.15391. '")
 
 
55
 
56
  if __name__ == "__main__":
57
  main()
 
1
  import streamlit as st
2
  import pandas as pd
3
 
 
4
  def load_data():
5
  return pd.read_csv("benchmark_data.csv")
6
 
 
9
  return data[data[column].str.lower().str.contains(query.lower())]
10
  return data
11
 
12
+ def display_table(data, rows_per_page=10, height=None):
13
  container = st.container()
14
  with container:
15
+ if height is None:
16
+ height = min(40 + rows_per_page * 38, 800)
17
  st.dataframe(data, height=height)
18
 
19
  def main():
 
36
  if frame_query:
37
  data = case_insensitive_search(data, frame_query, 'framework')
38
 
39
+ # Display settings
40
+ st.header("Settings")
41
+ display_table(data[['framework', 'chat_model', 'embedding_model', 'chunk']])
42
 
43
+ # Display retrieval metrics
44
+ st.header("Retrieval Metrics")
45
+ display_table(data[['MRR@10', 'Hit@10']])
46
 
47
+ # Display response metrics
48
+ st.header("Response Metrics")
49
+ display_table(data[['Accuracy']])
50
 
51
  st.sidebar.header("Citation")
52
  st.sidebar.info(
53
  "Please cite this dataset as:\n"
54
+ "Tang, Yixuan, and Yi Yang. MultiHop-RAG: Benchmarking Retrieval-Augmented Generation for Multi-Hop Queries. ArXiv, 2024, /abs/2401.15391."
55
  )
56
  st.markdown("---")
57
  st.caption("For citation, please use: 'Tang, Yixuan, and Yi Yang. MultiHop-RAG: Benchmarking Retrieval-Augmented Generation for Multi-Hop Queries. ArXiv, 2024, /abs/2401.15391. '")
58
+ st.markdown("---")
59
+ st.caption("For results self-reporting, please send an email to [email protected]")
60
 
61
  if __name__ == "__main__":
62
  main()