Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -273,7 +273,7 @@ def search_articles(name: str, max_articles: int = 4) -> str:
|
|
273 |
|
274 |
def extract_entities(search_results: str, company_name: str) -> str:
|
275 |
"""Extract entities using Claude 4"""
|
276 |
-
MAX_CHARS =
|
277 |
if len(search_results) > MAX_CHARS:
|
278 |
trunc = search_results[:MAX_CHARS]
|
279 |
last_period = trunc.rfind('. ')
|
@@ -283,27 +283,20 @@ def extract_entities(search_results: str, company_name: str) -> str:
|
|
283 |
Only include founders who are explicitly mentioned as founders of {company_name}.
|
284 |
Ignore founders of other companies that may be mentioned in the text.
|
285 |
|
286 |
-
Also identify the temporal context for each founder mention (recent news vs historical founding information).
|
287 |
-
|
288 |
Return a JSON object with the following structure:
|
289 |
{{
|
290 |
"founders": [
|
291 |
{{
|
292 |
"name": "Founder Name",
|
293 |
-
"type": "person" or "organization",
|
294 |
-
"context": "recent" or "historical" or "both",
|
295 |
"evidence": ["brief quote or context where they were mentioned as founder"]
|
296 |
}}
|
297 |
-
]
|
298 |
-
"founding_timeline": {{
|
299 |
-
"founding_date": "date if mentioned",
|
300 |
-
"key_events": ["important founding milestones mentioned"]
|
301 |
-
}},
|
302 |
-
"confidence": "high/medium/low based on clarity of founder information"
|
303 |
}}
|
304 |
|
305 |
Respond only with valid JSON. Do not include any explanations, comments, or additional formatting.
|
306 |
|
|
|
|
|
307 |
Text:
|
308 |
{search_results}"""
|
309 |
|
|
|
273 |
|
274 |
def extract_entities(search_results: str, company_name: str) -> str:
|
275 |
"""Extract entities using Claude 4"""
|
276 |
+
MAX_CHARS = 15000
|
277 |
if len(search_results) > MAX_CHARS:
|
278 |
trunc = search_results[:MAX_CHARS]
|
279 |
last_period = trunc.rfind('. ')
|
|
|
283 |
Only include founders who are explicitly mentioned as founders of {company_name}.
|
284 |
Ignore founders of other companies that may be mentioned in the text.
|
285 |
|
|
|
|
|
286 |
Return a JSON object with the following structure:
|
287 |
{{
|
288 |
"founders": [
|
289 |
{{
|
290 |
"name": "Founder Name",
|
|
|
|
|
291 |
"evidence": ["brief quote or context where they were mentioned as founder"]
|
292 |
}}
|
293 |
+
]
|
|
|
|
|
|
|
|
|
|
|
294 |
}}
|
295 |
|
296 |
Respond only with valid JSON. Do not include any explanations, comments, or additional formatting.
|
297 |
|
298 |
+
You have to examine every article available in the search results below.
|
299 |
+
|
300 |
Text:
|
301 |
{search_results}"""
|
302 |
|