I assumed that the image below is the output that you were looking for:
I was able to accomplish it using a modified code, but there is an issue with the elements in the list with multiple words such as “if possible” and “at the mininum” which I was not able to resolve quickly. You may be able to resolve it with a change on the split option, but this is not streamlit problem. Best of of luck!
if button:
count=0
x=x.split(" ")
for word in x:
#st.write(word)
if word in weakWords:
st.text("The requirement classified as: Bad\nThe wrong word: " +word+"\ncategory: Weak Words")
count+=1
elif word in unboundedList:
st.text("The requirement classified as: Bad\nThe wrong word: " +word+"\ncategory: Unbounded List")
count+=1
elif word in ambiguity:
st.text("The requirement classified as: Bad\nThe wrong word: " +word+"\ncategory: Ambiguity")
count+=1
elif word in ambiguityWeakWords:
st.text("The requirement classified as: Bad\nThe wrong word: " +word+"\ncategory: Ambiguity & WeakWords")
count+=1
if count==0:
st.text("The requirement classified as: Good")