DanyaalMajid commited on
Commit
5c7cb49
1 Parent(s): 2027dac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -60,7 +60,7 @@ def main():
60
  for entry in data:
61
  label = entry["label"]
62
  score = entry["score"]
63
- print(f"Label: {label}, Score: {score}")
64
 
65
  if analysis_type == "Named Entity Recognition":
66
  st.subheader("Named Entity Recognition:")
@@ -83,13 +83,12 @@ def main():
83
 
84
  # Parse JSON data
85
  data = toxicity_classifier(user_text)
86
- st.write(data)
87
  # Extract and display label and score values
88
- for labels_and_scores in data:
89
- for entry in labels_and_scores:
90
- label = entry["label"]
91
- score = entry["score"]
92
- st.write(f"Label: {label}, Score: {score}")
93
 
94
  if __name__ == "__main__":
95
  main()
 
60
  for entry in data:
61
  label = entry["label"]
62
  score = entry["score"]
63
+ st.write(f"Label: {label}, Score: {score}")
64
 
65
  if analysis_type == "Named Entity Recognition":
66
  st.subheader("Named Entity Recognition:")
 
83
 
84
  # Parse JSON data
85
  data = toxicity_classifier(user_text)
86
+ #st.write(data)
87
  # Extract and display label and score values
88
+ for entry in data:
89
+ label = entry["label"]
90
+ score = entry["score"]
91
+ st.write(f"Label: {label}, Score: {score}")
 
92
 
93
  if __name__ == "__main__":
94
  main()