Spaces:
Sleeping
Sleeping
Ashmi Banerjee
commited on
Commit
·
9075b46
1
Parent(s):
88f694a
removed test.py
Browse files- .gitignore +2 -1
- test.py +0 -138
.gitignore
CHANGED
|
@@ -165,4 +165,5 @@ notebooks/.ipynb_checkpoints
|
|
| 165 |
db/empty.json
|
| 166 |
.config/user-evaluations-firebase-creds.json
|
| 167 |
user-evaluations-default-rtdb-export.json
|
| 168 |
-
data/
|
|
|
|
|
|
| 165 |
db/empty.json
|
| 166 |
.config/user-evaluations-firebase-creds.json
|
| 167 |
user-evaluations-default-rtdb-export.json
|
| 168 |
+
data/
|
| 169 |
+
test.py
|
test.py
DELETED
|
@@ -1,138 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
import pandas as pd
|
| 3 |
-
|
| 4 |
-
# Sample Data (Replace with your actual data loading)
|
| 5 |
-
data = {
|
| 6 |
-
'query_v': {
|
| 7 |
-
'gemini': 'Cheap European city break in February.',
|
| 8 |
-
'llama': 'Affordable European trip in February.',
|
| 9 |
-
},
|
| 10 |
-
'query_p0': {
|
| 11 |
-
'gemini': 'European city break in February, less crowded destinations.',
|
| 12 |
-
'llama': 'February European city break, away from the crowds.',
|
| 13 |
-
},
|
| 14 |
-
'query_p1': {
|
| 15 |
-
'gemini': 'Best European cities for intense physical training and recovery with easy access to ice rinks?',
|
| 16 |
-
'llama': 'Top European cities for intense training and recovery with ice rinks?',
|
| 17 |
-
},
|
| 18 |
-
}
|
| 19 |
-
|
| 20 |
-
# Sample rating data (Replace this with your actual data)
|
| 21 |
-
rating_data = {
|
| 22 |
-
'gemini': {
|
| 23 |
-
'query_v': {'relevance': 'Not Relevant', 'clarity': 'Not Clear'},
|
| 24 |
-
'query_p0': {'relevance': 'Not Relevant', 'clarity': 'Not Clear', 'persona_alignment': 'N/A'},
|
| 25 |
-
'query_p1': {'relevance': 'N/A', 'clarity': 'N/A', 'persona_alignment': 'N/A'},
|
| 26 |
-
},
|
| 27 |
-
'llama': {
|
| 28 |
-
'query_v': {'relevance': 'Somewhat Relevant', 'clarity': 'Somewhat Clear'},
|
| 29 |
-
'query_p0': {'relevance': 'Somewhat Relevant', 'clarity': 'Somewhat Clear', 'persona_alignment': 'Partially Aligned'},
|
| 30 |
-
'query_p1': {'relevance': 'Not Relevant', 'clarity': 'Not Clear', 'persona_alignment': 'Not Aligned'},
|
| 31 |
-
}
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
df = pd.DataFrame.from_dict(data)
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
# Function to display query, rating, and controls for one query
|
| 39 |
-
def display_query_section(query_type, query_text_gemini, query_text_llama, relevance_gemini, clarity_gemini, relevance_llama, clarity_llama, persona_alignment_gemini=None, persona_alignment_llama=None):
|
| 40 |
-
st.subheader(f"{query_type}")
|
| 41 |
-
col1, col2 = st.columns(2)
|
| 42 |
-
with col1:
|
| 43 |
-
st.markdown("Gemini")
|
| 44 |
-
st.write(query_text_gemini)
|
| 45 |
-
st.markdown("Relevance")
|
| 46 |
-
relevance_options = ['N/A', 'Not Relevant', 'Somewhat Relevant', 'Relevant', 'Unclear']
|
| 47 |
-
selected_relevance_gemini = st.radio("Relevance", options = relevance_options, key=f"relevance_{query_type}_gemini", index=relevance_options.index(relevance_gemini), horizontal=True)
|
| 48 |
-
st.markdown("Clarity")
|
| 49 |
-
clarity_options = ['N/A', 'Not Clear', 'Somewhat Clear', 'Very Clear']
|
| 50 |
-
selected_clarity_gemini = st.radio("Clarity", options = clarity_options, key=f"clarity_{query_type}_gemini", index=clarity_options.index(clarity_gemini), horizontal=True)
|
| 51 |
-
|
| 52 |
-
if persona_alignment_gemini:
|
| 53 |
-
st.markdown("Persona Alignment")
|
| 54 |
-
persona_options = ['N/A', 'Not Aligned', 'Partially Aligned', 'Aligned', 'Unclear']
|
| 55 |
-
selected_persona_alignment_gemini = st.radio("Persona Alignment", options = persona_options, key=f"persona_{query_type}_gemini", index=persona_options.index(persona_alignment_gemini), horizontal=True)
|
| 56 |
-
with col2:
|
| 57 |
-
st.markdown("Llama")
|
| 58 |
-
st.write(query_text_llama)
|
| 59 |
-
st.markdown("Relevance")
|
| 60 |
-
relevance_options_llama = ['N/A', 'Not Relevant', 'Somewhat Relevant', 'Relevant', 'Unclear']
|
| 61 |
-
selected_relevance_llama = st.radio("Relevance", options = relevance_options_llama, key=f"relevance_{query_type}_llama", index=relevance_options_llama.index(relevance_llama), horizontal=True)
|
| 62 |
-
st.markdown("Clarity")
|
| 63 |
-
clarity_options_llama = ['N/A', 'Not Clear', 'Somewhat Clear', 'Very Clear']
|
| 64 |
-
selected_clarity_llama = st.radio("Clarity", options = clarity_options_llama, key=f"clarity_{query_type}_llama", index=clarity_options_llama.index(clarity_llama), horizontal=True)
|
| 65 |
-
if persona_alignment_llama:
|
| 66 |
-
st.markdown("Persona Alignment")
|
| 67 |
-
persona_options_llama = ['N/A', 'Not Aligned', 'Partially Aligned', 'Aligned', 'Unclear']
|
| 68 |
-
selected_persona_alignment_llama = st.radio("Persona Alignment", options = persona_options_llama, key=f"persona_{query_type}_llama", index=persona_options_llama.index(persona_alignment_llama), horizontal=True)
|
| 69 |
-
|
| 70 |
-
# Main Streamlit App
|
| 71 |
-
st.set_page_config(layout="wide")
|
| 72 |
-
|
| 73 |
-
# Context Information
|
| 74 |
-
st.title("Question 1 of 5")
|
| 75 |
-
st.subheader("Config ID: c_p_0_pop_low_easy")
|
| 76 |
-
st.markdown("### Context Information")
|
| 77 |
-
with st.expander("Persona", expanded=True):
|
| 78 |
-
st.write("A top-scoring player in the local league who is also eyeing a professional career in the NHL")
|
| 79 |
-
with st.expander("Filters & Cities", expanded=True):
|
| 80 |
-
st.write("Filters: {'popularity': 'low', 'month': 'February'}")
|
| 81 |
-
st.write("Cities: ['Adana', 'Adiyaman', 'Agri', 'Arad', 'Arkhangelsk', 'Bacau', 'Baia Mare', 'Balikesir', 'Brest',\
|
| 82 |
-
'Burgas', 'Canakkale', 'Craiova', 'Debrecen', 'Denizli', 'Diyarbakir', 'Elazig', 'Erzincan', 'Eskisehir',\
|
| 83 |
-
'Gaziantep', 'lasi', 'Ioannina', 'Isparta', 'Jonkoping', 'Kahramanmaras', 'Kars', 'Kayseri', 'Konya', 'Kosice',\
|
| 84 |
-
'Linkoping', 'Malatya', 'Miskolc', 'Mykolaiv', 'Nalchik', 'Nevsehir', 'Nis', 'Orebro', 'Orleans', 'Rivne',\
|
| 85 |
-
'Rzeszow', 'Samsun', 'Sanliurfa', 'Sevilla', 'Siirt', 'Sivas', 'Syktyvkar', 'Targu-Mures', 'Tekirdag',\
|
| 86 |
-
'Thessaloniki', 'Trabzon', 'Uzhhorod', 'Valladolid', 'Van', 'Vasteras', 'Vinnytsia', 'Vitoria-Gasteiz',\
|
| 87 |
-
'Vladikavkaz', 'Zaporizhzhia', 'Zielona Gora', 'Batman', 'Erzurum']")
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
# Display Query Sections
|
| 91 |
-
display_query_section(
|
| 92 |
-
query_type="Query_v",
|
| 93 |
-
query_text_gemini=df.loc['gemini','query_v'],
|
| 94 |
-
query_text_llama=df.loc['llama','query_v'],
|
| 95 |
-
relevance_gemini=rating_data['gemini']['query_v']['relevance'],
|
| 96 |
-
clarity_gemini=rating_data['gemini']['query_v']['clarity'],
|
| 97 |
-
relevance_llama=rating_data['llama']['query_v']['relevance'],
|
| 98 |
-
clarity_llama=rating_data['llama']['query_v']['clarity'],
|
| 99 |
-
)
|
| 100 |
-
|
| 101 |
-
display_query_section(
|
| 102 |
-
query_type="Query_p0",
|
| 103 |
-
query_text_gemini=df.loc['gemini','query_p0'],
|
| 104 |
-
query_text_llama=df.loc['llama','query_p0'],
|
| 105 |
-
relevance_gemini=rating_data['gemini']['query_p0']['relevance'],
|
| 106 |
-
clarity_gemini=rating_data['gemini']['query_p0']['clarity'],
|
| 107 |
-
persona_alignment_gemini=rating_data['gemini']['query_p0']['persona_alignment'],
|
| 108 |
-
relevance_llama=rating_data['llama']['query_p0']['relevance'],
|
| 109 |
-
clarity_llama=rating_data['llama']['query_p0']['clarity'],
|
| 110 |
-
persona_alignment_llama=rating_data['llama']['query_p0']['persona_alignment'],
|
| 111 |
-
)
|
| 112 |
-
|
| 113 |
-
display_query_section(
|
| 114 |
-
query_type="Query_p1",
|
| 115 |
-
query_text_gemini=df.loc['gemini','query_p1'],
|
| 116 |
-
query_text_llama=df.loc['llama','query_p1'],
|
| 117 |
-
relevance_gemini=rating_data['gemini']['query_p1']['relevance'],
|
| 118 |
-
clarity_gemini=rating_data['gemini']['query_p1']['clarity'],
|
| 119 |
-
persona_alignment_gemini=rating_data['gemini']['query_p1']['persona_alignment'],
|
| 120 |
-
relevance_llama=rating_data['llama']['query_p1']['relevance'],
|
| 121 |
-
clarity_llama=rating_data['llama']['query_p1']['clarity'],
|
| 122 |
-
persona_alignment_llama=rating_data['llama']['query_p1']['persona_alignment'],
|
| 123 |
-
|
| 124 |
-
)
|
| 125 |
-
# Additional Comments
|
| 126 |
-
st.markdown("Additional Comments (Optional):")
|
| 127 |
-
st.text_area("", key="additional_comments")
|
| 128 |
-
|
| 129 |
-
# Navigation Buttons
|
| 130 |
-
col1, col2, col3 = st.columns([1,1,1])
|
| 131 |
-
with col1:
|
| 132 |
-
st.button("Back")
|
| 133 |
-
with col2:
|
| 134 |
-
st.button("Next")
|
| 135 |
-
with col3:
|
| 136 |
-
st.button("Exit & Resume Later")
|
| 137 |
-
# Bottom message
|
| 138 |
-
st.markdown("Please provide a rating before proceeding.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|