Spaces:
Build error
Build error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -113,9 +113,7 @@ if st.session_state.page == "evaluation":
|
|
| 113 |
|
| 114 |
# If all pairs have been evaluated, display a message and save the results
|
| 115 |
if st.session_state.current_index+1 > NUM_PAIRS:
|
| 116 |
-
|
| 117 |
-
# results_df = pd.DataFrame(st.session_state.results)
|
| 118 |
-
# results_df.to_csv(RESULTS_FILE, index=False)
|
| 119 |
|
| 120 |
confidence = st.select_slider(
|
| 121 |
"How confident were you in your selections?",
|
|
@@ -136,20 +134,23 @@ if st.session_state.page == "evaluation":
|
|
| 136 |
nb_correct = np.sum(correct_guess)
|
| 137 |
|
| 138 |
st.success(f"Number of correct answers: {nb_correct}/{NUM_PAIRS}")
|
|
|
|
| 139 |
|
| 140 |
|
|
|
|
| 141 |
scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']
|
| 142 |
|
| 143 |
creds = ServiceAccountCredentials.from_json_keyfile_name('glass-flux-456209-d4-6fc4b7d9d274.json', scope)
|
| 144 |
client = gspread.authorize(creds)
|
| 145 |
|
| 146 |
sh = client.open('Results_woodAI').worksheet('test')
|
| 147 |
-
|
| 148 |
row = [
|
| 149 |
st.session_state.user_name,
|
| 150 |
confidence,
|
| 151 |
",".join(map(str, st.session_state.list_pair_ID)),
|
| 152 |
-
",".join(map(str, correct_guess))
|
|
|
|
| 153 |
]
|
| 154 |
sh.append_row(row)
|
| 155 |
|
|
|
|
| 113 |
|
| 114 |
# If all pairs have been evaluated, display a message and save the results
|
| 115 |
if st.session_state.current_index+1 > NUM_PAIRS:
|
| 116 |
+
|
|
|
|
|
|
|
| 117 |
|
| 118 |
confidence = st.select_slider(
|
| 119 |
"How confident were you in your selections?",
|
|
|
|
| 134 |
nb_correct = np.sum(correct_guess)
|
| 135 |
|
| 136 |
st.success(f"Number of correct answers: {nb_correct}/{NUM_PAIRS}")
|
| 137 |
+
st.success("Thank you for completing the evaluation!", icon=":material/tree:")
|
| 138 |
|
| 139 |
|
| 140 |
+
#Save result
|
| 141 |
scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']
|
| 142 |
|
| 143 |
creds = ServiceAccountCredentials.from_json_keyfile_name('glass-flux-456209-d4-6fc4b7d9d274.json', scope)
|
| 144 |
client = gspread.authorize(creds)
|
| 145 |
|
| 146 |
sh = client.open('Results_woodAI').worksheet('test')
|
| 147 |
+
|
| 148 |
row = [
|
| 149 |
st.session_state.user_name,
|
| 150 |
confidence,
|
| 151 |
",".join(map(str, st.session_state.list_pair_ID)),
|
| 152 |
+
",".join(map(str, correct_guess)),
|
| 153 |
+
",".join(map(str, nb_correct))
|
| 154 |
]
|
| 155 |
sh.append_row(row)
|
| 156 |
|