Spaces:
Runtime error
Runtime error
Rob Caamano
commited on
App 2.7
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ from transformers import (
|
|
| 7 |
|
| 8 |
st.title("Detecting Toxic Tweets")
|
| 9 |
|
| 10 |
-
demo = """
|
| 11 |
|
| 12 |
text = st.text_area("Input text", demo, height=250)
|
| 13 |
|
|
@@ -42,15 +42,15 @@ if st.button("Submit", type="primary"):
|
|
| 42 |
column_name = "Highest Toxicity Class"
|
| 43 |
else:
|
| 44 |
column_name = "Prediction"
|
| 45 |
-
|
| 46 |
if probability < 0.1:
|
| 47 |
st.write("This tweet is not toxic.")
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
|
|
|
| 7 |
|
| 8 |
st.title("Detecting Toxic Tweets")
|
| 9 |
|
| 10 |
+
demo = """Your words are like poison. They seep into my mind and make me feel worthless."""
|
| 11 |
|
| 12 |
text = st.text_area("Input text", demo, height=250)
|
| 13 |
|
|
|
|
| 42 |
column_name = "Highest Toxicity Class"
|
| 43 |
else:
|
| 44 |
column_name = "Prediction"
|
| 45 |
+
|
| 46 |
if probability < 0.1:
|
| 47 |
st.write("This tweet is not toxic.")
|
| 48 |
+
|
| 49 |
+
df = pd.DataFrame(
|
| 50 |
+
{
|
| 51 |
+
"Tweet (portion)": [tweet_portion],
|
| 52 |
+
column_name: [label],
|
| 53 |
+
"Probability": [probability],
|
| 54 |
+
}
|
| 55 |
+
)
|
| 56 |
+
st.table(df)
|