Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
| 3 |
import numpy as np
|
|
@@ -86,4 +123,9 @@ if st.button('Add to Results'):
|
|
| 86 |
st.write('Tweet:', text_input)
|
| 87 |
st.write('Highest Toxicity Class:', class_label)
|
| 88 |
st.write('Probability:', class_prob)
|
| 89 |
-
st.session_state.classification_results = st.session_state.classification_results.append
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Hugging Face's logo
|
| 2 |
+
Hugging Face
|
| 3 |
+
Search models, datasets, users...
|
| 4 |
+
Models
|
| 5 |
+
Datasets
|
| 6 |
+
Spaces
|
| 7 |
+
Docs
|
| 8 |
+
Solutions
|
| 9 |
+
Pricing
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
Hugging Face is way more fun with friends and colleagues! 🤗 Join an organization
|
| 14 |
+
Spaces:
|
| 15 |
+
|
| 16 |
+
jeromechew15
|
| 17 |
+
/
|
| 18 |
+
milestone3 Copied
|
| 19 |
+
like
|
| 20 |
+
0
|
| 21 |
+
App
|
| 22 |
+
Files
|
| 23 |
+
Community
|
| 24 |
+
milestone3
|
| 25 |
+
/
|
| 26 |
+
app.py
|
| 27 |
+
jeromechew15's picture
|
| 28 |
+
jeromechew15
|
| 29 |
+
Update app.py
|
| 30 |
+
0777fd8
|
| 31 |
+
2 days ago
|
| 32 |
+
raw
|
| 33 |
+
history
|
| 34 |
+
blame
|
| 35 |
+
contribute
|
| 36 |
+
delete
|
| 37 |
+
3.37 kB
|
| 38 |
import streamlit as st
|
| 39 |
import pandas as pd
|
| 40 |
import numpy as np
|
|
|
|
| 123 |
st.write('Tweet:', text_input)
|
| 124 |
st.write('Highest Toxicity Class:', class_label)
|
| 125 |
st.write('Probability:', class_prob)
|
| 126 |
+
st.session_state.classification_results = st.session_state.classification_results.append({
|
| 127 |
+
'tweet': text_input,
|
| 128 |
+
'toxicity_class': class_label,
|
| 129 |
+
'probability': class_prob
|
| 130 |
+
}, ignore_index=True)
|
| 131 |
+
st.write(st.session_state.classification_results)
|