Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -172,7 +172,7 @@ def main():
|
|
172 |
pred_val = [list_pred[i] for i in pred1]
|
173 |
|
174 |
#print('count',count)
|
175 |
-
for
|
176 |
if 'customers' in sent or 'client' in sent or 'consumer' in sent or 'user' in sent:
|
177 |
pred_val[ind] = 'Customers'
|
178 |
elif 'investor' in sent or 'finance' in sent or 'shareholder' in sent or 'stockholder' in sent or 'owners' in sent:
|
@@ -505,8 +505,11 @@ def main():
|
|
505 |
json_data = json.dumps(data_list)
|
506 |
|
507 |
# Write the JSON data to a file
|
508 |
-
with open(json_file, "
|
|
|
|
|
509 |
f.write(json_data)
|
|
|
510 |
# api.upload_file(
|
511 |
# path_or_fileobj=json_data,
|
512 |
# path_in_repo="ch.json",
|
|
|
172 |
pred_val = [list_pred[i] for i in pred1]
|
173 |
|
174 |
#print('count',count)
|
175 |
+
for ind,(sent,preds) in enumerate(zip(class_list,pred_val)):
|
176 |
if 'customers' in sent or 'client' in sent or 'consumer' in sent or 'user' in sent:
|
177 |
pred_val[ind] = 'Customers'
|
178 |
elif 'investor' in sent or 'finance' in sent or 'shareholder' in sent or 'stockholder' in sent or 'owners' in sent:
|
|
|
505 |
json_data = json.dumps(data_list)
|
506 |
|
507 |
# Write the JSON data to a file
|
508 |
+
with open(json_file, "r+") as f:
|
509 |
+
data = f.read()
|
510 |
+
f.seek(0)
|
511 |
f.write(json_data)
|
512 |
+
f.truncate()
|
513 |
# api.upload_file(
|
514 |
# path_or_fileobj=json_data,
|
515 |
# path_in_repo="ch.json",
|