Nikolay Banar commited on
Commit
d8255c3
·
1 Parent(s): f2a102e

Add application file search deleted

Browse files
Files changed (1) hide show
  1. app.py +12 -11
app.py CHANGED
@@ -1,10 +1,11 @@
1
  # coding=utf-8
2
  import streamlit as st
3
  import json
4
- from search import TFIDF, GenClient
5
 
6
 
7
  def display_search_results(results, page_number, results_per_page):
 
8
  st.title("Search Results")
9
  start_idx = (page_number - 1) * results_per_page
10
  end_idx = start_idx + results_per_page
@@ -32,16 +33,16 @@ def display_search_results(results, page_number, results_per_page):
32
  def main():
33
  st.title("Legal Search Engine")
34
  query = st.text_input("Enter your search query:")
35
- model = TFIDF()
36
- gen = GenClient()
37
- if st.button("Search"):
38
- results = model.search_all([query], top_k=5)[0]
39
- for r in results:
40
- r['summary'] = gen.respond(query, r['text'])
41
-
42
- # for
43
- # gen.respond()
44
- st.session_state.results = results
45
 
46
  if "results" in st.session_state:
47
  results = st.session_state.results
 
1
  # coding=utf-8
2
  import streamlit as st
3
  import json
4
+ # from search import TFIDF, GenClient
5
 
6
 
7
  def display_search_results(results, page_number, results_per_page):
8
+ pass
9
  st.title("Search Results")
10
  start_idx = (page_number - 1) * results_per_page
11
  end_idx = start_idx + results_per_page
 
33
  def main():
34
  st.title("Legal Search Engine")
35
  query = st.text_input("Enter your search query:")
36
+ # model = TFIDF()
37
+ # gen = GenClient()
38
+ # if st.button("Search"):
39
+ # results = model.search_all([query], top_k=5)[0]
40
+ # for r in results:
41
+ # r['summary'] = gen.respond(query, r['text'])
42
+ #
43
+ # # for
44
+ # # gen.respond()
45
+ # st.session_state.results = results
46
 
47
  if "results" in st.session_state:
48
  results = st.session_state.results