khizon commited on
Commit
5ebbffe
·
1 Parent(s): bf64a07

redact text

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -112,8 +112,14 @@ if __name__ == '__main__':
112
  st.error(f'Prediction: {prediction}')
113
 
114
  st.caption(f'Source: {sample["source"]} ({label})')
115
- if len(sample['content']) > 300:
116
- sample['content'] = sample['content'][:300]
 
 
 
 
 
 
117
  st.markdown(sample['content'])
118
  else:
119
  title = st.text_input('Article title', 'Test title')
 
112
  st.error(f'Prediction: {prediction}')
113
 
114
  st.caption(f'Source: {sample["source"]} ({label})')
115
+ # if len(sample['content']) > 300:
116
+ # sample['content'] = sample['content'][:300]
117
+ temp = []
118
+ for idx, word in enumerate(sample['content'].split(' ')):
119
+ if idx//5 == 0:
120
+ word = '*'*len(word)
121
+ temp.append(word)
122
+ sample['content'] = ' '.join(temp)
123
  st.markdown(sample['content'])
124
  else:
125
  title = st.text_input('Article title', 'Test title')