tweetpie commited on
Commit
e99974b
·
verified ·
1 Parent(s): aa485f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
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"Input Text: {input_text}")
53
- st.write("Model Output:", model_output)
54
- st.write("Model Output 2:", model_output_first)
55
- st.write("Length:", length)
 
 
 
 
 
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