Spaces:
Sleeping
Sleeping
Upload 17 files
Browse files- app.py +7 -4
- utils/entity_extraction.py +1 -1
app.py
CHANGED
@@ -94,7 +94,7 @@ col1, col2 = st.columns([3, 3], gap="medium")
|
|
94 |
with col1:
|
95 |
query_text = st.text_area(
|
96 |
"Input Query",
|
97 |
-
value="
|
98 |
)
|
99 |
|
100 |
# Extracting Document Entities from Question
|
@@ -209,8 +209,12 @@ if decoder_model == "GPT-3.5 Turbo":
|
|
209 |
generated_text = gpt_turbo_model(edited_prompt)
|
210 |
|
211 |
st.subheader("Answer:")
|
212 |
-
regex_pattern_sentences =
|
213 |
-
|
|
|
|
|
|
|
|
|
214 |
for answer_text in generated_text_list:
|
215 |
answer_text = f"""{answer_text}"""
|
216 |
st.write(
|
@@ -234,7 +238,6 @@ if decoder_model == "Vicuna-7B":
|
|
234 |
)
|
235 |
|
236 |
|
237 |
-
|
238 |
tab1, tab2 = st.tabs(["Retrieved Text", "Retrieved Documents"])
|
239 |
|
240 |
|
|
|
94 |
with col1:
|
95 |
query_text = st.text_area(
|
96 |
"Input Query",
|
97 |
+
value="How has the growth been for AMD in the PC market in 2020?",
|
98 |
)
|
99 |
|
100 |
# Extracting Document Entities from Question
|
|
|
209 |
generated_text = gpt_turbo_model(edited_prompt)
|
210 |
|
211 |
st.subheader("Answer:")
|
212 |
+
regex_pattern_sentences = (
|
213 |
+
"(?<!\w\.\w.)(?<![A-Z][a-z]\.)(?<=\.|\?)\s"
|
214 |
+
)
|
215 |
+
generated_text_list = re.split(
|
216 |
+
regex_pattern_sentences, generated_text
|
217 |
+
)
|
218 |
for answer_text in generated_text_list:
|
219 |
answer_text = f"""{answer_text}"""
|
220 |
st.write(
|
|
|
238 |
)
|
239 |
|
240 |
|
|
|
241 |
tab1, tab2 = st.tabs(["Retrieved Text", "Retrieved Documents"])
|
242 |
|
243 |
|
utils/entity_extraction.py
CHANGED
@@ -79,7 +79,7 @@ def year_quarter_range(start_quarter, start_year, end_quarter, end_year):
|
|
79 |
year_quarter_range_list.append(
|
80 |
(quarters[quarter_index], str(year))
|
81 |
)
|
82 |
-
|
83 |
return year_quarter_range_list
|
84 |
|
85 |
|
|
|
79 |
year_quarter_range_list.append(
|
80 |
(quarters[quarter_index], str(year))
|
81 |
)
|
82 |
+
print(year_quarter_range_list)
|
83 |
return year_quarter_range_list
|
84 |
|
85 |
|