Spaces:
Build error
Build error
Upload app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ st.write(
|
|
29 |
|
30 |
query_text = st.text_input("Input Query", value="Who is the CEO of Apple?")
|
31 |
|
32 |
-
years_choice = ["
|
33 |
|
34 |
year = st.selectbox("Year", years_choice)
|
35 |
|
@@ -50,7 +50,7 @@ ticker_choice = [
|
|
50 |
|
51 |
ticker = st.selectbox("Company", ticker_choice)
|
52 |
|
53 |
-
num_results = int(st.number_input("Number of Results to query", 1, 5, value=
|
54 |
|
55 |
|
56 |
# Choose encoder model
|
@@ -82,11 +82,11 @@ elif encoder_model == "SGPT":
|
|
82 |
retriever_model = get_sgpt_embedding_model()
|
83 |
|
84 |
|
85 |
-
window = int(st.number_input("Sentence Window Size", 0,
|
86 |
|
87 |
threshold = float(
|
88 |
st.number_input(
|
89 |
-
label="Similarity Score Threshold", step=0.05, format="%.2f", value=0.
|
90 |
)
|
91 |
)
|
92 |
|
@@ -103,7 +103,7 @@ query_results = query_pinecone(
|
|
103 |
threshold,
|
104 |
)
|
105 |
|
106 |
-
if threshold <= 0.
|
107 |
context_list = sentence_id_combine(data, query_results, lag=window)
|
108 |
else:
|
109 |
context_list = format_query(query_results)
|
|
|
29 |
|
30 |
query_text = st.text_input("Input Query", value="Who is the CEO of Apple?")
|
31 |
|
32 |
+
years_choice = ["2020", "2019", "2018", "2017", "2016"]
|
33 |
|
34 |
year = st.selectbox("Year", years_choice)
|
35 |
|
|
|
50 |
|
51 |
ticker = st.selectbox("Company", ticker_choice)
|
52 |
|
53 |
+
num_results = int(st.number_input("Number of Results to query", 1, 5, value=5))
|
54 |
|
55 |
|
56 |
# Choose encoder model
|
|
|
82 |
retriever_model = get_sgpt_embedding_model()
|
83 |
|
84 |
|
85 |
+
window = int(st.number_input("Sentence Window Size", 0, 5, value=3))
|
86 |
|
87 |
threshold = float(
|
88 |
st.number_input(
|
89 |
+
label="Similarity Score Threshold", step=0.05, format="%.2f", value=0.35
|
90 |
)
|
91 |
)
|
92 |
|
|
|
103 |
threshold,
|
104 |
)
|
105 |
|
106 |
+
if threshold <= 0.90:
|
107 |
context_list = sentence_id_combine(data, query_results, lag=window)
|
108 |
else:
|
109 |
context_list = format_query(query_results)
|