Spaces:
Sleeping
Sleeping
Upload 17 files
#6
by
awinml
- opened
- app.py +1 -1
- utils/entity_extraction.py +8 -5
app.py
CHANGED
@@ -265,5 +265,5 @@ with tab2:
|
|
265 |
|
266 |
else:
|
267 |
st.write(
|
268 |
-
"No specific document
|
269 |
)
|
|
|
265 |
|
266 |
else:
|
267 |
st.write(
|
268 |
+
"No specific document/documents found. Please mention Ticker and Duration in the Question."
|
269 |
)
|
utils/entity_extraction.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
import re
|
2 |
from ast import literal_eval
|
3 |
from nltk.stem import PorterStemmer, WordNetLemmatizer
|
4 |
|
@@ -9,14 +8,18 @@ def generate_ner_docs_prompt(query):
|
|
9 |
prompt = """USER: Extract the company names and time duration mentioned in the question. The entities should be extracted in the following format: {"companies": list of companies mentioned in the question,"start-duration": ("start-quarter", "start-year"), "end-duration": ("end-quarter", "end-year")}. Return {"companies": None, "start-duration": (None, None), "end-duration": (None, None)} if the entities are not found.
|
10 |
|
11 |
Examples:
|
12 |
-
What is
|
13 |
-
{"companies": ["
|
|
|
|
|
14 |
What are the opportunities and challenges in the Indian market for Amazon in 2016?
|
15 |
{"companies": ["Amazon"], "start-duration": ("Q1", "2016"), "end-duration": ("Q4", "2016")}
|
16 |
What did analysts ask about the Cisco's Webex?
|
17 |
{"companies": ["Cisco"], "start-duration": (None, None), "end-duration": (None, None)}
|
18 |
-
What is the comparative performance analysis between Intel and AMD in key overlapping segments such as PC, Gaming, and Data Centers in
|
19 |
-
{"companies": ["Intel", "AMD"], "start-duration": ("
|
|
|
|
|
20 |
How did Microsoft and Amazon perform in terms of reliability and scalability of cloud for the years 2016 and 2017?
|
21 |
{"companies": ["Microsoft", "Amazon"], "start-duration": ("Q1", "2016"), "end-duration": ("Q4", "2017")}"""
|
22 |
input_prompt = f"""###Input: {query}
|
|
|
|
|
1 |
from ast import literal_eval
|
2 |
from nltk.stem import PorterStemmer, WordNetLemmatizer
|
3 |
|
|
|
8 |
prompt = """USER: Extract the company names and time duration mentioned in the question. The entities should be extracted in the following format: {"companies": list of companies mentioned in the question,"start-duration": ("start-quarter", "start-year"), "end-duration": ("end-quarter", "end-year")}. Return {"companies": None, "start-duration": (None, None), "end-duration": (None, None)} if the entities are not found.
|
9 |
|
10 |
Examples:
|
11 |
+
What is Nvidia's visibility in the data center business in Q2 2020?
|
12 |
+
{"companies": ["Nvidia"], "start-duration": ("Q2", "2020"), "end-duration": ("Q2", "2020")}
|
13 |
+
What is Intel's update on the server chip road map and strategy for 2019?
|
14 |
+
{"companies": ["Intel"], "start-duration": ("Q1", "2019"), "end-duration": ("Q4", "2019")}
|
15 |
What are the opportunities and challenges in the Indian market for Amazon in 2016?
|
16 |
{"companies": ["Amazon"], "start-duration": ("Q1", "2016"), "end-duration": ("Q4", "2016")}
|
17 |
What did analysts ask about the Cisco's Webex?
|
18 |
{"companies": ["Cisco"], "start-duration": (None, None), "end-duration": (None, None)}
|
19 |
+
What is the comparative performance analysis between Intel and AMD in key overlapping segments such as PC, Gaming, and Data Centers in Q1 to Q3 2016?
|
20 |
+
{"companies": ["Intel", "AMD"], "start-duration": ("Q1", "2016"), "end-duration": ("Q3", "2016")}
|
21 |
+
How has the growth been for AMD in the PC market in 2020?
|
22 |
+
{"companies": ["AMD"], "start-duration": ("Q1", "2020"), "end-duration": ("Q4", "2020")}
|
23 |
How did Microsoft and Amazon perform in terms of reliability and scalability of cloud for the years 2016 and 2017?
|
24 |
{"companies": ["Microsoft", "Amazon"], "start-duration": ("Q1", "2016"), "end-duration": ("Q4", "2017")}"""
|
25 |
input_prompt = f"""###Input: {query}
|