Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import re
|
2 |
+
import streamlit as st
|
3 |
+
from PyBingScrapper.search import BingSearch
|
4 |
+
|
5 |
+
query = st.text_input("Enter the query you want to search for:,{PS: please enter the search term in brackets []}")
|
6 |
+
submit_button = st.button("Submit")
|
7 |
+
r = "\[(.*?)\]"
|
8 |
+
re_list = re.findall(r, query)
|
9 |
+
q_input = (' ').join(re_list)
|
10 |
+
|
11 |
+
if submit_button:
|
12 |
+
bingsearch = BingSearch(q_input)
|
13 |
+
b_res = bingsearch.get_results(num=5, max_lines=3)
|
14 |
+
st.info(bingsearch.rag_output(query, b_res, hf_token, 15))
|
15 |
+
|