Update app.py
Browse files
app.py
CHANGED
|
@@ -69,29 +69,20 @@ if text:
|
|
| 69 |
result = make_prediction(yorum_model, processed_data=processed_data)
|
| 70 |
#st.markdown("<br>", unsafe_allow_html=True)
|
| 71 |
st.success(result)
|
|
|
|
| 72 |
import matplotlib.pyplot as plt
|
| 73 |
-
from matplotlib.animation import FuncAnimation
|
| 74 |
-
|
| 75 |
-
colors = ['gold', 'yellowgreen', 'lightcoral', 'lightskyblue', 'limegreen',
|
| 76 |
-
'red', 'navy', 'blue', 'magenta', 'crimson']
|
| 77 |
-
explode = (0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, .01)
|
| 78 |
-
labels = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
|
| 79 |
-
nums = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
| 80 |
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
for x in range(10):
|
| 88 |
-
nums[x] += str_num.count(str(x))
|
| 89 |
-
ax.pie(nums, explode=explode, labels=labels, colors=colors,
|
| 90 |
-
autopct='%1.1f%%', shadow=True, startangle=140)
|
| 91 |
-
ax.set_title(str_num)
|
| 92 |
|
| 93 |
-
|
| 94 |
-
st.pyplot()
|
| 95 |
# description = '<table style="border: collapse; padding-top: 1px;"><tr><div style="height: 62px;"></div></tr><tr><p style="border-width: medium; border-color: #aa5e70; border-radius: 10px;padding-top: 1px;padding-left: 20px;background:#20212a;font-family:Courier New; color: white;font-size: 36px; font-weight: boldest;">'+result+'</p></tr><table>'
|
| 96 |
# st.markdown(description, unsafe_allow_html=True)
|
| 97 |
|
|
|
|
| 69 |
result = make_prediction(yorum_model, processed_data=processed_data)
|
| 70 |
#st.markdown("<br>", unsafe_allow_html=True)
|
| 71 |
st.success(result)
|
| 72 |
+
import streamlit as st
|
| 73 |
import matplotlib.pyplot as plt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
+
# Pie chart, where the slices will be ordered and plotted counter-clockwise:
|
| 76 |
+
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
|
| 77 |
+
sizes = [15, 30, 45, 10]
|
| 78 |
+
explode = (0, 0.1, 0, 0) # only "explode" the 2nd slice (i.e. 'Hogs')
|
| 79 |
|
| 80 |
+
fig1, ax1 = plt.subplots()
|
| 81 |
+
ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.1f%%',
|
| 82 |
+
shadow=True, startangle=90)
|
| 83 |
+
ax1.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
+
st.pyplot(fig1)
|
|
|
|
| 86 |
# description = '<table style="border: collapse; padding-top: 1px;"><tr><div style="height: 62px;"></div></tr><tr><p style="border-width: medium; border-color: #aa5e70; border-radius: 10px;padding-top: 1px;padding-left: 20px;background:#20212a;font-family:Courier New; color: white;font-size: 36px; font-weight: boldest;">'+result+'</p></tr><table>'
|
| 87 |
# st.markdown(description, unsafe_allow_html=True)
|
| 88 |
|