2gauravc commited on
Commit
8939a82
1 Parent(s): 739d3ad

added help tab

Browse files
Files changed (1) hide show
  1. app.py +52 -36
app.py CHANGED
@@ -25,39 +25,55 @@ def perform_search(pname, keywords, num_results):
25
  rep_txt= generate_kyc_output(query, search_links, resp, start_time)
26
  return (rep_txt)
27
 
28
- # Streamlit app
29
- st.title("Adverse News Detection Assistant")
30
-
31
- # Input fields
32
- names_txt = st.text_input("Enter party name (or multiple names separated by ,)")
33
- plc_text = "laundering OR terrorist OR fraud OR corrupt OR criminal OR investigation OR prosecute OR evasion OR bribe OR sanction"
34
- keywords = st.text_input("Enter other search words:", value=plc_text)
35
-
36
- st.sidebar.markdown("## Controls")
37
- st.sidebar.markdown("Choose your **search** *parameters*")
38
- num_results = st.sidebar.slider("Choose the number of search results:", 5, 30, 20, 5)
39
- st.sidebar.markdown("## Model")
40
- st.sidebar.markdown("GPT v3.5")
41
- st.sidebar.markdown("## App")
42
- st.sidebar.markdown("v0.3")
43
-
44
- # Search button
45
- if st.button("Search"):
46
- names = names_txt.split(",")
47
- # Perform the search and display the results
48
- if names and keywords:
49
- search_results = ""
50
- for name in names:
51
- #print("trying for name {} \n".format(name))
52
- search_results += perform_search(name, keywords, num_results)
53
-
54
- html(f"<pre>{search_results}</pre>", height=200, scrolling=True)
55
- st.download_button('Download Report',search_results)
56
- try:
57
- date_time = datetime.now()
58
- save_to_s3(search_results,date_time )
59
- print ("Completed processing for {} names: {} at {} \n".format(len(names), names_txt, str(date_time)))
60
- except:
61
- print ("Completed processing with S3 write error for {} names: {} at {} \n".format(len(names),names_txt, str(date_time)))
62
- else:
63
- st.error("Please enter your name and search keywords before searching.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  rep_txt= generate_kyc_output(query, search_links, resp, start_time)
26
  return (rep_txt)
27
 
28
+ main_tab, help_tab = st.tabs(["Run the Bot", "Help"])
29
+
30
+ with main_tab:
31
+ # Streamlit app
32
+ st.title("Adverse News Detection Assistant")
33
+
34
+ # Input fields
35
+ names_txt = st.text_input("Enter party name (or multiple names separated by ,)")
36
+ plc_text = "laundering OR terrorist OR fraud OR corrupt OR criminal OR investigation OR prosecute OR evasion OR bribe OR sanction"
37
+ keywords = st.text_input("Enter other search words:", value=plc_text)
38
+
39
+ st.sidebar.markdown("## Controls")
40
+ st.sidebar.markdown("Choose your **search** *parameters*")
41
+ num_results = st.sidebar.slider("Choose the number of search results:", 5, 30, 20, 5)
42
+ st.sidebar.markdown("## Model")
43
+ st.sidebar.markdown("GPT v3.5")
44
+ st.sidebar.markdown("## App")
45
+ st.sidebar.markdown("v0.3")
46
+
47
+ # Search button
48
+ if st.button("Search"):
49
+ names = names_txt.split(",")
50
+ # Perform the search and display the results
51
+ if names and keywords:
52
+ search_results = ""
53
+ for name in names:
54
+ #print("trying for name {} \n".format(name))
55
+ search_results += perform_search(name, keywords, num_results)
56
+
57
+ html(f"<pre>{search_results}</pre>", height=200, scrolling=True)
58
+ st.download_button('Download Report',search_results)
59
+ try:
60
+ date_time = datetime.now()
61
+ save_to_s3(search_results,date_time )
62
+ print ("Completed processing for {} names: {} at {} \n".format(len(names), names_txt, str(date_time)))
63
+ except:
64
+ print ("Completed processing with S3 write error for {} names: {} at {} \n".format(len(names),names_txt, str(date_time)))
65
+ else:
66
+ st.error("Please enter your name and search keywords before searching.")
67
+
68
+ with help_tab:
69
+ st.title("FAQ")
70
+
71
+ st.markdown("Q. How do I get a count of number of adverse news?")
72
+ st.markdown("A. This functionality isnt implemented yet. A workaround is to manually count the number of links with adverse news")
73
+
74
+ st.markdown("Q. How do I summarise all the adverse news?")
75
+ st.markdown("A. This functionality isnt implemented yet. A workaround is to aggregate the summary of all adverse news items manually, and get a sumary from ChatGPT (chat.openai.com")
76
+
77
+ st.markdown("Q. Can I search in other lauguages?")
78
+ st.markdown("A. This functionality isnt implemented yet. We are planning to test this feature out with Chinese first")
79
+