Mohzen321 commited on
Commit
a0a65f3
·
verified ·
1 Parent(s): a00ff89

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -33,7 +33,7 @@ if uploaded_file is not None:
33
 
34
  # دالة تصنيف الكلمات
35
  def classify_keywords(keywords, categories):
36
- nonlocal paused, stopped
37
  total_keywords = len(keywords)
38
  for i, word in enumerate(keywords):
39
  if stopped:
@@ -95,4 +95,14 @@ if uploaded_file is not None:
95
  st.write("Classification stopped.")
96
 
97
  else:
98
- st.warning("Please upload a text file to classify the keywords.")
 
 
 
 
 
 
 
 
 
 
 
33
 
34
  # دالة تصنيف الكلمات
35
  def classify_keywords(keywords, categories):
36
+ global paused, stopped # استخدام المتغيرات العالمية
37
  total_keywords = len(keywords)
38
  for i, word in enumerate(keywords):
39
  if stopped:
 
95
  st.write("Classification stopped.")
96
 
97
  else:
98
+ st.warning("Please upload a text file to classify the keywords.")
99
+
100
+ # زر حفظ النتائج
101
+ if st.button("Save Results"):
102
+ with open("shopping_keywords.txt", "w") as f:
103
+ f.write("\n".join(shopping_words))
104
+ with open("gaming_keywords.txt", "w") as f:
105
+ f.write("\n".join(gaming_words))
106
+ with open("streaming_keywords.txt", "w") as f:
107
+ f.write("\n".join(streaming_words))
108
+ st.success("Results saved successfully!")