Spaces:
Runtime error
Runtime error
jaifar530
commited on
fix output
Browse files
app.py
CHANGED
|
@@ -114,7 +114,7 @@ press_me_button = st.button("Press me")
|
|
| 114 |
if press_me_button:
|
| 115 |
input_features = df['paragraph'].apply(extract_features)
|
| 116 |
predicted_llm = clf_loaded.predict(input_features)
|
| 117 |
-
st.write(f"Predicted LLM: {predicted_llm[0]}")
|
| 118 |
|
| 119 |
predicted_proba = clf_loaded.predict_proba(input_features)
|
| 120 |
probabilities = predicted_proba[0]
|
|
@@ -133,10 +133,10 @@ if press_me_button:
|
|
| 133 |
prob_dict = {k: f'{v*100:.2f}%' for k, v in sorted(prob_dict.items(), key=lambda item: item[1], reverse=True)}
|
| 134 |
|
| 135 |
# Print the dictionary
|
| 136 |
-
st.write(prob_dict)
|
| 137 |
|
| 138 |
# Create a progress bar and a bar chart for each LLM
|
| 139 |
for llm, prob in prob_dict.items():
|
| 140 |
st.write(llm + ': ' + prob)
|
| 141 |
st.progress(float(prob.strip('%'))/100)
|
| 142 |
-
|
|
|
|
| 114 |
if press_me_button:
|
| 115 |
input_features = df['paragraph'].apply(extract_features)
|
| 116 |
predicted_llm = clf_loaded.predict(input_features)
|
| 117 |
+
#st.write(f"Predicted LLM: {predicted_llm[0]}")
|
| 118 |
|
| 119 |
predicted_proba = clf_loaded.predict_proba(input_features)
|
| 120 |
probabilities = predicted_proba[0]
|
|
|
|
| 133 |
prob_dict = {k: f'{v*100:.2f}%' for k, v in sorted(prob_dict.items(), key=lambda item: item[1], reverse=True)}
|
| 134 |
|
| 135 |
# Print the dictionary
|
| 136 |
+
#st.write(prob_dict)
|
| 137 |
|
| 138 |
# Create a progress bar and a bar chart for each LLM
|
| 139 |
for llm, prob in prob_dict.items():
|
| 140 |
st.write(llm + ': ' + prob)
|
| 141 |
st.progress(float(prob.strip('%'))/100)
|
| 142 |
+
|