Update app.py
Browse files
app.py
CHANGED
@@ -44,12 +44,14 @@ if generate_button:
|
|
44 |
# Call the model with the input text
|
45 |
input_text = "I love you"
|
46 |
model_output = classifier(input_text)
|
47 |
-
|
48 |
-
length = len(model_output)
|
49 |
-
model_output_first = model_output[0]
|
50 |
|
51 |
# Displaying the input and model's output
|
52 |
-
st.write(f"
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
|
44 |
# Call the model with the input text
|
45 |
input_text = "I love you"
|
46 |
model_output = classifier(input_text)
|
47 |
+
output = model_output[0]
|
|
|
|
|
48 |
|
49 |
# Displaying the input and model's output
|
50 |
+
st.write(f"Generated Tweet: {input_text}")
|
51 |
+
for i in range(3):
|
52 |
+
if output[i]['label'] == 'LABEL_0':
|
53 |
+
st.write(f"Non-Toxic Content: {output[i]['score']:.2f}%")
|
54 |
+
elif output[i]['label'] == 'LABEL_1':
|
55 |
+
st.write(f"Toxic Content: {output[i]['score']:.2f}%")
|
56 |
+
else:
|
57 |
+
continue
|