Spaces:
Runtime error
Runtime error
jaifar530
commited on
fix
Browse files
app.py
CHANGED
|
@@ -245,28 +245,28 @@ def AI_vs_AI_RandomForest_88_Samples(df):
|
|
| 245 |
except Exception as e:
|
| 246 |
st.write(f"An error occurred: {str(e)}")
|
| 247 |
|
| 248 |
-
labels = clf_loaded.classes_
|
| 249 |
|
| 250 |
-
# Create a mapping from old labels to new labels
|
| 251 |
-
label_mapping = {1: 'gpt3', 2: 'gpt4', 3: 'googlebard', 4: 'huggingface'}
|
| 252 |
|
| 253 |
-
# Apply the mapping to the labels
|
| 254 |
-
new_labels = [label_mapping[label] for label in labels]
|
| 255 |
|
| 256 |
-
# Create a dictionary that maps new labels to probabilities
|
| 257 |
-
prob_dict = {k: v for k, v in zip(new_labels, probabilities)}
|
| 258 |
|
| 259 |
-
# Convert probabilities to percentages and sort the dictionary in descending order
|
| 260 |
-
prob_dict = {k: f'{v*100:.2f}%' for k, v in sorted(prob_dict.items(), key=lambda item: item[1], reverse=True)}
|
| 261 |
|
| 262 |
-
# Print the dictionary
|
| 263 |
-
#st.write(prob_dict)
|
| 264 |
|
| 265 |
-
# Create a progress bar and a bar chart for each LLM
|
| 266 |
-
for llm, prob in prob_dict.items():
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
return
|
| 270 |
|
| 271 |
def AI_vs_AI_Ridge_2000_Samples(df):
|
| 272 |
|
|
|
|
| 245 |
except Exception as e:
|
| 246 |
st.write(f"An error occurred: {str(e)}")
|
| 247 |
|
| 248 |
+
# labels = clf_loaded.classes_
|
| 249 |
|
| 250 |
+
# # Create a mapping from old labels to new labels
|
| 251 |
+
# label_mapping = {1: 'gpt3', 2: 'gpt4', 3: 'googlebard', 4: 'huggingface'}
|
| 252 |
|
| 253 |
+
# # Apply the mapping to the labels
|
| 254 |
+
# new_labels = [label_mapping[label] for label in labels]
|
| 255 |
|
| 256 |
+
# # Create a dictionary that maps new labels to probabilities
|
| 257 |
+
# prob_dict = {k: v for k, v in zip(new_labels, probabilities)}
|
| 258 |
|
| 259 |
+
# # Convert probabilities to percentages and sort the dictionary in descending order
|
| 260 |
+
# prob_dict = {k: f'{v*100:.2f}%' for k, v in sorted(prob_dict.items(), key=lambda item: item[1], reverse=True)}
|
| 261 |
|
| 262 |
+
# # Print the dictionary
|
| 263 |
+
# #st.write(prob_dict)
|
| 264 |
|
| 265 |
+
# # Create a progress bar and a bar chart for each LLM
|
| 266 |
+
# for llm, prob in prob_dict.items():
|
| 267 |
+
# st.write(llm + ': ' + prob)
|
| 268 |
+
# st.progress(float(prob.strip('%'))/100)
|
| 269 |
+
# return
|
| 270 |
|
| 271 |
def AI_vs_AI_Ridge_2000_Samples(df):
|
| 272 |
|