abdulllah01 commited on
Commit
0f5c3da
·
verified ·
1 Parent(s): cd2e815

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -49,7 +49,8 @@ def process_matching(keywords, article, fuzzy, mode):
49
  if mode == "filter":
50
  results = {k: v for k, v in results.items() if v > 0}
51
 
52
- return results
 
53
 
54
  # Streamlit app
55
  st.title("Keyword Matcher")
@@ -88,11 +89,12 @@ if st.button("Process"):
88
  elif not article:
89
  st.error("Please provide an article.")
90
  else:
91
- results = process_matching(keywords, article, fuzzy, mode)
92
 
93
  st.subheader("Results")
94
  for keyword, count in results.items():
95
  st.write(f"{keyword}: {count}")
 
96
 
97
  # Save to Excel
98
  st.subheader("Download Results")
 
49
  if mode == "filter":
50
  results = {k: v for k, v in results.items() if v > 0}
51
 
52
+ total_count = sum(results.values())
53
+ return results, total_count
54
 
55
  # Streamlit app
56
  st.title("Keyword Matcher")
 
89
  elif not article:
90
  st.error("Please provide an article.")
91
  else:
92
+ results, total_count = process_matching(keywords, article, fuzzy, mode)
93
 
94
  st.subheader("Results")
95
  for keyword, count in results.items():
96
  st.write(f"{keyword}: {count}")
97
+ st.write(f"**Total Count:** {total_count}")
98
 
99
  # Save to Excel
100
  st.subheader("Download Results")