Spaces:
Runtime error
Runtime error
random redact
Browse files
app.py
CHANGED
|
@@ -2,6 +2,7 @@ import os
|
|
| 2 |
import json
|
| 3 |
import numpy as np
|
| 4 |
import pandas as pd
|
|
|
|
| 5 |
|
| 6 |
import streamlit as st
|
| 7 |
import torch
|
|
@@ -116,7 +117,7 @@ if __name__ == '__main__':
|
|
| 116 |
# sample['content'] = sample['content'][:300]
|
| 117 |
temp = []
|
| 118 |
for idx, word in enumerate(sample['content'].split()):
|
| 119 |
-
if (
|
| 120 |
word = '▒'*len(word)
|
| 121 |
temp.append(word)
|
| 122 |
sample['content'] = ' '.join(temp)
|
|
|
|
| 2 |
import json
|
| 3 |
import numpy as np
|
| 4 |
import pandas as pd
|
| 5 |
+
import random
|
| 6 |
|
| 7 |
import streamlit as st
|
| 8 |
import torch
|
|
|
|
| 117 |
# sample['content'] = sample['content'][:300]
|
| 118 |
temp = []
|
| 119 |
for idx, word in enumerate(sample['content'].split()):
|
| 120 |
+
if (random.randint(0, 99)> 45) and idx > 0:
|
| 121 |
word = '▒'*len(word)
|
| 122 |
temp.append(word)
|
| 123 |
sample['content'] = ' '.join(temp)
|