From 9b1489840a33729d2abdce3e58640e33dd82e916 Mon Sep 17 00:00:00 2001 From: Darren Edge Date: Wed, 8 Jan 2025 20:31:03 +0000 Subject: [PATCH 01/11] Thematic clustering --- app/workflows/query_text_data/variables.py | 1 + app/workflows/query_text_data/workflow.py | 233 ++++++++++-------- intelligence_toolkit/AI/client.py | 3 +- .../query_text_data/answer_schema.py | 55 +++++ intelligence_toolkit/query_text_data/api.py | 2 + .../query_text_data/commentary.py | 60 +++++ .../query_text_data/pattern_detector.py | 2 +- .../query_text_data/prompts.py | 72 ++++++ .../query_text_data/relevance_assessor.py | 44 ++-- 9 files changed, 347 insertions(+), 125 deletions(-) create mode 100644 intelligence_toolkit/query_text_data/commentary.py diff --git a/app/workflows/query_text_data/variables.py b/app/workflows/query_text_data/variables.py index e8aa6e7a..85430aef 100644 --- a/app/workflows/query_text_data/variables.py +++ b/app/workflows/query_text_data/variables.py @@ -36,6 +36,7 @@ def create_session(self, prefix): self.system_prompt = SessionVariable(prompts.list_prompts, prefix) self.chunk_progress = SessionVariable("", prefix) self.answer_progress = SessionVariable("", prefix) + self.show_search_process = SessionVariable(False, prefix) def reset_workflow(self): for key in st.session_state: diff --git a/app/workflows/query_text_data/workflow.py b/app/workflows/query_text_data/workflow.py index 64063a50..c3ead2d7 100644 --- a/app/workflows/query_text_data/workflow.py +++ b/app/workflows/query_text_data/workflow.py @@ -22,6 +22,7 @@ AnswerConfig, ChunkSearchConfig, ) +from intelligence_toolkit.AI.classes import LLMCallback sv_home = SessionVariables("home") ai_configuration = UIOpenAIConfiguration().get_configuration() @@ -182,68 +183,74 @@ async def create(sv: SessionVariables, workflow=None): st.warning(f"Process files to continue.") else: with st.expander("Options", expanded=False): - cl, cr = st.columns([5, 2]) - with cl: - st.markdown("**Search options**") - c1, c2, c3, c4, c5 = st.columns(5) - with c1: - st.number_input( - "Relevance test budget", - value=sv.relevance_test_budget.value, - key=sv.relevance_test_budget.key, - min_value=0, - help="The query method works by asking an LLM to evaluate the relevance of potentially-relevant text chunks, returning a single token, yes/no judgement. This parameter allows the user to cap the number of relvance tests that may be performed prior to generating an answer using all relevant chunks. Larger budgets will generally give better answers for a greater cost." - ) - with c2: - st.number_input( - "Tests/topic/round", - value=sv.relevance_test_batch_size.value, - key=sv.relevance_test_batch_size.key, - min_value=0, - help="How many relevant tests to perform for each topic in each round. Larger values reduce the likelihood of prematurely discarding topics whose relevant chunks may not be at the top of the similarity-based ranking, but may result in smaller values of `Relevance test budget` being spread across fewer topics and thus not capturing the full breadth of the data." - ) - with c3: - st.number_input( - "Restart on irrelevant topics", - value=sv.irrelevant_community_restart.value, - key=sv.irrelevant_community_restart.key, - min_value=0, - help="When this number of topics in a row fail to return any relevant chunks in their `Tests/topic/round`, return to the start of the topic ranking and continue testing `Tests/topic/round` text chunks from each topic with (a) relevance in the previous round and (b) previously untested text chunks. Higher values can avoid prematurely discarding topics that are relevant but whose relevant chunks are not at the top of the similarity-based ranking, but may result in a larger number of irrelevant topics being tested multiple times." - ) - with c4: - st.number_input( - "Test relevant neighbours", - value=sv.adjacent_test_steps.value, - key=sv.adjacent_test_steps.key, - min_value=0, - help="If a text chunk is relevant to the query, then adjacent text chunks in the original document may be able to add additional context to the relevant points. The value of this parameter determines how many chunks before and after each relevant text chunk will be evaluated at the end of the process (or `Relevance test budget`) if they are yet to be tested." - ) - with c5: - st.number_input( - "Target chunks per cluster", - value=sv.target_chunks_per_cluster.value, - key=sv.target_chunks_per_cluster.key, - min_value=0, - help="The average number of text chunks to target per cluster, which determines the text chunks that will be evaluated together and in parallel to other clusters. Larger values will generally result in more related text chunks being evaluated in parallel, but may also result in information loss from unprocessed content." - ) - with cr: - st.markdown("**Answer options**") - c6, c7 = st.columns([1, 1]) - with c6: - st.radio( - label="Evidence type", - options=["Source text", "Extracted claims"], - key=sv.search_type.key, - help="If the evidence type is set to 'Source text', the system will generate an answer directly from the text chunks. If the search type is set to 'Extracted claims', the system will extract claims from the text chunks and generate an answer based on the extracted claims in addition to the source text.", - ) - with c7: - st.number_input( - "Claim search depth", - value=sv.claim_search_depth.value, - key=sv.claim_search_depth.key, - min_value=0, - help="If the evidence type is set to 'Extracted claims', this parameter sets the number of most-similar text chunks to analyze for each extracted claim, looking for both supporting and contradicting evidence." - ) + + st.markdown("**Search options**") + c1, c2, c3, c4, c5 = st.columns(5) + with c1: + st.number_input( + "Relevance test budget", + value=sv.relevance_test_budget.value, + key=sv.relevance_test_budget.key, + min_value=0, + help="The query method works by asking an LLM to evaluate the relevance of potentially-relevant text chunks, returning a single token, yes/no judgement. This parameter allows the user to cap the number of relvance tests that may be performed prior to generating an answer using all relevant chunks. Larger budgets will generally give better answers for a greater cost." + ) + with c2: + st.number_input( + "Tests/topic/round", + value=sv.relevance_test_batch_size.value, + key=sv.relevance_test_batch_size.key, + min_value=0, + help="How many relevant tests to perform for each topic in each round. Larger values reduce the likelihood of prematurely discarding topics whose relevant chunks may not be at the top of the similarity-based ranking, but may result in smaller values of `Relevance test budget` being spread across fewer topics and thus not capturing the full breadth of the data." + ) + with c3: + st.number_input( + "Restart on irrelevant topics", + value=sv.irrelevant_community_restart.value, + key=sv.irrelevant_community_restart.key, + min_value=0, + help="When this number of topics in a row fail to return any relevant chunks in their `Tests/topic/round`, return to the start of the topic ranking and continue testing `Tests/topic/round` text chunks from each topic with (a) relevance in the previous round and (b) previously untested text chunks. Higher values can avoid prematurely discarding topics that are relevant but whose relevant chunks are not at the top of the similarity-based ranking, but may result in a larger number of irrelevant topics being tested multiple times." + ) + with c4: + st.number_input( + "Test relevant neighbours", + value=sv.adjacent_test_steps.value, + key=sv.adjacent_test_steps.key, + min_value=0, + help="If a text chunk is relevant to the query, then adjacent text chunks in the original document may be able to add additional context to the relevant points. The value of this parameter determines how many chunks before and after each relevant text chunk will be evaluated at the end of the process (or `Relevance test budget`) if they are yet to be tested." + ) + with c5: + st.number_input( + "Target chunks per cluster", + value=sv.target_chunks_per_cluster.value, + key=sv.target_chunks_per_cluster.key, + min_value=0, + help="The average number of text chunks to target per cluster, which determines the text chunks that will be evaluated together and in parallel to other clusters. Larger values will generally result in more related text chunks being evaluated in parallel, but may also result in information loss from unprocessed content." + ) + + st.markdown("**Answer options**") + c6, c7, c8 = st.columns([1, 1, 1]) + with c6: + st.radio( + label="Evidence type", + options=["Source text", "Extracted claims"], + key=sv.search_type.key, + help="If the evidence type is set to 'Source text', the system will generate an answer directly from the text chunks. If the search type is set to 'Extracted claims', the system will extract claims from the text chunks and generate an answer based on the extracted claims in addition to the source text.", + ) + with c7: + st.number_input( + "Claim search depth", + value=sv.claim_search_depth.value, + key=sv.claim_search_depth.key, + min_value=0, + help="If the evidence type is set to 'Extracted claims', this parameter sets the number of most-similar text chunks to analyze for each extracted claim, looking for both supporting and contradicting evidence." + ) + with c8: + st.checkbox( + "Show search process", + key=sv.show_search_process.key, + value=sv.show_search_process.value, + help="Show the search process in the UI, including the progress of chunk relevance tests and the search for relevant chunks." + ) query_panel = st.container() main_panel = st.container() @@ -251,30 +258,32 @@ async def create(sv: SessionVariables, workflow=None): query_placeholder = st.empty() with main_panel: anchored_query_placeholder = st.empty() - c1, c2 = st.columns([1, 1]) - - with c1: - chunk_placeholder = st.empty() - chunk_placeholder.dataframe( - pd.DataFrame( - columns=["Relevant text chunks (double click to expand)"], - data=[qtd.processed_chunks.cid_to_text[x] for x in qtd.relevant_cids] if qtd.relevant_cids != None else [], - ), - hide_index=True, - height=400, - use_container_width=True, - ) - chunk_progress_placeholder = st.empty() - answer_summary_placeholder = st.empty() - def empty_answer_placeholders(): - qtd.prepare_for_new_answer() - answer_placeholder.markdown("") - answer_summary_placeholder.markdown("") + if sv.show_search_process.value: + c1, c2 = st.columns([1, 1]) + with c1: + chunk_placeholder = st.empty() + chunk_placeholder.dataframe( + pd.DataFrame( + columns=["Relevant text chunks (double click to expand)"], + data=[qtd.processed_chunks.cid_to_text[x] for x in qtd.relevant_cids] if qtd.relevant_cids != None else [], + ), + hide_index=True, + height=400, + use_container_width=True, + ) + chunk_progress_placeholder = st.empty() + answer_summary_placeholder = st.empty() + def empty_answer_placeholders(): + qtd.prepare_for_new_answer() + answer_placeholder.markdown("") + answer_summary_placeholder.markdown("") - if qtd.search_summary is not None: - chunk_progress_placeholder.markdown(qtd.search_summary, unsafe_allow_html=True) + if qtd.search_summary is not None: + chunk_progress_placeholder.markdown(qtd.search_summary, unsafe_allow_html=True) + else: + c2 = st.empty() if sv.anchored_query.value != "": - anchored_query_placeholder.markdown(f"**Expanded query:** {sv.anchored_query.value}") + anchored_query_placeholder.markdown(f"**Expanded query:** {sv.anchored_query.value}") with c2: if qtd.stage.value >= QueryTextDataStage.CHUNKS_MINED.value: ca, cb = st.columns([1, 1]) @@ -296,24 +305,25 @@ def empty_answer_placeholders(): disabled=qtd.stage.value < QueryTextDataStage.QUESTION_ANSWERED.value, ) answer_spinner = st.empty() + commentary_placeholder = st.empty() answer_placeholder = st.empty() if qtd.stage.value == QueryTextDataStage.QUESTION_ANSWERED.value: answer_placeholder.markdown(qtd.answer_object.extended_answer, unsafe_allow_html=True) answer_summary_placeholder.markdown(f'**Additional chunks relevant to extracted claims: {qtd.answer_object.net_new_sources}**\n\n**Chunks referenced in answer / total relevant chunks: {len(qtd.answer_object.references)}/{len(qtd.relevant_cids)+qtd.answer_object.net_new_sources}**', unsafe_allow_html=True) - def do_search(): - st.session_state["search_answers"] = True - sv.query.value = st.session_state[sv.query.key] - qtd.prepare_for_new_query() - sv.chunk_progress.value = "" - sv.answer_progress.value = "" - answer_placeholder.markdown("") - main_panel.empty() - query_placeholder.text_input( - "Query", - key=sv.query.key, - on_change=lambda: do_search() - ) + def do_search(): + st.session_state["search_answers"] = True + sv.query.value = st.session_state[sv.query.key] + qtd.prepare_for_new_query() + sv.chunk_progress.value = "" + sv.answer_progress.value = "" + answer_placeholder.markdown("") + main_panel.empty() + query_placeholder.text_input( + "Query", + key=sv.query.key, + on_change=lambda: do_search() + ) if sv.query.value != "" and st.session_state["search_answers"]: st.session_state["search_answers"] = False sv.anchored_query.value = await qtd.anchor_query_to_concepts( @@ -322,18 +332,26 @@ def do_search(): ) anchored_query_placeholder.markdown(f"**Expanded query:** {sv.anchored_query.value}") def on_chunk_progress(message): - chunk_progress_placeholder.markdown(message, unsafe_allow_html=True) + if sv.show_search_process.value: + chunk_progress_placeholder.markdown(message, unsafe_allow_html=True) def on_chunk_relevant(message): - chunk_placeholder.dataframe( - pd.DataFrame( - columns=["Relevant text chunks (double click to expand)"], - data=message, - ), - hide_index=True, - height=400, - use_container_width=True, - ) + if sv.show_search_process.value: + chunk_placeholder.dataframe( + pd.DataFrame( + columns=["Relevant text chunks (double click to expand)"], + data=message, + ), + hide_index=True, + height=400, + use_container_width=True, + ) + + commentary_callback = LLMCallback() + def on_llm_new_token(message): + commentary_placeholder.markdown(message, unsafe_allow_html=True) + commentary_callback.on_llm_new_token = on_llm_new_token + await qtd.detect_relevant_text_chunks( query=sv.query.value, expanded_query=sv.anchored_query.value, @@ -347,6 +365,7 @@ def on_chunk_relevant(message): ), chunk_progress_callback=on_chunk_progress, chunk_callback=on_chunk_relevant, + commentary_callback=commentary_callback, ) st.rerun() if gen_answer or qtd.stage.value == QueryTextDataStage.CHUNKS_MINED.value: diff --git a/intelligence_toolkit/AI/client.py b/intelligence_toolkit/AI/client.py index acf8cb65..8c4ca876 100644 --- a/intelligence_toolkit/AI/client.py +++ b/intelligence_toolkit/AI/client.py @@ -80,6 +80,7 @@ def generate_chat( messages: list[str], stream: bool = True, callbacks: list[LLMCallback] | None = None, + prefix: str = "", **kwargs, ): try: @@ -108,7 +109,7 @@ def generate_chat( if delta is not None: full_response += delta if callbacks: - show = full_response + show = prefix + full_response if len(delta) > 0: show += "▌" for callback in callbacks: diff --git a/intelligence_toolkit/query_text_data/answer_schema.py b/intelligence_toolkit/query_text_data/answer_schema.py index 80c50ab3..803b820e 100644 --- a/intelligence_toolkit/query_text_data/answer_schema.py +++ b/intelligence_toolkit/query_text_data/answer_schema.py @@ -205,6 +205,61 @@ } } +thematic_update_format = { + "type": "json_schema", + "json_schema": { + "name": "thematic_analysis", + "strict": True, + "schema": { + "type": "object", + "properties": { + "updates": { + "type": "array", + "items": { + "type": "object", + "properties": { + "point_id": { + "type": "number" + }, + "point_title": { + "type": "string" + }, + "source_ids": { + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": ["point_id", "point_title", "source_ids"], + "additionalProperties": False, + } + }, + "themes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "theme_title": { + "type": "string" + }, + "point_ids": { + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": ["theme_title", "point_ids"], + "additionalProperties": False, + }, + } + }, + "required": ["updates", "themes"], + "additionalProperties": False, + } + } +} claim_requery_format = { "type": "json_schema", diff --git a/intelligence_toolkit/query_text_data/api.py b/intelligence_toolkit/query_text_data/api.py index 9f9b17c1..fd2bcf73 100644 --- a/intelligence_toolkit/query_text_data/api.py +++ b/intelligence_toolkit/query_text_data/api.py @@ -198,6 +198,7 @@ async def detect_relevant_text_chunks( chunk_search_config: ChunkSearchConfig, chunk_progress_callback=None, chunk_callback=None, + commentary_callback=None, ) -> tuple[list[int], str]: """ Detect relevant text chunks. @@ -227,6 +228,7 @@ async def detect_relevant_text_chunks( chunk_search_config=self.chunk_search_config, chunk_progress_callback=chunk_progress_callback, chunk_callback=chunk_callback, + commentary_callback=commentary_callback, ) self.stage = QueryTextDataStage.CHUNKS_MINED return self.relevant_cids, self.search_summary diff --git a/intelligence_toolkit/query_text_data/commentary.py b/intelligence_toolkit/query_text_data/commentary.py new file mode 100644 index 00000000..6bb9946e --- /dev/null +++ b/intelligence_toolkit/query_text_data/commentary.py @@ -0,0 +1,60 @@ + +import intelligence_toolkit.AI.utils as utils +import intelligence_toolkit.query_text_data.prompts as prompts +import intelligence_toolkit.query_text_data.answer_schema as answer_schema +from intelligence_toolkit.AI.client import OpenAIClient +from json import loads, dumps + +class Commentary: + + def __init__(self, ai_configuration, query, callback): + self.ai_configuration = ai_configuration + self.query = query + self.callback = callback + self.structure = { + "points": {}, + "point_sources": {}, + "themes": {}, + } + + def update_commentary(self, chunks: dict[int, str]): + messages = utils.prepare_messages( + prompts.thematic_update_prompt, {"sources": "\n\n".join([f"{k}:\n\n{v}" for k, v in chunks.items()]), "query": self.query, "structure": dumps(self.structure, indent=2)} + ) + callbacks = [self.callback] if self.callback is not None else [] + updates = OpenAIClient(self.ai_configuration).generate_chat( + messages, + stream=False, + response_format=answer_schema.thematic_update_format, + callbacks=callbacks + ) + update_obj = loads(updates) + for u in update_obj["updates"]: + point_id = u["point_id"] + point_title = u["point_title"] + source_ids = u["source_ids"] + if point_id not in self.structure["points"]: + self.structure["points"][point_id] = point_title + if point_title != "": + self.structure["points"][point_id] = point_title + if point_id not in self.structure["point_sources"]: + self.structure["point_sources"][point_id] = [] + for s in source_ids: + if s not in self.structure["point_sources"][point_id]: + self.structure["point_sources"][point_id].append(s) + for t in update_obj["themes"]: + theme_title = t["theme_title"] + point_ids = t["point_ids"] + self.structure["themes"][theme_title] = point_ids + print(dumps(self.structure, indent=2)) + for callback in callbacks: + callback.on_llm_new_token(self.format_structure()) + + def format_structure(self): + output = "" + for theme_title, point_ids in self.structure["themes"].items(): + output += f"- **{theme_title}**\n" + for point_id in point_ids: + source_list = ", ".join([str(x) for x in self.structure["point_sources"][point_id]]) + output += f" - {self.structure['points'][point_id]} (sources: {source_list})\n" + return output \ No newline at end of file diff --git a/intelligence_toolkit/query_text_data/pattern_detector.py b/intelligence_toolkit/query_text_data/pattern_detector.py index 8474a74b..cee8df11 100644 --- a/intelligence_toolkit/query_text_data/pattern_detector.py +++ b/intelligence_toolkit/query_text_data/pattern_detector.py @@ -114,7 +114,7 @@ def explain_chunk_significance( return cid_to_summary -def combine_chunk_text_and_explantion(cid_to_text, cid_to_summary): +def combine_chunk_text_and_explanation(cid_to_text, cid_to_summary): cid_to_explained_text = {} for cid, text in cid_to_text.items(): summary = cid_to_summary[cid] if cid in cid_to_summary else "" diff --git a/intelligence_toolkit/query_text_data/prompts.py b/intelligence_toolkit/query_text_data/prompts.py index 57f48e7e..dd083b22 100644 --- a/intelligence_toolkit/query_text_data/prompts.py +++ b/intelligence_toolkit/query_text_data/prompts.py @@ -169,6 +169,78 @@ Output JSON object: """ +chunk_commentary_prompt = """\ +You are a helpful assistant providing a thematic analysis of an information stream with respect to a user query. + +---Task--- + +Output a nested thematic structure that organizes low-level titles of events/insights into higher-level themes. Each theme should be a concise, high-level summary of the events/insights that fall under it. + +Themes should clearly related to the user query and the new information provided. Each theme should contain at least one point. + +Example: + +- **Theme 1** + - Point 1 + - Point 2 +- **Theme 2** + - Point 3 + - Point 4 +- **Theme 3** + - Point 5 + - Point 6 + +---User query--- + +{query} + +---New information--- + +{information} + +---Existing thematic structure--- + +{commentary} + +---New thematic structure--- + +""" + +thematic_update_prompt = """\ +You are a helpful assistant tasked with creating a JSON object that updates a thematic organization of points relevant to a user query. + +The output object should capture new themes, points, and source references that should be added to or modify the existing thematic structure: + +- "updates": an array of objects, each representing an update to a point derived from the input text chunks +- "point_id": the ID of the point to update, else the next available point ID if creating a new point +- "point_title": the title of the point to update or create. If the existing point title is unchanged, the field should be left blank +- "source_ids": an array of source IDs that support the point, to be added to the existing source IDs for the point +- "theme_title": the title of a theme that organizes a set of related points. + +--Rules-- + +- Each point MUST be sufficiently detailed to stand along without ambiguity +- If a source relates to an existing point, the source ID MUST be assigned to the existing point ID, rather than creating a new point +- If the addition of a source to a point warrants a change in point title, the point title MUST be updated +- Aim for 3-7 themes overall, with an even distribution of points across themes +- Points should be assigned to a single theme in a logical sequence that addresses the user query +- Order themes in a logical sequence that addresses the user query + +--User query-- + +{query} + +--Existing thematic structure-- + +{structure} + +--New sources by source ID-- + +{sources} + +--Output JSON object-- + +""" list_prompts = { "report_prompt": report_prompt, diff --git a/intelligence_toolkit/query_text_data/relevance_assessor.py b/intelligence_toolkit/query_text_data/relevance_assessor.py index 0e51e82b..702de336 100644 --- a/intelligence_toolkit/query_text_data/relevance_assessor.py +++ b/intelligence_toolkit/query_text_data/relevance_assessor.py @@ -10,7 +10,7 @@ import intelligence_toolkit.AI.utils as utils import intelligence_toolkit.query_text_data.helper_functions as helper_functions import intelligence_toolkit.query_text_data.prompts as prompts - +from intelligence_toolkit.query_text_data.commentary import Commentary async def assess_relevance( ai_configuration, @@ -25,6 +25,7 @@ async def assess_relevance( test_history, progress_callback, chunk_callback, + commentary ): batched_cids = [ search_cids[i : i + relevance_test_batch_size] @@ -61,6 +62,7 @@ async def assess_relevance( test_history, progress_callback, chunk_callback, + commentary, ) is_relevant = num_relevant > 0 if not is_relevant: # No relevant chunks found in this batch; terminate early @@ -76,6 +78,7 @@ def process_relevance_responses( test_history, progress_callback, chunk_callback, + commentary, ): num_relevant = 0 for r, c in zip(mapped_responses, search_cids): @@ -88,6 +91,10 @@ def process_relevance_responses( relevant_list = [x[1] for x in test_history if x[2] == "Yes"] if chunk_callback is not None: chunk_callback([cid_to_text[cid] for cid in relevant_list]) + + if commentary is not None: + relevant_texts = {cid: cid_to_text[cid] for cid in relevant_list} + commentary.update_commentary(relevant_texts) return num_relevant @@ -101,7 +108,9 @@ async def detect_relevant_chunks( chunk_search_config, chunk_progress_callback=None, chunk_callback=None, + commentary_callback=None, ): + commentary = Commentary(ai_configuration, query, commentary_callback) if commentary_callback is not None else None test_history = [] all_units = sorted( [(cid, vector) for cid, vector in (cid_to_vector.items())], key=lambda x: x[0] @@ -132,7 +141,7 @@ async def detect_relevant_chunks( reverse=False, ) semantic_search_cids = [x[0] for x in cosine_distances] - print(f"Top semantic search cids: {semantic_search_cids[:100]}") + # print(f"Top semantic search cids: {semantic_search_cids[:100]}") level_to_community_sequence = {} max_level = max([hc.level for hc in processed_chunks.hierarchical_communities]) concept_to_level_to_community = defaultdict(dict) @@ -184,7 +193,7 @@ async def detect_relevant_chunks( community_sequence = [ x[0] for x in sorted(community_mean_rank, key=lambda x: x[1]) ] - print(f"Level {level} community sequence: {community_sequence}") + # print(f"Level {level} community sequence: {community_sequence}") level_to_community_sequence[level] = community_sequence for cid in semantic_search_cids: @@ -214,7 +223,7 @@ async def detect_relevant_chunks( current_level = -1 while len(test_history) + len(adjacent) < chunk_search_config.relevance_test_budget: - print(f"New level {current_level} loop after {len(test_history)} tests") + # print(f"New level {current_level} loop after {len(test_history)} tests") relevant_this_loop = False community_sequence = [] @@ -225,10 +234,10 @@ async def detect_relevant_chunks( community_sequence.append(community) else: eliminated_communities.add(community) - print(f"Eliminated community {community} due to parent {parent}") + # print(f"Eliminated community {community} due to parent {parent}") else: community_sequence.append(community) - print(f"Community sequence: {community_sequence}") + # print(f"Community sequence: {community_sequence}") community_to_cids = level_to_community_to_cids[current_level] for community in community_sequence: relevant, seen, adjacent = helper_functions.test_history_elements( @@ -241,9 +250,9 @@ async def detect_relevant_chunks( : chunk_search_config.community_relevance_tests ] if len(unseen_cids) > 0: - print( - f"Assessing relevance for community {community} with chunks {unseen_cids}" - ) + # print( + # f"Assessing relevance for community {community} with chunks {unseen_cids}" + # ) is_relevant = await assess_relevance( ai_configuration=ai_configuration, search_label=f"topic {community}", @@ -257,9 +266,10 @@ async def detect_relevant_chunks( test_history=test_history, progress_callback=chunk_progress_callback, chunk_callback=chunk_callback, + commentary=commentary ) relevant_this_loop |= is_relevant - print(f"Community {community} relevant? {is_relevant}") + # print(f"Community {community} relevant? {is_relevant}") if ( current_level > -1 and not is_relevant ): # don't stop after failure at the root level @@ -269,9 +279,9 @@ async def detect_relevant_chunks( successive_irrelevant == chunk_search_config.irrelevant_community_restart ): - print( - f"{successive_irrelevant} successive irrelevant communities; restarting" - ) + # print( + # f"{successive_irrelevant} successive irrelevant communities; restarting" + # ) successive_irrelevant = 0 break else: @@ -279,13 +289,14 @@ async def detect_relevant_chunks( if ( current_level > -1 and not relevant_this_loop ): # don't stop after failure at the root level - print("Nothing relevant this loop") + # print("Nothing relevant this loop") break if current_level + 1 in level_to_community_sequence.keys(): - print("Incrementing level") + # print("Incrementing level") current_level += 1 else: - print("Reached final level") + # print("Reached final level") + pass relevant, seen, adjacent = helper_functions.test_history_elements( test_history, @@ -307,6 +318,7 @@ async def detect_relevant_chunks( test_history=test_history, progress_callback=chunk_progress_callback, chunk_callback=chunk_callback, + commentary=commentary ) relevant, seen, adjacent = helper_functions.test_history_elements( test_history, From 73840999133e3b0355fe9fca8f17d9bfdcf3cb10 Mon Sep 17 00:00:00 2001 From: Darren Edge Date: Thu, 9 Jan 2025 14:59:50 +0000 Subject: [PATCH 02/11] Live analysis updates --- app/workflows/query_text_data/variables.py | 4 +- app/workflows/query_text_data/workflow.py | 209 ++- .../query_text_data/example_format.json | 17 +- ...swer.md => news_articles_answer_report.md} | 0 ...ws_articles_extended_answer_from_claims.md | 1164 ----------------- ...xt.md => news_articles_research_report.md} | 0 .../query_text_data/answer_builder.py | 388 +----- .../query_text_data/answer_schema.py | 205 +-- intelligence_toolkit/query_text_data/api.py | 21 +- .../query_text_data/classes.py | 22 - .../query_text_data/commentary.py | 37 +- .../query_text_data/pattern_detector.py | 128 -- .../query_text_data/prompts.py | 129 +- .../query_text_data/relevance_assessor.py | 19 +- 14 files changed, 245 insertions(+), 2098 deletions(-) rename example_outputs/query_text_data/news_articles/{news_articles_condensed_answer.md => news_articles_answer_report.md} (100%) delete mode 100644 example_outputs/query_text_data/news_articles/news_articles_extended_answer_from_claims.md rename example_outputs/query_text_data/news_articles/{news_articles_extended_answer_from_text.md => news_articles_research_report.md} (100%) delete mode 100644 intelligence_toolkit/query_text_data/pattern_detector.py diff --git a/app/workflows/query_text_data/variables.py b/app/workflows/query_text_data/variables.py index 85430aef..6392a8b1 100644 --- a/app/workflows/query_text_data/variables.py +++ b/app/workflows/query_text_data/variables.py @@ -29,7 +29,7 @@ def create_session(self, prefix): self.adjacent_test_steps = SessionVariable(1, prefix) self.community_relevance_tests = SessionVariable(10, prefix) self.relevance_test_batch_size = SessionVariable(5, prefix) - self.relevance_test_budget = SessionVariable(100, prefix) + self.relevance_test_budget = SessionVariable(10, prefix) self.irrelevant_community_restart = SessionVariable(5, prefix) self.report_validation_messages = SessionVariable("", prefix) self.report_validation = SessionVariable({}, prefix) @@ -37,6 +37,8 @@ def create_session(self, prefix): self.chunk_progress = SessionVariable("", prefix) self.answer_progress = SessionVariable("", prefix) self.show_search_process = SessionVariable(False, prefix) + self.thematic_analysis = SessionVariable("", prefix) + self.thematic_commentary = SessionVariable("", prefix) def reset_workflow(self): for key in st.session_state: diff --git a/app/workflows/query_text_data/workflow.py b/app/workflows/query_text_data/workflow.py index c3ead2d7..dc1e3095 100644 --- a/app/workflows/query_text_data/workflow.py +++ b/app/workflows/query_text_data/workflow.py @@ -19,7 +19,6 @@ from intelligence_toolkit.AI.defaults import CHUNK_SIZE from intelligence_toolkit.query_text_data.api import QueryTextDataStage from intelligence_toolkit.query_text_data.classes import ( - AnswerConfig, ChunkSearchConfig, ) from intelligence_toolkit.AI.classes import LLMCallback @@ -46,7 +45,7 @@ async def create(sv: SessionVariables, workflow=None): "Query Text Data workflow:", "Prepare data", "Explore concept graph", - "Generate AI extended answer", + "Generate AI research report", "Generate AI answer reports", "View example outputs" ] @@ -182,19 +181,10 @@ async def create(sv: SessionVariables, workflow=None): if qtd.stage.value < QueryTextDataStage.CHUNKS_EMBEDDED.value: st.warning(f"Process files to continue.") else: - with st.expander("Options", expanded=False): - - st.markdown("**Search options**") + with st.expander("Advanced Options", expanded=False): c1, c2, c3, c4, c5 = st.columns(5) + with c1: - st.number_input( - "Relevance test budget", - value=sv.relevance_test_budget.value, - key=sv.relevance_test_budget.key, - min_value=0, - help="The query method works by asking an LLM to evaluate the relevance of potentially-relevant text chunks, returning a single token, yes/no judgement. This parameter allows the user to cap the number of relvance tests that may be performed prior to generating an answer using all relevant chunks. Larger budgets will generally give better answers for a greater cost." - ) - with c2: st.number_input( "Tests/topic/round", value=sv.relevance_test_batch_size.value, @@ -202,7 +192,7 @@ async def create(sv: SessionVariables, workflow=None): min_value=0, help="How many relevant tests to perform for each topic in each round. Larger values reduce the likelihood of prematurely discarding topics whose relevant chunks may not be at the top of the similarity-based ranking, but may result in smaller values of `Relevance test budget` being spread across fewer topics and thus not capturing the full breadth of the data." ) - with c3: + with c2: st.number_input( "Restart on irrelevant topics", value=sv.irrelevant_community_restart.value, @@ -210,7 +200,7 @@ async def create(sv: SessionVariables, workflow=None): min_value=0, help="When this number of topics in a row fail to return any relevant chunks in their `Tests/topic/round`, return to the start of the topic ranking and continue testing `Tests/topic/round` text chunks from each topic with (a) relevance in the previous round and (b) previously untested text chunks. Higher values can avoid prematurely discarding topics that are relevant but whose relevant chunks are not at the top of the similarity-based ranking, but may result in a larger number of irrelevant topics being tested multiple times." ) - with c4: + with c3: st.number_input( "Test relevant neighbours", value=sv.adjacent_test_steps.value, @@ -218,7 +208,7 @@ async def create(sv: SessionVariables, workflow=None): min_value=0, help="If a text chunk is relevant to the query, then adjacent text chunks in the original document may be able to add additional context to the relevant points. The value of this parameter determines how many chunks before and after each relevant text chunk will be evaluated at the end of the process (or `Relevance test budget`) if they are yet to be tested." ) - with c5: + with c4: st.number_input( "Target chunks per cluster", value=sv.target_chunks_per_cluster.value, @@ -226,25 +216,7 @@ async def create(sv: SessionVariables, workflow=None): min_value=0, help="The average number of text chunks to target per cluster, which determines the text chunks that will be evaluated together and in parallel to other clusters. Larger values will generally result in more related text chunks being evaluated in parallel, but may also result in information loss from unprocessed content." ) - - st.markdown("**Answer options**") - c6, c7, c8 = st.columns([1, 1, 1]) - with c6: - st.radio( - label="Evidence type", - options=["Source text", "Extracted claims"], - key=sv.search_type.key, - help="If the evidence type is set to 'Source text', the system will generate an answer directly from the text chunks. If the search type is set to 'Extracted claims', the system will extract claims from the text chunks and generate an answer based on the extracted claims in addition to the source text.", - ) - with c7: - st.number_input( - "Claim search depth", - value=sv.claim_search_depth.value, - key=sv.claim_search_depth.key, - min_value=0, - help="If the evidence type is set to 'Extracted claims', this parameter sets the number of most-similar text chunks to analyze for each extracted claim, looking for both supporting and contradicting evidence." - ) - with c8: + with c5: st.checkbox( "Show search process", key=sv.show_search_process.key, @@ -255,11 +227,15 @@ async def create(sv: SessionVariables, workflow=None): main_panel = st.container() with query_panel: - query_placeholder = st.empty() - with main_panel: + c1, c2 = st.columns([5, 1]) + with c1: + query_placeholder = st.empty() + with c2: + budget_placeholder = st.empty() anchored_query_placeholder = st.empty() + with main_panel: if sv.show_search_process.value: - c1, c2 = st.columns([1, 1]) + c1, c2 = st.columns([1, 2]) with c1: chunk_placeholder = st.empty() chunk_placeholder.dataframe( @@ -272,45 +248,38 @@ async def create(sv: SessionVariables, workflow=None): use_container_width=True, ) chunk_progress_placeholder = st.empty() - answer_summary_placeholder = st.empty() - def empty_answer_placeholders(): - qtd.prepare_for_new_answer() - answer_placeholder.markdown("") - answer_summary_placeholder.markdown("") - if qtd.search_summary is not None: chunk_progress_placeholder.markdown(qtd.search_summary, unsafe_allow_html=True) else: - c2 = st.empty() + c2 = st.container() if sv.anchored_query.value != "": anchored_query_placeholder.markdown(f"**Expanded query:** {sv.anchored_query.value}") with c2: - if qtd.stage.value >= QueryTextDataStage.CHUNKS_MINED.value: - ca, cb = st.columns([1, 1]) - with ca: - gen_answer = st.button( - "Regenerate AI extended answer", - key="generate_answer", - disabled=qtd.stage.value < QueryTextDataStage.QUESTION_ANSWERED.value, - on_click=lambda: empty_answer_placeholders(), - ) - with cb: - + c1, c2 = st.columns([1, 1]) + with c1: + st.markdown("#### Live analysis") + analysis_placeholder = st.empty() + commentary_placeholder = st.empty() + with c2: + + + st.markdown("#### Final report") + answer_spinner = st.empty() + answer_placeholder = st.empty() + if qtd.stage.value >= QueryTextDataStage.CHUNKS_MINED.value: st.download_button( - "Download extended answer as MD", + "Download research report as MD", data=qtd.answer_object.extended_answer if qtd.answer_object is not None else "", file_name=re.sub(r'[^\w\s]','',sv.query.value).replace(' ', '_')+".md", mime="text/markdown", - key="extended_answer_download_button", + key="research_report_download_button", disabled=qtd.stage.value < QueryTextDataStage.QUESTION_ANSWERED.value, ) - answer_spinner = st.empty() - commentary_placeholder = st.empty() - answer_placeholder = st.empty() + analysis_placeholder.markdown(sv.thematic_analysis.value, unsafe_allow_html=True) + commentary_placeholder.markdown(sv.thematic_commentary.value, unsafe_allow_html=True) + if qtd.stage.value == QueryTextDataStage.QUESTION_ANSWERED.value: + answer_placeholder.markdown(qtd.answer_object.extended_answer, unsafe_allow_html=True) - if qtd.stage.value == QueryTextDataStage.QUESTION_ANSWERED.value: - answer_placeholder.markdown(qtd.answer_object.extended_answer, unsafe_allow_html=True) - answer_summary_placeholder.markdown(f'**Additional chunks relevant to extracted claims: {qtd.answer_object.net_new_sources}**\n\n**Chunks referenced in answer / total relevant chunks: {len(qtd.answer_object.references)}/{len(qtd.relevant_cids)+qtd.answer_object.net_new_sources}**', unsafe_allow_html=True) def do_search(): st.session_state["search_answers"] = True sv.query.value = st.session_state[sv.query.key] @@ -324,64 +293,74 @@ def do_search(): key=sv.query.key, on_change=lambda: do_search() ) - if sv.query.value != "" and st.session_state["search_answers"]: - st.session_state["search_answers"] = False - sv.anchored_query.value = await qtd.anchor_query_to_concepts( - query=sv.query.value, - top_concepts=500, - ) - anchored_query_placeholder.markdown(f"**Expanded query:** {sv.anchored_query.value}") - def on_chunk_progress(message): - if sv.show_search_process.value: - chunk_progress_placeholder.markdown(message, unsafe_allow_html=True) - - def on_chunk_relevant(message): - if sv.show_search_process.value: - chunk_placeholder.dataframe( - pd.DataFrame( - columns=["Relevant text chunks (double click to expand)"], - data=message, - ), - hide_index=True, - height=400, - use_container_width=True, + budget_placeholder.number_input( + "Relevance test budget", + value=sv.relevance_test_budget.value, + key=sv.relevance_test_budget.key, + min_value=0, + help="The query method works by asking an LLM to evaluate the relevance of potentially-relevant text chunks, returning a single token, yes/no judgement. This parameter allows the user to cap the number of relvance tests that may be performed prior to generating an answer using all relevant chunks. Larger budgets will generally give better answers for a greater cost." + ) + if sv.query.value != "" and st.session_state["search_answers"]: + st.session_state["search_answers"] = False + sv.anchored_query.value = await qtd.anchor_query_to_concepts( + query=sv.query.value, + top_concepts=500, ) + anchored_query_placeholder.markdown(f"**Expanded query:** {sv.anchored_query.value}") + def on_chunk_progress(message): + if sv.show_search_process.value: + chunk_progress_placeholder.markdown(message, unsafe_allow_html=True) - commentary_callback = LLMCallback() - def on_llm_new_token(message): - commentary_placeholder.markdown(message, unsafe_allow_html=True) - commentary_callback.on_llm_new_token = on_llm_new_token + def on_chunk_relevant(message): + if sv.show_search_process.value: + chunk_placeholder.dataframe( + pd.DataFrame( + columns=["Relevant text chunks (double click to expand)"], + data=message, + ), + hide_index=True, + height=400, + use_container_width=True, + ) - await qtd.detect_relevant_text_chunks( - query=sv.query.value, - expanded_query=sv.anchored_query.value, - chunk_search_config=ChunkSearchConfig( - relevance_test_budget=sv.relevance_test_budget.value, - relevance_test_batch_size=sv.relevance_test_batch_size.value, - community_ranking_chunks=sv.relevance_test_batch_size.value, - irrelevant_community_restart=sv.irrelevant_community_restart.value, - adjacent_test_steps=sv.adjacent_test_steps.value, - community_relevance_tests=sv.relevance_test_batch_size.value, - ), - chunk_progress_callback=on_chunk_progress, - chunk_callback=on_chunk_relevant, - commentary_callback=commentary_callback, - ) - st.rerun() - if gen_answer or qtd.stage.value == QueryTextDataStage.CHUNKS_MINED.value: - with answer_spinner: - with st.spinner("Generating extended answer..."): - await qtd.answer_query_with_relevant_chunks( - answer_config=AnswerConfig( - target_chunks_per_cluster=sv.target_chunks_per_cluster.value, - extract_claims=sv.search_type.value == "Extracted claims", - claim_search_depth=sv.claim_search_depth.value - ) + analysis_callback = LLMCallback() + def on_llm_new_token_analysis(message): + analysis_placeholder.markdown(message, unsafe_allow_html=True) + sv.thematic_analysis.value = message + analysis_callback.on_llm_new_token = on_llm_new_token_analysis + + commentary_callback = LLMCallback() + def on_llm_new_token_commentary(message): + commentary_placeholder.markdown(message, unsafe_allow_html=True) + sv.thematic_commentary.value = message + commentary_callback.on_llm_new_token = on_llm_new_token_commentary + + await qtd.detect_relevant_text_chunks( + query=sv.query.value, + expanded_query=sv.anchored_query.value, + chunk_search_config=ChunkSearchConfig( + relevance_test_budget=sv.relevance_test_budget.value, + relevance_test_batch_size=sv.relevance_test_batch_size.value, + community_ranking_chunks=sv.relevance_test_batch_size.value, + irrelevant_community_restart=sv.irrelevant_community_restart.value, + adjacent_test_steps=sv.adjacent_test_steps.value, + community_relevance_tests=sv.relevance_test_batch_size.value, + ), + chunk_progress_callback=on_chunk_progress, + chunk_callback=on_chunk_relevant, + analysis_callback=analysis_callback, + commentary_callback=commentary_callback, ) st.rerun() + if gen_answer or qtd.stage.value == QueryTextDataStage.CHUNKS_MINED.value: + with answer_spinner: + with st.spinner("Generating research report..."): + await qtd.generate_analysis_commentary() + await qtd.answer_query_with_relevant_chunks() + st.rerun() with report_tab: if qtd.stage.value < QueryTextDataStage.QUESTION_ANSWERED.value: - st.warning("Generate an extended answer to continue.") + st.warning("Generate a research report to continue.") else: c1, c2 = st.columns([2, 3]) diff --git a/example_outputs/query_text_data/example_format.json b/example_outputs/query_text_data/example_format.json index f8c4b224..9ea17a08 100644 --- a/example_outputs/query_text_data/example_format.json +++ b/example_outputs/query_text_data/example_format.json @@ -1,25 +1,20 @@ { - "example_order" : ["texts", "extended_answer_from_text", "extended_answer_from_claims", "condensed_answer"], + "example_order" : ["texts", "research_report", "answer_report"], "example_metadata" : { "texts": { "type": "csv", "heading": "Input texts", "description": "Input texts to be queried" }, - "extended_answer_from_text": { + "research_report": { "type": "md", - "heading": "Extended answer (relevant chunks only)", + "heading": "Research report", "description": "An extended answer to a user query generated using multiple generative AI calls, first to detect relevant text chunks and then to generate an answer" }, - "extended_answer_from_claims": { + "answer_report": { "type": "md", - "heading": "Extended answer (with claim analysis)", - "description": "An extended answer to a user query generated using multiple generative AI calls, first to detect relevant text chunks, then to extract relevant claims, then to query again for each claim, and finally to generate an answer from both the claims and the original text chunks" - }, - "condensed_answer": { - "type": "md", - "heading": "Condensed answer", - "description": "A condensed answer to a user query using a single generative AI call to summarize the extended answer" + "heading": "Answer report", + "description": "A condensed answer to a user query using a single generative AI call to summarize the research report" } } } \ No newline at end of file diff --git a/example_outputs/query_text_data/news_articles/news_articles_condensed_answer.md b/example_outputs/query_text_data/news_articles/news_articles_answer_report.md similarity index 100% rename from example_outputs/query_text_data/news_articles/news_articles_condensed_answer.md rename to example_outputs/query_text_data/news_articles/news_articles_answer_report.md diff --git a/example_outputs/query_text_data/news_articles/news_articles_extended_answer_from_claims.md b/example_outputs/query_text_data/news_articles/news_articles_extended_answer_from_claims.md deleted file mode 100644 index 22cee314..00000000 --- a/example_outputs/query_text_data/news_articles/news_articles_extended_answer_from_claims.md +++ /dev/null @@ -1,1164 +0,0 @@ -# Report - -## Query - -*What are the main political events discussed?* - -## Expanded Query - -*What are the main political events discussed, including significant gatherings, geopolitical tensions, international diplomacy, economic policies, and key issues addressed by world leaders and political analysts?* - -## Answer - -The main political events discussed include India's collaboration with the IMF and World Bank to shape economic policies, the Vienna Summit on EU trade agreements, the UN Conference on Human Rights in Cairo, peace talks in Geneva, Ambassador Rachel Kim's advocacy for diplomatic ties at the UN, diplomatic talks and a climate summit in Geneva, debates on education reform in Capital City, re-election campaigns focusing on healthcare and education reforms by various politicians, President Lin Wei's advocacy for regional cooperation at the Asian Economic Forum, and various climate summits held globally to address climate change challenges. - -## Analysis - -### Key Political Events and International Collaborations in 2023 - -The report covers a range of significant political events and international collaborations that took place in 2023. These include India's strategic engagement with the IMF and World Bank, the Vienna Summit on EU trade agreements, the UN Conference on Human Rights in Cairo, and peace talks in Geneva. Additionally, the report highlights Ambassador Rachel Kim's advocacy for strengthened diplomatic ties, diplomatic talks and a climate summit in Geneva, and debates on education reform. It also discusses re-election campaigns focusing on healthcare and education reforms, President Lin Wei's advocacy for regional cooperation, and various global climate summits. - -#### Theme: India's Strategic Economic Collaborations - -India's engagement with the IMF and World Bank highlights its strategic efforts to shape economic policies and address challenges such as inflation and employment. These collaborations are part of India's commitment to fostering economic stability and growth through international partnerships. - -##### India and IMF Collaborate on Economic Growth Strategies - -**Source evidence**: On August 1, 2023, India's Finance Minister Raj Patel met with representatives from the International Monetary Fund (IMF) in Delhi to discuss new economic policies aimed at bolstering India's growth and integrating robust economic strategies [source: [15](#source-15), [200](#source-200), [201](#source-201), [203](#source-203)]. The discussions are part of ongoing efforts to address and refine key economic strategies crucial for maintaining India's economic health and growth [source: [200](#source-200)]. The collaboration involves crafting strategic policy frameworks to stimulate robust economic growth, with a focus on sustainable growth benefiting all sectors of society [source: [201](#source-201)]. The IMF is expected to provide insights and recommendations to streamline India's financial frameworks and enhance productivity [source: [15](#source-15)]. Further meetings are anticipated to refine the proposed policy frameworks and ensure their effective implementation [source: [201](#source-201)]. - -**AI commentary**: The collaboration between India and the IMF signifies a strategic partnership aimed at enhancing India's economic resilience and growth potential. The involvement of high-level discussions and the focus on sustainable growth indicate a comprehensive approach to economic policy-making. The IMF's role in providing guidance and support highlights the importance of international cooperation in addressing economic challenges. This partnership could lead to significant reforms and investments that bolster India's economic stability and growth prospects. The ongoing nature of these discussions suggests a long-term commitment to refining and implementing effective economic strategies. - -##### India's Strategic Engagement with IMF and World Bank to Shape Economic Policies - -**Source evidence**: On August 5, 2023, a significant roundtable discussion was held in Delhi, attended by representatives from the International Monetary Fund (IMF) and the World Bank, focusing on India's future economic policies. The discussions covered fiscal strategies, monetary policies, and structural reforms necessary for India's growth. Deputy Finance Minister Neha Singh emphasized the importance of collaboration with these global financial institutions to address economic challenges such as inflation and employment. The meeting concluded with a consensus on the need for continued dialogue and cooperation, highlighting India's commitment to engaging with the global community to foster economic stability and growth [source: [202](#source-202)]. - -**AI commentary**: The roundtable discussion in Delhi underscores India's proactive approach in engaging with international financial institutions to shape its economic policies. The involvement of high-level representatives from the IMF and the World Bank suggests a strong international interest in India's economic trajectory. This collaboration could provide India with valuable insights and resources to address its economic challenges, potentially influencing its policy decisions significantly. The emphasis on continued dialogue indicates a long-term strategic partnership, which could enhance India's role in the global economic landscape. - -##### AI theme commentary - -India's collaboration with the IMF and World Bank underscores its proactive approach to economic policy-making. By engaging with these global financial institutions, India aims to address key economic challenges and enhance its growth prospects. This strategic partnership reflects India's commitment to integrating with the global economy and leveraging international expertise to refine its economic strategies. - -#### Theme: International Diplomatic Efforts and Summits - -Several international diplomatic efforts and summits took place in 2023, focusing on trade agreements, human rights, peace talks, and climate change. These events highlight the global commitment to addressing pressing international issues through dialogue and cooperation. - -##### Vienna Summit 2022: A Diplomatic Effort to Shape EU Trade Agreements - -**Source evidence**: The Vienna Summit, held on November 28, 2022, was a significant diplomatic event focused on discussing critical trade agreements that could influence the economic landscape of the European Union for years to come [source: [31](#source-31)]. The summit aimed to foster collaboration among EU member states and explore ways to enhance trade relations, with the EU Council playing a leading role [source: [31](#source-31)]. Ambassador John Smith, a key speaker, emphasized the importance of constructive dialogue and cooperation to establish mutually beneficial agreements [source: [31](#source-31)]. The event included numerous diplomats and economic experts who addressed issues such as tariffs, market access, and regulatory standards [source: [31](#source-31)]. Participants expressed optimism about the progress made, anticipating that the summit's outcomes would impact EU policy decisions and trade strategies [source: [31](#source-31)]. - -**AI commentary**: The Vienna Summit appears to have been a pivotal moment for the European Union in terms of trade diplomacy. The focus on critical trade agreements suggests a strategic effort to strengthen economic ties within the EU and potentially with external partners. The involvement of high-profile diplomats and experts indicates the importance of the issues discussed, such as tariffs and regulatory standards, which are crucial for smooth international trade. The optimism expressed by participants could signal a positive shift in EU trade policies, potentially leading to more robust economic growth and stability in the region. The outcomes of this summit may serve as a foundation for future trade negotiations and policy-making within the EU. - -##### UN Conference on Human Rights in Cairo Focuses on Global Human Rights Issues - -**Source evidence**: The UN Conference on Human Rights began in Cairo on October 11, 2022, with a focus on advancing human rights and addressing key issues such as freedom of expression and the rights of marginalized communities [source: [56](#source-56)]. The conference was organized by the United Nations as part of its ongoing commitment to human rights, drawing delegates from numerous countries and organizations [source: [56](#source-56)]. Fatima Ali, a prominent human rights advocate, highlighted the conference as a critical opportunity to address pressing challenges and collaborate on solutions [source: [56](#source-56)]. The agenda included discussions aimed at fostering international cooperation and producing actionable recommendations [source: [56](#source-56)]. - -**AI commentary**: The UN Conference on Human Rights in Cairo represents a significant international effort to address and advance human rights issues globally. The focus on topics such as freedom of expression and the rights of marginalized communities indicates a comprehensive approach to human rights challenges. The involvement of diverse international delegates and organizations suggests a strong commitment to fostering cooperation and solidarity. The conference's outcomes, particularly the actionable recommendations, could potentially influence global human rights policies and practices. - -##### Peace Talks in Geneva Aim to Address Regional Conflicts - -**Source evidence**: The peace talks in Geneva, scheduled for March 15, 2023, are a significant diplomatic effort to address and mediate escalating regional tensions. These talks are facilitated by the United Nations, which has been instrumental in organizing the event and bringing together representatives from conflicting nations in a neutral setting. Ambassador John Smith expressed optimism about the potential for these discussions to pave the way for sustainable peace and cooperation. The agenda includes addressing the root causes of conflicts, establishing ceasefires, and setting a framework for future cooperation. Geneva's historical role as a hub for international diplomacy underscores the importance of these discussions in the broader context of global peace efforts [source: [64](#source-64)]. - -**AI commentary**: The resumption of peace talks in Geneva highlights the ongoing commitment of the international community to resolve regional conflicts through dialogue and cooperation. The involvement of the United Nations and the choice of Geneva as the venue reflect the seriousness and neutrality required for such negotiations. The optimism expressed by diplomats like Ambassador John Smith suggests a hopeful outlook for achieving long-term stability. The focus on addressing root causes and establishing frameworks for cooperation indicates a comprehensive approach to conflict resolution. The outcomes of these talks could set important precedents for future diplomatic efforts in similar contexts. - -##### Ambassador Rachel Kim Advocates for Strengthened Diplomatic Ties at the UN - -**Source evidence**: On February 25, 2024, Ambassador Rachel Kim delivered a significant address at the United Nations Headquarters, emphasizing the critical need for robust communication channels between nations to effectively tackle global challenges such as climate change, economic instability, and security threats [source: [192](#source-192)]. Her speech underscored the importance of international cooperation in maintaining global stability and prosperity, advocating for enhanced diplomatic engagement and trust-building among nations [source: [192](#source-192)]. The Diplomatic Relations Council, as highlighted by Kim, plays a vital role in facilitating dialogues that promote mutual understanding and peace [source: [192](#source-192)]. The event was well-received, with attendees expressing optimism about the potential for renewed partnerships and strengthened alliances [source: [192](#source-192)]. - -**AI commentary**: Ambassador Rachel Kim's address at the United Nations underscores a growing recognition of the interconnected nature of global challenges and the necessity for collaborative international efforts. Her emphasis on diplomacy and communication reflects a strategic approach to global governance, where dialogue and cooperation are seen as essential tools for addressing complex issues. The positive reception of her speech suggests a readiness among international actors to pursue deeper partnerships, which could lead to more effective responses to global crises. This approach aligns with broader trends in international relations that prioritize multilateralism and collective action. - -##### Diplomatic Talks and Climate Summit in Geneva Mark Progress in International Cooperation - -**Source evidence**: Diplomatic talks in Geneva concluded on July 15, 2023, marking a significant step forward in international relations, with key agreements reached on issues such as climate change and economic cooperation [source: [279](#source-279), [364](#source-364)]. Ambassador Kevin Wright played a pivotal role in these discussions, emphasizing the importance of cooperation and dialogue [source: [279](#source-279)]. The talks were described as intense and productive, setting a precedent for future diplomatic engagements [source: [279](#source-279)]. Concurrently, the International Summit on Climate Change also concluded in Geneva, focusing on global policies to combat climate change, with discussions on reducing carbon emissions and enhancing renewable energy adoption [source: [364](#source-364)]. The summit highlighted the urgency of collective action and the need for immediate implementation of agreed measures [source: [364](#source-364)]. - -**AI commentary**: The successful conclusion of both the diplomatic talks and the climate summit in Geneva underscores the city's role as a hub for international dialogue and cooperation. The alignment of these events suggests a concerted effort by the international community to address pressing global challenges through collaboration. The emphasis on climate change at both events indicates a growing recognition of its critical importance. The outcomes of these discussions could lead to significant policy shifts and enhanced international cooperation, potentially setting the stage for more effective global governance in addressing complex issues. - -##### AI theme commentary - -The international diplomatic efforts and summits in 2023 reflect a concerted global effort to address critical issues such as trade, human rights, peace, and climate change. These events underscore the importance of international cooperation and dialogue in resolving complex challenges and fostering global stability. The outcomes of these summits and talks could significantly influence future international policies and collaborations. - -#### Theme: Political Campaigns and Policy Reforms - -Political campaigns and policy reforms in 2023 focused on key issues such as healthcare, education, and economic disparities. Various politicians emphasized these areas in their re-election campaigns, reflecting their importance to constituents and the broader political landscape. - -##### Senator Jane Smith's Re-Election Campaign Focuses on Healthcare and Education Reforms - -**Source evidence**: On March 16, 2023, Senator Jane Smith announced her re-election campaign in Washington D.C., emphasizing healthcare and education reforms as the main issues of her platform. The event was organized by the National Democratic Party and highlighted her commitment to making healthcare more accessible and affordable, as well as improving public education through increased funding and support for teachers. These initiatives have been central to her current term and are expected to be pivotal in her campaign [source: [87](#source-87)]. - -**AI commentary**: The focus on healthcare and education reforms in Senator Jane Smith's re-election campaign suggests a strategic alignment with key voter concerns, potentially increasing her appeal among constituents who prioritize these issues. Her emphasis on making healthcare a right and improving education quality indicates a progressive stance that may resonate well within her party and with the electorate. This approach could strengthen her position in the upcoming election, especially if these issues remain at the forefront of public discourse. - -##### Governor Emma Li's Re-election Campaign Focuses on Education and Healthcare Reforms - -**Source evidence**: Governor Emma Li announced her re-election campaign on September 1, 2023, with a focus on education and healthcare reforms [source: [206](#source-206), [460](#source-460)]. Her campaign emphasizes community engagement and detailed policy discussions, highlighting achievements in healthcare, education, and infrastructure [source: [460](#source-460)]. In Buffalo, she outlined plans to overhaul the education system, including increased funding for public schools and teacher training [source: [461](#source-461)]. In Rochester, she detailed healthcare initiatives such as Medicaid expansion and reducing prescription drug costs [source: [462](#source-462)]. Her campaign also promotes bipartisanship, as seen in a rally with John Doe in Syracuse, emphasizing unity and collaboration [source: [463](#source-463)]. - -**AI commentary**: Governor Li's re-election campaign is strategically focused on two critical areas: education and healthcare, which are likely to resonate with a broad base of voters. Her emphasis on community engagement and policy-driven discussions suggests a campaign that values voter input and transparency. The detailed plans for education and healthcare reforms indicate a commitment to addressing systemic issues, potentially strengthening her appeal among constituents concerned with these areas. The bipartisan approach, highlighted by her collaboration with John Doe, may enhance her appeal across party lines, positioning her as a unifying figure in New York politics. This strategy could be pivotal in a competitive election landscape, potentially setting a precedent for future campaigns. - -##### Senator Mark Johnson Announces Re-election Bid Focusing on Healthcare and Climate Change - -**Source evidence**: On February 20, 2024, Senator Mark Johnson announced his re-election bid at Capitol Hill, emphasizing his commitment to healthcare reform and climate change as key issues. This announcement was made during a spirited address attended by supporters and Democratic Party members, highlighting his legislative achievements and future vision [source: [226](#source-226)]. Johnson's advocacy on these issues has been a hallmark of his tenure, and his campaign is expected to gain momentum as the fall elections approach [source: [226](#source-226)]. - -**AI commentary**: The announcement of Senator Mark Johnson's re-election bid underscores his continued focus on significant policy areas such as healthcare reform and climate change, which are likely to resonate with his constituents and the Democratic Party base. His established record on these issues may strengthen his campaign, potentially attracting both support and scrutiny. The emphasis on these topics suggests they will be central to his legislative agenda if re-elected, reflecting broader party priorities and public concerns. - -##### Laura Benton Announces Senate Candidacy with Focus on Key Issues - -**Source evidence**: On August 25, 2023, Laura Benton announced her candidacy for the United States Senate at Capitol Hill, emphasizing her focus on healthcare reform, climate change, and economic equity. This announcement was made amidst a supportive crowd, including members of the Democratic Party, and was anticipated by political analysts. Benton, a rising figure in the Democratic Party, delivered a speech that highlighted her commitment to public service and progressive policies. Her candidacy has been met with enthusiasm from key party figures, suggesting a strong start to her campaign [source: [487](#source-487)]. - -**AI commentary**: Laura Benton's announcement of her Senate candidacy marks a significant moment in the political landscape, particularly within the Democratic Party. Her focus on healthcare, climate change, and economic equity aligns with key progressive issues, potentially galvanizing support from like-minded voters. The enthusiastic reception from party figures suggests that Benton could be a strong contender in the upcoming election. Her campaign strategy, which includes extensive travel and public engagement, indicates a proactive approach to building a broad base of support. - -##### Minister Julia Bennett Announces Policy Reforms to Address Economic Disparities - -**Source evidence**: On April 5, 2023, Minister Julia Bennett announced a series of policy reforms at Parliament House aimed at addressing economic disparities. These reforms include increased funding for education and job training programs, as well as tax incentives for small businesses and startups to stimulate economic growth and job creation in underserved communities. The announcement was met with both optimism and scrutiny, with supporters praising the initiative as a step towards social justice and economic fairness, while critics highlighted the need for careful planning and resources for effective implementation [source: [378](#source-378)]. - -**AI commentary**: The announcement by Minister Julia Bennett represents a significant policy shift aimed at reducing economic disparities through targeted reforms. The focus on education and job training suggests a long-term strategy to equip the workforce with necessary skills, while tax incentives for small businesses aim to stimulate immediate economic activity. The mixed reception indicates that while the reforms are ambitious, their success will depend on effective implementation and resource allocation. This initiative could potentially serve as a model for other regions facing similar economic challenges. - -##### AI theme commentary - -The focus on healthcare, education, and economic disparities in political campaigns and policy reforms highlights the prioritization of these issues in the political agenda. Politicians' emphasis on these areas reflects their strategic alignment with voter concerns and the need for comprehensive policy solutions to address systemic challenges. These campaigns and reforms could shape the political landscape and influence future policy directions. - -#### Theme: Global Climate Summits and Environmental Initiatives - -Global climate summits and environmental initiatives in 2023 emphasized the need for international cooperation to address climate change. These events focused on reducing carbon emissions, promoting renewable energy, and fostering sustainable development. - -##### World leaders convene in various cities for UN climate summits to address global climate change challenges - -**Source evidence**: The claim that world leaders convened in Beijing on April 1, 2023, for a UN-organized climate summit is supported by sources [144, 209]. These sources describe a significant gathering in Beijing focused on international cooperation to combat climate change, with key figures like Prime Minister Liu Wei emphasizing the need for collaborative action. However, this claim is contradicted by multiple sources [84, 224, 244, 284, 344, 364, 409, 464], which report on similar UN climate summits held in different locations such as Geneva, New York, and London throughout 2023. These sources highlight the global nature of the climate crisis and the widespread international efforts to address it, with various summits focusing on reducing carbon emissions, promoting renewable energy, and fostering international cooperation. - -**AI commentary**: The evidence suggests that while a UN climate summit did occur in Beijing, it was one of several such gatherings held globally in 2023. This reflects the widespread and urgent international focus on climate change, with multiple summits organized to address different aspects of the crisis. The presence of numerous summits indicates a concerted global effort to tackle climate change through diverse strategies and collaborative approaches. The discrepancies in reported locations highlight the decentralized and multifaceted nature of international climate diplomacy, where multiple venues and forums are utilized to engage a broad range of stakeholders in the fight against climate change. - -##### President Lin Zhou Advocates for Global Unity in Climate Change Fight - -**Source evidence**: President Lin Zhou of China delivered a speech at the United Nations on March 25, 2023, calling for global unity in addressing climate change. He emphasized the importance of multinational collaboration and highlighted China's commitment to reducing carbon emissions and investing in renewable energy sources [source: [209](#source-209)]. President Zhou praised the United Nations for its role in fostering international cooperation and urged other countries to increase their efforts in combating climate change [source: [209](#source-209)]. The speech was well-received by delegates and environmental advocates, who see China's involvement as vital to global climate initiatives [source: [209](#source-209)]. - -**AI commentary**: President Zhou's address at the United Nations underscores China's strategic positioning as a leader in global climate change efforts. By advocating for international cooperation and highlighting China's commitments, Zhou aims to inspire other nations to enhance their climate actions. This approach not only strengthens China's role in global environmental governance but also aligns with broader international efforts to mitigate climate impacts. The positive reception of Zhou's speech suggests a growing consensus on the need for unified global action, which could lead to more robust international agreements and collaborations. - -##### Global Climate Action Forum in Berlin Emphasizes Collaboration and Innovation for Climate Solutions - -**Source evidence**: The Global Climate Action Forum, held in Berlin on March 15, 2023, was a significant event that brought together leaders and activists from around the world to address environmental challenges. The forum was organized by the Green Earth Initiative and highlighted the urgency of climate action. It aimed to foster collaboration and innovation, with discussions covering renewable energy, carbon footprint reduction, and biodiversity conservation. The event was seen as a call to action for immediate steps to protect the planet, with expectations of influencing international climate policies and agreements [source: [213](#source-213)]. - -**AI commentary**: The Global Climate Action Forum in Berlin represents a critical step in international efforts to combat climate change. By bringing together diverse stakeholders, the forum underscores the importance of collective action and innovation in addressing environmental issues. The focus on collaboration suggests a growing recognition that global challenges require unified responses. The outcomes of such forums could significantly shape future climate policies and initiatives, potentially leading to more sustainable and resilient global practices. - -##### Global Summits on Climate Change Highlight the Need for Unified International Response - -**Source evidence**: The claim that a Global Summit on Climate Change was held at the United Nations Headquarters in New York on November 11, 2023, is supported by sources [224, 440]. These sources describe a high-stakes diplomatic gathering aimed at forging a unified response to the climate crisis, with significant participation from global leaders and a focus on international cooperation [source: [224](#source-224), [440](#source-440)]. However, this claim is contradicted by multiple other sources that report on various climate summits held in different locations and times, such as Geneva in March, August, and November 2023 [source: [84](#source-84), [244](#source-244), [284](#source-284), [364](#source-364), [464](#source-464)], Beijing in April 2023 [source: [144](#source-144)], London in October 2023 [source: [409](#source-409)], and another event in June 2023 [source: [344](#source-344)]. These sources highlight the widespread and ongoing nature of climate discussions across the globe, emphasizing the urgency and diversity of international efforts to address climate change. - -**AI commentary**: The evidence suggests that while a significant summit did occur in New York, the broader context is that numerous climate summits are being held worldwide, reflecting a global consensus on the urgency of addressing climate change. This multiplicity of events underscores the decentralized and multifaceted approach required to tackle such a complex issue. The presence of high-profile leaders and experts at these summits indicates a strong international commitment to finding solutions. However, the challenge remains in translating these discussions into concrete actions and policies that can effectively mitigate climate impacts. The global nature of these summits also highlights the need for sustained international collaboration and the sharing of best practices to achieve meaningful progress. - -##### International Collaboration Emphasized at UN Climate Summit in Geneva - -**Source evidence**: On August 15, 2023, a significant climate summit was held at the United Nations headquarters in Geneva, attended by global leaders including President Jane Doe. The summit focused on international cooperation to address climate change, with key discussions on reducing carbon emissions and promoting renewable energy. President Jane Doe highlighted the importance of global collaboration, stating that climate change transcends borders and requires collective action to protect future generations. The summit aimed to build on existing agreements and set new environmental accountability benchmarks, with leaders debating strategies like stricter emissions targets and clean technology investments. The United Nations facilitated the event, underscoring its role in fostering global cooperation. The outcomes are expected to shape future climate policies and initiatives [source: [244](#source-244)]. - -**AI commentary**: The Geneva summit represents a critical step in international efforts to combat climate change, emphasizing the necessity of global collaboration. President Jane Doe's remarks reflect a growing consensus that climate change is a borderless issue requiring unified action. The summit's focus on renewable energy and emissions reduction aligns with global sustainability goals, suggesting a potential shift towards more stringent environmental policies. The commitment of world leaders to continue the momentum from this summit indicates a promising direction for future international climate initiatives. This event could serve as a catalyst for more robust global environmental agreements and actions. - -##### President John Smith Advocates for Global Unity at UN Climate Summit - -**Source evidence**: President John Smith delivered a keynote address at the United Nations Climate Summit in New York City on November 12, 2023, emphasizing the urgent need for global cooperation to address climate change. He highlighted that climate challenges transcend national borders and require a unified global response, urging nations to collaborate on sustainable solutions. The summit, attended by international leaders and organizations, aims to foster dialogue and commitments towards a greener future. The audience responded positively, expressing optimism for meaningful progress driven by President Smith's leadership [source: [440](#source-440)]. - -**AI commentary**: The emphasis on global unity and cooperation in President Smith's address reflects a growing recognition among world leaders of the interconnected nature of climate challenges. His call for a unified response underscores the importance of international collaboration in crafting effective climate policies. The positive reception of his speech suggests a readiness among global stakeholders to engage in cooperative efforts, potentially leading to significant advancements in climate action and policy. This event highlights the critical role of diplomatic forums in shaping global environmental strategies. - -##### Secretary Jane Doe and Prime Minister Alex Green Enhance Climate Cooperation at UN Summit - -**Source evidence**: On November 11, 2023, Secretary Jane Doe and Prime Minister Alex Green held bilateral meetings at the United Nations Headquarters to discuss enhancing cooperation on climate change [source: [224](#source-224), [441](#source-441), [442](#source-442), [443](#source-443)]. This meeting was part of a broader climate summit where world leaders gathered to address global environmental challenges [source: [224](#source-224), [441](#source-441)]. The discussions focused on sustainable practices and shared technologies to mitigate climate change effects, reflecting the summit's objectives of fostering global partnerships [source: [442](#source-442)]. The summit also featured the unveiling of innovative technologies aimed at combating climate change, underscoring the role of technological innovation in achieving sustainable development goals [source: [443](#source-443)]. - -**AI commentary**: The bilateral meeting between Secretary Jane Doe and Prime Minister Alex Green highlights the importance of international diplomacy in addressing climate change. The emphasis on cooperation and technology sharing suggests a strategic approach to tackling environmental issues that require global solutions. The summit's focus on innovative technologies and health impacts of climate change indicates a comprehensive strategy that integrates various aspects of the climate crisis. This event could potentially lead to significant advancements in international climate policy and foster stronger global partnerships. - -##### UN Climate Summit Urges Immediate Global Action on Climate Change - -**Source evidence**: The United Nations Climate Summit held in Geneva on September 1, 2023, was a significant event focusing on the urgent need for global actions to combat climate change. Dr. Susan Green, a prominent climate scientist, highlighted the necessity for immediate and comprehensive strategies to reduce global carbon emissions, emphasizing that current actions will shape the future of the planet [source: [464](#source-464)]. The summit addressed the increasing frequency and severity of climate-related disasters, such as wildfires and hurricanes, and underscored the urgency of the discussions [source: [464](#source-464)]. The United Nations presented a comprehensive agenda aimed at enhancing renewable energy adoption, preserving biodiversity, and supporting vulnerable communities affected by climate shifts, calling for nations to commit to more ambitious greenhouse gas reduction targets [source: [464](#source-464)]. - -**AI commentary**: The UN Climate Summit in Geneva serves as a critical platform for global leaders to address the escalating climate crisis. The emphasis on immediate action and comprehensive strategies to reduce carbon emissions reflects a growing recognition of the urgent need to mitigate climate change impacts. The summit's focus on collaborative efforts and ambitious targets suggests a potential shift towards more unified and effective global climate policies. The outcomes of this summit could significantly influence international climate strategies and commitments, potentially leading to more robust and coordinated efforts to address climate change challenges. - -##### AI theme commentary - -The global climate summits and environmental initiatives in 2023 highlight the urgent need for collective action to combat climate change. These events underscore the importance of international collaboration and innovation in developing effective climate policies and solutions. The outcomes of these summits could lead to significant advancements in global environmental governance and sustainable development practices. - -#### AI report commentary - -The report provides a comprehensive overview of key political events and international collaborations in 2023, highlighting the global efforts to address economic, diplomatic, and environmental challenges. The themes of strategic economic collaborations, international diplomatic efforts, political campaigns, and global climate summits reflect the interconnected nature of these issues and the importance of international cooperation in finding solutions. These events and initiatives underscore the need for continued dialogue and collaboration to address complex global challenges and foster a more stable and sustainable future. - -## Sources - -#### Source 15 - -
- -##### Text chunk: news_articles_texts.csv_16 (1) - -mock_text: **India Engages in Strategic Talks with IMF for Economic Growth** - -*Delhi, August 1, 2023* — In a pivotal move to enhance the nation's economic trajectory, Finance Minister Raj Patel met with representatives from the International Monetary Fund (IMF) in Delhi today. The discussions centered on formulating and implementing new economic policies aimed at bolstering growth in India, a country poised to cement its place as a major global economy. - -The meeting, held in the capital city of Delhi, marks a significant step in India's ongoing efforts to integrate more robust economic strategies that can withstand global challenges and leverage opportunities for accelerated development. With the global economy facing uncertainties, the collaboration between India and the IMF is seen as a critical measure to ensure sustainable growth. - -Finance Minister Raj Patel emphasized the importance of this collaboration, stating, "India is committed to pursuing economic strategies that not only propel our growth but also contribute to global stability. Working with the IMF allows us to harness international expertise and align our policies with best practices worldwide." - -The IMF, known for its role in fostering monetary cooperation and financial stability among countries, is expected to provide India with insights and recommendations that could help streamline India's financial frameworks and enhance productivity across various sectors. - -As India continues to navigate its economic path, the outcomes of these discussions will be closely monitored by economists and policymakers alike. The collaborative effort with the IMF is seen as a promising step towards achieving sustained economic expansion and prosperity. - -Stay tuned for further updates as India and the IMF refine their strategies to implement these new economic policies, which could significantly impact the country's growth landscape in the coming years. - -##### Supports claims - -- On August 1, 2023, India's Finance Minister Raj Patel met with representatives from the International Monetary Fund (IMF) in Delhi to discuss new economic policies aimed at bolstering India's growth and integrating robust economic strategies. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 31 - -
- -##### Text chunk: news_articles_texts.csv_32 (1) - -mock_text: **Vienna Summit Focuses on Trade Agreements: A Key Step in International Diplomacy** - -*Vienna, November 28, 2022* — The picturesque city of Vienna played host to a major diplomatic gathering today, as delegates from across the European Union and international observers convened for the Vienna Summit. The central focus of this high-profile meeting was the discussion of critical trade agreements that could shape the economic landscape of the region for years to come. - -With the EU Council taking a leading role in the proceedings, the summit aimed to foster collaboration among member states and explore avenues for enhancing trade relations. Ambassador John Smith, a prominent figure in international diplomacy, was among the key speakers at the event. His insights were instrumental in guiding discussions towards mutually beneficial outcomes. - -The summit, held amidst the elegant backdrop of Vienna's historic architecture, was attended by numerous diplomats and economic experts who sought to navigate the complexities of trade in a rapidly changing global market. Participants engaged in a series of meetings and workshops designed to address pressing issues such as tariffs, market access, and regulatory standards. - -"The Vienna Summit represents a pivotal moment for the EU as we strive to solidify our economic alliances and promote sustainable growth," Ambassador Smith remarked during his opening address. "Through constructive dialogue and cooperation, we aim to establish agreements that will benefit all parties involved." - -The discussions in Vienna underscored the importance of unity and collaboration in addressing economic challenges. As the summit drew to a close, participants expressed optimism that the groundwork laid during the event would lead to significant progress in trade negotiations. - -The outcomes of the Vienna Summit are expected to influence policy decisions and trade strategies across the EU. As stakeholders reflect on the day's achievements, the international community will be watching closely to see how these deliberations translate into concrete action in the coming months. - -##### Supports claims - -- The Vienna Summit, held on November 28, 2022, was a major diplomatic gathering focused on discussing critical trade agreements that could shape the economic landscape of the European Union. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 56 - -
- -##### Text chunk: news_articles_texts.csv_57 (1) - -mock_text: **UN Conference on Human Rights Begins in Cairo** - -*October 11, 2022 - Cairo* - -Delegates from across the globe have convened in Cairo today for a significant United Nations conference focused on the advancement of human rights. The event has drawn attention from numerous countries and organizations dedicated to addressing key human rights issues. - -Fatima Ali, a prominent advocate for human rights, emphasized the importance of this gathering. "This conference represents a critical opportunity for us to address pressing human rights challenges and to collaborate on effective solutions," she stated during her opening remarks. - -The United Nations has organized this conference as part of its ongoing commitment to human rights. The agenda includes discussions on a wide range of topics, from freedom of expression to the rights of marginalized communities, and aims to foster international cooperation. - -Participants in Cairo will engage in dialogue and workshops over the next few days, sharing insights and strategies to enhance human rights protections worldwide. With a diverse array of voices and perspectives, the conference is expected to produce actionable recommendations and foster greater solidarity among nations. - -As the conference unfolds, the global community looks to Cairo with anticipation, hopeful that the deliberations will pave the way for meaningful progress in the realm of human rights. - -##### Supports claims - -- The UN Conference on Human Rights began in Cairo on October 11, 2022, focusing on advancing human rights and addressing key issues such as freedom of expression and the rights of marginalized communities. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 64 - -
- -##### Text chunk: news_articles_texts.csv_65 (1) - -mock_text: **Peace Talks to Resume in Geneva with International Focus** - -Geneva, March 15, 2023 — In a significant move towards resolving ongoing regional conflicts, diplomats from various nations are set to reconvene in Geneva next week. The peace talks, facilitated by the United Nations, aim to address and mediate tensions that have been escalating in multiple regions around the globe. - -Ambassador John Smith, a key figure in the diplomatic community, expressed optimism about the upcoming discussions. "We are hopeful that these talks will pave the way for sustainable peace and cooperation among the involved parties," Smith stated. The ambassador highlighted the importance of dialogue and international cooperation in achieving long-term stability. - -The United Nations has been instrumental in organizing these talks, bringing together representatives from conflicting nations in a neutral setting. Geneva, known for its rich history of diplomacy, provides an ideal backdrop for such crucial negotiations. The city's role as a hub for international diplomacy underscores the importance of these discussions in the broader context of global peace efforts. - -The agenda for the meeting includes addressing root causes of the conflicts, establishing ceasefires, and setting a framework for future cooperation. Observers and experts will be closely monitoring the proceedings, as the outcomes could have significant implications for the affected regions. - -As the world watches, the hope is that this round of talks will lead to meaningful progress and set a precedent for peaceful resolution of conflicts through dialogue and negotiation. - -##### Supports claims - -- Peace talks are set to resume in Geneva on March 15, 2023, with the aim of addressing and mediating escalating regional tensions. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 84 - -
- -##### Text chunk: news_articles_texts.csv_85 (1) - -mock_text: **UN Climate Summit Convenes in Geneva** - -*Geneva, March 10, 2023* — Today marks the commencement of the highly anticipated UN Climate Summit in Geneva, where global leaders have gathered to address pressing climate change challenges. The conference, organized by the UN Climate Division, aims to foster international collaboration and implement urgent initiatives to combat the escalating climate crisis. - -Dr. Emily Waters, a prominent climate scientist, delivered a compelling opening speech at the summit. She emphasized the critical need for decisive action, citing recent data that highlights the accelerating impacts of climate change across the globe. "We are at a pivotal moment," Dr. Waters stated, urging policymakers to commit to transformative environmental policies. - -The summit agenda includes discussions on reducing carbon emissions, protecting biodiversity, and increasing investments in renewable energy sources. Delegates from various countries are expected to present their national strategies and collaborate on joint efforts to meet the targets set by the Paris Agreement. - -Geneva, known for its diplomatic significance, provides a fitting backdrop for these crucial discussions. As the summit progresses, attendees hope to forge a unified path forward in the fight against climate change, with a focus on sustainable development and resilience. - -The world watches closely as the outcomes of this summit could significantly influence the global approach to climate change mitigation and adaptation in the years to come. - -##### Contradicts claims - -- World leaders convened in Beijing on April 1, 2023, for a United Nations-organized climate summit to formulate strategies against climate change, emphasizing international cooperation. -- A Global Summit on Climate Change was held at the United Nations Headquarters in New York on November 11, 2023, aiming to forge a unified response to the climate crisis. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 87 - -
- -##### Text chunk: news_articles_texts.csv_88 (1) - -mock_text: **Senator Jane Smith Announces Re-Election Campaign in Washington D.C.** - -*Washington D.C.* – On March 16, 2023, in a spirited gathering at the heart of the nation's capital, Senator Jane Smith officially kicked off her campaign for re-election. The event, held under the auspices of the National Democratic Party, highlighted her commitment to pressing issues such as healthcare and education reforms, which she identified as the cornerstones of her campaign platform. - -In her announcement speech, Senator Smith emphasized the need for comprehensive reforms in the healthcare system, aiming to make it more accessible and affordable for all citizens. "Healthcare is a right, not a privilege," she declared to a supportive crowd. Her agenda includes proposals to expand healthcare coverage and reduce prescription drug prices, initiatives she has championed during her current term. - -Education also took center stage in her address. Senator Smith outlined her vision for improving the public education system, advocating for increased funding and support for teachers. She stressed the importance of equipping the next generation with the necessary skills to thrive in a rapidly changing world. "Our children deserve the best start in life, and that begins with quality education," she stated passionately. - -The event in Washington D.C. drew a diverse audience, including party members, constituents, and supporters eager to hear about the senator's plans for the future. As a prominent figure within the National Democratic Party, Senator Smith's campaign is expected to gain significant traction in the coming months. - -Her re-election campaign sets the stage for what promises to be a pivotal race, with healthcare and education reforms at the forefront of her policy agenda. With the stakes high, Senator Jane Smith is determined to continue her work in the Senate, advocating for policies that reflect the values and needs of her constituents. - -##### Supports claims - -- On March 16, 2023, Senator Jane Smith announced her re-election campaign in Washington D.C., focusing on healthcare and education reforms as key issues. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 144 - -
- -##### Text chunk: news_articles_texts.csv_145 (1) - -mock_text: **Global Leaders Convene for Climate Summit in Beijing** - -*Beijing, April 1, 2023* — In a significant gathering aimed at addressing one of the most pressing issues of our time, world leaders have convened in Beijing for a high-stakes climate summit organized by the United Nations. This pivotal event is focused on formulating new strategies to combat the escalating threat of climate change. - -Among the key figures attending the summit is Prime Minister Liu Wei, who has been vocal about the urgent need for international cooperation in tackling environmental challenges. As the host nation, China has emphasized its commitment to playing a central role in the global effort to reduce carbon emissions and promote sustainable development. - -The summit, which is scheduled to span several days, brings together heads of state, environmental experts, and representatives from various sectors to discuss innovative approaches to mitigate the impacts of climate change. The agenda includes sessions on renewable energy, carbon pricing, and the implementation of green technologies across industries. - -Prime Minister Liu Wei, in his opening remarks, highlighted the importance of collaborative action, stating, "No country can tackle climate change in isolation. It is imperative that we unite our efforts and resources to secure a sustainable future for generations to come." - -The United Nations has underscored the urgency of the summit, noting that recent scientific reports have pointed to an accelerated pace of climate change and its increasingly severe impacts on ecosystems and human societies. The outcomes of this summit are expected to influence international policy and set the stage for future climate negotiations. - -As the summit progresses, the world watches with anticipation, hopeful for decisive actions and commitments that can steer global efforts towards a more sustainable and resilient future. - -##### Supports claims - -- World leaders convened in Beijing on April 1, 2023, for a United Nations-organized climate summit to formulate strategies against climate change, emphasizing international cooperation. - -##### Contradicts claims - -- A Global Summit on Climate Change was held at the United Nations Headquarters in New York on November 11, 2023, aiming to forge a unified response to the climate crisis. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 192 - -
- -##### Text chunk: news_articles_texts.csv_193 (1) - -mock_text: **Ambassador Kim Discusses International Relations at UN** - -*United Nations Headquarters, February 25, 2024* — In a pivotal address at the United Nations Headquarters, Ambassador Rachel Kim emphasized the importance of bolstering diplomatic ties in a world increasingly defined by complex international challenges. Speaking under the auspices of the Diplomatic Relations Council, Ambassador Kim underscored the necessity of fostering robust communication channels between nations to address pressing global issues effectively. - -The Ambassador's speech highlighted the critical role that international cooperation plays in maintaining global stability and prosperity. "In today's interconnected world, no nation can afford to stand alone. We must work together to address shared challenges such as climate change, economic instability, and security threats," Kim stated. - -The event, which gathered diplomats and representatives from around the globe, provided a platform for discussing the ways in which countries can collaborate more closely. Ambassador Kim's address was particularly focused on enhancing diplomatic engagement and building trust among nations. - -Ambassador Kim also pointed out that the Diplomatic Relations Council has been instrumental in facilitating dialogues that promote mutual understanding and peace. "Our council is committed to creating avenues for dialogue and cooperation, ensuring that all voices are heard and respected," she noted. - -Attendees at the United Nations Headquarters expressed optimism following the Ambassador's speech, recognizing the potential for renewed partnerships and strengthened alliances. The discussions are expected to continue in follow-up meetings, as nations strive to implement the vision of enhanced international relations outlined by Ambassador Kim. - -As the world faces an ever-evolving set of challenges, Ambassador Rachel Kim's call for unity and collaboration resonates strongly with the global community, setting the stage for a future where diplomacy plays a central role in overcoming obstacles and achieving common goals. - -##### Supports claims - -- On February 25, 2024, Ambassador Rachel Kim addressed the United Nations, highlighting the necessity of fostering robust communication channels between nations to tackle global issues like climate change and economic instability. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 200 - -
- -##### Text chunk: news_articles_texts.csv_201 (1) - -mock_text: **IMF and India Further Economic Strategy Talks in Mumbai** - -*3rd August 2023, Mumbai* - In a bid to bolster economic stability, the International Monetary Fund (IMF) and India have embarked on another round of discussions today in Mumbai. These talks are a continuation of ongoing efforts to address and refine key economic strategies that are crucial for maintaining India's economic health and growth. - -The discussions were attended by prominent figures in the economic sector, including India's Finance Minister Raj Patel. Minister Patel, known for his proactive approach towards economic reform, has been at the forefront of these dialogues, emphasizing the need for robust strategies in the face of global economic challenges. - -Central to the talks is the collaboration between the IMF and the Reserve Bank of India, both of which play pivotal roles in shaping the country’s economic landscape. The focus of the meetings is on enhancing fiscal policies, managing inflation, and ensuring sustainable growth. The discussions also touch on potential reforms that could stabilize and boost the Indian economy amid fluctuating global markets. - -The IMF has been a long-standing partner in India's economic development, providing guidance and support in implementing effective economic policies. This partnership aims to not only address immediate economic concerns but also to lay down a framework for long-term economic resilience. - -As these talks progress, stakeholders remain optimistic about the outcomes. The collaborative efforts between the IMF and Indian financial institutions signify a promising step towards a more stable economic future for the nation. - -The ongoing dialogue in Mumbai is expected to continue over the next few days, with further updates anticipated on the agreements and strategies that will emerge from these critical discussions. - -##### Supports claims - -- On August 1, 2023, India's Finance Minister Raj Patel met with representatives from the International Monetary Fund (IMF) in Delhi to discuss new economic policies aimed at bolstering India's growth and integrating robust economic strategies. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 201 - -
- -##### Text chunk: news_articles_texts.csv_202 (1) - -mock_text: **Title: IMF Engages with Indian Leaders on Economic Growth** - -*Delhi, August 2, 2023* — In a significant stride towards fostering economic development, high-level discussions took place today between Indian government officials and representatives from the International Monetary Fund (IMF). The talks, held in Delhi, were centered around crafting strategic policy frameworks aimed at stimulating robust economic growth in India. - -Finance Minister Raj Patel, a key figure in India's economic policy-making, led the discussions from the Indian side. "Our focus is on sustainable growth that benefits all sectors of society," Minister Patel stated during a press briefing. "We are keen to explore innovative policy solutions that can drive our economy forward." - -The IMF delegation was headed by Christine Lagarde, who has been instrumental in shaping global economic policies. Lagarde emphasized the importance of collaboration between the IMF and national governments. "India's potential for economic expansion is immense, and we are here to support and advise on strategies that could unlock this potential," she remarked. - -The dialogue comes at a crucial time for India, as it seeks to navigate global economic uncertainties while pursuing ambitious growth targets. The discussions are expected to cover a range of topics, including fiscal policy reforms, investment in infrastructure, and enhancing the ease of doing business. - -Both parties expressed optimism about the outcomes of the meeting, highlighting a shared commitment to achieving sustainable economic progress. The International Monetary Fund's continued engagement with Indian leaders underscores the global attention on India's economic trajectory. - -Further meetings are anticipated in the coming months to refine the proposed policy frameworks and ensure their effective implementation. As these dialogues continue, both the Indian government and the International Monetary Fund remain hopeful for a prosperous economic future. - -##### Supports claims - -- On August 1, 2023, India's Finance Minister Raj Patel met with representatives from the International Monetary Fund (IMF) in Delhi to discuss new economic policies aimed at bolstering India's growth and integrating robust economic strategies. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 202 - -
- -##### Text chunk: news_articles_texts.csv_203 (1) - -mock_text: **Roundtable on Economic Policies Held in Delhi: Key Discussions with Global Financial Institutions** - -*Delhi, August 5, 2023* — In a significant gathering that underscored India's pivotal role in the global economic landscape, a roundtable discussion was convened in Delhi today, bringing together some of the most influential voices in international finance. The meeting, attended by representatives from the International Monetary Fund (IMF) and the World Bank, focused on the future directions of India's economic policies. - -The event was marked by the presence of Deputy Finance Minister Neha Singh, who played a crucial role in articulating India's economic priorities and challenges. Her insights were highly anticipated, given the current economic climate and India's position as a rapidly growing economy. - -Discussions at the roundtable were wide-ranging, covering various aspects of economic policy, including fiscal strategies, monetary policies, and structural reforms necessary to sustain India's growth trajectory. The representatives from the IMF and the World Bank provided their perspectives on how India could leverage its economic potential while addressing pressing issues such as inflation, employment, and sustainable development. - -Deputy Finance Minister Neha Singh highlighted the importance of collaboration between India and these global financial institutions. She emphasized that such partnerships are vital for sharing expertise and resources, which can help India navigate complex economic challenges. - -The roundtable concluded with a consensus on the need for continued dialogue and cooperation. As India continues to emerge as a key player on the world stage, the insights from this meeting are expected to influence its economic policy decisions in the coming years. - -This event is a testament to India's commitment to engaging with the global community in crafting policies that foster economic stability and growth. The outcomes of this roundtable will likely have significant implications, not only for India but also for the broader global economic environment. - -##### Supports claims - -- On August 5, 2023, a roundtable discussion was held in Delhi with representatives from the IMF and the World Bank, focusing on India's future economic policies, including fiscal strategies, monetary policies, and structural reforms. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 203 - -
- -##### Text chunk: news_articles_texts.csv_204 (1) - -mock_text: **Title: India Prepares New Financial Agreements with IMF** - -**Delhi, August 4, 2023** — In a significant move to bolster its economic initiatives, India is gearing up to finalize new financial agreements with the International Monetary Fund (IMF). This development comes as part of the country's broader efforts to support its ambitious economic programs and enhance financial stability amid global uncertainties. - -Finance Minister Raj Patel has been at the forefront of these negotiations, which are expected to pave the way for substantial financial support and collaboration with the IMF. The agreements are anticipated to include provisions that will assist India in implementing key economic reforms and investment projects aimed at fostering sustainable growth. - -The discussions, which have been ongoing in Delhi, reflect India's commitment to strengthening its economic framework and addressing challenges posed by the global economic climate. "These agreements with the IMF are crucial for our economic strategy," stated Minister Patel in a recent press briefing. "They will provide us with the necessary support to advance our initiatives and ensure economic resilience." - -The IMF, known for its role in providing financial assistance and advice to countries worldwide, has expressed its support for India's economic plans. Representatives from the organization have been working closely with Indian officials to finalize the terms of the agreements, which are expected to be signed in the coming weeks. - -This partnership between India and the IMF underscores the importance of international cooperation in addressing economic challenges and promoting growth. As India continues to navigate the complexities of the global economy, these new financial agreements are seen as a pivotal step in securing a stable and prosperous future for the country. - -##### Supports claims - -- On August 1, 2023, India's Finance Minister Raj Patel met with representatives from the International Monetary Fund (IMF) in Delhi to discuss new economic policies aimed at bolstering India's growth and integrating robust economic strategies. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 206 - -
- -##### Text chunk: news_articles_texts.csv_207 (1) - -mock_text: **Governor Emma Li Announces Re-election Campaign with Focus on Education and Healthcare** - -*New York, September 1, 2023* — In a highly anticipated announcement, Governor Emma Li confirmed her plans to seek re-election in the upcoming gubernatorial race. Speaking at a packed rally in downtown New York, the Democratic Party stalwart outlined her vision for the state, promising to prioritize education and healthcare reforms if granted a second term. - -Governor Li, who made history as the first Asian-American woman to hold the office of Governor in New York, has been a prominent figure in state politics since her initial election. Her tenure has been marked by a commitment to progressive values, and her administration has been lauded for its efforts to increase funding for public schools and expand access to affordable healthcare. - -During her speech, Governor Li emphasized the need to continue these efforts, citing the importance of building on the foundations laid during her first term. "We have made significant strides, but our work is far from over," she told supporters. "Every child in New York deserves a quality education, and every resident deserves access to healthcare that doesn't break the bank." - -The announcement comes as no surprise to political analysts, who have long speculated about Li's intentions to run again. Under her leadership, the state's economy has seen steady growth, and her approval ratings remain strong among New Yorkers. - -As the campaign kicks off, Governor Li's re-election bid will be closely watched, with education and healthcare expected to be central themes. Her campaign team is already mobilizing efforts to engage with voters across the state, highlighting her achievements and future plans. - -The Democratic Party in New York has expressed unwavering support for Li's candidacy. Party officials have praised her leadership and expressed confidence in her ability to continue driving positive change for the state. - -With the election just months away, Governor Li's announcement marks the beginning of what promises to be a spirited campaign season. As she takes her message to the voters, all eyes will be on how her vision for education and healthcare reforms resonates with New Yorkers. - -##### Supports claims - -- On September 1, 2023, Governor Emma Li announced her re-election campaign in New York, prioritizing education and healthcare reforms. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 209 - -
- -##### Text chunk: news_articles_texts.csv_210 (1) - -mock_text: ### President Zhou Calls for Global Unity in Climate Fight at United Nations - -**Beijing, March 25, 2023** — In a passionate plea for international solidarity, President Lin Zhou of China addressed the United Nations today, emphasizing the urgent need for global cooperation in tackling climate change. The speech, delivered via a live broadcast from Beijing, underscored the critical role of multinational collaboration in addressing the environmental challenges facing the world. - -President Zhou's address comes at a pivotal moment, as nations worldwide grapple with increasingly severe climate-related impacts. "Climate change is not an issue that respects borders," President Zhou stated. "It is a global challenge that requires a global response." - -During the speech, President Zhou highlighted China's ongoing commitment to reducing carbon emissions and investing in renewable energy sources. He urged other countries to step up their efforts, stressing that time is of the essence. "We must act now, collectively, to preserve our planet for future generations," he declared. - -The United Nations, as a leading platform for international dialogue, was praised by President Zhou for its role in fostering cooperation among nations. He called on the organization to continue its efforts to bring countries together to forge meaningful agreements and share technologies that can mitigate the impacts of climate change. - -The address by President Zhou was well-received by delegates and environmental advocates, who view China's engagement as crucial to global climate initiatives. As the world looks to the future, the call for unity and action resonates strongly with many who are committed to ensuring a sustainable planet. - -This speech marks another step in China's ongoing efforts to position itself as a leader in the fight against climate change, building on previous commitments made in international climate accords. As the world listens, the hope is that President Zhou's words will inspire a renewed commitment to global cooperation and innovative solutions in the face of this pressing global challenge. - -##### Supports claims - -- World leaders convened in Beijing on April 1, 2023, for a United Nations-organized climate summit to formulate strategies against climate change, emphasizing international cooperation. -- President Lin Zhou of China called for global unity in the fight against climate change during a United Nations address on March 25, 2023, highlighting China's commitment to reducing carbon emissions. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 213 - -
- -##### Text chunk: news_articles_texts.csv_214 (1) - -mock_text: **Berlin Hosts Global Climate Action Forum: Leaders Unite for Environmental Change** - -*Berlin, March 15, 2023* – Today marks the commencement of the Global Climate Action Forum in Berlin, a pivotal event drawing leaders from across the globe to address the pressing challenges faced by our environment. - -The forum, organized by the Green Earth Initiative, is a testament to the growing urgency of climate action as world leaders, activists, and organizations converge to discuss and strategize on solutions to mitigate the impact of climate change. Among the prominent voices at the event is renowned activist Jamie Lee, who has been a leading figure in advocating for sustainable practices and policies. - -Held at the heart of Berlin, the forum aims to foster collaboration and innovation in the fight against climate change. Participants are expected to engage in discussions that cover a wide range of topics, from renewable energy advancements to strategies for reducing carbon footprints and conserving biodiversity. - -This gathering comes at a crucial time as the world grapples with the effects of climate change, including extreme weather events, rising sea levels, and threats to food security. The Global Climate Action Forum is not just a platform for dialogue, but a call to action for immediate and concrete steps to protect our planet for future generations. - -As the forum continues over the next few days, stakeholders hope to forge partnerships and commitments that will drive significant progress in global climate policies. The outcomes of this forum are anticipated to influence international agreements and initiatives aimed at creating a sustainable and resilient future. - -With Berlin as the backdrop, this forum highlights the city’s role as a leader in environmental advocacy and its commitment to fostering a global dialogue on climate action. The event underscores the importance of collective effort in tackling one of the most significant challenges of our time. - -##### Supports claims - -- The Global Climate Action Forum in Berlin on March 15, 2023, brought together leaders and activists to strategize on climate change solutions, emphasizing collaboration and innovation. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 224 - -
- -##### Text chunk: news_articles_texts.csv_225 (1) - -mock_text: **Global Summit on Climate Change Convenes at United Nations Headquarters** - -*November 11, 2023* - -**New York, NY** — In a significant move towards addressing the pressing challenges posed by climate change, world leaders have convened at the United Nations Headquarters for the Global Summit on Climate Change. This high-stakes diplomatic gathering aims to forge a unified response to the escalating climate crisis that transcends national borders and political agendas. - -The summit, which officially commenced at 8:30 AM today, features a distinguished array of participants, including Secretary Jane Doe, who is representing her nation in this pivotal discourse. As a key figure in international diplomacy, Secretary Doe has been instrumental in fostering collaborative efforts aimed at mitigating the impacts of climate change. - -The gathering at the United Nations Headquarters underscores the organization's ongoing commitment to fostering global cooperation on environmental issues. It serves as a platform for dialogue and negotiation, with the hopes of reaching comprehensive agreements that can lead to actionable solutions. Delegates from various nations are expected to engage in discussions covering a wide range of topics, including renewable energy initiatives, conservation strategies, and mechanisms for reducing carbon emissions. - -The urgency of the summit's agenda cannot be overstated. Recent scientific reports have highlighted the accelerating pace of climate-related disruptions, emphasizing the necessity for immediate and concerted action. The summit's proceedings are anticipated to produce a set of guidelines and commitments that will steer international efforts in the coming years. - -As the world watches, the outcomes of this summit could very well shape the future of global climate policy. The presence of influential leaders like Secretary Jane Doe signals a strong commitment to achieving meaningful progress. The eyes of the world are on the United Nations Headquarters, where the decisions made today will resonate far beyond the halls of diplomacy. - -##### Supports claims - -- A Global Summit on Climate Change was held at the United Nations Headquarters in New York on November 11, 2023, aiming to forge a unified response to the climate crisis. -- Secretary Jane Doe and Prime Minister Alex Green held bilateral meetings at the United Nations Headquarters on November 11, 2023, to enhance cooperation on climate change. - -##### Contradicts claims - -- World leaders convened in Beijing on April 1, 2023, for a United Nations-organized climate summit to formulate strategies against climate change, emphasizing international cooperation. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 226 - -
- -##### Text chunk: news_articles_texts.csv_227 (1) - -mock_text: **Senator Mark Johnson Announces Re-election Bid at Capitol Hill Event** - -*Capitol Hill, February 20, 2024* — In a spirited address at Capitol Hill, Senator Mark Johnson officially announced his bid for re-election, setting the stage for what promises to be a closely watched contest in the upcoming fall elections. The event, attended by a crowd of supporters and key members of the Democratic Party, underscored Johnson's commitment to continue his legislative work. - -Speaking to an enthusiastic audience, Senator Johnson emphasized his dedication to the values and priorities of the Democratic Party, highlighting his achievements and outlining his vision for the future. "Today, I am proud to announce my candidacy for re-election," Johnson declared, his voice resonating with determination. "Together, we have made great strides, but there is much more to do." - -The announcement comes as no surprise to political observers, who have long speculated about Johnson's intentions. Known for his steadfast advocacy on issues such as healthcare reform and climate change, Johnson has been a prominent figure on Capitol Hill since first being elected. - -During his speech, Senator Johnson reflected on his past term, noting significant legislative victories and the challenges that lie ahead. He called for unity and continued engagement from his constituents, urging them to support his campaign as they have in previous elections. - -The Democratic Party, rallying behind Johnson, expressed confidence in his leadership and ability to secure another term. "Senator Mark Johnson has been an invaluable asset to our party and to the people he serves," a party spokesperson stated. "We are fully committed to supporting his re-election efforts." - -As the fall elections approach, Senator Johnson's campaign is expected to gain momentum, drawing attention from both supporters and opponents. With his announcement, the race is now officially underway, and all eyes will be on Johnson as he seeks to retain his seat and further his legislative agenda. - -##### Supports claims - -- On February 20, 2024, Senator Mark Johnson announced his re-election bid at Capitol Hill, emphasizing healthcare reform and climate change as key issues. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 244 - -
- -##### Text chunk: news_articles_texts.csv_245 (1) - -mock_text: **Global Summit Tackles Climate Change: A Step Forward in International Cooperation** - -*August 15, 2023, Geneva* — In a pivotal meeting held at the United Nations headquarters in Geneva, prominent leaders from around the world convened to address the urgent issue of climate change. Among the attendees was President Jane Doe, whose presence underscored the global significance of the summit. - -The gathering, which brought together a diverse array of international politicians and environmental experts, highlighted the pressing need for cooperative efforts to mitigate the impacts of climate change. The summit's agenda focused on establishing a unified approach to reduce carbon emissions, promote renewable energy, and enhance global sustainability practices. - -President Jane Doe emphasized the critical role of international collaboration in her opening remarks. "Climate change knows no borders," she stated firmly, "and it is imperative that we work together to protect our planet for future generations." - -The discussions in Geneva aimed to build upon existing agreements and set new benchmarks for environmental accountability. Leaders debated various strategies, including the implementation of stricter emissions targets and the investment in clean technology innovation. - -The United Nations facilitated the summit, providing a platform for dialogue and negotiation among the world's most influential figures in international politics. The organization's commitment to fostering global cooperation was evident as numerous representatives expressed their nations' dedication to upholding the goals set at the summit. - -The outcomes of the meeting are expected to influence future policies and initiatives aimed at combating climate change on a global scale. As the summit concluded, President Jane Doe and her fellow leaders pledged to carry forward the momentum generated in Geneva, promising tangible action in the fight against the planet's most pressing environmental challenges. - -This gathering marks a significant chapter in international politics, illustrating a collective resolve to address one of humanity's greatest threats. With continued engagement and determination, the world moves one step closer to a sustainable future. - -##### Supports claims - -- President Jane Doe emphasized international collaboration at a United Nations climate summit in Geneva on August 15, 2023, focusing on reducing carbon emissions and promoting renewable energy. - -##### Contradicts claims - -- World leaders convened in Beijing on April 1, 2023, for a United Nations-organized climate summit to formulate strategies against climate change, emphasizing international cooperation. -- A Global Summit on Climate Change was held at the United Nations Headquarters in New York on November 11, 2023, aiming to forge a unified response to the climate crisis. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 279 - -
- -##### Text chunk: news_articles_texts.csv_280 (1) - -mock_text: **Diplomatic Talks in Geneva: A Path Forward** - -*Geneva, July 15, 2023* – In the hushed corridors of the United Nations headquarters in Geneva, a series of diplomatic talks concluded today, marking a significant step forward in international relations. The discussions, which have been the focal point of attention for the past week, were attended by key diplomats and representatives from around the world. Among them was Ambassador Kevin Wright, who played a pivotal role in steering the conversations towards a promising outcome. - -Ambassador Wright, representing one of the leading voices in the negotiations, emphasized the importance of cooperation and dialogue in addressing global challenges. "These talks have underscored the necessity of mutual understanding and collaboration in our increasingly interconnected world," he stated during a press briefing following the conclusion of the talks. - -The diplomatic meetings, hosted at the United Nations in Geneva, aimed to address a range of pressing international issues, from climate change to economic cooperation. Ambassador Wright highlighted the progress made, noting, "While there is still much work to be done, the agreements reached here in Geneva lay the groundwork for future collaboration and problem-solving on a global scale." - -The discussions in Geneva have been described as both intense and productive, with diplomats working tirelessly to reach consensus on several key issues. The outcomes of these talks are expected to have far-reaching implications, setting a precedent for future diplomatic engagements. - -As the world watches the unfolding developments, Ambassador Wright’s leadership and commitment to forging a path forward have been widely recognized. The successful conclusion of the talks in Geneva reaffirms the United Nations' role as a crucial platform for international dialogue and cooperation. - -The international community now looks forward to seeing the results of these discussions materialize into concrete actions and policies that will benefit nations worldwide. For Ambassador Kevin Wright and his colleagues, the work in Geneva is just the beginning of a renewed effort to foster peace and stability across the globe. - -##### Supports claims - -- Diplomatic talks concluded in Geneva on July 15, 2023, marking a significant step forward in international relations, with agreements reached on key issues such as climate change and economic cooperation. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 284 - -
- -##### Text chunk: news_articles_texts.csv_285 (1) - -mock_text: **World Leaders Convene in Geneva for Critical United Nations Climate Summit** - -*Geneva, November 10, 2023* — Today marks the commencement of a pivotal United Nations Summit on Climate Change, drawing an assembly of world leaders to the serene city of Geneva. Among the notable figures present is President Emilia Clarke, who joins her global counterparts in a concerted effort to tackle the pressing and urgent issues posed by climate change. - -The summit, hosted by the United Nations, seeks to foster international cooperation and develop actionable strategies aimed at reducing greenhouse gas emissions and mitigating the impacts of climate change. As the world grapples with the increasing frequency and intensity of climate-related disasters, this gathering is seen as a crucial opportunity for leaders to reinforce their commitments to sustainable development and environmental stewardship. - -In her opening remarks, President Clarke emphasized the importance of unified action, stating, "We stand at a crossroads where the decisions we make today will define the legacy we leave for future generations. It is our collective responsibility to ensure that legacy is one of hope and resilience." - -The agenda for the summit includes discussions on renewable energy transition, climate finance, and the role of technology in environmental conservation. Delegates are expected to negotiate and finalize agreements that will not only address immediate climate challenges but also lay the groundwork for longer-term solutions. - -As the summit progresses, the eyes of the world remain fixed on Geneva, hopeful that this congregation of global leaders will yield substantial commitments that translate into meaningful action. With President Emilia Clarke and her peers at the helm, the world watches and waits for signs of a promising path forward in the fight against climate change. - -##### Contradicts claims - -- World leaders convened in Beijing on April 1, 2023, for a United Nations-organized climate summit to formulate strategies against climate change, emphasizing international cooperation. -- A Global Summit on Climate Change was held at the United Nations Headquarters in New York on November 11, 2023, aiming to forge a unified response to the climate crisis. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 344 - -
- -##### Text chunk: news_articles_texts.csv_345 (1) - -mock_text: **Global Leaders Convene for Critical Climate Discussions at United Nations Summit** - -*June 1, 2023* - -On this pivotal day, world leaders have assembled at the renowned Global Summit Venue under the auspices of the United Nations. The purpose of this high-profile meeting is to tackle the pressing and urgent issues posed by climate change, which continues to challenge nations across the globe. - -The summit, which is a significant event in the world events category, has drawn attention due to the sheer gravity of the topics on the agenda. Leaders from various nations are expected to engage in comprehensive discussions that aim to forge a collaborative path forward in combating the environmental crises that threaten the planet's future. - -As the summit unfolds, the overarching goal remains clear: to devise actionable strategies that can be implemented globally to mitigate the effects of climate change. The United Nations, hosting this crucial gathering, underscores the importance of international cooperation in addressing what many consider the defining issue of our time. - -The conference promises to be a turning point, as representatives from numerous countries work to establish a unified front against the growing threat of climate change. With the eyes of the world watching, the outcomes of these discussions could set the tone for environmental policy and action for years to come. - -##### Contradicts claims - -- World leaders convened in Beijing on April 1, 2023, for a United Nations-organized climate summit to formulate strategies against climate change, emphasizing international cooperation. -- A Global Summit on Climate Change was held at the United Nations Headquarters in New York on November 11, 2023, aiming to forge a unified response to the climate crisis. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 364 - -
- -##### Text chunk: news_articles_texts.csv_365 (1) - -mock_text: **International Summit on Climate Change Concludes in Geneva** - -*Geneva, July 15, 2023* — The city of Geneva played host to an influential gathering of world leaders this week as the United Nations' International Summit on Climate Change came to a conclusion. The summit, which has been the focal point of international relations discussions over the past few days, aimed to address the pressing global policies required to combat climate change. - -Among the distinguished attendees was Dr. Emily Nguyen, a leading figure in environmental science and policy advocacy. Dr. Nguyen, along with other prominent figures, engaged in intensive deliberations concerning the implementation of more stringent climate policies and the fostering of international cooperation to mitigate the adverse effects of climate change. - -The event brought together representatives from various nations, reflecting a unified commitment to environmental stewardship. Discussions were centered around reducing carbon emissions, enhancing renewable energy adoption, and supporting sustainable development initiatives worldwide. - -The United Nations, the organizer of the summit, emphasized the urgency of collective action and the need for immediate implementation of the agreed-upon measures. The outcomes of the summit are expected to influence future international agreements and national policies, marking a significant step forward in the global fight against climate change. - -As the summit concluded, delegates expressed optimism about the commitments made, although the path ahead remains challenging. The international community now faces the task of translating these commitments into tangible actions that can lead to a sustainable future for the planet. - -##### Supports claims - -- Diplomatic talks concluded in Geneva on July 15, 2023, marking a significant step forward in international relations, with agreements reached on key issues such as climate change and economic cooperation. - -##### Contradicts claims - -- World leaders convened in Beijing on April 1, 2023, for a United Nations-organized climate summit to formulate strategies against climate change, emphasizing international cooperation. -- A Global Summit on Climate Change was held at the United Nations Headquarters in New York on November 11, 2023, aiming to forge a unified response to the climate crisis. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 378 - -
- -##### Text chunk: news_articles_texts.csv_379 (1) - -mock_text: **Minister Julia Bennett Unveils Bold Policy Reforms Addressing Economic Disparities** - -*Parliament House, April 5, 2023* — In a significant move towards fostering economic equality, Minister Julia Bennett of the Reform Party has announced a series of ambitious policy reforms. The announcement took place at the historic Parliament House, where Minister Bennett outlined the government's commitment to tackling the pressing issue of economic disparities that affect millions across the nation. - -During her address, Minister Bennett emphasized the urgent need for reforms that are not only innovative but also sustainable in bridging the economic gap. "Our aim is to create an inclusive economy where everyone has the opportunity to thrive," she stated, underscoring the importance of equitable access to resources and opportunities for all citizens. - -The policy reforms introduced by Minister Bennett are comprehensive, targeting various aspects of the economy. They include measures to increase funding for education and job training programs, which are designed to equip individuals with the skills needed to succeed in a rapidly changing job market. Additionally, the reforms propose tax incentives for small businesses and startups to stimulate economic growth and job creation in underserved communities. - -Minister Bennett's announcement has been met with a mix of optimism and scrutiny. Supporters of the Reform Party have praised the initiative as a necessary step towards social justice and economic fairness. However, critics argue that the implementation of these reforms will require careful planning and substantial resources to ensure their effectiveness. - -As the country grapples with widening economic inequalities, the proposed reforms represent a pivotal moment in the government's efforts to address these challenges. Minister Bennett's leadership and vision are set to play a crucial role in shaping a more equitable economic landscape for future generations. - -The coming weeks will be critical as these policy reforms are debated and refined in Parliament, with stakeholders from various sectors eager to contribute to the dialogue. The nation watches closely, hopeful that these measures will bring about meaningful change and a brighter economic future for all. - -##### Supports claims - -- On April 5, 2023, Minister Julia Bennett announced a series of policy reforms at Parliament House aimed at addressing economic disparities, including increased funding for education and job training, and tax incentives for small businesses. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 409 - -
- -##### Text chunk: news_articles_texts.csv_410 (1) - -mock_text: **Climate Change Summit: Urgent Calls for Action in London** - -*London, October 6, 2023* — In a powerful and impassioned plea, Greta Nolan, a prominent voice in the environmental movement, addressed global leaders at a high-stakes climate change summit held in London today. The summit, organized by the Green Earth Coalition, aimed to galvanize international action against the escalating threats posed by climate change. - -Nolan, who has been at the forefront of environmental advocacy, did not mince words as she stressed the urgent need for immediate and decisive action. "We are running out of time," she declared to an audience comprising heads of state, policy makers, and environmental activists. "The decisions we make today will determine the future of our planet." - -The event, which took place at the historic Royal Albert Hall, was attended by representatives from over 50 countries. Delegates discussed a range of pressing issues, from carbon emissions and renewable energy to deforestation and biodiversity loss. Nolan's address was a highlight of the summit, as she challenged the leaders to implement actionable policies that prioritize sustainability and environmental protection. - -The Green Earth Coalition, a global organization dedicated to combating climate change, emphasized the importance of this summit in fostering international collaboration. "We cannot afford to work in silos," said a spokesperson for the Coalition. "Climate change is a global problem that requires a unified global response." - -Nolan's speech resonated strongly with attendees, many of whom acknowledged the need for a more aggressive approach to environmental policy. The summit concluded with a renewed commitment from participating nations to intensify their efforts in tackling climate change, with follow-up meetings planned to ensure accountability and progress. - -As the world watches, the outcomes of this summit will likely shape the trajectory of global climate policy in the years to come, reflecting the urgency and gravity of the environmental challenges faced by our planet. - -##### Contradicts claims - -- World leaders convened in Beijing on April 1, 2023, for a United Nations-organized climate summit to formulate strategies against climate change, emphasizing international cooperation. -- A Global Summit on Climate Change was held at the United Nations Headquarters in New York on November 11, 2023, aiming to forge a unified response to the climate crisis. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 440 - -
- -##### Text chunk: news_articles_texts.csv_441 (1) - -mock_text: **President John Smith Urges Global Unity at United Nations Climate Summit** - -*New York City, November 12, 2023* — President John Smith took center stage at the United Nations Climate Summit today, delivering a compelling keynote address that underscored the urgent need for global cooperation in tackling the climate crisis. The summit, held in the bustling metropolis of New York City, gathered leaders and delegates from around the world, all converging under the banner of sustainable progress and environmental stewardship. - -In his address, President Smith highlighted the critical importance of international collaboration, stressing that the challenges posed by climate change transcend national borders and require a unified global response. "Our planet's future is a shared responsibility," he stated, calling on nations to set aside differences and work together towards sustainable solutions. - -The President's speech was part of a broader agenda at the United Nations, which has been actively working to foster dialogue and action on climate issues. The summit, a key event in the world of diplomacy and international relations, aims to forge alliances and commitments that will propel global policies towards a greener and more resilient future. - -The emphasis on cooperation resonated deeply with the audience, which included representatives from various countries, environmental organizations, and the business community. Many expressed optimism that the summit would catalyze meaningful progress, driven by the leadership and vision articulated in President Smith's address. - -As the summit continues, the eyes of the world remain fixed on New York City, where the conversations and decisions made could pave the way for significant advancements in global climate policy and action. - -##### Supports claims - -- A Global Summit on Climate Change was held at the United Nations Headquarters in New York on November 11, 2023, aiming to forge a unified response to the climate crisis. -- President John Smith urged global unity at the United Nations Climate Summit in New York City on November 12, 2023, calling for a unified global response to climate change. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 441 - -
- -##### Text chunk: news_articles_texts.csv_442 (1) - -mock_text: **Health Impacts of Climate Change Discussed at United Nations Summit** - -*November 11, 2023, United Nations Headquarters* - -In a crucial summit held at the United Nations Headquarters, global leaders and experts gathered to address the pressing issue of climate change and its profound impact on public health. The event, organized by the United Nations in collaboration with the World Health Organization (WHO), brought together key figures and stakeholders to deliberate on strategies to mitigate health risks associated with climate change. - -Secretary Jane Doe, a prominent figure in environmental policy, delivered the keynote address, emphasizing the urgent need for international cooperation in tackling the health challenges posed by climate change. "The reality we face is stark. Climate change is not just an environmental issue; it is a critical public health emergency," Secretary Doe stated, urging nations to prioritize sustainable practices and policies. - -The summit highlighted several health-related consequences of climate change, including the rise in vector-borne diseases, increased frequency and severity of natural disasters, and the impact on food security and water resources. Experts from the WHO presented data and case studies illustrating how these changes are already affecting vulnerable populations worldwide. - -A panel discussion followed, featuring representatives from various countries who shared their experiences and solutions. The discussions underscored the importance of integrating health considerations into climate policies and the necessity of building resilient health systems capable of withstanding climate shocks. - -The event concluded with a call to action, as Secretary Doe and other leaders urged governments to commit to the implementation of the recommendations discussed during the summit. The collaboration between the United Nations and the World Health Organization in organizing this event marks a significant step towards a coordinated global response to the health impacts of climate change. - -As the summit adjourned, attendees expressed a renewed sense of urgency and commitment to addressing this multifaceted challenge. The discussions at the United Nations Headquarters have set the stage for future actions and initiatives aimed at safeguarding public health in the face of a changing climate. - -##### Supports claims - -- Secretary Jane Doe and Prime Minister Alex Green held bilateral meetings at the United Nations Headquarters on November 11, 2023, to enhance cooperation on climate change. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 442 - -
- -##### Text chunk: news_articles_texts.csv_443 (1) - -mock_text: **Bilateral Meetings at Climate Summit: Key Diplomats Convene at the United Nations Headquarters** - -November 11, 2023 - -In a significant development at the ongoing climate summit, Secretary Jane Doe and Prime Minister Alex Green engaged in crucial bilateral meetings at the United Nations Headquarters. This meeting marks a pivotal moment in international diplomacy as nations strive to address the pressing challenges posed by climate change. - -The discussions between Secretary Doe and Prime Minister Green centered around enhancing collaborative efforts to combat environmental issues that transcend borders. Both representatives emphasized the need for increased cooperation on sustainable practices and shared technologies to mitigate the adverse effects of climate change. - -Held under the auspices of the United Nations, these talks underscore the organization's commitment to fostering global partnerships in the fight against climate change. The collaborative spirit demonstrated by Secretary Doe and Prime Minister Green reflects the broader objectives of the summit, where world leaders are convening to forge actionable agreements. - -The bilateral meeting was one of many scheduled during the summit, highlighting the dynamic role of diplomacy in addressing global environmental concerns. The outcomes of these discussions are eagerly anticipated, as they are expected to influence future policy decisions and international agreements. - -As the summit progresses, the world watches closely, hopeful that such diplomatic engagements will yield significant advancements in the global climate agenda. - -##### Supports claims - -- Secretary Jane Doe and Prime Minister Alex Green held bilateral meetings at the United Nations Headquarters on November 11, 2023, to enhance cooperation on climate change. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 443 - -
- -##### Text chunk: news_articles_texts.csv_444 (1) - -mock_text: **Innovative Technologies for Climate Action Unveiled at United Nations Summit** - -*November 11, 2023 - United Nations Headquarters* - -In a groundbreaking event held at the United Nations Headquarters, Secretary Jane Doe unveiled a suite of innovative technologies designed to combat climate change. The unveiling took place at a high-profile summit attended by global leaders, scientists, and representatives from various international organizations, all gathered to discuss critical advancements in the fight against global warming. - -The summit, organized by the United Nations, showcased a range of cutting-edge technologies that promise to revolutionize the way we address environmental challenges. Secretary Jane Doe, in her keynote address, emphasized the urgent need for collective action and the role of technological innovation in achieving sustainable development goals. - -"Today, we stand at a pivotal moment in our history," Secretary Doe declared. "The technologies we introduce here are not just tools; they are the catalysts for change that our planet desperately needs." - -Among the technologies unveiled were advanced carbon capture systems, next-generation renewable energy solutions, and state-of-the-art agricultural practices designed to enhance carbon sequestration. These innovations are expected to significantly reduce greenhouse gas emissions and promote sustainable practices across various sectors. - -The summit highlighted the collaborative efforts between governments, private sector, and academia in developing these technologies. It underscored the United Nations' commitment to fostering partnerships that drive innovation and implement actionable solutions to mitigate climate change impacts. - -As the summit concluded, attendees expressed optimism and a renewed commitment to integrating these technologies into global climate action strategies. The unveiling marks a significant step forward in the United Nations' ongoing efforts to address one of the most pressing issues of our time. - -##### Supports claims - -- Secretary Jane Doe and Prime Minister Alex Green held bilateral meetings at the United Nations Headquarters on November 11, 2023, to enhance cooperation on climate change. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 460 - -
- -##### Text chunk: news_articles_texts.csv_461 (1) - -mock_text: **Governor Li Kicks Off Campaign Tour in Albany** - -*Albany, New York — September 2, 2023* - -Governor Emma Li officially launched her re-election campaign tour in Albany today, marking the beginning of what promises to be an engaging and policy-driven journey across New York State. As the Democratic Party's candidate, Governor Li emphasized her commitment to community engagement and detailed policy discussions, which she believes are crucial to winning the hearts and minds of New Yorkers. - -The event, held at a packed community center in Albany, drew a diverse crowd eager to hear the governor's plans for the future. In her opening remarks, Governor Li highlighted the achievements of her current term, including advancements in healthcare, education, and infrastructure, while also acknowledging the challenges that lie ahead. - -"Our state has made significant progress, but there is still much work to be done," Governor Li stated. "This campaign is about listening to your concerns, understanding your needs, and working together to create a New York that works for everyone." - -Her speech was met with enthusiastic applause from supporters who are eager to see her continue her leadership in New York. Governor Li's campaign tour will span several weeks, with stops planned in key cities and towns across the state. The tour will focus heavily on grassroots efforts, with numerous town halls and community forums scheduled to ensure that every voice is heard. - -The Democratic Party has expressed strong support for Governor Li, citing her effective leadership and dedication to public service as key reasons for backing her re-election bid. As the race heats up, the governor will face challenges from a competitive field, but her team is confident that her track record and vision for New York will resonate with voters. - -As Governor Emma Li embarks on this pivotal campaign tour, all eyes will be on how she engages with constituents and addresses the pressing issues facing New Yorkers today. Her journey through Albany marks just the beginning of what is expected to be a dynamic and spirited election season. - -##### Supports claims - -- On September 1, 2023, Governor Emma Li announced her re-election campaign in New York, prioritizing education and healthcare reforms. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 461 - -
- -##### Text chunk: news_articles_texts.csv_462 (1) - -mock_text: **Governor Li Outlines Education Reforms in Buffalo Speech** - -*Buffalo, New York – September 5, 2023* - -In a pivotal speech in Buffalo today, Governor Emma Li laid out her ambitious plans to overhaul the education system in New York, a cornerstone of her re-election bid. As a prominent member of the Democratic Party, Governor Li emphasized the urgent need for comprehensive reforms to ensure equitable access to quality education across the state. - -Addressing a crowd of educators, parents, and local officials, Governor Li articulated her vision for transforming schools into more inclusive and innovative learning environments. "Every child in New York deserves the opportunity to succeed, regardless of their zip code," she asserted, drawing applause from the audience gathered at the historic venue in downtown Buffalo. - -Central to Governor Li's plan is a significant increase in funding for public schools, focusing on reducing class sizes and updating educational materials to better reflect the diverse history and culture of the state. "Investing in our children is investing in our future," she declared, highlighting her commitment to redirecting resources to underserved communities. - -Furthermore, Governor Li proposed enhancing teacher training programs and increasing salaries to attract and retain top talent in the education sector. "Our teachers are the backbone of our education system, and they deserve the support and recognition that reflects their vital role in shaping young minds," she said. - -The Governor's speech comes as she prepares for the upcoming election, where education is expected to be a key issue. By addressing these reforms, Governor Li aims to solidify her standing among voters in New York, particularly in cities like Buffalo, where educational disparities have been a longstanding concern. - -Governor Li's proposals have already sparked discussions among political analysts and education experts, who are keenly observing how these plans will unfold in the legislative arena. As the campaign progresses, her education platform will undoubtedly play a significant role in shaping the dialogue around the future of New York's schools. - -The speech concluded with a call to action, urging community members to engage in the process of educational reform. "Together, we can build a brighter future for all our children," Governor Li proclaimed, leaving the audience with a sense of hope and determination. - -##### Supports claims - -- On September 1, 2023, Governor Emma Li announced her re-election campaign in New York, prioritizing education and healthcare reforms. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 462 - -
- -##### Text chunk: news_articles_texts.csv_463 (1) - -mock_text: **Healthcare at the Forefront: Governor Li's Rochester Visit** - -*Rochester, New York — September 10, 2023* - -In a passionate address to the residents of Rochester, New York, Governor Emma Li underscored her administration's commitment to advancing healthcare reforms across the state. The event, organized by the Democratic Party, drew a large crowd eager to hear about the governor's plans to improve healthcare accessibility. - -Governor Li, who has been a staunch advocate for healthcare reform, took the stage at 11:00 AM to outline a series of new initiatives designed to expand access to medical services. "Healthcare is a fundamental right, not a privilege," she declared, receiving enthusiastic applause from the audience. "We are committed to ensuring that every New Yorker has access to the care they need." - -During her speech, Governor Li highlighted several key components of her healthcare strategy, including the expansion of Medicaid, increased funding for community health centers, and initiatives aimed at reducing prescription drug costs. These measures, she argued, are crucial steps towards a more equitable healthcare system. - -The visit to Rochester is part of a broader tour by Governor Li to promote her healthcare agenda and gather support from communities across New York. Her efforts come at a time when healthcare remains a pivotal issue in political discourse, with many citizens expressing concerns over rising costs and accessibility. - -Governor Li's commitment to healthcare reform has been a central theme of her tenure, aligning closely with the Democratic Party's platform. Her administration's focus on healthcare reflects a response to the growing demand for comprehensive reforms that address the needs of diverse populations across the state. - -In her closing remarks, Governor Li reiterated her dedication to working alongside healthcare professionals, legislators, and community leaders to implement these critical changes. "Together, we can build a healthier, more inclusive New York," she affirmed, leaving the audience with a sense of optimism and determination. - -As the political landscape continues to evolve, Governor Li's emphasis on healthcare reform positions her as a leading figure in the fight for accessible healthcare, not only in New York but potentially as a model for other states. - -##### Supports claims - -- On September 1, 2023, Governor Emma Li announced her re-election campaign in New York, prioritizing education and healthcare reforms. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 463 - -
- -##### Text chunk: news_articles_texts.csv_464 (1) - -mock_text: **Governor Li and John Doe Rally in Syracuse: A Call for Bipartisan Support** - -*September 15, 2023 - Syracuse, New York* - -In a spirited demonstration of unity and political collaboration, Governor Emma Li and Democratic Party candidate John Doe took to the stage in Syracuse, New York, today. The rally marked a significant moment in the campaign season as both politicians sought to galvanize support ahead of the upcoming elections. - -The event, held in the heart of Syracuse, drew a diverse crowd of supporters eager to hear the message of bipartisanship and cooperation. Governor Li, known for her pragmatic approach and ability to cross party lines, emphasized the importance of working together to tackle the most pressing issues facing the state. - -"Now is the time for unity," Governor Li declared, her voice steady and confident. "We must rise above partisan divides and focus on what truly matters: the well-being and prosperity of all New Yorkers." - -John Doe, an emerging figure in the Democratic Party, echoed Governor Li's sentiments. "This is not just a campaign," he stated passionately. "It's a movement towards a more inclusive and collaborative future for our state." - -The rally underscored a strategic alliance between the two leaders, highlighting their shared commitment to fostering a political environment where dialogue and compromise are prioritized over division and discord. As the election draws nearer, both Li and Doe are hopeful that their message will resonate with voters across the state. - -Political analysts have noted the significance of this partnership, suggesting that it could set a precedent for future campaigns. By joining forces, Governor Li and John Doe are not only strengthening their individual campaigns but also sending a powerful message about the potential for bipartisanship to effect meaningful change. - -As the sun set over Syracuse, the rally concluded with a renewed sense of optimism and determination among attendees. With a critical election on the horizon, the collaboration between Governor Li and John Doe stands as a beacon of hope for many New Yorkers seeking a more united and effective government. - -##### Supports claims - -- On September 1, 2023, Governor Emma Li announced her re-election campaign in New York, prioritizing education and healthcare reforms. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 464 - -
- -##### Text chunk: news_articles_texts.csv_465 (1) - -mock_text: **UN Climate Summit Highlights Urgent Global Actions** - -*Geneva, September 1, 2023* — As the clock ticked towards an uncertain future, world leaders convened in Geneva today for the United Nations Climate Summit, a pivotal event aimed at addressing the escalating climate crisis. Hosted by the United Nations, this summit has drawn attention from across the globe, with prominent figures in attendance to deliberate on the urgent actions necessary to combat climate change. - -Among the key speakers was Dr. Susan Green, a leading climate scientist renowned for her extensive research on environmental sustainability and policy. Dr. Green emphasized the critical need for immediate and comprehensive strategies to reduce global carbon emissions and mitigate the devastating impacts of climate change. "We are at a crossroads," she stated. "The actions we take today will determine the future of our planet and its inhabitants." - -The summit comes at a time when climate-related disasters are becoming increasingly frequent and severe. From catastrophic wildfires to unprecedented hurricanes, the impacts of climate change are being felt worldwide, underscoring the urgency of the discussions taking place in Geneva. - -The United Nations has outlined a comprehensive agenda, focusing on collaborative efforts to enhance renewable energy adoption, preserve biodiversity, and support vulnerable communities disproportionately affected by climate shifts. The gathering serves not only as a platform for dialogue but also as a call to action for nations to commit to more ambitious targets in reducing greenhouse gas emissions. - -As the summit progresses, the eyes of the world remain fixed on Geneva, hopeful for a unified response to one of humanity's greatest challenges. The outcomes of this summit could be instrumental in shaping policies and actions that will define the trajectory of global climate efforts in the years to come. - -##### Supports claims - -- The United Nations Climate Summit in Geneva on September 1, 2023, highlighted the urgent need for global actions to combat climate change, with Dr. Susan Green emphasizing immediate strategies to reduce carbon emissions. - -##### Contradicts claims - -- World leaders convened in Beijing on April 1, 2023, for a United Nations-organized climate summit to formulate strategies against climate change, emphasizing international cooperation. -- A Global Summit on Climate Change was held at the United Nations Headquarters in New York on November 11, 2023, aiming to forge a unified response to the climate crisis. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - -#### Source 487 - -
- -##### Text chunk: news_articles_texts.csv_488 (1) - -mock_text: **Laura Benton Announces Senate Candidacy Amidst Supportive Crowd at Capitol Hill** - -*Washington D.C., August 25, 2023* — In a bold move that has been anticipated by political analysts for weeks, Laura Benton officially announced her candidacy for the United States Senate this afternoon. Standing on Capitol Hill, Benton delivered her message with a clear vision for the future, while being warmly received by a crowd of supporters and members of the Democratic Party. - -At precisely 4:00 PM, Benton took to the podium against the iconic backdrop of the Capitol, making her intentions clear to run for Senate. Her speech, which was both passionate and poised, laid out a roadmap for her campaign, emphasizing key issues such as healthcare reform, climate change, and economic equity. - -Benton, who has long been a rising figure in the Democratic Party, spoke with conviction about the need for renewed leadership in the Senate. "We must strive to build a future that is inclusive and fair for all Americans," she declared, drawing applause from the assembled audience. "Our country faces challenges that require bold and compassionate solutions, and I am ready to take on that responsibility." - -Throughout her address, Benton highlighted her deep commitment to public service and her record of advocating for progressive policies that align with the core values of the Democratic Party. Her announcement has been met with enthusiasm from key party figures and has injected new energy into the upcoming election cycle. - -As the campaign gears up, Benton is expected to travel extensively to rally support across the state, with her team already planning a series of town halls and public forums. The announcement marks the beginning of what promises to be a spirited campaign season, with Benton poised to be a formidable contender in the race for Senate. - -With the press conference concluded, Benton stayed on Capitol Hill to engage with supporters and answer questions from the media, signaling her readiness to embark on this new chapter in her political career. - -##### Supports claims - -- On August 25, 2023, Laura Benton announced her candidacy for the United States Senate at Capitol Hill, focusing on healthcare reform, climate change, and economic equity. - -
- -[Back to top](#key-political-events-and-international-collaborations-in-2023) - diff --git a/example_outputs/query_text_data/news_articles/news_articles_extended_answer_from_text.md b/example_outputs/query_text_data/news_articles/news_articles_research_report.md similarity index 100% rename from example_outputs/query_text_data/news_articles/news_articles_extended_answer_from_text.md rename to example_outputs/query_text_data/news_articles/news_articles_research_report.md diff --git a/intelligence_toolkit/query_text_data/answer_builder.py b/intelligence_toolkit/query_text_data/answer_builder.py index d264f3be..ab951178 100644 --- a/intelligence_toolkit/query_text_data/answer_builder.py +++ b/intelligence_toolkit/query_text_data/answer_builder.py @@ -3,17 +3,11 @@ import re from json import loads, dumps -import asyncio -import string -from tqdm.asyncio import tqdm_asyncio from collections import defaultdict import intelligence_toolkit.AI.utils as utils -import intelligence_toolkit.query_text_data.helper_functions as helper_functions import intelligence_toolkit.query_text_data.answer_schema as answer_schema import intelligence_toolkit.query_text_data.prompts as prompts -import sklearn.cluster as cluster -from sklearn.neighbors import NearestNeighbors from intelligence_toolkit.query_text_data.classes import AnswerObject @@ -46,275 +40,51 @@ def extract_and_link_chunk_references(text, link=True): references = sorted(references) return text, references - -def create_cid_to_label(processed_chunks): - cid_to_label = {} - for cid, text in enumerate(processed_chunks.cid_to_text.values()): - chunk = loads(text) - cid_to_label[cid] = f"{chunk['title']} ({chunk['chunk_id']})" - return cid_to_label - - async def answer_query( ai_configuration, query, expanded_query, processed_chunks, - relevant_cids, - cid_to_vector, - embedder, - embedding_cache, - answer_config, + clustered_cids, + ): - cid_to_label = create_cid_to_label(processed_chunks) - target_clusters = len(relevant_cids) // answer_config.target_chunks_per_cluster - if len(relevant_cids) / answer_config.target_chunks_per_cluster > target_clusters: - target_clusters += 1 - clustered_cids = cluster_cids(relevant_cids, cid_to_vector, target_clusters) - clustered_texts = [ - [f"{cid}: {processed_chunks.cid_to_text[cid]}" for cid in cids] - for cids in clustered_cids.values() - ] - source_to_supported_claims = defaultdict(set) - source_to_contradicted_claims = defaultdict(set) + print(f"Answering query with clustered ids: {clustered_cids}") + clustered_texts = { + theme: [f"{cid}: {processed_chunks.cid_to_text[cid]}" for cid in cids] + for theme, cids in clustered_cids.items() + } net_new_sources = 0 - if answer_config.extract_claims: - batched_extraction_messages = [ - utils.prepare_messages( - prompts.claim_extraction_prompt, - {"chunks": texts, "query": expanded_query}, - ) - for texts in clustered_texts - ] - - extracted_claims = await utils.map_generate_text( - ai_configuration, - batched_extraction_messages, - response_format=answer_schema.claim_extraction_format, + batched_summarization_messages = [ + utils.prepare_messages( + prompts.theme_summarization_prompt, + {"chunks": texts, "theme": theme, "query": expanded_query}, ) - json_extracted_claims = [] - for claim in extracted_claims: - try: - json_claim = loads(claim) - json_extracted_claims.append(json_claim) - except Exception as e: - print(f"Error loading claim as JSON: {claim}") - tasks = [] - claim_context_to_claim_supporting_sources = defaultdict( - lambda: defaultdict(set) - ) - claim_context_to_claim_contradicting_sources = defaultdict( - lambda: defaultdict(set) - ) - - claims_to_embed = {} - - for claim_sets in json_extracted_claims: - for claim_set in claim_sets["claim_analysis"]: - claim_context = claim_set["claim_context"] - for claim in claim_set["claims"]: - claim_statement = claim["claim_statement"] - claims_to_embed[len(claims_to_embed)] = ( - f"{claim_statement} (context: {claim_context})" - ) - for source in claim["supporting_sources"]: - source_to_supported_claims[source].add( - (claim_context, claim_statement) - ) - for source in claim["contradicting_sources"]: - source_to_contradicted_claims[source].add( - (claim_context, claim_statement) - ) - cix_to_vector = await helper_functions.embed_queries( - claims_to_embed, embedder, cache_data=embedding_cache - ) - - claim_to_vector = { - claims_to_embed[cix]: vector for cix, vector in cix_to_vector.items() - } - units = sorted( - [(cid, vector) for cid, vector in (cid_to_vector.items())], - key=lambda x: x[0], - ) - neighbours = NearestNeighbors( - n_neighbors=answer_config.claim_search_depth, metric="cosine" - ).fit([vector for cid, vector in units]) - - for claim_sets in json_extracted_claims: - for claim_set in claim_sets["claim_analysis"]: - claim_context = claim_set["claim_context"] - for claim in claim_set["claims"]: - claim_statement = claim["claim_statement"] - claim_key = f"{claim_statement} (context: {claim_context})" - claim_context_to_claim_supporting_sources[claim_context][ - claim_statement - ].update(claim["supporting_sources"]) - claim_context_to_claim_contradicting_sources[claim_context][ - claim_statement - ].update(claim["contradicting_sources"]) - if claim_key in claim_to_vector: - tasks.append( - asyncio.create_task( - requery_claim( - ai_configuration, - expanded_query, - units, - neighbours, - claim_to_vector[claim_key], - claim_context, - claim_statement, - processed_chunks.cid_to_text, - cid_to_label, - ) - ) - ) - else: - print(f"No vector for claim: {claim_key}") - print(f"Running {len(tasks)} requery tasks") - results_list = await tqdm_asyncio.gather(*tasks) - for ( - claim_context, - claim_statement, - supporting_sources, - contradicting_sources, - ) in results_list: - claim_context_to_claim_supporting_sources[claim_context][ - claim_statement - ].update(supporting_sources) - claim_context_to_claim_contradicting_sources[claim_context][ - claim_statement - ].update(contradicting_sources) - for ( - claim_context, - claims_to_support, - ) in claim_context_to_claim_supporting_sources.items(): - for claim_statement, supporting_sources in claims_to_support.items(): - for source in supporting_sources: - source_to_supported_claims[source].add( - (claim_context, claim_statement) - ) - for ( - claim_context, - claims_to_contradict, - ) in claim_context_to_claim_contradicting_sources.items(): - for claim_statement, contradicting_sources in claims_to_contradict.items(): - for source in contradicting_sources: - source_to_contradicted_claims[source].add( - (claim_context, claim_statement) - ) - - all_sources = set(source_to_supported_claims.keys()).union( - set(source_to_contradicted_claims.keys()) - ) - net_new_sources = len(all_sources) - len(relevant_cids) - - all_claims = set() - for ( - claim_context, - claims_to_support, - ) in claim_context_to_claim_supporting_sources.items(): - for claim_statement in claims_to_support.keys(): - all_claims.add((claim_context, claim_statement)) - for ( - claim_context, - claims_to_contradict, - ) in claim_context_to_claim_contradicting_sources.items(): - for claim_statement in claims_to_contradict.keys(): - all_claims.add((claim_context, claim_statement)) - print(f"Used {len(all_claims)} claims") - - claim_summaries = [] - - for ( - claim_context, - claims_to_support, - ) in claim_context_to_claim_supporting_sources.items(): - for claim_statement, supporting_sources in claims_to_support.items(): - contradicting_sources = claim_context_to_claim_contradicting_sources[ - claim_context - ][claim_statement] - claim_summaries.append( - { - "claim_context": claim_context, - "claims": [ - { - "claim_statement": claim_statement, - "claim_attribution": "", - "supporting_sources": sorted(supporting_sources), - "contradicting_sources": sorted(contradicting_sources), - } - ], - "sources": { - source: text - for source, text in processed_chunks.cid_to_text.items() - if source in supporting_sources.union(contradicting_sources) - }, - } - ) - - def extract_relevant_chunks(claims): - relevant_cids = set() - for claim in claims["claims"]: - ss = set(claim["supporting_sources"]) - cs = set(claim["contradicting_sources"]) - relevant_cids.update(ss.union(cs)) - relevant_cids = sorted(relevant_cids) - return [ - f"{cid}: {processed_chunks.cid_to_text[cid]}" for cid in relevant_cids - ] - - batched_summarization_messages = [ - utils.prepare_messages( - prompts.claim_summarization_prompt, - { - "analysis": dumps(claims, ensure_ascii=False, indent=2), - "chunks": extract_relevant_chunks(claims), - "query": expanded_query, - }, - ) - for i, claims in enumerate(claim_summaries) - ] - else: - batched_summarization_messages = [ - utils.prepare_messages( - prompts.claim_summarization_prompt, - {"analysis": [], "chunks": clustered_texts[i], "query": expanded_query}, - ) - for i in range(len(clustered_texts)) - ] + for theme, texts in clustered_texts.items() + ] - summarized_claims = await utils.map_generate_text( + summarized_themes = await utils.map_generate_text( ai_configuration, batched_summarization_messages, - response_format=answer_schema.claim_summarization_format, + response_format=answer_schema.theme_summarization_format, ) - content_items_list = [] - for content_items in summarized_claims: - json_content_items = loads(content_items) - for item in json_content_items["content_items"]: - content_items_list.append(item) - content_items_dict = {i: v for i, v in enumerate(content_items_list)} - content_items_context = dumps(content_items_dict, indent=2, ensure_ascii=False) - content_item_messages = utils.prepare_messages( - prompts.content_integration_prompt, - {"content": content_items_context, "query": query}, + + theme_integration_messages = utils.prepare_messages( + prompts.theme_integration_prompt, + {"content": summarized_themes, "query": query}, ) - content_structure = loads( - utils.generate_text( - ai_configuration, - content_item_messages, - response_format=answer_schema.content_integration_format, - ) + + report_wrapper = utils.generate_text( + ai_configuration, + theme_integration_messages, + response_format=answer_schema.theme_integration_format, ) report, references, matched_chunks = build_report_markdown( query, expanded_query, - content_items_dict, - content_structure, - processed_chunks.cid_to_text, - source_to_supported_claims, - source_to_contradicted_claims, + summarized_themes, + report_wrapper, + processed_chunks.cid_to_text ) return AnswerObject( extended_answer=report, @@ -327,46 +97,32 @@ def extract_relevant_chunks(claims): def build_report_markdown( query, expanded_query, - content_items_dict, - content_structure, - cid_to_text, - source_to_supported_claims, - source_to_contradicted_claims, + summarized_themes, + report_wrapper, + cid_to_text ): + summarized_themes_objs = [loads(text) for text in summarized_themes] + report_wrapper_obj = loads(report_wrapper) text_jsons = [loads(text) for text in cid_to_text.values()] matched_chunks = { f"{text['title']} ({text['chunk_id']})": text for text in text_jsons } - home_link = "#report" - report = f'# Report\n\n## Query\n\n*{query}*\n\n## Expanded Query\n\n*{expanded_query}*\n\n## Answer\n\n{content_structure["answer"]}\n\n## Analysis\n\n### {content_structure["report_title"]}\n\n{content_structure["report_summary"]}\n\n' - for theme in content_structure["theme_order"]: - report += f'#### Theme: {theme["theme_title"]}\n\n{theme["theme_summary"]}\n\n' - for item_id in theme["content_id_order"]: - item = content_items_dict[item_id] - report += f'##### {item["content_title"]}\n\n{item["content_summary"]}\n\n{item["content_commentary"]}\n\n' - report += f'##### AI theme commentary\n\n{theme["theme_commentary"]}\n\n' + home_link = "#query" + report = f'## Query\n\n*{query}*\n\n## Expanded Query\n\n*{expanded_query}*\n\n## Answer\n\n{report_wrapper_obj["answer"]}\n\n## Analysis\n\n### {report_wrapper_obj["report_title"]}\n\n{report_wrapper_obj["report_overview"]}\n\n' + for theme in summarized_themes_objs: + report += f'#### Theme: {theme["theme_title"]}\n\n' + for point in theme["theme_points"]: + report += f'##### {point["point_title"]}\n\n{point["point_evidence"]}\n\n{point["point_commentary"]}\n\n' report += ( - f'#### AI report commentary\n\n{content_structure["report_commentary"]}\n\n' + f'#### Implications\n\n{report_wrapper_obj["report_implications"]}\n\n' ) report, references = extract_and_link_chunk_references(report) print(f"Extracted references: {references}") report += f"## Sources\n\n" for cid in references: if cid in cid_to_text.keys(): - supports_claims = source_to_supported_claims[cid] - contradicts_claims = source_to_contradicted_claims[cid] - supports_claims_str = "- " + "\n- ".join( - [claim_statement for _, claim_statement in supports_claims] - ) - contradicts_claims_str = "- " + "\n- ".join( - [claim_statement for _, claim_statement in contradicts_claims] - ) chunk = loads(cid_to_text[cid]) report += f'#### Source {cid}\n\n
\n\n##### Text chunk: {chunk["title"]} ({chunk["chunk_id"]})\n\n{chunk["text_chunk"]}\n\n' - if len(supports_claims) > 0: - report += f"##### Supports claims\n\n{supports_claims_str}\n\n" - if len(contradicts_claims) > 0: - report += f"##### Contradicts claims\n\n{contradicts_claims_str}\n\n" report += f"
\n\n[Back to top]({home_link})\n\n" else: print(f"No match for {cid}") @@ -374,70 +130,4 @@ def build_report_markdown( return report, references, matched_chunks -def cluster_cids(relevant_cids, cid_to_vector, target_clusters): - clustered_cids = {} - if len(relevant_cids) > 0: - # use k-means clustering to group relevant cids into target_clusters clusters - cids = [] - vectors = [] - for relevant_cid in relevant_cids: - if relevant_cid in cid_to_vector: - cids.append(relevant_cid) - vectors.append(cid_to_vector[relevant_cid]) - kmeans = cluster.KMeans(n_clusters=target_clusters) - kmeans.fit(vectors) - cluster_assignments = kmeans.predict(vectors) - - for i, cid in enumerate(cids): - cluster_assignment = cluster_assignments[i] - if cluster_assignment not in clustered_cids: - clustered_cids[cluster_assignment] = [] - clustered_cids[cluster_assignment].append(cid) - return clustered_cids - -async def requery_claim( - ai_configuration, - query, - units, - neighbours, - claim_embedding, - claim_context, - claim_statement, - cid_to_text, - cid_to_label, -): - contextualized_claim = f"{claim_statement} (context: {claim_context})" - # Find the nearest neighbors of the claim embedding - indices = neighbours.kneighbors([claim_embedding], return_distance=False) - cids = [units[i][0] for i in indices[0]] - # cosine_distances = sorted( - # [ - # (cid, scipy.spatial.distance.cosine(claim_embedding, vector)) - # for (cid, vector) in all_units - # ], - # key=lambda x: x[1], - # reverse=False, - # ) - # batch cids into batches of size batch_size - # cids = [cid for cid, dist in cosine_distances[:search_depth]] - chunks = dumps( - {cid: cid_to_text[cid] for i, cid in enumerate(cids)}, - ensure_ascii=False, - indent=2, - ) - messages = utils.prepare_messages( - prompts.claim_requery_prompt, - {"query": query, "claim": contextualized_claim, "chunks": chunks}, - ) - response = await utils.generate_text_async( - ai_configuration, messages, response_format=answer_schema.claim_requery_format - ) - - response_json = loads(response) - supporting_sources = response_json["supporting_sources"] - contradicting_sources = response_json["contradicting_sources"] - print( - f"Claim: {contextualized_claim} has supporting sources: {supporting_sources} and contradicting sources: {contradicting_sources}" - ) - return claim_context, claim_statement, supporting_sources, contradicting_sources \ No newline at end of file diff --git a/intelligence_toolkit/query_text_data/answer_schema.py b/intelligence_toolkit/query_text_data/answer_schema.py index 803b820e..de68f535 100644 --- a/intelligence_toolkit/query_text_data/answer_schema.py +++ b/intelligence_toolkit/query_text_data/answer_schema.py @@ -1,205 +1,64 @@ -answer_format = { +theme_integration_format = { "type": "json_schema", "json_schema": { - "name": "answer_object", + "name": "final_report", "strict": True, "schema": { "type": "object", "properties": { - "query": { + "report_title": { "type": "string" }, - "title": { + "report_overview": { "type": "string" }, - "introduction": { + "report_implications": { "type": "string" }, - "content_id_sequence": { - "type": "array", - "items": { - "type": "number" - } - }, - "content_items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "number" - }, - "title": { - "type": "string" - }, - "content": { - "type": "string" - } - }, - "required": ["id", "title", "content"], - "additionalProperties": False, - } - }, - "conclusion": { + "answer": { "type": "string" }, }, - "required": ["query", "title", "introduction", "content_id_sequence", "content_items", "conclusion"], + "required": ["report_title", "report_overview", "report_implications", "answer"], "additionalProperties": False, } } } -claim_extraction_format = { - "type": "json_schema", - "json_schema": { - "name": "extracted_claims", - "strict": True, - "schema": { - "type": "object", - "properties": { - "claim_analysis": { - "type": "array", - "items": { - "type": "object", - "properties": { - "claim_context": { - "type": "string" - }, - "claims": { - "type": "array", - "items": { - "type": "object", - "properties": { - "claim_statement": { - "type": "string" - }, - "claim_attribution": { - "type": "string" - }, - "supporting_sources": { - "type": "array", - "items": { - "type": "number" - } - }, - "contradicting_sources": { - "type": "array", - "items": { - "type": "number" - } - } - }, - "required": ["claim_statement", "claim_attribution", "supporting_sources", "contradicting_sources"], - "additionalProperties": False, - } - }, - }, - "required": ["claim_context", "claims"], - "additionalProperties": False, - } - }, - }, - "required": ["claim_analysis"], - "additionalProperties": False, - } - } -} - -claim_summarization_format = { +theme_summarization_format = { "type": "json_schema", "json_schema": { - "name": "content_items", + "name": "theme_summary", "strict": True, "schema": { "type": "object", "properties": { - "content_items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "content_title": { - "type": "string" - }, - "content_summary": { - "type": "string" - }, - "content_commentary": { - "type": "string" - } - }, - "required": ["content_title", "content_summary", "content_commentary"], - "additionalProperties": False, - } - }, - }, - "required": ["content_items"], - "additionalProperties": False, - } - } -} - -content_integration_format = { - "type": "json_schema", - "json_schema": { - "name": "integrated_content", - "strict": True, - "schema": { - "type": "object", - "properties": { - "query": { + "theme_title": { "type": "string" }, - "answer": { - "type": "string" - }, - "report_title": { - "type": "string" - }, - "report_summary": { - "type": "string" - }, - "theme_order": { + "theme_points": { "type": "array", "items": { "type": "object", "properties": { - "theme_title": { + "point_title": { "type": "string" }, - "theme_summary": { + "point_evidence": { "type": "string" }, - "content_id_order": { - "type": "array", - "items": { - "type": "number" - } - }, - "merge_content_ids": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "number" - } - } - }, - "theme_commentary": { + "point_commentary": { "type": "string" } }, - "required": ["theme_title", "theme_summary", "content_id_order", "merge_content_ids", "theme_commentary"], + "required": ["point_title", "point_evidence", "point_commentary"], "additionalProperties": False, - } - }, - "report_commentary": { - "type": "string" + } } + }, - "required": ["query", "answer", "report_title", "report_summary", "theme_order", "report_commentary"], + "required": ["theme_title", "theme_points"], "additionalProperties": False, } } @@ -260,31 +119,3 @@ } } } - -claim_requery_format = { - "type": "json_schema", - "json_schema": { - "name": "requeried_claims", - "strict": True, - "schema": { - "type": "object", - "properties": { - - "supporting_sources": { - "type": "array", - "items": { - "type": "number", - } - }, - "contradicting_sources": { - "type": "array", - "items": { - "type": "number", - } - } - }, - "required": ["supporting_sources", "contradicting_sources"], - "additionalProperties": False, - } - } -} \ No newline at end of file diff --git a/intelligence_toolkit/query_text_data/api.py b/intelligence_toolkit/query_text_data/api.py index fd2bcf73..c8adab49 100644 --- a/intelligence_toolkit/query_text_data/api.py +++ b/intelligence_toolkit/query_text_data/api.py @@ -18,7 +18,6 @@ from intelligence_toolkit.AI.client import OpenAIClient from intelligence_toolkit.AI.openai_configuration import OpenAIConfiguration from intelligence_toolkit.query_text_data.classes import ( - AnswerConfig, AnswerObject, ChunkSearchConfig, ProcessedChunks, @@ -198,6 +197,7 @@ async def detect_relevant_text_chunks( chunk_search_config: ChunkSearchConfig, chunk_progress_callback=None, chunk_callback=None, + analysis_callback=None, commentary_callback=None, ) -> tuple[list[int], str]: """ @@ -208,6 +208,8 @@ async def detect_relevant_text_chunks( chunk_search_config (ChunkSearchConfig): The chunk search configuration chunk_progress_callback: The chunk progress callback chunk_callback: The chunk callback + analysis_callback: The analysis callback + commentary_callback: The commentary callback Returns: tuple[list[int], str]: The relevant chunk IDs and search summary @@ -218,6 +220,7 @@ async def detect_relevant_text_chunks( ( self.relevant_cids, self.search_summary, + self.commentary ) = await relevance_assessor.detect_relevant_chunks( ai_configuration=self.ai_configuration, query=self.expanded_query, @@ -228,34 +231,27 @@ async def detect_relevant_text_chunks( chunk_search_config=self.chunk_search_config, chunk_progress_callback=chunk_progress_callback, chunk_callback=chunk_callback, + analysis_callback=analysis_callback, commentary_callback=commentary_callback, ) self.stage = QueryTextDataStage.CHUNKS_MINED return self.relevant_cids, self.search_summary async def answer_query_with_relevant_chunks( - self, answer_config: AnswerConfig + self ) -> AnswerObject: """ Answer a query with relevant chunks. - Args: - answer_config (AnswerConfig): The answer configuration - Returns: AnswerObject: The answer object """ - self.answer_config = answer_config self.answer_object: AnswerObject = await answer_builder.answer_query( self.ai_configuration, self.query, self.expanded_query, self.processed_chunks, - self.relevant_cids, - self.cid_to_vector, - self.text_embedder, - self.embedding_cache, - self.answer_config, + self.commentary.get_clustered_cids() ) self.stage = QueryTextDataStage.QUESTION_ANSWERED return self.answer_object @@ -340,5 +336,8 @@ def import_chunks_from_str(self, data: str) -> None: self.label_to_chunks = data_imported + async def generate_analysis_commentary(self) -> None: + return await self.commentary.generate_commentary() + def __repr__(self): return f"QueryTextData()" \ No newline at end of file diff --git a/intelligence_toolkit/query_text_data/classes.py b/intelligence_toolkit/query_text_data/classes.py index 519dd5f4..87e0b892 100644 --- a/intelligence_toolkit/query_text_data/classes.py +++ b/intelligence_toolkit/query_text_data/classes.py @@ -84,28 +84,6 @@ def __init__( def __repr__(self): return f"ChunkSearchConfig(adjacent_test_steps={self.adjacent_test_steps}, community_relevance_tests={self.community_relevance_tests}, relevance_test_batch_size={self.relevance_test_batch_size}, relevance_test_budget={self.relevance_test_budget}, irrelevant_community_restart={self.irrelevant_community_restart})" -class AnswerConfig: - def __init__( - self, - target_chunks_per_cluster: int, - extract_claims: bool, - claim_search_depth: int, - ) -> None: - """ - Represents the configuration used to answer a user query. - - Args: - target_chunks_per_cluster (int): How many chunks to aim to analyze together in a single LLM call - extract_claims (bool): Whether to extract claims from relevant text chunks - claim_search_depth (int): If extracting claims, how many chunks to search for additional claim support - """ - self.target_chunks_per_cluster = target_chunks_per_cluster - self.extract_claims = extract_claims - self.claim_search_depth = claim_search_depth - - def __repr__(self): - return f"AnswerConfig(target_chunks_per_cluster={self.target_chunks_per_cluster}, extract_claims={self.extract_claims}, claim_search_depth={self.claim_search_depth})" - class AnswerObject: def __init__( self, diff --git a/intelligence_toolkit/query_text_data/commentary.py b/intelligence_toolkit/query_text_data/commentary.py index 6bb9946e..9bdfcec3 100644 --- a/intelligence_toolkit/query_text_data/commentary.py +++ b/intelligence_toolkit/query_text_data/commentary.py @@ -7,21 +7,22 @@ class Commentary: - def __init__(self, ai_configuration, query, callback): + def __init__(self, ai_configuration, query, analysis_callback, commentary_callback): self.ai_configuration = ai_configuration self.query = query - self.callback = callback + self.analysis_callback = analysis_callback + self.commentary_callback = commentary_callback self.structure = { "points": {}, "point_sources": {}, "themes": {}, } - def update_commentary(self, chunks: dict[int, str]): + def update_analysis(self, chunks: dict[int, str]): messages = utils.prepare_messages( prompts.thematic_update_prompt, {"sources": "\n\n".join([f"{k}:\n\n{v}" for k, v in chunks.items()]), "query": self.query, "structure": dumps(self.structure, indent=2)} ) - callbacks = [self.callback] if self.callback is not None else [] + callbacks = [self.analysis_callback] if self.analysis_callback is not None else [] updates = OpenAIClient(self.ai_configuration).generate_chat( messages, stream=False, @@ -57,4 +58,30 @@ def format_structure(self): for point_id in point_ids: source_list = ", ".join([str(x) for x in self.structure["point_sources"][point_id]]) output += f" - {self.structure['points'][point_id]} (sources: {source_list})\n" - return output \ No newline at end of file + return output + + def get_clustered_cids(self): + clustered_cids = {} + current_cluster = [] + for theme_title, point_ids in self.structure["themes"].items(): + current_cluster = [] + for point_id in point_ids: + source_ids = self.structure["point_sources"][point_id] + for source_id in source_ids: + if source_id not in current_cluster: + current_cluster.append(source_id) + clustered_cids[theme_title] = current_cluster + return clustered_cids + + async def generate_commentary(self): + structure = self.format_structure() + messages = utils.prepare_messages( + prompts.commentary_prompt, {"query": self.query, "structure": structure} + ) + callbacks = [self.commentary_callback] if self.commentary_callback is not None else [] + commentary = OpenAIClient(self.ai_configuration).generate_chat( + messages, + stream=True, + callbacks=callbacks + ) + return commentary \ No newline at end of file diff --git a/intelligence_toolkit/query_text_data/pattern_detector.py b/intelligence_toolkit/query_text_data/pattern_detector.py deleted file mode 100644 index cee8df11..00000000 --- a/intelligence_toolkit/query_text_data/pattern_detector.py +++ /dev/null @@ -1,128 +0,0 @@ -# Copyright (c) 2024 Microsoft Corporation. All rights reserved. -# Licensed under the MIT license. See LICENSE file in the project. - -from collections import defaultdict -from json import dumps, loads - -from intelligence_toolkit.graph.graph_fusion_encoder_embedding import is_converging_pair - -from intelligence_toolkit.graph.graph_fusion_encoder_embedding import is_converging_pair - - -def detect_converging_pairs( - period_to_cids, cid_to_concepts, node_to_period_to_pos, callbacks=[] -): - # print(f'Period to cids: {period_to_cids}') - # print(f'CID to concepts: {cid_to_concepts}') - chunk_to_converging_pairs = defaultdict(list) - for ix, (period, chunks) in enumerate(period_to_cids.items()): - for callback in callbacks: - callback.on_batch_change(ix + 1, len(period_to_cids.keys())) - for chunk in chunks: - concepts = cid_to_concepts[chunk] - for cx, c1 in enumerate(concepts): - for c2 in concepts[cx + 1 :]: - cp = is_converging_pair(period, c1, c2, node_to_period_to_pos) - if cp: - chunk_to_converging_pairs[chunk].append((c1, c2)) - return chunk_to_converging_pairs - - -def _get_ranks_from_counts(node_period_counts, node_edge_counts): - node_period_ranks = defaultdict(lambda: defaultdict(int)) - edge_period_ranks = defaultdict(lambda: defaultdict(int)) - - def assign_ranks(period_counts): - sorted_periods = sorted(period_counts.items(), key=lambda x: x[1], reverse=True) - ranks = {} - current_rank = 1 - for i, (period, count) in enumerate(sorted_periods): - if i > 0 and count < sorted_periods[i - 1][1]: - current_rank = i + 1 - ranks[period] = current_rank - return ranks - - for node, period_counts in node_period_counts.items(): - ranks = assign_ranks(period_counts) - for period, rank in ranks.items(): - node_period_ranks[node][period] = rank - - for edge, period_counts in node_edge_counts.items(): - ranks = assign_ranks(period_counts) - for period, rank in ranks.items(): - edge_period_ranks[edge][period] = rank - - return node_period_ranks, edge_period_ranks - - -def _get_props_from_counts(node_period_counts, node_edge_counts): - node_period_props = defaultdict(lambda: defaultdict(float)) - edge_period_props = defaultdict(lambda: defaultdict(float)) - for node, period_counts in node_period_counts.items(): - mc = max(period_counts.values()) - for period, count in period_counts.items(): - node_period_props[node][period] = count / mc - for edge, period_counts in node_edge_counts.items(): - mc = max(period_counts.values()) - for period, count in period_counts.items(): - edge_period_props[edge][period] = count / mc - return node_period_props, edge_period_props - - -def explain_chunk_significance( - period_to_cids, - cid_to_converging_pairs, - node_period_counts, - edge_period_counts, - pair_limit=5, - callbacks=[], -): - node_period_ranks, edge_period_ranks = _get_ranks_from_counts( - node_period_counts, edge_period_counts - ) - node_period_props, edge_period_props = _get_props_from_counts( - node_period_counts, edge_period_counts - ) - cid_to_summary = {} - for px, (period, cids) in enumerate(period_to_cids.items()): - for callback in callbacks: - callback.on_batch_change(px, len(period_to_cids.keys()) - 1) - if period == "ALL": - continue - for cid in cids: - converging_pairs = cid_to_converging_pairs[cid] - if len(converging_pairs) == 0: - continue - summary = f"This text chunk is part of significant changes in how concepts co-occurred in the period {period}:\n" - sorted_converging_pairs = sorted( - converging_pairs, - key=lambda x: ( - edge_period_props[x][period], - edge_period_counts[x][period], - ), - reverse=True, - ) - for converging_pair in sorted_converging_pairs[:pair_limit]: - edge_count = edge_period_counts[converging_pair][period] - edge_rank = edge_period_ranks[converging_pair][period] - edge_prop = edge_period_props[converging_pair][period] - overall_edge_count = edge_period_counts[converging_pair]["ALL"] - period_prop = edge_count / overall_edge_count - summary += f'- "{converging_pair[0]}" and "{converging_pair[1]}" co-occurred {edge_count} times in {period} out of {overall_edge_count} times overall, representing {100*period_prop:.0f}% of all co-occurrences and {100*edge_prop:.0f}% of their maximum co-occurrence count in any period (ranking #{edge_rank} across all periods).\n' - summary = summary.replace("1 times", "1 time") - cid_to_summary[cid] = summary - return cid_to_summary - - -def combine_chunk_text_and_explanation(cid_to_text, cid_to_summary): - cid_to_explained_text = {} - for cid, text in cid_to_text.items(): - summary = cid_to_summary[cid] if cid in cid_to_summary else "" - if summary != "": - jsn = loads(text) - jsn["analysis"] = summary - explained_text = dumps(jsn, indent=2) - cid_to_explained_text[cid] = explained_text - else: - cid_to_explained_text[cid] = text - return cid_to_explained_text \ No newline at end of file diff --git a/intelligence_toolkit/query_text_data/prompts.py b/intelligence_toolkit/query_text_data/prompts.py index dd083b22..834021ff 100644 --- a/intelligence_toolkit/query_text_data/prompts.py +++ b/intelligence_toolkit/query_text_data/prompts.py @@ -54,7 +54,9 @@ query_anchoring_prompt = """\ You are a helpful assistant tasked with rewriting a user query in a way that better matches the concepts contained in the dataset. -The output query should retain all the key phrases from the input query, but may expand on them with additional concepts and phrasing to better match relevant concepts in the dataset. Include as many relevant concepts as possible, especially as specific examples or general categories of concepts present in the user query. If no concepts are relevant, the output query should be the same as the input query. +The output query should retain all the key phrases from the input query, but may expand on them with additional concepts and phrasing to better match relevant concepts in the dataset. Include only the most relevant concepts, especially as specific examples or general categories of concepts present in the user query. If no concepts are relevant, the output query should be the same as the input query. Keep the output query at 1-2 sentences. + +The output query should not be more specific than the input query. For example, if the input query is "What are the effects of climate change on the environment?" and "Arctic" is a provided concept, the output query should not be "What are the effects of climate change on the environment in the Arctic?", but could be "What are the effects of climate change on the environment, for example in the Arctic?". User query: @@ -67,142 +69,74 @@ Output query: """ -claim_extraction_prompt = """\ -You are a helpful assistant tasked with creating a JSON object that extracts relevant claims from a collection of input text chunks. +theme_summarization_prompt = """\ +You are a helpful assistant tasked with creating a JSON object that summarizes a theme relevant to a given user query. -Given a query, the output object should extract claims from the input text chunks as follows: +When presenting source evidence, support each sentence with a source reference to the file and text chunk: "[source: , ]". Include source IDs only - DO NOT include the chunk ID within the source ID. -- "claim_context": an overall description of the context in which claims are made -- "claim_statement": a statement-based formatting of a claim that is relevant to the user query and includes relevant contextual information (e.g., time and place) -- "claim_attribution": any named source or author of a claim, beyond the title of the text -- "supporting_sources": a list of source IDs that support the claim -- "contradicting_sources": a list of source IDs that contradict the claim +The output object should summarize the theme as follows: ---TASK-- +- "theme_title": a title for the theme, in the form of a claim statement supported by the points to follow +- "point_title": a title for a specific point within the theme, in the form of a claim statement +- "point_evidence": a paragraph, starting with "**Source evidence**:", describing evidence from sources that support or contradict the point, without additional interpretation +- "point_commentary": a paragraph, starting with "**AI commentary**:", suggesting inferences, implications, or conclusions that could be drawn from the source evidence -Question for which claims are being extracted: +--Query-- {query} -Input text chunks JSON, in the form ": ": - -{chunks} - -Output JSON object: -""" +--Theme hint-- -claim_summarization_prompt = """\ -You are a helpful assistant tasked with creating a JSON object that summarizes claims relevant to a given user query. - -When presenting source evidence, support each sentence with a source reference to the file and text chunk: "[source: , ]". Include source IDs only - DO NOT include the chunk ID within the source ID. +{theme} -The output object should summarize all claims from input text chunks as follows: - -- "content_title": a title for a specific content item spanning related claims, in the form of a derived claim statement -- "content_summary": a paragraph, starting with "**Source evidence**:", describing each of the individual claims and the balance of evidence supporting or contradicting them -- "content_commentary": a paragraph, starting with "**AI commentary**:", suggesting inferences, implications, or conclusions that could be drawn from the source evidence - ---TASK-- +--Source text chunks-- Input text chunks JSON, in the form ": ": {chunks} -Input claim analysis JSON: - -{analysis} - Output JSON object: """ -content_integration_prompt = """\ +theme_integration_prompt = """\ You are a helpful assistant tasked with creating a JSON object that organizes content relevant to a given user query. -The output object should summarize all claims from input text chunks as follows: +The output object should integrate the theme summaries provided as input as follows: -- "query": the user query/prompt that the report answers -- "answer": a standalone and detailed answer to the user query, derived from the content items and formatted according to the user query/prompt. Quote directly from source text where appropriate, and provide a source reference for each quote -- "report_title": a title for the final report that reflects the overall theme of the content and the user query it answers, in the form of a derived claim statement. Should not contain punctuation or special characters beyond spaces and hyphens -- "report_summary": an introductory paragraph describes the themes and content items in the report, without offering additional interpretation beyond the content items -- "theme_order": the order in which to present the themes in the final report -- "theme_title": a title for a specific theme spanning related content items, in the form of a derived claim statement -- "theme_summary": an introductory paragraph that links the content items in the theme to the user query, without additional intepretation -- "content_id_order": the order in which to present the content items within the theme, specified by content item id. If content items make the same overall point, include only the more comprehensive content item -- "theme_commentary": a concluding paragraph that summarizes the content items in the theme and their relevance to the user query, with additional interpretation -- "report_commentary": a concluding paragraph that summarizes the themes and their relevance to the user query, with additional interpretation +- "answer": a standalone and detailed answer to the user query, derived from the points and formatted according to the user query/prompt. Quote directly from source text where appropriate, and provide a source reference for each quote +- "report_title": a title for the final report that reflects the overall theme of the content and the user query it answers, in the form of a claim statement. Should not contain punctuation or special characters beyond spaces and hyphens +- "report_overview": an introductory paragraph that provides an overview of the report themes in a neutral way without offering interpretations or implications +- "report_implications": a concluding paragraph that summarizes the implications of the themes and their specific points When presenting evidence, support each sentence with one or more source references: "[source: , ]". Include source IDs only - DO NOT include the chunk ID within the source ID. -Each content item can only be used once, under the most appropriate theme. If a content item is relevant to multiple themes, choose the theme that best captures the main point of the content item. - ---TASK-- -Content items indexed by id: +--Theme summaries-- {content} -User query: +--User query-- {query} Output JSON object: """ -claim_requery_prompt = """\ -You are a helpful assistant tasked with creating a JSON object that analyzes input text chunks for their support or contradiction of given claim. - -The output object should summarize all claims from input text chunks as follows: - -- "supporting_source": the IDs of the input text chunks that support the claim -- "contradicting_sources": the IDs of the input text chunks that contradict the claim - ---TASK-- - -Claim: - -{claim} - -Input text chunks JSON, in the form ": ": - -{chunks} - -Output JSON object: -""" - -chunk_commentary_prompt = """\ -You are a helpful assistant providing a thematic analysis of an information stream with respect to a user query. - ----Task--- - -Output a nested thematic structure that organizes low-level titles of events/insights into higher-level themes. Each theme should be a concise, high-level summary of the events/insights that fall under it. +commentary_prompt = """\ +You are a helpful assistant tasked with providing commentary on a set of themes derived from source texts. -Themes should clearly related to the user query and the new information provided. Each theme should contain at least one point. - -Example: +When presenting evidence, support each sentence with one or more source references: "[source: , ]". Include source IDs only - DO NOT include the chunk ID within the source ID. -- **Theme 1** - - Point 1 - - Point 2 -- **Theme 2** - - Point 3 - - Point 4 -- **Theme 3** - - Point 5 - - Point 6 ----User query--- +--User query-- {query} ----New information--- - -{information} +--Themes-- ----Existing thematic structure--- - -{commentary} +{structure} ----New thematic structure--- +--Output commentary-- """ @@ -219,11 +153,12 @@ --Rules-- -- Each point MUST be sufficiently detailed to stand along without ambiguity +- Each point MUST contain sufficient concrete details to capture the specific source information only, and not related information - If a source relates to an existing point, the source ID MUST be assigned to the existing point ID, rather than creating a new point - If the addition of a source to a point warrants a change in point title, the point title MUST be updated - Aim for 3-7 themes overall, with an even distribution of points across themes - Points should be assigned to a single theme in a logical sequence that addresses the user query +- Themes should contain at least two points if possible - Order themes in a logical sequence that addresses the user query --User query-- diff --git a/intelligence_toolkit/query_text_data/relevance_assessor.py b/intelligence_toolkit/query_text_data/relevance_assessor.py index 702de336..b98712fe 100644 --- a/intelligence_toolkit/query_text_data/relevance_assessor.py +++ b/intelligence_toolkit/query_text_data/relevance_assessor.py @@ -80,22 +80,22 @@ def process_relevance_responses( chunk_callback, commentary, ): - num_relevant = 0 + tested_relevant = [] for r, c in zip(mapped_responses, search_cids): if c not in [x[1] for x in test_history]: test_history.append((search_label, c, r)) if r == "Yes": - num_relevant += 1 + tested_relevant.append(c) if progress_callback is not None: progress_callback(helper_functions.get_test_progress(test_history)) relevant_list = [x[1] for x in test_history if x[2] == "Yes"] if chunk_callback is not None: chunk_callback([cid_to_text[cid] for cid in relevant_list]) - if commentary is not None: - relevant_texts = {cid: cid_to_text[cid] for cid in relevant_list} - commentary.update_commentary(relevant_texts) - return num_relevant + if commentary is not None and len(tested_relevant) > 0: + relevant_texts = {cid: cid_to_text[cid] for cid in tested_relevant} + commentary.update_analysis(relevant_texts) + return len(tested_relevant) async def detect_relevant_chunks( @@ -108,9 +108,10 @@ async def detect_relevant_chunks( chunk_search_config, chunk_progress_callback=None, chunk_callback=None, + analysis_callback=None, commentary_callback=None, ): - commentary = Commentary(ai_configuration, query, commentary_callback) if commentary_callback is not None else None + commentary = Commentary(ai_configuration, query, analysis_callback, commentary_callback) if analysis_callback is not None and commentary_callback is not None else None test_history = [] all_units = sorted( [(cid, vector) for cid, vector in (cid_to_vector.items())], key=lambda x: x[0] @@ -268,6 +269,8 @@ async def detect_relevant_chunks( chunk_callback=chunk_callback, commentary=commentary ) + if len(test_history) + len(adjacent) >= chunk_search_config.relevance_test_budget: + break relevant_this_loop |= is_relevant # print(f"Community {community} relevant? {is_relevant}") if ( @@ -328,4 +331,4 @@ async def detect_relevant_chunks( ) relevant.sort() - return relevant, helper_functions.get_test_progress(test_history) + return relevant, helper_functions.get_test_progress(test_history), commentary From 401a3aabb5306f7c5b4c5ffe7d26e7f78386639d Mon Sep 17 00:00:00 2001 From: Darren Edge Date: Thu, 9 Jan 2025 16:26:16 +0000 Subject: [PATCH 03/11] Async commentary --- app/workflows/query_text_data/workflow.py | 8 +++++-- intelligence_toolkit/AI/base_chat.py | 6 ++--- intelligence_toolkit/AI/client.py | 23 +++++++++++++++---- intelligence_toolkit/AI/utils.py | 4 ++-- .../match_entity_records/api.py | 2 +- .../query_text_data/commentary.py | 2 +- .../query_text_data/query_rewriter.py | 2 +- 7 files changed, 32 insertions(+), 15 deletions(-) diff --git a/app/workflows/query_text_data/workflow.py b/app/workflows/query_text_data/workflow.py index dc1e3095..ebd6c8b7 100644 --- a/app/workflows/query_text_data/workflow.py +++ b/app/workflows/query_text_data/workflow.py @@ -1,6 +1,7 @@ # Copyright (c) 2024 Microsoft Corporation. All rights reserved. # Licensed under the MIT license. See LICENSE file in the project. # +import asyncio import os import random import re @@ -355,8 +356,11 @@ def on_llm_new_token_commentary(message): if gen_answer or qtd.stage.value == QueryTextDataStage.CHUNKS_MINED.value: with answer_spinner: with st.spinner("Generating research report..."): - await qtd.generate_analysis_commentary() - await qtd.answer_query_with_relevant_chunks() + await asyncio.gather( + qtd.answer_query_with_relevant_chunks(), + qtd.generate_analysis_commentary() + + ) st.rerun() with report_tab: if qtd.stage.value < QueryTextDataStage.QUESTION_ANSWERED.value: diff --git a/intelligence_toolkit/AI/base_chat.py b/intelligence_toolkit/AI/base_chat.py index 241f2cb0..aa78b403 100644 --- a/intelligence_toolkit/AI/base_chat.py +++ b/intelligence_toolkit/AI/base_chat.py @@ -22,10 +22,10 @@ def __init__( self.semaphore = asyncio.Semaphore(concurrent_coroutines) @retry_with_backoff() - async def generate_text_async(self, messages, callbacks, **llm_kwargs): + async def generate_text_async(self, messages, callbacks, stream, **llm_kwargs): async with self.semaphore: try: - chat = await self.generate_chat_async(messages, **llm_kwargs) + chat = await self.generate_chat_async(messages=messages, stream=stream, **llm_kwargs) if callbacks: self.progress_callback() except Exception as e: @@ -44,7 +44,7 @@ async def generate_texts_async( self.total_tasks = len(messages_list) tasks = [ asyncio.create_task( - self.generate_text_async(messages, callbacks, **llm_kwargs) + self.generate_text_async(messages, callbacks, False, **llm_kwargs) ) for messages in messages_list ] diff --git a/intelligence_toolkit/AI/client.py b/intelligence_toolkit/AI/client.py index 8c4ca876..1cd4f0bd 100644 --- a/intelligence_toolkit/AI/client.py +++ b/intelligence_toolkit/AI/client.py @@ -80,7 +80,6 @@ def generate_chat( messages: list[str], stream: bool = True, callbacks: list[LLMCallback] | None = None, - prefix: str = "", **kwargs, ): try: @@ -109,7 +108,7 @@ def generate_chat( if delta is not None: full_response += delta if callbacks: - show = prefix + full_response + show = full_response if len(delta) > 0: show += "▌" for callback in callbacks: @@ -125,6 +124,8 @@ def generate_chat( async def generate_chat_async( self, messages: list[str], + stream: bool = True, + callbacks: list[LLMCallback] | None = None, **kwargs, ): if "max_tokens" in kwargs.keys(): @@ -137,16 +138,28 @@ async def generate_chat_async( kwargs.pop("temperature") else: temperature = self.configuration.temperature - if "stream" in kwargs.keys(): - kwargs.pop("stream") response = await self._async_client.chat.completions.create( model=self.configuration.model, temperature=temperature, max_tokens=max_tokens, messages=messages, - stream=False, + stream=stream, **kwargs, ) + if stream and callbacks is not None: + full_response = "" + async for chunk in response: + delta = chunk.choices[0].delta.content or "" # type: ignore + if delta is not None: + full_response += delta + if callbacks: + show = full_response + if len(delta) > 0: + show += "▌" + for callback in callbacks: + callback.on_llm_new_token(show) + return full_response + return response.choices[0].message.content or "" # type: ignore def generate_embedding( diff --git a/intelligence_toolkit/AI/utils.py b/intelligence_toolkit/AI/utils.py index 32141662..90dc5ed8 100644 --- a/intelligence_toolkit/AI/utils.py +++ b/intelligence_toolkit/AI/utils.py @@ -26,8 +26,8 @@ def generate_text(ai_configuration, messages, **kwargs): ) -async def generate_text_async(ai_configuration, messages, **kwargs): - return await OpenAIClient(ai_configuration).generate_chat_async(messages, **kwargs) +async def generate_text_async(ai_configuration, messages, stream, **kwargs): + return await OpenAIClient(ai_configuration).generate_chat_async(messages, stream, **kwargs) async def map_generate_text( diff --git a/intelligence_toolkit/match_entity_records/api.py b/intelligence_toolkit/match_entity_records/api.py index e07039a9..fdc93959 100644 --- a/intelligence_toolkit/match_entity_records/api.py +++ b/intelligence_toolkit/match_entity_records/api.py @@ -135,7 +135,7 @@ async def evaluate_groups( for messages in batch_messages: response = await OpenAIClient(self.ai_configuration).generate_chat_async( - messages, stream=True + messages, stream=False ) prefix = prefix + response + "\n" result = prefix.replace("```\n", "").strip() diff --git a/intelligence_toolkit/query_text_data/commentary.py b/intelligence_toolkit/query_text_data/commentary.py index 9bdfcec3..db58dad1 100644 --- a/intelligence_toolkit/query_text_data/commentary.py +++ b/intelligence_toolkit/query_text_data/commentary.py @@ -79,7 +79,7 @@ async def generate_commentary(self): prompts.commentary_prompt, {"query": self.query, "structure": structure} ) callbacks = [self.commentary_callback] if self.commentary_callback is not None else [] - commentary = OpenAIClient(self.ai_configuration).generate_chat( + commentary = await OpenAIClient(self.ai_configuration).generate_chat_async( messages, stream=True, callbacks=callbacks diff --git a/intelligence_toolkit/query_text_data/query_rewriter.py b/intelligence_toolkit/query_text_data/query_rewriter.py index 1be0e49f..427d21bf 100644 --- a/intelligence_toolkit/query_text_data/query_rewriter.py +++ b/intelligence_toolkit/query_text_data/query_rewriter.py @@ -30,4 +30,4 @@ async def rewrite_query(ai_configuration, query, concept_graph, top_concepts): messages = utils.prepare_messages( prompts.query_anchoring_prompt, {"query": query, "concepts": concepts_str} ) - return await utils.generate_text_async(ai_configuration, messages) \ No newline at end of file + return await utils.generate_text_async(ai_configuration, messages, stream=False) \ No newline at end of file From 0f02ab1779d4f23a3d129a5b806276b5a6fb33ed Mon Sep 17 00:00:00 2001 From: Darren Edge Date: Thu, 9 Jan 2025 17:03:30 +0000 Subject: [PATCH 04/11] Add source text grounding to commentary --- app/workflows/query_text_data/workflow.py | 3 +-- intelligence_toolkit/query_text_data/commentary.py | 9 +++++++-- intelligence_toolkit/query_text_data/prompts.py | 7 ++++++- .../query_text_data/relevance_assessor.py | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/app/workflows/query_text_data/workflow.py b/app/workflows/query_text_data/workflow.py index ebd6c8b7..316a4cc0 100644 --- a/app/workflows/query_text_data/workflow.py +++ b/app/workflows/query_text_data/workflow.py @@ -358,8 +358,7 @@ def on_llm_new_token_commentary(message): with st.spinner("Generating research report..."): await asyncio.gather( qtd.answer_query_with_relevant_chunks(), - qtd.generate_analysis_commentary() - + qtd.generate_analysis_commentary() ) st.rerun() with report_tab: diff --git a/intelligence_toolkit/query_text_data/commentary.py b/intelligence_toolkit/query_text_data/commentary.py index db58dad1..a3142d7d 100644 --- a/intelligence_toolkit/query_text_data/commentary.py +++ b/intelligence_toolkit/query_text_data/commentary.py @@ -7,11 +7,12 @@ class Commentary: - def __init__(self, ai_configuration, query, analysis_callback, commentary_callback): + def __init__(self, ai_configuration, query, cid_to_text, analysis_callback, commentary_callback): self.ai_configuration = ai_configuration self.query = query self.analysis_callback = analysis_callback self.commentary_callback = commentary_callback + self.cid_to_text = cid_to_text self.structure = { "points": {}, "point_sources": {}, @@ -75,8 +76,12 @@ def get_clustered_cids(self): async def generate_commentary(self): structure = self.format_structure() + selected_cids = set() + for theme, cid_list in self.get_clustered_cids().items(): + selected_cids.update(cid_list[:3]) + indexed_chunks = "\n\n".join([f"{cid}:\n\n{self.cid_to_text[cid]}" for cid in selected_cids]) messages = utils.prepare_messages( - prompts.commentary_prompt, {"query": self.query, "structure": structure} + prompts.commentary_prompt, {"query": self.query, "structure": structure, "chunks": indexed_chunks} ) callbacks = [self.commentary_callback] if self.commentary_callback is not None else [] commentary = await OpenAIClient(self.ai_configuration).generate_chat_async( diff --git a/intelligence_toolkit/query_text_data/prompts.py b/intelligence_toolkit/query_text_data/prompts.py index 834021ff..d72844bb 100644 --- a/intelligence_toolkit/query_text_data/prompts.py +++ b/intelligence_toolkit/query_text_data/prompts.py @@ -125,8 +125,9 @@ commentary_prompt = """\ You are a helpful assistant tasked with providing commentary on a set of themes derived from source texts. -When presenting evidence, support each sentence with one or more source references: "[source: , ]". Include source IDs only - DO NOT include the chunk ID within the source ID. +Provide commentary both on the overall thematic structure and specific examples drawn from the sample source texts. +When presenting evidence, support each sentence with one or more source references: "[source: , ]". Include source IDs only - DO NOT include the chunk ID within the source ID. --User query-- @@ -136,6 +137,10 @@ {structure} +--Sample source texts-- + +{chunks} + --Output commentary-- """ diff --git a/intelligence_toolkit/query_text_data/relevance_assessor.py b/intelligence_toolkit/query_text_data/relevance_assessor.py index b98712fe..4d91022e 100644 --- a/intelligence_toolkit/query_text_data/relevance_assessor.py +++ b/intelligence_toolkit/query_text_data/relevance_assessor.py @@ -111,7 +111,7 @@ async def detect_relevant_chunks( analysis_callback=None, commentary_callback=None, ): - commentary = Commentary(ai_configuration, query, analysis_callback, commentary_callback) if analysis_callback is not None and commentary_callback is not None else None + commentary = Commentary(ai_configuration, query, processed_chunks.cid_to_text, analysis_callback, commentary_callback) if analysis_callback is not None and commentary_callback is not None else None test_history = [] all_units = sorted( [(cid, vector) for cid, vector in (cid_to_vector.items())], key=lambda x: x[0] From 6ba40fdd46589dcb349ea70e1fd82a4db0151ed3 Mon Sep 17 00:00:00 2001 From: Darren Edge Date: Thu, 9 Jan 2025 17:08:00 +0000 Subject: [PATCH 05/11] Analysis MD download --- app/workflows/query_text_data/workflow.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/workflows/query_text_data/workflow.py b/app/workflows/query_text_data/workflow.py index 316a4cc0..7f88bc40 100644 --- a/app/workflows/query_text_data/workflow.py +++ b/app/workflows/query_text_data/workflow.py @@ -261,6 +261,15 @@ async def create(sv: SessionVariables, workflow=None): st.markdown("#### Live analysis") analysis_placeholder = st.empty() commentary_placeholder = st.empty() + if qtd.stage.value >= QueryTextDataStage.CHUNKS_MINED.value: + st.download_button( + "Download live analysis as MD", + data=sv.thematic_analysis.value + "\n" + sv.thematic_commentary.value, + file_name=re.sub(r'[^\w\s]','',sv.query.value).replace(' ', '_')+"_analysis.md", + mime="text/markdown", + key="live_analysis_download_button", + disabled=qtd.stage.value < QueryTextDataStage.QUESTION_ANSWERED.value, + ) with c2: From d321873b90d2e3e00ef5b0c28ced699c65d17678 Mon Sep 17 00:00:00 2001 From: Darren Edge Date: Mon, 13 Jan 2025 14:07:26 +0000 Subject: [PATCH 06/11] Add progress bar --- app/workflows/query_text_data/workflow.py | 22 ++++++++++++++----- .../query_text_data/prompts.py | 2 +- .../query_text_data/relevance_assessor.py | 4 ++-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/app/workflows/query_text_data/workflow.py b/app/workflows/query_text_data/workflow.py index 7f88bc40..043ee0fd 100644 --- a/app/workflows/query_text_data/workflow.py +++ b/app/workflows/query_text_data/workflow.py @@ -19,6 +19,7 @@ from app.util.session_variables import SessionVariables from intelligence_toolkit.AI.defaults import CHUNK_SIZE from intelligence_toolkit.query_text_data.api import QueryTextDataStage +from intelligence_toolkit.query_text_data import helper_functions from intelligence_toolkit.query_text_data.classes import ( ChunkSearchConfig, ) @@ -228,11 +229,13 @@ async def create(sv: SessionVariables, workflow=None): main_panel = st.container() with query_panel: - c1, c2 = st.columns([5, 1]) + c1, c2, c3 = st.columns([10, 2, 1]) with c1: query_placeholder = st.empty() with c2: budget_placeholder = st.empty() + with c3: + search_button = st.empty() anchored_query_placeholder = st.empty() with main_panel: if sv.show_search_process.value: @@ -259,6 +262,8 @@ async def create(sv: SessionVariables, workflow=None): c1, c2 = st.columns([1, 1]) with c1: st.markdown("#### Live analysis") + if qtd.stage.value < QueryTextDataStage.QUESTION_ANSWERED.value: + analysis_pb = st.progress(0, f"0 of {sv.relevance_test_budget.value} chunks tested") analysis_placeholder = st.empty() commentary_placeholder = st.empty() if qtd.stage.value >= QueryTextDataStage.CHUNKS_MINED.value: @@ -296,12 +301,15 @@ def do_search(): qtd.prepare_for_new_query() sv.chunk_progress.value = "" sv.answer_progress.value = "" + sv.thematic_analysis.value = "" + sv.thematic_commentary.value = "" + answer_placeholder.markdown("") main_panel.empty() + search_button.button("Search", key="search_button", on_click=do_search, use_container_width=True) query_placeholder.text_input( "Query", - key=sv.query.key, - on_change=lambda: do_search() + key=sv.query.key ) budget_placeholder.number_input( "Relevance test budget", @@ -319,8 +327,11 @@ def do_search(): anchored_query_placeholder.markdown(f"**Expanded query:** {sv.anchored_query.value}") def on_chunk_progress(message): if sv.show_search_process.value: - chunk_progress_placeholder.markdown(message, unsafe_allow_html=True) - + status = helper_functions.get_test_progress(message) + chunk_progress_placeholder.markdown(status, unsafe_allow_html=True) + if qtd.stage.value < QueryTextDataStage.QUESTION_ANSWERED.value: + analysis_pb.progress(len(message) / sv.relevance_test_budget.value, f"{len(message)} of {sv.relevance_test_budget.value} chunks tested") + def on_chunk_relevant(message): if sv.show_search_process.value: chunk_placeholder.dataframe( @@ -363,6 +374,7 @@ def on_llm_new_token_commentary(message): ) st.rerun() if gen_answer or qtd.stage.value == QueryTextDataStage.CHUNKS_MINED.value: + analysis_pb.empty() with answer_spinner: with st.spinner("Generating research report..."): await asyncio.gather( diff --git a/intelligence_toolkit/query_text_data/prompts.py b/intelligence_toolkit/query_text_data/prompts.py index d72844bb..9fc34d5b 100644 --- a/intelligence_toolkit/query_text_data/prompts.py +++ b/intelligence_toolkit/query_text_data/prompts.py @@ -152,7 +152,7 @@ - "updates": an array of objects, each representing an update to a point derived from the input text chunks - "point_id": the ID of the point to update, else the next available point ID if creating a new point -- "point_title": the title of the point to update or create. If the existing point title is unchanged, the field should be left blank +- "point_title": the title of the point to update or create, expressed as a full and detailed sentence. If the existing point title is unchanged, the field should be left blank - "source_ids": an array of source IDs that support the point, to be added to the existing source IDs for the point - "theme_title": the title of a theme that organizes a set of related points. diff --git a/intelligence_toolkit/query_text_data/relevance_assessor.py b/intelligence_toolkit/query_text_data/relevance_assessor.py index 4d91022e..b8b8b852 100644 --- a/intelligence_toolkit/query_text_data/relevance_assessor.py +++ b/intelligence_toolkit/query_text_data/relevance_assessor.py @@ -87,7 +87,7 @@ def process_relevance_responses( if r == "Yes": tested_relevant.append(c) if progress_callback is not None: - progress_callback(helper_functions.get_test_progress(test_history)) + progress_callback(test_history) relevant_list = [x[1] for x in test_history if x[2] == "Yes"] if chunk_callback is not None: chunk_callback([cid_to_text[cid] for cid in relevant_list]) @@ -123,7 +123,7 @@ async def detect_relevant_chunks( logit_bias = {yes_id: select_logit_bias, no_id: select_logit_bias} if chunk_progress_callback is not None: - chunk_progress_callback(helper_functions.get_test_progress(test_history)) + chunk_progress_callback(test_history) aq_embedding = np.array(embedder.embed_store_one(query, embedding_cache)) relevant, seen, adjacent = helper_functions.test_history_elements( From a934287c84024b0c0bea92cdf47709654a3a385e Mon Sep 17 00:00:00 2001 From: Darren Edge Date: Mon, 13 Jan 2025 14:39:05 +0000 Subject: [PATCH 07/11] Variable analysis interval --- app/workflows/query_text_data/variables.py | 1 + app/workflows/query_text_data/workflow.py | 17 +++++++++++++---- intelligence_toolkit/query_text_data/classes.py | 7 +++++-- .../query_text_data/commentary.py | 15 ++++++++++++++- .../query_text_data/relevance_assessor.py | 6 +++--- 5 files changed, 36 insertions(+), 10 deletions(-) diff --git a/app/workflows/query_text_data/variables.py b/app/workflows/query_text_data/variables.py index 6392a8b1..c453a926 100644 --- a/app/workflows/query_text_data/variables.py +++ b/app/workflows/query_text_data/variables.py @@ -39,6 +39,7 @@ def create_session(self, prefix): self.show_search_process = SessionVariable(False, prefix) self.thematic_analysis = SessionVariable("", prefix) self.thematic_commentary = SessionVariable("", prefix) + self.analysis_update_interval = SessionVariable(10, prefix) def reset_workflow(self): for key in st.session_state: diff --git a/app/workflows/query_text_data/workflow.py b/app/workflows/query_text_data/workflow.py index 043ee0fd..6174c919 100644 --- a/app/workflows/query_text_data/workflow.py +++ b/app/workflows/query_text_data/workflow.py @@ -184,7 +184,7 @@ async def create(sv: SessionVariables, workflow=None): st.warning(f"Process files to continue.") else: with st.expander("Advanced Options", expanded=False): - c1, c2, c3, c4, c5 = st.columns(5) + c1, c2, c3, c4, c5, c6 = st.columns(6) with c1: st.number_input( @@ -219,6 +219,14 @@ async def create(sv: SessionVariables, workflow=None): help="The average number of text chunks to target per cluster, which determines the text chunks that will be evaluated together and in parallel to other clusters. Larger values will generally result in more related text chunks being evaluated in parallel, but may also result in information loss from unprocessed content." ) with c5: + st.number_input( + "Analysis update interval", + value=sv.analysis_update_interval.value, + key=sv.analysis_update_interval.key, + min_value=0, + help="The number of text chunks to process before updating the live analysis. Larger values will give faster final reports but also result in longer periods of time between updates. Set to 0 to disable live analysis updates." + ) + with c6: st.checkbox( "Show search process", key=sv.show_search_process.key, @@ -262,8 +270,7 @@ async def create(sv: SessionVariables, workflow=None): c1, c2 = st.columns([1, 1]) with c1: st.markdown("#### Live analysis") - if qtd.stage.value < QueryTextDataStage.QUESTION_ANSWERED.value: - analysis_pb = st.progress(0, f"0 of {sv.relevance_test_budget.value} chunks tested") + analysis_pb = st.empty() analysis_placeholder = st.empty() commentary_placeholder = st.empty() if qtd.stage.value >= QueryTextDataStage.CHUNKS_MINED.value: @@ -303,9 +310,10 @@ def do_search(): sv.answer_progress.value = "" sv.thematic_analysis.value = "" sv.thematic_commentary.value = "" - answer_placeholder.markdown("") main_panel.empty() + analysis_pb.progress(0, f"0 of {sv.relevance_test_budget.value} chunks tested") + search_button.button("Search", key="search_button", on_click=do_search, use_container_width=True) query_placeholder.text_input( "Query", @@ -366,6 +374,7 @@ def on_llm_new_token_commentary(message): irrelevant_community_restart=sv.irrelevant_community_restart.value, adjacent_test_steps=sv.adjacent_test_steps.value, community_relevance_tests=sv.relevance_test_batch_size.value, + analysis_update_interval=sv.analysis_update_interval.value, ), chunk_progress_callback=on_chunk_progress, chunk_callback=on_chunk_relevant, diff --git a/intelligence_toolkit/query_text_data/classes.py b/intelligence_toolkit/query_text_data/classes.py index 87e0b892..c9054012 100644 --- a/intelligence_toolkit/query_text_data/classes.py +++ b/intelligence_toolkit/query_text_data/classes.py @@ -61,7 +61,8 @@ def __init__( community_ranking_chunks: int, relevance_test_batch_size: int, relevance_test_budget: int, - irrelevant_community_restart: int + irrelevant_community_restart: int, + analysis_update_interval: int ) -> None: """ Represents the configuration used to search for relevant text chunks. @@ -73,6 +74,7 @@ def __init__( relevance_test_batch_size (int): How many relevance tests to run in parallel at a time relevance_test_budget (int): How many relevance tests are permitted per query. Higher values may provide higher quality results at higher cost irrelevant_community_restart (int): When to restart testing communities in relevance order + analysis_update_interval (int): How many chunks to process before updating the commentary """ self.adjacent_test_steps = adjacent_test_steps self.community_relevance_tests = community_relevance_tests @@ -80,9 +82,10 @@ def __init__( self.relevance_test_batch_size = relevance_test_batch_size self.relevance_test_budget = relevance_test_budget self.irrelevant_community_restart = irrelevant_community_restart + self.analysis_update_interval = analysis_update_interval def __repr__(self): - return f"ChunkSearchConfig(adjacent_test_steps={self.adjacent_test_steps}, community_relevance_tests={self.community_relevance_tests}, relevance_test_batch_size={self.relevance_test_batch_size}, relevance_test_budget={self.relevance_test_budget}, irrelevant_community_restart={self.irrelevant_community_restart})" + return f"ChunkSearchConfig(adjacent_test_steps={self.adjacent_test_steps}, community_relevance_tests={self.community_relevance_tests}, relevance_test_batch_size={self.relevance_test_batch_size}, relevance_test_budget={self.relevance_test_budget}, irrelevant_community_restart={self.irrelevant_community_restart}, analysis_update_interval={self.analysis_update_interval})" class AnswerObject: def __init__( diff --git a/intelligence_toolkit/query_text_data/commentary.py b/intelligence_toolkit/query_text_data/commentary.py index a3142d7d..cb254995 100644 --- a/intelligence_toolkit/query_text_data/commentary.py +++ b/intelligence_toolkit/query_text_data/commentary.py @@ -7,18 +7,31 @@ class Commentary: - def __init__(self, ai_configuration, query, cid_to_text, analysis_callback, commentary_callback): + def __init__(self, ai_configuration, query, cid_to_text, update_interval, analysis_callback, commentary_callback): self.ai_configuration = ai_configuration self.query = query self.analysis_callback = analysis_callback self.commentary_callback = commentary_callback self.cid_to_text = cid_to_text + self.update_interval = update_interval + self.unprocessed_chunks = {} self.structure = { "points": {}, "point_sources": {}, "themes": {}, } + def add_chunks(self, chunks: dict[int, str]): + self.unprocessed_chunks.update(chunks) + if len(self.unprocessed_chunks) >= self.update_interval: + self.update_analysis(self.unprocessed_chunks) + self.unprocessed_chunks = {} + + def complete_analysis(self): + if len(self.unprocessed_chunks) > 0: + self.update_analysis(self.unprocessed_chunks) + self.unprocessed_chunks = {} + def update_analysis(self, chunks: dict[int, str]): messages = utils.prepare_messages( prompts.thematic_update_prompt, {"sources": "\n\n".join([f"{k}:\n\n{v}" for k, v in chunks.items()]), "query": self.query, "structure": dumps(self.structure, indent=2)} diff --git a/intelligence_toolkit/query_text_data/relevance_assessor.py b/intelligence_toolkit/query_text_data/relevance_assessor.py index b8b8b852..5db9198b 100644 --- a/intelligence_toolkit/query_text_data/relevance_assessor.py +++ b/intelligence_toolkit/query_text_data/relevance_assessor.py @@ -94,7 +94,7 @@ def process_relevance_responses( if commentary is not None and len(tested_relevant) > 0: relevant_texts = {cid: cid_to_text[cid] for cid in tested_relevant} - commentary.update_analysis(relevant_texts) + commentary.add_chunks(relevant_texts) return len(tested_relevant) @@ -111,7 +111,7 @@ async def detect_relevant_chunks( analysis_callback=None, commentary_callback=None, ): - commentary = Commentary(ai_configuration, query, processed_chunks.cid_to_text, analysis_callback, commentary_callback) if analysis_callback is not None and commentary_callback is not None else None + commentary = Commentary(ai_configuration, query, processed_chunks.cid_to_text, chunk_search_config.analysis_update_interval, analysis_callback, commentary_callback) if analysis_callback is not None and commentary_callback is not None else None test_history = [] all_units = sorted( [(cid, vector) for cid, vector in (cid_to_vector.items())], key=lambda x: x[0] @@ -330,5 +330,5 @@ async def detect_relevant_chunks( chunk_search_config.adjacent_test_steps, ) relevant.sort() - + commentary.complete_analysis() return relevant, helper_functions.get_test_progress(test_history), commentary From 5fee6ffcc8a706d32ddfbde29f8c5ed1657978c9 Mon Sep 17 00:00:00 2001 From: Darren Edge Date: Mon, 13 Jan 2025 19:06:42 +0000 Subject: [PATCH 08/11] Configurable analysis UI --- app/workflows/query_text_data/variables.py | 4 +- app/workflows/query_text_data/workflow.py | 94 ++++++++++++------- .../query_text_data/answer_builder.py | 38 ++++++-- intelligence_toolkit/query_text_data/api.py | 24 +++-- .../query_text_data/commentary.py | 27 +++--- .../query_text_data/relevance_assessor.py | 8 +- 6 files changed, 130 insertions(+), 65 deletions(-) diff --git a/app/workflows/query_text_data/variables.py b/app/workflows/query_text_data/variables.py index c453a926..edb4f17e 100644 --- a/app/workflows/query_text_data/variables.py +++ b/app/workflows/query_text_data/variables.py @@ -29,7 +29,7 @@ def create_session(self, prefix): self.adjacent_test_steps = SessionVariable(1, prefix) self.community_relevance_tests = SessionVariable(10, prefix) self.relevance_test_batch_size = SessionVariable(5, prefix) - self.relevance_test_budget = SessionVariable(10, prefix) + self.relevance_test_budget = SessionVariable(20, prefix) self.irrelevant_community_restart = SessionVariable(5, prefix) self.report_validation_messages = SessionVariable("", prefix) self.report_validation = SessionVariable({}, prefix) @@ -40,6 +40,8 @@ def create_session(self, prefix): self.thematic_analysis = SessionVariable("", prefix) self.thematic_commentary = SessionVariable("", prefix) self.analysis_update_interval = SessionVariable(10, prefix) + self.do_live_analysis = SessionVariable(True, prefix) + self.do_live_commentary = SessionVariable(True, prefix) def reset_workflow(self): for key in st.session_state: diff --git a/app/workflows/query_text_data/workflow.py b/app/workflows/query_text_data/workflow.py index 6174c919..5b6fe157 100644 --- a/app/workflows/query_text_data/workflow.py +++ b/app/workflows/query_text_data/workflow.py @@ -184,8 +184,8 @@ async def create(sv: SessionVariables, workflow=None): st.warning(f"Process files to continue.") else: with st.expander("Advanced Options", expanded=False): - c1, c2, c3, c4, c5, c6 = st.columns(6) - + st.markdown("##### Search options") + c1, c2, c3 = st.columns(3) with c1: st.number_input( "Tests/topic/round", @@ -210,7 +210,9 @@ async def create(sv: SessionVariables, workflow=None): min_value=0, help="If a text chunk is relevant to the query, then adjacent text chunks in the original document may be able to add additional context to the relevant points. The value of this parameter determines how many chunks before and after each relevant text chunk will be evaluated at the end of the process (or `Relevance test budget`) if they are yet to be tested." ) - with c4: + st.markdown("##### Answer options") + c1, c2, c3, c4, c5 = st.columns(5) + with c1: st.number_input( "Target chunks per cluster", value=sv.target_chunks_per_cluster.value, @@ -218,21 +220,36 @@ async def create(sv: SessionVariables, workflow=None): min_value=0, help="The average number of text chunks to target per cluster, which determines the text chunks that will be evaluated together and in parallel to other clusters. Larger values will generally result in more related text chunks being evaluated in parallel, but may also result in information loss from unprocessed content." ) - with c5: + with c2: + st.checkbox( + "Show search process", + key=sv.show_search_process.key, + value=sv.show_search_process.value, + help="Show the search process in the UI, including the progress of chunk relevance tests and the search for relevant chunks." + ) + with c3: + st.checkbox( + "Live analysis", + key=sv.do_live_analysis.key, + value=sv.do_live_analysis.value, + help="Enable live analysis of the text chunks as they are processed. This provides immediate feedback but slows down the overall process." + ) + with c4: st.number_input( "Analysis update interval", value=sv.analysis_update_interval.value, key=sv.analysis_update_interval.key, min_value=0, - help="The number of text chunks to process before updating the live analysis. Larger values will give faster final reports but also result in longer periods of time between updates. Set to 0 to disable live analysis updates." + help="The number of text chunks to process before updating the live analysis. Larger values will give faster final reports but also result in longer periods of time between updates." ) - with c6: + with c5: st.checkbox( - "Show search process", - key=sv.show_search_process.key, - value=sv.show_search_process.value, - help="Show the search process in the UI, including the progress of chunk relevance tests and the search for relevant chunks." + "Live commentary", + key=sv.do_live_commentary.key, + value=sv.do_live_commentary.value, + help="Enable live commentary of analysis themes after text chunks are processed. This provides a preview of report content while the final report is being generated." ) + query_panel = st.container() main_panel = st.container() @@ -245,6 +262,7 @@ async def create(sv: SessionVariables, workflow=None): with c3: search_button = st.empty() anchored_query_placeholder = st.empty() + analysis_pb = st.empty() with main_panel: if sv.show_search_process.value: c1, c2 = st.columns([1, 2]) @@ -267,24 +285,24 @@ async def create(sv: SessionVariables, workflow=None): if sv.anchored_query.value != "": anchored_query_placeholder.markdown(f"**Expanded query:** {sv.anchored_query.value}") with c2: - c1, c2 = st.columns([1, 1]) - with c1: - st.markdown("#### Live analysis") - analysis_pb = st.empty() - analysis_placeholder = st.empty() - commentary_placeholder = st.empty() - if qtd.stage.value >= QueryTextDataStage.CHUNKS_MINED.value: - st.download_button( - "Download live analysis as MD", - data=sv.thematic_analysis.value + "\n" + sv.thematic_commentary.value, - file_name=re.sub(r'[^\w\s]','',sv.query.value).replace(' ', '_')+"_analysis.md", - mime="text/markdown", - key="live_analysis_download_button", - disabled=qtd.stage.value < QueryTextDataStage.QUESTION_ANSWERED.value, - ) + if sv.do_live_analysis.value or sv.do_live_commentary.value: + c1, c2 = st.columns([1, 1]) + with c1: + st.markdown("#### Live analysis") + analysis_placeholder = st.empty() + commentary_placeholder = st.empty() + if qtd.stage.value >= QueryTextDataStage.CHUNKS_MINED.value: + st.download_button( + "Download live analysis as MD", + data=sv.thematic_analysis.value + "\n" + sv.thematic_commentary.value, + file_name=re.sub(r'[^\w\s]','',sv.query.value).replace(' ', '_')+"_analysis.md", + mime="text/markdown", + key="live_analysis_download_button", + disabled=qtd.stage.value < QueryTextDataStage.QUESTION_ANSWERED.value, + ) + else: + c2 = st.container() with c2: - - st.markdown("#### Final report") answer_spinner = st.empty() answer_placeholder = st.empty() @@ -297,8 +315,9 @@ async def create(sv: SessionVariables, workflow=None): key="research_report_download_button", disabled=qtd.stage.value < QueryTextDataStage.QUESTION_ANSWERED.value, ) - analysis_placeholder.markdown(sv.thematic_analysis.value, unsafe_allow_html=True) - commentary_placeholder.markdown(sv.thematic_commentary.value, unsafe_allow_html=True) + if sv.do_live_analysis.value or sv.do_live_commentary.value: + analysis_placeholder.markdown(sv.thematic_analysis.value, unsafe_allow_html=True) + commentary_placeholder.markdown(sv.thematic_commentary.value, unsafe_allow_html=True) if qtd.stage.value == QueryTextDataStage.QUESTION_ANSWERED.value: answer_placeholder.markdown(qtd.answer_object.extended_answer, unsafe_allow_html=True) @@ -311,8 +330,10 @@ def do_search(): sv.thematic_analysis.value = "" sv.thematic_commentary.value = "" answer_placeholder.markdown("") + if sv.do_live_analysis.value or sv.do_live_commentary.value: + analysis_placeholder.markdown("") + commentary_placeholder.markdown("") main_panel.empty() - analysis_pb.progress(0, f"0 of {sv.relevance_test_budget.value} chunks tested") search_button.button("Search", key="search_button", on_click=do_search, use_container_width=True) query_placeholder.text_input( @@ -374,7 +395,7 @@ def on_llm_new_token_commentary(message): irrelevant_community_restart=sv.irrelevant_community_restart.value, adjacent_test_steps=sv.adjacent_test_steps.value, community_relevance_tests=sv.relevance_test_batch_size.value, - analysis_update_interval=sv.analysis_update_interval.value, + analysis_update_interval=sv.analysis_update_interval.value if sv.do_live_analysis.value else 0, ), chunk_progress_callback=on_chunk_progress, chunk_callback=on_chunk_relevant, @@ -386,10 +407,13 @@ def on_llm_new_token_commentary(message): analysis_pb.empty() with answer_spinner: with st.spinner("Generating research report..."): - await asyncio.gather( - qtd.answer_query_with_relevant_chunks(), - qtd.generate_analysis_commentary() - ) + if sv.do_live_commentary.value: + await asyncio.gather( + qtd.answer_query_with_relevant_chunks(sv.target_chunks_per_cluster.value), + qtd.generate_analysis_commentary() + ) + else: + await qtd.answer_query_with_relevant_chunks(sv.target_chunks_per_cluster.value) st.rerun() with report_tab: if qtd.stage.value < QueryTextDataStage.QUESTION_ANSWERED.value: diff --git a/intelligence_toolkit/query_text_data/answer_builder.py b/intelligence_toolkit/query_text_data/answer_builder.py index ab951178..31917d08 100644 --- a/intelligence_toolkit/query_text_data/answer_builder.py +++ b/intelligence_toolkit/query_text_data/answer_builder.py @@ -9,6 +9,7 @@ import intelligence_toolkit.query_text_data.answer_schema as answer_schema import intelligence_toolkit.query_text_data.prompts as prompts from intelligence_toolkit.query_text_data.classes import AnswerObject +import sklearn.cluster as cluster def _split_on_multiple_delimiters(string, delimiters): @@ -46,20 +47,25 @@ async def answer_query( expanded_query, processed_chunks, clustered_cids, - + cid_to_vector, + target_chunks_per_cluster ): print(f"Answering query with clustered ids: {clustered_cids}") - clustered_texts = { - theme: [f"{cid}: {processed_chunks.cid_to_text[cid]}" for cid in cids] - for theme, cids in clustered_cids.items() - } + partitioned_texts = {} + for theme, cids in clustered_cids.items(): + if len(cids) > target_chunks_per_cluster: + cluster_to_cids = cluster_cids(cids, cid_to_vector, len(cids) // target_chunks_per_cluster) + for cluster, cids in cluster_to_cids.items(): + partitioned_texts[f"{theme} - topic {cluster}"] = [f"{cid}: {processed_chunks.cid_to_text[cid]}" for cid in cids] + else: + partitioned_texts[theme] = [f"{cid}: {processed_chunks.cid_to_text[cid]}" for cid in cids] net_new_sources = 0 batched_summarization_messages = [ utils.prepare_messages( prompts.theme_summarization_prompt, {"chunks": texts, "theme": theme, "query": expanded_query}, ) - for theme, texts in clustered_texts.items() + for theme, texts in partitioned_texts.items() ] summarized_themes = await utils.map_generate_text( @@ -129,5 +135,25 @@ def build_report_markdown( return report, references, matched_chunks +def cluster_cids(relevant_cids, cid_to_vector, target_clusters): + clustered_cids = {} + if len(relevant_cids) > 0: + # use k-means clustering to group relevant cids into target_clusters clusters + cids = [] + vectors = [] + for relevant_cid in relevant_cids: + if relevant_cid in cid_to_vector: + cids.append(relevant_cid) + vectors.append(cid_to_vector[relevant_cid]) + kmeans = cluster.KMeans(n_clusters=target_clusters) + kmeans.fit(vectors) + cluster_assignments = kmeans.predict(vectors) + + for i, cid in enumerate(cids): + cluster_assignment = cluster_assignments[i] + if cluster_assignment not in clustered_cids: + clustered_cids[cluster_assignment] = [] + clustered_cids[cluster_assignment].append(cid) + return clustered_cids diff --git a/intelligence_toolkit/query_text_data/api.py b/intelligence_toolkit/query_text_data/api.py index c8adab49..65df9a26 100644 --- a/intelligence_toolkit/query_text_data/api.py +++ b/intelligence_toolkit/query_text_data/api.py @@ -22,7 +22,7 @@ ChunkSearchConfig, ProcessedChunks, ) - +from intelligence_toolkit.query_text_data.commentary import Commentary class QueryTextDataStage(Enum): """ @@ -217,10 +217,17 @@ async def detect_relevant_text_chunks( self.query = query self.expanded_query = expanded_query self.chunk_search_config = chunk_search_config + self.commentary = Commentary( + self.ai_configuration, + self.query, + self.processed_chunks.cid_to_text, + self.chunk_search_config.analysis_update_interval, + analysis_callback, + commentary_callback + ) ( self.relevant_cids, self.search_summary, - self.commentary ) = await relevance_assessor.detect_relevant_chunks( ai_configuration=self.ai_configuration, query=self.expanded_query, @@ -231,27 +238,32 @@ async def detect_relevant_text_chunks( chunk_search_config=self.chunk_search_config, chunk_progress_callback=chunk_progress_callback, chunk_callback=chunk_callback, - analysis_callback=analysis_callback, - commentary_callback=commentary_callback, + commentary=self.commentary, ) self.stage = QueryTextDataStage.CHUNKS_MINED return self.relevant_cids, self.search_summary async def answer_query_with_relevant_chunks( - self + self, + target_chunks_per_cluster: int ) -> AnswerObject: """ Answer a query with relevant chunks. + Args: + target_chunks_per_cluster (int): The target chunks per cluster Returns: AnswerObject: The answer object """ + self.target_chunks_per_cluster = target_chunks_per_cluster self.answer_object: AnswerObject = await answer_builder.answer_query( self.ai_configuration, self.query, self.expanded_query, self.processed_chunks, - self.commentary.get_clustered_cids() + self.commentary.get_clustered_cids(), + self.cid_to_vector, + self.target_chunks_per_cluster ) self.stage = QueryTextDataStage.QUESTION_ANSWERED return self.answer_object diff --git a/intelligence_toolkit/query_text_data/commentary.py b/intelligence_toolkit/query_text_data/commentary.py index cb254995..be0bda87 100644 --- a/intelligence_toolkit/query_text_data/commentary.py +++ b/intelligence_toolkit/query_text_data/commentary.py @@ -23,12 +23,12 @@ def __init__(self, ai_configuration, query, cid_to_text, update_interval, analys def add_chunks(self, chunks: dict[int, str]): self.unprocessed_chunks.update(chunks) - if len(self.unprocessed_chunks) >= self.update_interval: + if self.update_interval > 0 and len(self.unprocessed_chunks) >= self.update_interval: self.update_analysis(self.unprocessed_chunks) self.unprocessed_chunks = {} def complete_analysis(self): - if len(self.unprocessed_chunks) > 0: + if self.update_interval > 0 and len(self.unprocessed_chunks) > 0: self.update_analysis(self.unprocessed_chunks) self.unprocessed_chunks = {} @@ -75,17 +75,20 @@ def format_structure(self): return output def get_clustered_cids(self): - clustered_cids = {} - current_cluster = [] - for theme_title, point_ids in self.structure["themes"].items(): + if self.update_interval > 0: + clustered_cids = {} current_cluster = [] - for point_id in point_ids: - source_ids = self.structure["point_sources"][point_id] - for source_id in source_ids: - if source_id not in current_cluster: - current_cluster.append(source_id) - clustered_cids[theme_title] = current_cluster - return clustered_cids + for theme_title, point_ids in self.structure["themes"].items(): + current_cluster = [] + for point_id in point_ids: + source_ids = self.structure["point_sources"][point_id] + for source_id in source_ids: + if source_id not in current_cluster: + current_cluster.append(source_id) + clustered_cids[theme_title] = current_cluster + return clustered_cids + else: + return {"All relevant chunks": list(self.unprocessed_chunks.keys())} async def generate_commentary(self): structure = self.format_structure() diff --git a/intelligence_toolkit/query_text_data/relevance_assessor.py b/intelligence_toolkit/query_text_data/relevance_assessor.py index 5db9198b..287be6e1 100644 --- a/intelligence_toolkit/query_text_data/relevance_assessor.py +++ b/intelligence_toolkit/query_text_data/relevance_assessor.py @@ -10,7 +10,6 @@ import intelligence_toolkit.AI.utils as utils import intelligence_toolkit.query_text_data.helper_functions as helper_functions import intelligence_toolkit.query_text_data.prompts as prompts -from intelligence_toolkit.query_text_data.commentary import Commentary async def assess_relevance( ai_configuration, @@ -108,10 +107,9 @@ async def detect_relevant_chunks( chunk_search_config, chunk_progress_callback=None, chunk_callback=None, - analysis_callback=None, - commentary_callback=None, + commentary=None ): - commentary = Commentary(ai_configuration, query, processed_chunks.cid_to_text, chunk_search_config.analysis_update_interval, analysis_callback, commentary_callback) if analysis_callback is not None and commentary_callback is not None else None + test_history = [] all_units = sorted( [(cid, vector) for cid, vector in (cid_to_vector.items())], key=lambda x: x[0] @@ -331,4 +329,4 @@ async def detect_relevant_chunks( ) relevant.sort() commentary.complete_analysis() - return relevant, helper_functions.get_test_progress(test_history), commentary + return relevant, helper_functions.get_test_progress(test_history) From abf7700ef89be4b052c7e3d0c50e13ea389dfd95 Mon Sep 17 00:00:00 2001 From: Darren Edge Date: Tue, 14 Jan 2025 19:59:00 +0000 Subject: [PATCH 09/11] Updated QTD notebook --- app/workflows/query_text_data/README.md | 8 +- example_notebooks/query_text_data.ipynb | 1145 ++++------------- .../query_text_data/classes.py | 4 +- .../query_text_data/commentary.py | 5 +- .../query_text_data/prompts.py | 1 + poetry.lock | 319 +---- pyproject.toml | 1 - 7 files changed, 286 insertions(+), 1197 deletions(-) diff --git a/app/workflows/query_text_data/README.md b/app/workflows/query_text_data/README.md index f21767b9..21d1bf93 100644 --- a/app/workflows/query_text_data/README.md +++ b/app/workflows/query_text_data/README.md @@ -13,9 +13,9 @@ Select the `View example outputs` tab (in app) or navigate to [example_outputs/q 5. [**Embedding Calls**] Text chunks are embedded into a multi-dimensional semantic space, with similar ideas close to one another. 6. [**Process**] The user's question is embedded into the same space, and the text chunks ranked by similarity. 7. [**Process**] The ranking of text chunks is used to determine a ranking of topics, which span the entire dataset. -8. [**AI Calls**] The system uses generative AI to evaluate the relevance of the top-ranked text chunks from each community in turn, until either a relevance test budget is reached, there are no more communities yielding relevant chunks, or there are no more chunks to test. -9. [**AI Calls**] The system uses generative AI to build an answer report progressively from batches of relevant text chunks. -10. [**Output**] AI answer report MD/PDF file(s) including a concise answer to the user's question and the extended answer report. +8. [**AI Calls**] The system uses generative AI to evaluate the relevance of the top-ranked text chunks from each community in turn, until either a relevance test budget is reached or there are no more communities yielding relevant chunks. +9. [**AI Calls**] The system uses generative AI to build a research report progressively from batches of relevant text chunks. +10. [**Output**] AI answer report MD/PDF file(s) including a concise answer to the user's question and the extended research report. ## Input requirements @@ -37,7 +37,7 @@ This file contains one news article per row, stored in the single column `mock_t Press `Process files` to prepare the data for analysis. After successfully processing the data, you will see a status message like the following: -`Chunked 500 files into 501 chunks of up to 500 tokens. Extracted concept graph with 1327 concepts and 3593 cooccurrences.` +`Chunked 500 files into 501 chunks of up to 500 tokens. Extracted concept graph with XXX concepts and XXX cooccurrences.` ### Query method diff --git a/example_notebooks/query_text_data.ipynb b/example_notebooks/query_text_data.ipynb index 8ceed4e1..32ae8198 100644 --- a/example_notebooks/query_text_data.ipynb +++ b/example_notebooks/query_text_data.ipynb @@ -13,9 +13,23 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "invalid syntax (classes.py, line 65)", + "output_type": "error", + "traceback": [ + "Traceback \u001b[1;36m(most recent call last)\u001b[0m:\n", + "\u001b[0m File \u001b[0;32mc:\\Users\\daedge\\Code\\ITK2025\\.venv\\Lib\\site-packages\\IPython\\core\\interactiveshell.py:3577\u001b[0m in \u001b[0;35mrun_code\u001b[0m\n exec(code_obj, self.user_global_ns, self.user_ns)\u001b[0m\n", + "\u001b[0m Cell \u001b[0;32mIn[1], line 9\u001b[0m\n from intelligence_toolkit.query_text_data.api import QueryTextData\u001b[0m\n", + "\u001b[0m File \u001b[0;32mc:\\Users\\daedge\\Code\\ITK2025\\intelligence-toolkit\\example_notebooks\\..\\intelligence_toolkit\\query_text_data\\api.py:10\u001b[0m\n import intelligence_toolkit.query_text_data.answer_builder as answer_builder\u001b[0m\n", + "\u001b[1;36m File \u001b[1;32mc:\\Users\\daedge\\Code\\ITK2025\\intelligence-toolkit\\example_notebooks\\..\\intelligence_toolkit\\query_text_data\\answer_builder.py:11\u001b[1;36m\n\u001b[1;33m from intelligence_toolkit.query_text_data.classes import AnswerObject\u001b[1;36m\n", + "\u001b[1;36m File \u001b[1;32mc:\\Users\\daedge\\Code\\ITK2025\\intelligence-toolkit\\example_notebooks\\..\\intelligence_toolkit\\query_text_data\\classes.py:65\u001b[1;36m\u001b[0m\n\u001b[1;33m analysis_update_interval = 0: int\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n" + ] + } + ], "source": [ "import sys\n", "\n", @@ -28,8 +42,7 @@ "from intelligence_toolkit.query_text_data.api import QueryTextData\n", "from intelligence_toolkit.query_text_data.classes import (\n", " ProcessedChunks,\n", - " ChunkSearchConfig,\n", - " AnswerConfig,\n", + " ChunkSearchConfig\n", ")\n", "\n", "import intelligence_toolkit.query_text_data.prompts as prompts\n", @@ -44,7 +57,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -76,7 +89,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -99,7 +112,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -118,17 +131,39 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "metadata": {}, "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + " 0%| | 0/500 [00:00\n", - "\n", - "##### Text chunk: news_articles_texts.csv_8 (1)\n", - "\n", - "mock_text: **Louvre Museum Unveils Dazzling Asian Art Exhibition Curated by Sophia Lin**\n", - "\n", - "*Paris, July 23, 2023* – The Louvre Museum, renowned for its rich tapestry of art collections, has today unveiled a new exhibition that promises to captivate visitors with its exquisite display of Asian art. The grand opening of this much-anticipated exhibition was marked by a special event held at the museum, drawing art enthusiasts, critics, and cultural aficionados from around the globe.\n", - "\n", - "Curated by the distinguished art historian Sophia Lin, the exhibition showcases a remarkable collection of artworks that span centuries of Asian history and culture. Lin, whose expertise in Asian art is widely recognized, has meticulously selected pieces that highlight the diversity and depth of artistic expression across the continent. The exhibition aims to provide a comprehensive overview of Asian art, featuring items from nations such as China, Japan, Korea, and India, among others.\n", - "\n", - "Visitors to the Louvre can expect to be enthralled by the vivid colors, intricate designs, and profound symbolism that characterize the collection. Among the standout pieces are ancient silk paintings, delicate porcelain vases, and intricately carved jade sculptures. Each artifact tells a story of its own, reflecting the unique cultural heritage and artistic traditions of its origin.\n", - "\n", - "\"Sophia Lin's curation brings a fresh perspective to the appreciation of Asian art,\" said Jean-Paul Martin, director of the Louvre Museum. \"Her selection not only highlights the beauty and craftsmanship inherent in these works but also encourages a dialogue about the cultural exchange between East and West.\"\n", - "\n", - "The opening of the exhibition was attended by prominent figures from the art world and beyond, who praised the Louvre's commitment to cultural diversity and education. The exhibition is set to run for six months, offering ample opportunity for visitors to explore the rich tapestry of Asian art.\n", - "\n", - "With this new exhibition, the Louvre Museum continues to cement its status as a global leader in the arts, providing a platform for cross-cultural understanding and appreciation. Art lovers visiting Paris in the coming months will not want to miss this extraordinary opportunity to witness the splendor of Asian art through the eyes of Sophia Lin.\n", - "\n", - "\n", - "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", - "\n", - "#### Source 14\n", - "\n", - "
\n", - "\n", - "##### Text chunk: news_articles_texts.csv_15 (1)\n", - "\n", - "mock_text: **Tech Innovators Conference Showcases Future Technologies in San Francisco**\n", - "\n", - "*San Francisco, July 30, 2023* - The bustling city of San Francisco played host to the much-anticipated Tech Innovators Conference this weekend, attracting a throng of industry leaders, technology enthusiasts, and media representatives. This annual event, renowned for its showcase of cutting-edge technologies and groundbreaking innovations, once again lived up to its reputation as a premier gathering for forward-thinking minds.\n", - "\n", - "The conference, held in the heart of San Francisco, featured a series of presentations and exhibitions that highlighted the latest advancements across a broad spectrum of technology sectors. Attendees were treated to a glimpse of the future, with innovations ranging from artificial intelligence and robotics to sustainable energy solutions and digital health technologies.\n", - "\n", - "Among the notable figures present was Elena Russo, a distinguished name in the tech community, who delivered an inspiring keynote address. Russo's speech focused on the transformative power of technology in shaping a sustainable future, emphasizing the importance of responsible innovation and collaboration.\n", - "\n", - "\"The Tech Innovators Conference continues to be a beacon for those who are passionate about the intersection of technology and society,\" Russo stated. \"It provides an invaluable platform for sharing ideas and fostering the partnerships that drive progress.\"\n", - "\n", - "The event also featured interactive workshops and panel discussions, allowing participants to engage directly with the creators of these pioneering technologies. The vibrant atmosphere was a testament to the collaborative spirit that defines the tech industry, with many attendees expressing enthusiasm for the potential applications of the innovations on display.\n", - "\n", - "As the conference drew to a close, the energy and excitement were palpable, leaving attendees eager to apply the insights gained and explore new opportunities in their respective fields. The Tech Innovators Conference not only showcased the technologies of tomorrow but also reinforced San Francisco's status as a global hub for innovation and creativity.\n", - "\n", - "With another successful event in the books, organizers are already looking ahead to next year's conference, promising even more groundbreaking discoveries and inspiring discussions.\n", - "\n", - "
\n", - "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", - "\n", - "#### Source 55\n", - "\n", - "
\n", - "\n", - "##### Text chunk: news_articles_texts.csv_56 (1)\n", - "\n", - "mock_text: **Austin Hosts Annual Tech Innovators Conference**\n", - "\n", - "*Austin, September 5, 2022* — The vibrant city of Austin has once again become the hub of technological advancement as it hosts the much-anticipated annual Tech Innovators Conference. The event, held today, brings together a myriad of industry leaders, tech enthusiasts, and innovators eager to explore and discuss the latest in cutting-edge technology.\n", - "\n", - "The conference, known for its dynamic environment that fosters industry collaboration, is a significant event in the technology calendar. This year's edition promises to be no different, with a lineup of esteemed speakers, engaging workshops, and interactive sessions designed to inspire and educate attendees.\n", - "\n", - "Among the notable figures attending this year's conference is Ravi Kapoor, a prominent name in the technology sector. Kapoor is expected to share valuable insights on emerging trends and the future of technology, contributing to the dialogue that the Tech Innovators Conference is celebrated for.\n", - "\n", - "The conference not only highlights technological advancements but also serves as a platform for networking and partnership opportunities, which are crucial for driving innovation forward. Hosted by the Tech Innovators Conference organization, the event underscores Austin's reputation as a thriving tech hub.\n", - "\n", - "As participants gather to showcase their latest projects and ideas, the conference continues to be a testament to the power of collaboration and the relentless pursuit of innovation in the technology industry.\n", - "\n", - "
\n", - "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", - "\n", - "#### Source 61\n", - "\n", - "
\n", - "\n", - "##### Text chunk: news_articles_texts.csv_62 (1)\n", - "\n", - "mock_text: **Senator Ng Outlines Vision for Healthcare Reform in Capitol City Rally**\n", - "\n", - "*Capitol City, January 19, 2023* — In a passionate rally held today in Capitol City, Senator Linda Ng unveiled her comprehensive plan for overhauling the nation's healthcare system. Addressing a large crowd of supporters, Senator Ng emphasized the urgent need for reform, with a particular focus on making healthcare more accessible and affordable for every citizen.\n", - "\n", - "The event, organized by the influential Healthcare Reform Alliance, brought together healthcare advocates, policymakers, and concerned citizens, all eager to hear Senator Ng's proposals. \"Healthcare is a fundamental right, not a privilege,\" Senator Ng declared, drawing applause from the audience. She outlined a series of initiatives aimed at reducing costs, improving quality of care, and expanding coverage to millions of uninsured Americans.\n", - "\n", - "Senator Ng's plan proposes significant investments in preventative care and the expansion of government-subsidized health insurance options. She argued that these measures would not only improve public health outcomes but also reduce the long-term costs associated with treating preventable diseases.\n", - "\n", - "\"Every citizen deserves access to affordable healthcare services, regardless of their income or where they live,\" Senator Ng stated, addressing the crowd. \"We must dismantle the barriers that prevent so many from receiving the care they need.\"\n", - "\n", - "The Healthcare Reform Alliance, a coalition of various stakeholders in the healthcare sector, has expressed strong support for Senator Ng's initiative. They believe her plan represents a critical step toward achieving a more equitable healthcare system.\n", - "\n", - "As the rally concluded, Senator Ng urged her supporters to continue advocating for change and to hold elected officials accountable for advancing healthcare reform. \"Together, we can build a system that works for everyone,\" she encouraged, leaving the audience energized and hopeful for the future.\n", - "\n", - "Senator Ng's campaign will undoubtedly gain momentum as she continues to champion her healthcare reform agenda, which could become a pivotal issue in the upcoming elections.\n", - "\n", - "
\n", - "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", - "\n", - "#### Source 67\n", - "\n", - "
\n", - "\n", - "##### Text chunk: news_articles_texts.csv_68 (1)\n", - "\n", - "mock_text: **Art Enthusiasts Gather for Emily Rivera's Latest Exhibition at the Metropolitan Art Gallery**\n", - "\n", - "On June 12, 2023, the Metropolitan Art Gallery buzzed with excitement as renowned artist Emily Rivera unveiled her much-anticipated new exhibition. Art lovers and critics from around the city gathered to witness the opening of this captivating showcase, which delves deep into the themes of identity and transformation.\n", - "\n", - "Emily Rivera, a celebrated figure in the contemporary art world, has once again captured the imagination of her audience with her thought-provoking pieces. Her latest collection is a testament to her ability to challenge and inspire through the medium of art. Attendees at the gallery were treated to an array of artworks that explore the complexities of self-perception and the ever-evolving nature of identity.\n", - "\n", - "The exhibition, organized in collaboration with the Art Enthusiasts Society, offers a unique opportunity for visitors to engage with Rivera's work on a profound level. \"Emily's art speaks to the core of human experience,\" remarked a member of the Art Enthusiasts Society. \"Her exploration of transformation resonates with everyone who views it, prompting us to reflect on our own journeys.\"\n", - "\n", - "Rivera's exhibition is set to run for several weeks, allowing art aficionados ample time to immerse themselves in her visionary world. The Metropolitan Art Gallery, known for its commitment to showcasing groundbreaking artists, provides the perfect backdrop for this remarkable event.\n", - "\n", - "As the doors opened on the first day, Rivera mingled with guests, sharing insights into her creative process and the inspiration behind her latest body of work. \"I wanted to explore the fluidity of identity and how our experiences shape who we are,\" Rivera explained. \"Art is a powerful medium for expressing these ideas, and I hope that visitors leave with a new perspective on their own transformations.\"\n", - "\n", - "For those eager to experience Emily Rivera's exploration of identity and transformation, the exhibition is a must-visit destination this summer. The convergence of artistic talent and thematic depth promises to leave a lasting impression on all who attend.\n", - "\n", - "
\n", - "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", - "\n", - "#### Source 70\n", - "\n", - "
\n", - "\n", - "##### Text chunk: news_articles_texts.csv_71 (1)\n", - "\n", - "mock_text: **Tech Innovators Conference Highlights AI Advances**\n", - "\n", - "SILICON VALLEY — On September 30th, 2023, the Tech Innovators Conference, an annual event that draws some of the brightest minds in technology, kicked off in Silicon Valley. This year, the spotlight was firmly on the groundbreaking strides being made in artificial intelligence (AI) and machine learning.\n", - "\n", - "Engineer Sarah Kim, a notable figure in the tech industry, was among the key speakers at the conference. She emphasized the transformative potential of AI technologies in various sectors, including healthcare, finance, and environmental management. \"AI is not just a tool; it's a catalyst for change,\" Kim stated, capturing the essence of the conference's theme.\n", - "\n", - "The event, which attracts innovators and industry leaders from around the world, featured a series of presentations and workshops that highlighted the most recent advances in AI. From sophisticated machine learning algorithms to ethical considerations in AI development, the conference covered a broad spectrum of topics, offering insights into both current capabilities and future possibilities.\n", - "\n", - "Attendees had the opportunity to engage with interactive demonstrations and network with other professionals passionate about technology's role in shaping the future. The Tech Innovators Conference continues to be a pivotal platform for fostering innovation and collaboration in Silicon Valley, setting the stage for what promises to be a dynamic era in technology. \n", - "\n", - "As the conference concluded, participants left with a renewed sense of excitement and urgency to integrate these cutting-edge technologies into their respective fields, ensuring that the advancements in AI will indeed serve as a beacon of progress in the coming years.\n", - "\n", - "
\n", - "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", - "\n", - "#### Source 76\n", - "\n", - "
\n", - "\n", - "##### Text chunk: news_articles_texts.csv_77 (1)\n", - "\n", - "mock_text: **Global Economic Forum to Address Market Volatility**\n", - "\n", - "*December 30, 2023*\n", - "\n", - "*World Events - Economy*\n", - "\n", - "In a much-anticipated session at the Global Economic Forum, esteemed Economist Robert Liu is set to deliver a pivotal speech addressing the pressing issue of market volatility. The forum, recognized as a key gathering of influential figures in the economic realm, will see Liu sharing insights and strategies aimed at stabilizing the current tumultuous market conditions.\n", - "\n", - "The International Monetary Fund (IMF) is among the prominent organizations closely monitoring the outcomes of this forum. With market fluctuations posing significant challenges to both emerging and established economies, the IMF looks towards experts like Liu for guidance on navigating these turbulent waters.\n", - "\n", - "Liu's presentation is expected to delve into both short-term measures and long-term strategies, providing a comprehensive framework to mitigate volatility. With the global economy facing uncertainties from geopolitical tensions to shifting trade policies, Liu's expertise will be invaluable in charting a course towards stability.\n", - "\n", - "As the world tunes in to the discussions at the Global Economic Forum, stakeholders hope to gain actionable insights that can be translated into policy and practice, ensuring a more resilient global economic landscape.\n", - "\n", - "The forum continues to be a beacon for economic dialogue, bringing together thought leaders and policymakers in a collaborative effort to address the challenges facing the world economy today.\n", - "\n", - "
\n", - "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", - "\n", - "#### Source 87\n", - "\n", - "
\n", - "\n", - "##### Text chunk: news_articles_texts.csv_88 (1)\n", - "\n", - "mock_text: **Senator Jane Smith Announces Re-Election Campaign in Washington D.C.**\n", - "\n", - "*Washington D.C.* – On March 16, 2023, in a spirited gathering at the heart of the nation's capital, Senator Jane Smith officially kicked off her campaign for re-election. The event, held under the auspices of the National Democratic Party, highlighted her commitment to pressing issues such as healthcare and education reforms, which she identified as the cornerstones of her campaign platform.\n", - "\n", - "In her announcement speech, Senator Smith emphasized the need for comprehensive reforms in the healthcare system, aiming to make it more accessible and affordable for all citizens. \"Healthcare is a right, not a privilege,\" she declared to a supportive crowd. Her agenda includes proposals to expand healthcare coverage and reduce prescription drug prices, initiatives she has championed during her current term.\n", - "\n", - "Education also took center stage in her address. Senator Smith outlined her vision for improving the public education system, advocating for increased funding and support for teachers. She stressed the importance of equipping the next generation with the necessary skills to thrive in a rapidly changing world. \"Our children deserve the best start in life, and that begins with quality education,\" she stated passionately.\n", - "\n", - "The event in Washington D.C. drew a diverse audience, including party members, constituents, and supporters eager to hear about the senator's plans for the future. As a prominent figure within the National Democratic Party, Senator Smith's campaign is expected to gain significant traction in the coming months.\n", - "\n", - "Her re-election campaign sets the stage for what promises to be a pivotal race, with healthcare and education reforms at the forefront of her policy agenda. With the stakes high, Senator Jane Smith is determined to continue her work in the Senate, advocating for policies that reflect the values and needs of her constituents.\n", - "\n", - "
\n", - "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", - "\n", - "#### Source 90\n", + "#### Source 91\n", "\n", "
\n", "\n", - "##### Text chunk: news_articles_texts.csv_91 (1)\n", + "##### Text chunk: news_articles_texts.csv_92 (1)\n", "\n", - "mock_text: **Breakthroughs in AI Highlighted at Tech Innovators Conference**\n", + "mock_text: **Rome Hosts Annual Italian Food Festival**\n", "\n", - "*Tokyo, March 22, 2023* — The bustling metropolis of Tokyo was at the forefront of technological innovation today as the Tech Innovators Conference kicked off with a series of stunning presentations. Among the most anticipated speakers was Elena Garcia, a leading figure in the field of artificial intelligence, who captivated the audience with her insights into the latest advancements in AI technology.\n", + "*Rome, March 24, 2023* — The Eternal City is alive with the tantalizing aromas and vibrant flavors of Italy's rich culinary heritage as the annual Italian Food Festival kicks off in Rome. Organized by the esteemed Italian Culinary Guild, this much-anticipated event is a celebration of the country's gastronomic traditions, offering locals and tourists alike a unique opportunity to indulge in Italy's most beloved dishes.\n", "\n", - "Held at one of Tokyo's premier conference venues, the Tech Innovators Conference drew participants from around the globe, eager to engage with cutting-edge developments in technology. The event, celebrated for its ability to bring together the brightest minds in the industry, did not disappoint.\n", + "This year's festival showcases an impressive lineup of culinary delights, featuring the expertise of renowned chef Marco Tanzi. Known for his innovative approach to traditional Italian cuisine, Chef Tanzi is set to present an array of signature dishes that promise to captivate the palates of festival-goers. With a perfect blend of classic and contemporary flavors, his creations highlight the diversity and depth of Italian gastronomy.\n", "\n", - "Elena Garcia's presentation was a highlight of the day, as she unveiled a host of new breakthroughs that promise to revolutionize the way AI is integrated into various sectors. Her talk focused on the practical applications of AI, demonstrating how recent innovations can enhance efficiency, accuracy, and productivity across a wide range of industries.\n", + "Visitors to the festival will have the chance to explore a variety of food stalls, each offering a distinct taste of Italy's regional specialties. From the rich, hearty sauces of the north to the fresh, vibrant flavors of the south, there is something to satisfy every taste.\n", "\n", - "Attendees were particularly impressed by Garcia's exploration of AI's role in sectors such as healthcare, where the technology is being used to improve diagnostic accuracy and patient outcomes. She also touched upon the ethical considerations of AI development, emphasizing the importance of ensuring that these powerful tools are used responsibly.\n", + "In addition to the culinary offerings, the festival features live cooking demonstrations, where attendees can learn tips and tricks from Chef Tanzi himself. These sessions provide a rare glimpse into the artistry and passion that define Italian cooking, making them a highlight of the event.\n", "\n", - "The Tech Innovators Conference will continue over the next few days, featuring a diverse lineup of speakers and workshops. As the event progresses, participants are eager to explore the many ways in which technology, particularly artificial intelligence, will shape the future.\n", + "The Italian Food Festival is not just about food; it is a cultural celebration that brings people together to enjoy music, dance, and art, all while savoring the best of Italian cuisine. With its lively atmosphere and delicious offerings, the festival is a testament to Rome's status as a culinary capital, drawing food enthusiasts from all over the world.\n", "\n", - "This year's conference highlights the ongoing commitment of the tech community to push the boundaries of what is possible, ensuring that innovation continues to drive progress in the digital age.\n", + "As the festival continues throughout the weekend, attendees are encouraged to immerse themselves in the flavors and traditions of Italy, making the most of this extraordinary gastronomic experience. Whether a seasoned foodie or a curious visitor, everyone is welcome to join in the celebration of Italy's rich culinary legacy.\n", "\n", "
\n", "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", + "[Back to top](#query)\n", "\n", - "#### Source 104\n", + "#### Source 120\n", "\n", "
\n", "\n", - "##### Text chunk: news_articles_texts.csv_105 (1)\n", - "\n", - "mock_text: **Global Economic Forum: Key Takeaways**\n", + "##### Text chunk: news_articles_texts.csv_121 (1)\n", "\n", - "*July 25, 2021 - New York*\n", + "mock_text: **International Teams Bolster Relief in Bali**\n", "\n", - "The bustling metropolis of New York was the epicenter of economic discourse this past week as it played host to the prestigious Global Economic Forum. The event, which attracts top economists and policymakers from around the world, concluded with insightful discussions and pivotal takeaways that are expected to shape the future of the global economy.\n", + "*Jakarta, July 17, 2023* — In the wake of a devastating earthquake that shook the Indonesian island of Bali, international relief efforts have ramped up to support the affected communities. The disaster, which struck last week, has left a trail of destruction, prompting a swift response from both local and international organizations.\n", "\n", - "Economist Sarah Lin, a prominent figure in economic circles, was among the leading voices at the forum. Her analysis of the forum's outcomes highlighted several key areas of concern and opportunity for the global economy. According to Lin, one of the most significant discussions revolved around the recovery strategies post-pandemic, as economies around the world grapple with the consequences of COVID-19.\n", + "Dr. Emily Chen, a leading expert in disaster management, has been closely involved in the coordination of relief efforts. She emphasized the importance of rebuilding infrastructure as a crucial step in the recovery process. \"Restoring essential services and ensuring that the affected communities have access to basic needs are our top priorities,\" Dr. Chen stated during a press briefing in Jakarta.\n", "\n", - "\"The pandemic has reshaped the global economic landscape, and it is imperative that we adopt strategies that not only react to the current crisis but also build resilience for future uncertainties,\" Lin stated during a session in New York. Her comments underscore the forum's emphasis on sustainable growth and the need for international cooperation in economic policymaking.\n", + "The Global Relief Network, in collaboration with the Indonesian Red Cross, has deployed teams to the hardest-hit areas in Bali. These teams are working tirelessly to provide emergency aid, shelter, and medical assistance to those in need. The organizations have also been focusing on long-term recovery plans, including the reconstruction of homes, schools, and hospitals.\n", "\n", - "Another major topic of discussion was the role of digital currencies and the potential for blockchain technology to revolutionize financial systems. Experts at the forum, including those from London, debated the implications of these technologies on traditional banking systems and the regulatory challenges they present.\n", + "Local authorities have reported that while immediate needs are being met, the road to full recovery will be long. \"The resilience of the Balinese people is remarkable,\" said a spokesperson from the Indonesian Red Cross. \"With the continued support from international partners, we are confident that Bali will rebuild stronger than before.\"\n", "\n", - "The Global Economic Forum concluded with a call for increased collaboration among nations to address pressing global issues such as climate change, wealth inequality, and digital transformation. The gathering in New York served as a reminder of the interconnectedness of economies and the importance of joint efforts in crafting policies that benefit all.\n", + "As relief efforts continue, Dr. Emily Chen and her team remain optimistic about the progress being made. \"The international community has shown tremendous solidarity,\" she remarked. \"Together, we can help the people of Bali overcome this tragedy and look towards a brighter future.\"\n", "\n", - "As the forum wraps up, the insights shared by economists like Sarah Lin will undoubtedly influence discussions in economic hubs such as London and beyond. The outcomes of this forum are expected to play a crucial role in steering global economic policies in the coming years.\n", + "As the situation unfolds, the focus remains on sustaining the momentum of aid and ensuring that the affected regions receive the necessary support to rebuild and thrive once again.\n", "\n", "
\n", "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", + "[Back to top](#query)\n", "\n", - "#### Source 136\n", + "#### Source 137\n", "\n", "
\n", "\n", - "##### Text chunk: news_articles_texts.csv_137 (1)\n", - "\n", - "mock_text: **Rome Celebrates Its Annual Food Festival**\n", - "\n", - "*September 3, 2023*\n", + "##### Text chunk: news_articles_texts.csv_138 (1)\n", "\n", - "**Rome, Italy** – The vibrant streets of Rome are alive with the tantalizing aromas and lively sounds of the city's beloved annual food festival. Held under the auspices of the Culinary Arts Association, this year's event promises to be a feast for both the eyes and the palate, bringing together food enthusiasts, tourists, and locals alike to celebrate Rome's rich culinary heritage.\n", + "mock_text: **Federer Returns to Wimbledon: A Triumphant Comeback**\n", "\n", - "The festival, which kicked off today at 3:15 PM, is a showcase of the city's traditional flavors and innovative culinary creations. Renowned chefs and food artisans from across the region have gathered to present their finest dishes, offering an exquisite array of tastes that reflect Rome's storied history and modern trends.\n", + "**Wimbledon, September 5, 2023** — In an exhilarating turn of events that has left the tennis world buzzing, Roger Federer, widely regarded as one of the greatest players in the history of the sport, made a spectacular return to Wimbledon today. Fans from across the globe tuned in to witness this iconic moment, as Federer graced the grass courts of the All England Club once more.\n", "\n", - "One of the highlights of the festival is the presence of the esteemed Chef Antonio, whose culinary prowess has earned him accolades both locally and internationally. Chef Antonio is known for his ability to blend classic Roman recipes with contemporary flair, and attendees are eagerly lining up to sample his latest creations.\n", + "The Swiss maestro, whose career achievements have set an exemplary standard in tennis, seemed at home as he stepped onto the hallowed grounds of Wimbledon. Known for his elegance and precision on the court, Federer's presence was met with roaring applause from the audience, reminding everyone of the magic he brings to the game.\n", "\n", - "Throughout the festival, visitors will have the opportunity to attend cooking demonstrations, participate in tasting sessions, and explore a variety of food stalls featuring everything from artisanal cheeses and cured meats to decadent pastries and innovative street food.\n", + "Federer's return to Wimbledon comes under the banner of the ATP World Tour, an organization that has chronicled much of his illustrious career. The anticipation surrounding his comeback has been building for weeks, with fans eager to see if the 20-time Grand Slam champion still possesses the prowess that has defined his legendary career.\n", "\n", - "\"This festival is a true celebration of our culinary culture,\" said a representative from the Culinary Arts Association. \"It's a chance for people to come together and enjoy the flavors that make Rome unique, while also discovering new and exciting dishes.\"\n", + "As the match unfolded, Federer's performance did not disappoint. His skillful play and strategic acumen were on full display, captivating both seasoned tennis enthusiasts and new fans alike. The atmosphere was electric, with each rally drawing cheers and admiration from the crowd.\n", "\n", - "As the sun sets over the ancient city, the festival continues to buzz with excitement, offering a festive atmosphere where food lovers can indulge their senses and experience the best of Roman cuisine. The event not only highlights the talent of local chefs but also fosters a sense of community and appreciation for the art of cooking.\n", + "This return marks a significant moment not only for Federer but also for the sport of tennis, as it highlights the enduring appeal of one of its most beloved figures. As the ATP World Tour continues, all eyes will be on Federer to see how his journey unfolds in the coming weeks.\n", "\n", - "The Rome annual food festival is set to run through the weekend, ensuring that everyone has the opportunity to savor the diverse and delicious offerings that make this celebration a must-visit for anyone in the city.\n", + "In the world of tennis, few stories inspire as much as Federer's remarkable career, and his latest appearance at Wimbledon adds yet another exciting chapter. Tennis aficionados and casual observers alike will undoubtedly be watching closely as the legend continues to weave his magic on the court.\n", "\n", "
\n", "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", - "\n", - "#### Source 155\n", - "\n", - "
\n", - "\n", - "##### Text chunk: news_articles_texts.csv_156 (1)\n", - "\n", - "mock_text: **WHO Hosts Global Health Conference in Geneva**\n", - "\n", - "*Geneva, November 20, 2023* — The global health community has turned its attention to the city of Geneva this week, as the World Health Organization (WHO) hosts its much-anticipated annual health conference. This significant event, set against the backdrop of the serene Swiss landscape, brings together leading experts and policymakers to address pressing global health challenges and explore innovative solutions.\n", - "\n", - "Among the distinguished attendees is Dr. Sarah Jensen, a prominent figure in the field of public health, who will be sharing her insights on emerging health trends and the impact of recent technological advancements in healthcare. Dr. Jensen's participation highlights the caliber of expertise gathered at this year’s conference.\n", - "\n", - "The conference, which officially commenced today, has drawn participants from diverse corners of the world, all eager to collaborate on strategies that could shape the future of global health. With a series of presentations, panel discussions, and workshops scheduled over the coming days, the event promises to be a fertile ground for exchanging ideas and forging partnerships.\n", - "\n", - "Topics on the agenda include the battle against communicable diseases, the integration of AI in healthcare delivery, and the socio-economic factors influencing health outcomes. As the world continues to grapple with health crises and the aftershocks of recent pandemics, the conference aims to foster resilient health systems capable of withstanding future threats.\n", - "\n", - "The World Health Organization, renowned for its leadership in global health initiatives, is committed to leveraging this gathering as a platform for driving change and inspiring action. Attendees are hopeful that the discussions here in Geneva will lead to tangible improvements in health policies and practices worldwide.\n", - "\n", - "As the conference unfolds, all eyes remain on Geneva, where the collective efforts of health leaders could very well chart the course for a healthier, more equitable future for all.\n", - "\n", - "
\n", - "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", + "[Back to top](#query)\n", "\n", "#### Source 159\n", "\n", @@ -943,31 +497,31 @@ "\n", "\n", "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", + "[Back to top](#query)\n", "\n", - "#### Source 213\n", + "#### Source 183\n", "\n", "
\n", "\n", - "##### Text chunk: news_articles_texts.csv_214 (1)\n", + "##### Text chunk: news_articles_texts.csv_184 (1)\n", "\n", - "mock_text: **Berlin Hosts Global Climate Action Forum: Leaders Unite for Environmental Change**\n", + "mock_text: **United Nations and Economists Unite to Tackle Global Economic Challenges**\n", "\n", - "*Berlin, March 15, 2023* – Today marks the commencement of the Global Climate Action Forum in Berlin, a pivotal event drawing leaders from across the globe to address the pressing challenges faced by our environment. \n", + "*Global Economic Forum, January 10, 2024* — In a critical meeting held today at the Global Economic Forum, leading economists and international organizations gathered to strategize on pressing global economic issues. Among the distinguished attendees was Economist Robert Liu, who played a pivotal role in the discussions, partnering closely with the United Nations to forge a path forward.\n", "\n", - "The forum, organized by the Green Earth Initiative, is a testament to the growing urgency of climate action as world leaders, activists, and organizations converge to discuss and strategize on solutions to mitigate the impact of climate change. Among the prominent voices at the event is renowned activist Jamie Lee, who has been a leading figure in advocating for sustainable practices and policies.\n", + "The forum, renowned for bringing together the world's foremost economic thinkers and policymakers, focused this year on addressing the multifaceted challenges that threaten global economic stability. As economic pressures mount worldwide, the collaboration between economists and international bodies like the United Nations has never been more crucial.\n", "\n", - "Held at the heart of Berlin, the forum aims to foster collaboration and innovation in the fight against climate change. Participants are expected to engage in discussions that cover a wide range of topics, from renewable energy advancements to strategies for reducing carbon footprints and conserving biodiversity.\n", + "Economist Robert Liu emphasized the importance of international cooperation in his address, stating, \"The global economy is at a crossroads. It is imperative that we work together, leveraging our collective expertise and resources, to navigate the challenges ahead and foster sustainable growth.\"\n", "\n", - "This gathering comes at a crucial time as the world grapples with the effects of climate change, including extreme weather events, rising sea levels, and threats to food security. The Global Climate Action Forum is not just a platform for dialogue, but a call to action for immediate and concrete steps to protect our planet for future generations.\n", + "The United Nations, recognizing the interconnected nature of today's economic landscape, has been actively seeking partnerships with economists and other stakeholders to enhance its efforts in promoting economic resilience and development. This forum provided a platform for such collaborations, with discussions spanning a range of topics including trade imbalances, inflation, and the impacts of geopolitical tensions on global markets.\n", "\n", - "As the forum continues over the next few days, stakeholders hope to forge partnerships and commitments that will drive significant progress in global climate policies. The outcomes of this forum are anticipated to influence international agreements and initiatives aimed at creating a sustainable and resilient future.\n", + "As the forum concluded, participants expressed optimism about the steps being taken to address these challenges. The partnership between Economist Robert Liu and the United Nations is expected to yield actionable strategies that will be critical in shaping economic policies worldwide.\n", "\n", - "With Berlin as the backdrop, this forum highlights the city’s role as a leader in environmental advocacy and its commitment to fostering a global dialogue on climate action. The event underscores the importance of collective effort in tackling one of the most significant challenges of our time.\n", + "The outcomes of the Global Economic Forum will likely influence discussions in upcoming international summits and meetings, as the world looks to economists and organizations like the United Nations for leadership and solutions in these uncertain times.\n", "\n", "
\n", "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", + "[Back to top](#query)\n", "\n", "#### Source 219\n", "\n", @@ -987,327 +541,199 @@ "\n", "\n", "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", + "[Back to top](#query)\n", "\n", - "#### Source 230\n", + "#### Source 241\n", "\n", "
\n", "\n", - "##### Text chunk: news_articles_texts.csv_231 (1)\n", + "##### Text chunk: news_articles_texts.csv_242 (1)\n", "\n", - "mock_text: **Annual Food Festival Returns to Riverfront Park**\n", + "mock_text: **Gourmet Guild Hosts Successful Food Gala on Main Street**\n", "\n", - "Riverfront Park is set to come alive with the sizzling sounds and tantalizing aromas of the city's most anticipated culinary event. On March 3, 2024, at precisely 2:30 PM, the Annual Food Festival makes its much-anticipated return, promising a day full of gastronomic adventures for food lovers of all ages.\n", + "Main Street was abuzz with excitement on Thursday as the Gourmet Guild, in collaboration with the Culinary Arts Association, hosted a spectacular food gala that delighted attendees from all walks of life. The event, held on August 10, 2023, was a resounding success, drawing food enthusiasts and curious locals alike to savor a variety of culinary delights.\n", "\n", - "This year's festival is spearheaded by none other than the renowned Chef Tom Wilson, whose culinary expertise has won him accolades both locally and nationally. Chef Wilson, who has been a pivotal figure in the food community, expressed his excitement about the event. \"The festival is not just about food; it's about bringing people together and celebrating our diverse culinary heritage,\" he said.\n", + "The highlight of the day was the presence of two renowned chefs: Maria Lopez and John Smith. Both chefs are celebrated for their innovative approaches to traditional dishes, and they certainly did not disappoint. Chef Maria Lopez, known for her flair in Mediterranean cuisine, captivated the crowd with her signature paella, which drew long lines and rave reviews throughout the afternoon. Meanwhile, Chef John Smith, famous for his modern twist on classic American comfort food, served up a gourmet mac and cheese that left everyone coming back for seconds.\n", "\n", - "The Festival Committee, the organization responsible for orchestrating this grand event, has ensured that the lineup of activities will cater to a wide audience. Attendees can expect a variety of food stalls, each offering unique and delicious dishes that showcase the talents of local chefs and vendors. From gourmet treats to traditional favorites, there will be something to satisfy every palate.\n", + "The event, organized by the Gourmet Guild, was designed to promote local culinary talent and provide a platform for chefs to showcase their skills. The Culinary Arts Association also played a pivotal role in bringing together some of the best culinary minds for this gathering, ensuring a diverse range of flavors and styles were represented.\n", "\n", - "Riverfront Park, known for its scenic beauty, provides the perfect backdrop for this festival. The location not only offers ample space for the expected crowds but also enhances the overall experience with its picturesque views of the river.\n", + "Attendees had the opportunity to sample dishes from various stalls set up along Main Street, transforming the area into a vibrant tapestry of aromas and tastes. Beyond the food, the gala featured live music and cooking demonstrations, adding to the festive atmosphere and offering something for everyone.\n", "\n", - "In addition to the mouth-watering food, the festival will feature live cooking demonstrations, where Chef Tom Wilson and other culinary experts will share their tips and tricks. There will also be music performances and family-friendly activities throughout the day, making it an event not to be missed.\n", + "The success of the food gala not only highlighted the talents of chefs Lopez and Smith but also underscored the Gourmet Guild's commitment to fostering a strong and supportive culinary community. The event organizers expressed their gratitude to all participants and attendees, and hinted at plans for future events that promise to be even bigger and more exciting.\n", "\n", - "The Annual Food Festival is a testament to the city's vibrant food scene and a celebration of community spirit. With its array of culinary delights and entertainment, it promises to be a memorable occasion for all who attend. Mark your calendars and prepare your taste buds for a day of indulgence at Riverfront Park.\n", + "As the day came to a close, it was clear that the Gourmet Guild had achieved its goal of creating a memorable experience for all involved, leaving the community eagerly anticipating the next culinary celebration on Main Street.\n", "\n", "
\n", "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", + "[Back to top](#query)\n", "\n", - "#### Source 240\n", + "#### Source 242\n", "\n", "
\n", "\n", - "##### Text chunk: news_articles_texts.csv_241 (1)\n", + "##### Text chunk: news_articles_texts.csv_243 (1)\n", "\n", - "mock_text: **Culinary Stars Shine at Town's Annual Food Festival**\n", + "mock_text: **Local Chefs Union Partners with Gourmet Guild for Fest**\n", "\n", - "*Town Square, August 9, 2023* — The vibrant streets of Town Square were filled with the enticing aromas of gourmet dishes as the town played host to its much-anticipated annual food festival. This year, the event was organized in association with the esteemed Gourmet Guild, a name synonymous with culinary excellence.\n", + "*City Park, August 11, 2023* — Under the vibrant late summer sun, City Park was transformed into a foodie paradise as the Local Chefs Union teamed up with the Gourmet Guild for a spectacular culinary festival. The event, celebrated this past Friday, brought together a myriad of flavors and cooking talents, spotlighting some of the most creative culinary minds in the region.\n", "\n", - "Among the highlights of the festival was the presence of Chef Maria Lopez, a celebrated figure in the culinary world known for her innovative fusion dishes that blend traditional flavors with modern techniques. Chef Lopez captivated the audience with a live cooking demonstration, showcasing her signature dish that featured local ingredients paired with exotic spices.\n", + "Among the highlights of the festival was the presence of renowned Chef Maria Lopez, who dazzled attendees with her innovative dishes. Chef Lopez, celebrated for her fusion of traditional and modern culinary techniques, drew a large crowd eager to sample her signature creations. Her participation was a testament to the event's prestige and the collaborative power of the Local Chefs Union and Gourmet Guild in uniting top culinary talent.\n", "\n", - "The festival, a staple event in the local calendar, attracted food enthusiasts from all over the region. It provided an excellent platform for emerging chefs to display their skills and allowed attendees to indulge in a variety of cuisines ranging from rustic street food to high-end gourmet treats.\n", + "The festival, held at the picturesque City Park, offered a variety of food stalls and live cooking demonstrations. Attendees were treated to an array of gourmet dishes ranging from local favorites to international delicacies, showcasing the diverse culinary landscape that the event aimed to celebrate.\n", "\n", - "In addition to the mouth-watering food, the event also featured cooking workshops, interactive sessions with chefs, and a marketplace where local producers sold homemade jams, artisanal cheeses, and freshly baked bread.\n", + "The partnership between the Local Chefs Union and Gourmet Guild was praised by many as a successful endeavor that highlighted the importance of collaboration in the culinary community. Together, these organizations managed to curate an experience that not only satisfied taste buds but also fostered community spirit and an appreciation for the culinary arts.\n", "\n", - "The Gourmet Guild, known for its commitment to promoting culinary arts, played a pivotal role in organizing the event, ensuring that it was both a gastronomic delight and an educational experience for all attendees.\n", + "Event-goers expressed their delight in the festival's offerings, noting the exceptional organization and the unique opportunity to engage with chefs like Maria Lopez. The event also included workshops and interactive sessions, providing a platform for aspiring chefs to learn from the best.\n", "\n", - "As the sun set over Town Square, the festival concluded with a spectacular fireworks display, leaving attendees with unforgettable memories and a taste for more. The success of this year's festival has set a high bar for future events, promising even more culinary adventures in the years to come.\n", + "As the sun set over City Park, the festival concluded on a high note, with attendees already looking forward to the next collaboration between the Local Chefs Union and Gourmet Guild. This event has undoubtedly set a high bar for future culinary festivals in the area, promising an exciting future for food enthusiasts and professionals alike.\n", "\n", "
\n", "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", + "[Back to top](#query)\n", "\n", - "#### Source 268\n", + "#### Source 243\n", "\n", "
\n", "\n", - "##### Text chunk: news_articles_texts.csv_269 (1)\n", + "##### Text chunk: news_articles_texts.csv_244 (1)\n", "\n", - "mock_text: **Art in Paris: A Cultural Exploration with Emma Thompson**\n", + "mock_text: **Food Lovers Club Celebrates Local Chefs at Town Hall**\n", "\n", - "*Paris, September 1, 2023* — The city of lights, renowned for its unparalleled contributions to the world of art and culture, recently welcomed a distinguished visitor. Emma Thompson, acclaimed actress and art enthusiast, embarked on a cultural journey through Paris, delving into the vibrant art scene that encapsulates the city’s rich artistic heritage.\n", + "*Town Hall, August 12, 2023* — The aroma of exquisite dishes filled the air at Town Hall this Saturday as food enthusiasts gathered to celebrate the culinary prowess of Chef Maria Lopez and Chef Ana Torres. Organized by the Gourmet Guild in collaboration with the Food Lovers Club, this event highlighted the exceptional talents of these local culinary artists.\n", "\n", - "The highlight of Thompson's visit was an exploration of the Louvre Museum, an iconic institution that continues to be a beacon for art lovers globally. The Louvre, nestled in the heart of Paris, is home to some of the world's most treasured artworks, ranging from ancient artifacts to masterpieces of the Renaissance.\n", + "The evening commenced at 6:45 PM, drawing a crowd of food lovers eager to taste the creations of the celebrated chefs. Chef Maria Lopez, known for her innovative fusion dishes, showcased a menu that included a delightful blend of traditional flavors with modern twists. Her passion for incorporating local ingredients was evident in every bite.\n", "\n", - "During her visit, Thompson expressed her admiration for the museum's extensive collections. \"The Louvre is not just a museum; it’s a testament to human creativity and history,\" she remarked. Her journey through the galleries was more than just a tour; it was a deep dive into the narratives that each piece of art tells.\n", + "Chef Ana Torres, on the other hand, captivated attendees with her mastery of classic culinary techniques. Her dishes were a testament to her dedication to preserving culinary heritage while infusing her own unique flair.\n", "\n", - "The current exhibitions at the Louvre have attracted art aficionados from around the world, featuring both classic and contemporary artworks that reflect the dynamic nature of art. Thompson was particularly drawn to the exhibitions that highlight the interplay between historical and modern art forms, showcasing how they influence and inspire one another.\n", + "Members of the Gourmet Guild and the Food Lovers Club expressed their admiration for the chefs, praising their contributions to the local culinary scene. \"It's an honor to host this event for such talented individuals,\" said a representative from the Food Lovers Club. \"Maria and Ana have not only pushed the boundaries of flavor but have also inspired a new generation of chefs.\"\n", "\n", - "Paris, with its cobblestone streets and historic architecture, provides the perfect backdrop for such a cultural exploration. The city's art scene is not confined to its museums; it spills into its streets, its cafes, and its people, each contributing to the vibrant tapestry that makes Paris a haven for artists and admirers alike.\n", + "The celebration at Town Hall was more than just a feast for the palate; it was a testament to the thriving culinary culture in the community. As the event concluded, attendees left with satisfied appetites and a renewed appreciation for the art of cooking.\n", "\n", - "Emma Thompson's exploration of Paris serves as a reminder of the city's enduring allure and its pivotal role in the world of art. Her visit underscores the importance of cultural institutions like the Louvre in preserving and promoting artistic heritage. As she continues her journey, Thompson hopes to inspire others to explore and appreciate the art that surrounds them, wherever they may be.\n", + "Both Chef Maria Lopez and Chef Ana Torres received accolades for their work, marking the event as a memorable celebration of culinary excellence.\n", "\n", "
\n", "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", + "[Back to top](#query)\n", "\n", - "#### Source 308\n", + "#### Source 278\n", "\n", "
\n", "\n", - "##### Text chunk: news_articles_texts.csv_309 (1)\n", + "##### Text chunk: news_articles_texts.csv_279 (1)\n", "\n", - "mock_text: **Innovative Designs Unveiled at Paris Fashion Week**\n", + "mock_text: **Wimbledon Championships: A Historic Tournament**\n", "\n", - "*Paris, March 22, 2023* — The fashion world turned its eyes to Paris today as Designer Mia Liu unveiled her latest collection at the renowned Fashion Week. Known for her avant-garde approach and innovative techniques, Liu did not disappoint, capturing the attention of critics and fashion enthusiasts alike.\n", + "*Wimbledon, June 20, 2023* — This year's Wimbledon Championships have been nothing short of spectacular, with thrilling matches and unforgettable moments that will be etched in the history of tennis. Serena Thompson, a seasoned sports journalist, offers an insightful report on the standout performances and champions that emerged from this prestigious tournament.\n", "\n", - "In the opulent setting of Paris, the heart of haute couture, Liu's collection stood out for its bold use of color and texture, a testament to her unique style and creative vision. Each piece showcased a blend of traditional craftsmanship with contemporary flair, embodying Liu's signature aesthetic.\n", + "The Wimbledon Championships, organized by the International Tennis Federation, is renowned for its tradition and excellence. This year's event lived up to its reputation, showcasing extraordinary talent and fierce competition on the grass courts of the All England Club.\n", "\n", - "The event, part of the prestigious Fashion Week, was attended by an array of industry leaders, influencers, and celebrities, all eager to witness the unveiling of Liu's much-anticipated designs. As the models graced the runway, the audience was captivated by the intricate details and the innovative cuts that defined the collection.\n", + "As the tournament unfolded, tennis fans were treated to a series of gripping matches. Players from around the globe displayed remarkable skill and determination, vying for the coveted Wimbledon title. The atmosphere was electric as spectators cheered for their favorite athletes, creating an unforgettable experience for all involved.\n", "\n", - "Critics have already begun to sing praises, with many highlighting Liu's ability to push the boundaries of conventional fashion while maintaining an elegant and wearable appeal. Her collection is expected to set the trend for the upcoming seasons, influencing not just the Parisian fashion scene, but the global industry as well.\n", - "\n", - "Fashion Week in Paris continues to be a pivotal platform for designers like Mia Liu to showcase their talent and creativity. As the event progresses, the fashion community eagerly awaits more such groundbreaking presentations that define the spirit of innovation and artistry.\n", - "\n", - "
\n", - "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", - "\n", - "#### Source 309\n", - "\n", - "
\n", + "Serena Thompson highlights several matches that stood out for their intensity and high level of play. These encounters not only captivated the audience but also demonstrated the evolving nature of the sport. The tournament saw both seasoned champions and rising stars make their mark, each leaving a unique imprint on the competition.\n", "\n", - "##### Text chunk: news_articles_texts.csv_310 (1)\n", + "The crowning of this year's champions was the pinnacle of the event, with winners embodying the spirit of resilience and sportsmanship. Their victories were celebrated by fans and critics alike, adding another chapter to the storied legacy of Wimbledon.\n", "\n", - "mock_text: **Groundbreaking AI Innovations Unveiled in Silicon Valley**\n", + "As the matches concluded and the curtains fell on the tournament, reflections on the performances and outcomes began. This year's Wimbledon Championships will be remembered as a landmark event, a testament to the enduring appeal and global impact of tennis.\n", "\n", - "*Silicon Valley, April 1, 2023* — In an event that drew attention from tech enthusiasts and industry leaders alike, the Tech Innovators Conference in Silicon Valley became the stage for a series of remarkable AI advancements. Among the highlights was a presentation by renowned tech innovator Carlos Ruiz, who unveiled a suite of new artificial intelligence technologies that promise to transform multiple sectors.\n", - "\n", - "Ruiz, known for his forward-thinking approach and expertise in AI, captivated the audience with demonstrations that showcased the potential of these technologies to enhance efficiency and drive innovation across various industries. His presentation underscored the profound impact AI can have on everyday life, from streamlining manufacturing processes to revolutionizing healthcare delivery.\n", - "\n", - "The Tech Innovators Conference, a premier event for unveiling cutting-edge technologies, was abuzz with excitement as attendees witnessed the unveiling of these groundbreaking innovations. With the convergence of industry leaders and tech pioneers, the atmosphere was ripe for collaboration and inspiration.\n", - "\n", - "Speaking to a packed hall, Ruiz emphasized the importance of ethical AI development, highlighting how these advancements could be leveraged to address global challenges. \"We are at the cusp of a new era,\" Ruiz stated, \"one where AI not only augments human capabilities but also fosters a more sustainable and equitable future.\"\n", - "\n", - "The unveiling of these technologies is expected to spark discussions and foster partnerships aimed at integrating AI solutions into existing infrastructures. As Silicon Valley continues to be the cradle of technological innovation, the advancements presented by Carlos Ruiz are set to propel industries into a new age of efficiency and capability.\n", - "\n", - "With the conclusion of the Tech Innovators Conference, the buzz surrounding these AI innovations continues to reverberate throughout the tech community, promising exciting developments in the months and years to come.\n", + "For those who witnessed the action firsthand or followed from afar, this year's tournament reaffirmed Wimbledon as a beacon of excellence in the world of sports. The International Tennis Federation once again delivered a world-class event, further solidifying its status as a leading force in the tennis community.\n", "\n", "
\n", "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", + "[Back to top](#query)\n", "\n", - "#### Source 324\n", + "#### Source 361\n", "\n", "
\n", "\n", - "##### Text chunk: news_articles_texts.csv_325 (1)\n", - "\n", - "mock_text: **James Carter Addresses Global Leadership Forum in London**\n", - "\n", - "*London, April 1, 2023* — In a significant address to the Global Leadership Forum held in London, renowned political analyst James Carter shared his insights on emerging global trends that are shaping the future of international politics.\n", + "##### Text chunk: news_articles_texts.csv_362 (1)\n", "\n", - "The event, which gathered some of the most influential figures in global governance and policy-making, provided a platform for Carter to delve into pressing issues facing the world today. His speech, delivered at precisely 9:00 AM GMT, captivated an audience keen on understanding the dynamics of current geopolitical shifts.\n", + "mock_text: **Gastronomy Weekend Brings Top Chefs to Town Square**\n", "\n", - "Carter, well-regarded for his analytical prowess, highlighted several key trends that he believes will define the coming decade. Among these were the increasing role of technology in governance, the shifting alliances in international relations, and the growing importance of sustainable development in policy agendas.\n", + "*Town Square, August 10, 2023* — This past weekend, the heart of our community became a haven for food enthusiasts as the much-anticipated Gastronomy Weekend unfolded at Town Square. Organized by the renowned Culinary Association, the event was a celebration of culinary arts and culture, drawing food lovers from near and far.\n", "\n", - "\"The world is at a crossroads,\" Carter stated emphatically. \"The decisions we make today will determine our collective future. It's imperative that leaders across the globe collaborate to address these challenges.\"\n", + "Headlining the festival were two celebrated chefs, Maria Lopez and John Smith, both known for their exceptional talent and innovative approach to cooking. Chef Maria Lopez, whose expertise in Latin American cuisine has earned her accolades worldwide, dazzled the audience with her signature dishes. Her vibrant flavors and unique techniques captivated the taste buds and imaginations of all who attended.\n", "\n", - "The Global Leadership Forum, known for its commitment to fostering dialogue among world leaders, served as an ideal venue for Carter's thought-provoking address. Participants from various sectors, including government, academia, and private industry, engaged in vibrant discussions following his speech, reflecting on the implications of his insights for their respective fields.\n", + "Meanwhile, Chef John Smith, a maestro of modern European cuisine, took to the stage with his sophisticated yet accessible creations. His demonstrations were a highlight of the weekend, offering attendees a glimpse into the art of blending traditional flavors with contemporary flair.\n", "\n", - "As the forum continues, attendees are expected to explore further the themes introduced by Carter, with the goal of crafting actionable strategies that can be implemented on a global scale.\n", + "Throughout Town Square, a myriad of stalls and booths showcased a diverse array of culinary talents. From artisanal bread makers to exotic spice vendors, the festival celebrated the richness and diversity of the culinary world. Visitors had the chance to sample a wide range of foods, participate in interactive cooking workshops, and engage with the chefs themselves.\n", "\n", - "James Carter's participation in the forum underscores his standing as a pivotal voice in the realm of political analysis, and his contributions are likely to influence discussions well beyond the event's conclusion.\n", + "The event, lauded by the Culinary Association as a tremendous success, not only highlighted the skills of top chefs but also fostered a sense of community and shared passion for food. As the aromas of exquisite dishes filled the air, Town Square became a vibrant tapestry of flavors and experiences, leaving attendees eagerly anticipating next year's edition of Gastronomy Weekend.\n", "\n", "
\n", "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", + "[Back to top](#query)\n", "\n", - "#### Source 381\n", + "#### Source 363\n", "\n", "
\n", "\n", - "##### Text chunk: news_articles_texts.csv_382 (1)\n", - "\n", - "mock_text: **Leaders Discuss Cooperation at East Asia Summit**\n", - "\n", - "*Beijing, March 30, 2023* — In a significant move towards bolstering regional cooperation, President Lin Wei of China and Prime Minister Hiro Tanaka of Japan engaged in high-level discussions today at the East Asia Summit. The meeting, held in parallel with the Asian Economic Forum, underscored the commitment of both leaders to strengthen ties between their nations amidst a complex geopolitical landscape.\n", - "\n", - "The discussions took place in Beijing, where the East Asia Summit is being hosted this year. The Summit has drawn leaders from across the region, providing a crucial platform for dialogue on pressing economic and political issues. President Lin Wei and Prime Minister Hiro Tanaka, representing two of Asia's largest economies, emphasized the importance of collaboration in areas such as trade, technology, and sustainable development.\n", - "\n", - "\"China and Japan have a shared responsibility to ensure the stability and prosperity of the region,\" President Lin Wei stated. \"Our discussions today mark a new chapter in Sino-Japanese relations, as we seek to build bridges and overcome past challenges.\"\n", - "\n", - "Prime Minister Hiro Tanaka echoed these sentiments, highlighting the mutual benefits of enhanced cooperation. \"Japan is committed to working closely with China to address regional challenges and seize opportunities for growth,\" he said. \"Together, we can contribute to a more secure and prosperous East Asia.\"\n", - "\n", - "The Asian Economic Forum, occurring alongside the Summit, provided an additional venue for business leaders and policymakers to explore economic strategies and partnerships. Both President Lin Wei and Prime Minister Hiro Tanaka attended various sessions, engaging with experts on topics ranging from digital innovation to climate change.\n", - "\n", - "As the East Asia Summit continues, observers will be keenly watching for further developments in the relationship between China and Japan. The outcomes of these discussions could have far-reaching implications for the region and beyond, as both countries strive to navigate a rapidly changing global landscape.\n", + "##### Text chunk: news_articles_texts.csv_364 (1)\n", "\n", - "In conclusion, the dialogue between President Lin Wei and Prime Minister Hiro Tanaka marks a pivotal moment in international relations within East Asia, promising a future of closer ties and cooperative efforts in addressing common challenges.\n", + "mock_text: **Wine and Dine Event Unites Culinary Experts at Riverfront Plaza**\n", "\n", - "
\n", - "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", + "August 12, 2023\n", "\n", - "#### Source 391\n", - "\n", - "
\n", + "In a delightful confluence of flavors and expertise, the Riverfront Plaza was transformed into a haven for food and wine enthusiasts on Saturday. The much-anticipated Wine and Dine event, organized by the esteemed Gourmet Guild, brought together some of the region's most talented culinary artists to showcase their skills in food and wine pairings.\n", "\n", - "##### Text chunk: news_articles_texts.csv_392 (1)\n", + "Among the highlights of the event were the appearances of celebrated chefs Maria Lopez and Ana Torres, both of whom have carved out prestigious reputations in the culinary world. Chef Maria Lopez, known for her innovative approach to traditional cuisine, dazzled attendees with her unique take on Mediterranean dishes. Her pairings, which featured a delicate balance of flavors, were complemented by a selection of crisp, white wines that accentuated the freshness of her creations.\n", "\n", - "mock_text: **Tech Innovators Forum Explores AI Advances: A Visionary Discussion in Silicon Valley**\n", + "Chef Ana Torres, on the other hand, drew in crowds with her bold and vibrant culinary creations. Specializing in Latin American cuisine, she presented a series of dishes that were both flavorful and artfully presented. Her choice of robust red wines perfectly matched the intensity and richness of her dishes, leaving a lasting impression on all who sampled her offerings.\n", "\n", - "*April 9, 2023, Silicon Valley* — In the heart of Silicon Valley, a hub known for its technological prowess and innovation, the Tech Innovators Forum convened today, drawing attention from industry leaders and tech enthusiasts alike. The highlight of the forum was an insightful keynote address by the esteemed CEO Maria Chen, who delved into the transformative potential of artificial intelligence (AI) and its far-reaching implications for the future.\n", + "The Riverfront Plaza, with its stunning views and elegant ambiance, provided the perfect backdrop for this gastronomic celebration. Attendees strolled through various stalls, each offering a different experience, from artisanal cheeses to handcrafted chocolates, all paired with carefully selected wines.\n", "\n", - "Maria Chen, a renowned figure in the tech industry, captivated the audience with her forward-thinking perspective on AI technologies. She emphasized the critical role AI is poised to play in reshaping various sectors, from healthcare to transportation, and highlighted the importance of ethical considerations in AI development. \"We are on the brink of a new era where AI can truly enhance human capabilities and improve quality of life,\" Chen stated, urging stakeholders to embrace innovation while remaining vigilant about the societal impacts.\n", + "The event not only highlighted the talents of individual chefs but also served as a platform for the Gourmet Guild to further its mission of promoting culinary excellence and innovation. As the sun set over the river, the Wine and Dine event concluded with guests expressing their appreciation for the exceptional food and wine, as well as the opportunity to witness such masterful culinary artistry in one place.\n", "\n", - "The Tech Innovators Forum, a gathering of some of the brightest minds in technology, provided a platform for discussing cutting-edge advancements and fostering collaboration among tech companies. The event underscored Silicon Valley's status as a leading force in the global technology landscape and reaffirmed the region's commitment to driving progress in AI.\n", - "\n", - "As discussions unfolded, attendees explored the myriad ways AI can be harnessed to tackle complex challenges and create new opportunities. Maria Chen's address not only inspired hope for a future enriched by AI but also served as a call to action for responsible innovation. The forum concluded with a consensus on the need for continued dialogue and partnership in navigating the evolving AI landscape.\n", - "\n", - "In summary, the Tech Innovators Forum showcased the dynamic interplay between technology and society, with AI at its core. Under CEO Maria Chen's visionary leadership, the forum set the stage for a future where artificial intelligence could fundamentally transform how we live and work, echoing the innovative spirit of Silicon Valley.\n", + "For those fortunate enough to attend, it was an evening to remember—an exquisite blend of taste, community, and art, all under the guidance of culinary masters like Chef Maria Lopez and Chef Ana Torres.\n", "\n", "
\n", "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", + "[Back to top](#query)\n", "\n", - "#### Source 400\n", + "#### Source 431\n", "\n", "
\n", "\n", - "##### Text chunk: news_articles_texts.csv_401 (1)\n", - "\n", - "mock_text: **Economic Insights from Asia: A Dialogue in Beijing**\n", + "##### Text chunk: news_articles_texts.csv_432 (1)\n", "\n", - "*Beijing, October 2, 2023* — In a significant gathering that attracted attention from across the globe, Dr. Robert Moore and Prof. Sandra Li convened in Beijing to delve into the latest economic developments and trends shaping Asia. The dialogue, held under the auspices of the World Economic Forum and with the support of the International Monetary Fund, provided a platform for deep insights into the economic dynamics at play across the continent.\n", + "mock_text: **Leo Martins Dominates City Tennis Open with Exceptional Performance**\n", "\n", - "Dr. Moore, a renowned economist known for his work on global market trends, and Prof. Li, a leading academic authority on Asian economies, shared the stage in the bustling city of Beijing. Their discussion was timely, given the rapid economic transformations occurring in key Asian markets such as Beijing and Shanghai.\n", + "*City Arena, July 22, 2023* — In an electrifying display of skill and determination, Champion Leo Martins emerged victorious at the City Tennis Open, capturing the title at the prestigious City Arena. The tournament, organized by the renowned Tennis Association, saw fierce competition, but it was Martins who stole the show with his remarkable prowess on the court.\n", "\n", - "The conversation highlighted several pivotal topics, including the impact of technological advancements on economic growth and the evolving trade relationships within the region. Both experts emphasized the importance of sustainable development and the need for policies that address income inequality and environmental challenges.\n", + "The City Arena buzzed with excitement as fans gathered to witness the final match of the City Tennis Open. Expectations were high, and Leo Martins did not disappoint. From the very first serve, it was clear that Martins was in top form, executing powerful strokes and agile footwork that left his opponents struggling to keep pace.\n", "\n", - "Prof. Sandra Li noted, \"Shanghai and Beijing are not just economic powerhouses of China; they are pivotal players in the global economy. Understanding their growth patterns and challenges offers a microcosm of wider Asian economic trends.\"\n", + "Throughout the tournament, Martins demonstrated why he is considered one of the top players in the sport. His strategic play and unwavering focus were evident in every match, culminating in a stunning victory that solidified his status as a champion. Spectators were treated to a masterclass in tennis as Martins outmaneuvered his rivals with ease.\n", "\n", - "Dr. Robert Moore added, \"The economic pulse of Asia is vital for global markets. The discussions here in Beijing are crucial as they shape the strategies for international economic cooperation and growth.\"\n", + "The Tennis Association, which has been at the forefront of promoting the sport, was delighted with the success of the event. Officials praised Martins for his outstanding performance and contribution to the tournament’s prestige. The victory at City Arena adds another accolade to Martins' already impressive career, further cementing his legacy in the tennis world.\n", "\n", - "The event underscored the important role of forums like these in fostering dialogue and collaboration between leading economic thinkers and institutions such as the World Economic Forum and the International Monetary Fund. The insights shared in Beijing will likely influence economic policy and strategy in the region and beyond.\n", + "As the City Tennis Open concluded, fans and fellow players alike celebrated Martins' achievement. His dominance on the court was a testament to his hard work, dedication, and love for the game. The City Arena, having witnessed such an enthralling display of tennis, will surely be remembered as the venue where Leo Martins once again proved his mettle.\n", "\n", - "As Asia continues to be a focal point of economic activity, the insights from experts like Dr. Moore and Prof. Li are invaluable for understanding the forces driving change and shaping the future of the global economy.\n", + "With this latest triumph, Leo Martins has set his sights on future challenges, eager to continue his winning streak and inspire the next generation of tennis enthusiasts. The City Tennis Open has undoubtedly left an indelible mark on the sporting calendar, thanks in no small part to the exceptional talent of Champion Leo Martins.\n", "\n", "
\n", "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", + "[Back to top](#query)\n", "\n", - "#### Source 408\n", + "#### Source 459\n", "\n", "
\n", "\n", - "##### Text chunk: news_articles_texts.csv_409 (1)\n", + "##### Text chunk: news_articles_texts.csv_460 (1)\n", "\n", - "mock_text: **Health and Wellness Expo Comes to Chicago**\n", + "mock_text: **Serena Roy Clinches Grand Slam Title in Thrilling Match**\n", "\n", - "*Chicago, IL - October 5, 2023*\n", + "*Grand Slam Stadium, September 5, 2023* — In a stunning display of athleticism and skill, Champion Serena Roy has once again proven her prowess on the tennis court by clinching the Grand Slam title. The match, held at the iconic Grand Slam Stadium, drew an enthusiastic crowd, all eager to witness history in the making.\n", "\n", - "The bustling city of Chicago played host to the much-anticipated annual Health and Wellness Expo, drawing health enthusiasts and professionals from across the region. This year, the spotlight was on modern lifestyle changes, a topic that has garnered increasing attention amid rapidly evolving health trends.\n", + "Serena Roy, a name synonymous with excellence in the world of tennis, faced fierce competition but ultimately emerged victorious. Her performance was nothing short of spectacular, showcasing her determination and strategic gameplay. This victory adds yet another accolade to her illustrious career, solidifying her status as one of the sport's greats.\n", "\n", - "Dr. Emily Green, a renowned health expert and keynote speaker at the event, captivated the audience with her insights on how contemporary lifestyle adjustments can significantly impact overall well-being. Dr. Green, known for her research in lifestyle medicine, emphasized the importance of integrating small, sustainable changes into daily routines, which can lead to substantial health benefits over time.\n", + "The event, organized by the prestigious Tennis Association, was a highlight of the sporting calendar, drawing fans from around the globe. The association praised Roy's indomitable spirit and congratulated her on her well-deserved triumph.\n", "\n", - "The Expo, organized by the American Health Association, featured a range of activities and workshops designed to educate attendees on various aspects of health and wellness. From nutrition and exercise to stress management and mental health, the event covered a comprehensive array of topics aimed at promoting a holistic approach to health.\n", + "As the match concluded and Serena raised her hands in victory, the stadium erupted in applause. Fans and fellow athletes alike celebrated her achievement, recognizing the dedication and hard work that led to this moment.\n", "\n", - "\"We are thrilled to bring together such a diverse group of experts and participants,\" said a representative from the American Health Association. \"Our goal is to empower individuals with the knowledge and tools they need to lead healthier lives.\"\n", - "\n", - "Participants had the opportunity to engage with exhibitors showcasing the latest in health technology and innovations. Interactive sessions allowed attendees to explore new ways to incorporate healthful practices into their busy lives, reflecting the Expo's theme of modern lifestyle changes.\n", - "\n", - "As the event concluded, attendees left with a renewed sense of motivation and a wealth of information to apply in their personal health journeys. The Health and Wellness Expo once again proved to be a valuable platform for fostering community engagement and promoting health awareness in Chicago and beyond.\n", + "This Grand Slam victory not only enhances Serena Roy's legacy but also inspires a new generation of tennis enthusiasts. Her journey reflects the essence of sportsmanship and the relentless pursuit of excellence. The Tennis Association, along with the global tennis community, looks forward to many more stellar performances from this iconic athlete.\n", "\n", "
\n", "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", - "\n", - "#### Source 438\n", - "\n", - "
\n", - "\n", - "##### Text chunk: news_articles_texts.csv_439 (1)\n", - "\n", - "mock_text: **Chef Julia Wilson Hosts Exclusive Cooking Workshop at Gourmet Hall**\n", - "\n", - "On June 9, 2023, food enthusiasts gathered at the renowned Gourmet Hall for an exceptional culinary experience hosted by Chef Julia Wilson. This special event, organized by the esteemed Culinary Arts Association, offered attendees an opportunity to delve into the culinary secrets of one of the most celebrated chefs in the industry.\n", - "\n", - "Chef Julia Wilson, known for her innovative techniques and exquisite palate, led the workshop with her characteristic flair. Participants were treated to a hands-on experience, learning the art of crafting gourmet dishes from scratch. The workshop began promptly at 5:00 PM, with eager attendees filling the elegant space of Gourmet Hall, a venue known for its dedication to the culinary arts.\n", - "\n", - "Throughout the session, Chef Wilson shared insights into her creative process, demonstrating how to balance flavors and textures to create dishes that are both visually stunning and delectable. Her passion for cooking was palpable, and her engaging teaching style made complex techniques accessible to cooks of all skill levels.\n", - "\n", - "The Culinary Arts Association, committed to promoting excellence in the culinary field, organized this event as part of their ongoing series of workshops aimed at nurturing talent and inspiring a love for cooking. Their collaboration with Chef Julia Wilson brought together a diverse group of food lovers, all eager to learn from one of the best in the business.\n", - "\n", - "As the workshop concluded, participants left with newfound skills, a deeper appreciation for the culinary arts, and perhaps most importantly, a collection of cherished recipes straight from Chef Wilson's own kitchen. This event not only highlighted the expertise of Chef Julia Wilson but also reinforced Gourmet Hall's status as a premier destination for culinary education and innovation.\n", - "\n", - "
\n", - "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", - "\n", - "#### Source 462\n", - "\n", - "
\n", - "\n", - "##### Text chunk: news_articles_texts.csv_463 (1)\n", - "\n", - "mock_text: **Healthcare at the Forefront: Governor Li's Rochester Visit**\n", - "\n", - "*Rochester, New York — September 10, 2023*\n", - "\n", - "In a passionate address to the residents of Rochester, New York, Governor Emma Li underscored her administration's commitment to advancing healthcare reforms across the state. The event, organized by the Democratic Party, drew a large crowd eager to hear about the governor's plans to improve healthcare accessibility.\n", - "\n", - "Governor Li, who has been a staunch advocate for healthcare reform, took the stage at 11:00 AM to outline a series of new initiatives designed to expand access to medical services. \"Healthcare is a fundamental right, not a privilege,\" she declared, receiving enthusiastic applause from the audience. \"We are committed to ensuring that every New Yorker has access to the care they need.\"\n", - "\n", - "During her speech, Governor Li highlighted several key components of her healthcare strategy, including the expansion of Medicaid, increased funding for community health centers, and initiatives aimed at reducing prescription drug costs. These measures, she argued, are crucial steps towards a more equitable healthcare system.\n", - "\n", - "The visit to Rochester is part of a broader tour by Governor Li to promote her healthcare agenda and gather support from communities across New York. Her efforts come at a time when healthcare remains a pivotal issue in political discourse, with many citizens expressing concerns over rising costs and accessibility.\n", - "\n", - "Governor Li's commitment to healthcare reform has been a central theme of her tenure, aligning closely with the Democratic Party's platform. Her administration's focus on healthcare reflects a response to the growing demand for comprehensive reforms that address the needs of diverse populations across the state.\n", - "\n", - "In her closing remarks, Governor Li reiterated her dedication to working alongside healthcare professionals, legislators, and community leaders to implement these critical changes. \"Together, we can build a healthier, more inclusive New York,\" she affirmed, leaving the audience with a sense of optimism and determination.\n", - "\n", - "As the political landscape continues to evolve, Governor Li's emphasis on healthcare reform positions her as a leading figure in the fight for accessible healthcare, not only in New York but potentially as a model for other states.\n", - "\n", - "
\n", - "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", - "\n", - "#### Source 470\n", - "\n", - "
\n", - "\n", - "##### Text chunk: news_articles_texts.csv_471 (1)\n", - "\n", - "mock_text: **Innovators Gather in Tokyo for Technology Forum**\n", - "\n", - "*By Tech Daily News*\n", - "\n", - "Tokyo, Japan – September 8, 2023 – Today, the vibrant city of Tokyo plays host to the prestigious Tech Innovators Forum, where leading minds in technology and innovation converge to explore and discuss the future of their fields. This significant event marks a gathering of influential figures from across the globe, united by their shared vision for technological advancement.\n", - "\n", - "The Tech Innovators Forum, renowned for being at the forefront of technological discourse, has once again brought together a diverse group of experts, including engineers, entrepreneurs, and policymakers. Although specific individuals were not highlighted, the collective expertise of those present is expected to drive meaningful conversations and collaborations.\n", - "\n", - "The bustling metropolis of Tokyo, known for its cutting-edge technology and innovation-friendly environment, provides the perfect backdrop for this international assembly. Participants are expected to engage in a series of discussions and presentations focused on emerging trends, groundbreaking research, and the societal impact of new technologies.\n", - "\n", - "In an era where technology is rapidly transforming industries and daily life, the insights and decisions made at this forum could play a pivotal role in shaping the future. The event offers a platform for sharing ideas and forging partnerships that could lead to significant breakthroughs in various technological domains.\n", - "\n", - "As the forum unfolds over the coming days, attendees will have the opportunity to attend keynote speeches, panel discussions, and networking sessions. These activities are designed to foster collaboration and inspire innovation, ensuring that the technological community continues to push the boundaries of what is possible.\n", - "\n", - "The Tech Innovators Forum in Tokyo stands as a testament to the power of global collaboration in driving progress and addressing the challenges of the modern world. As the event progresses, the world watches eagerly to see what innovations and ideas will emerge from this gathering of tech pioneers.\n", - "\n", - "
\n", - "\n", - "[Back to top](#diverse-global-events-highlight-cultural-technological-and-health-innovations)\n", + "[Back to top](#query)\n", "\n", "\n" ] @@ -1320,7 +746,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -1339,82 +765,61 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "# Global Events: A Comprehensive Overview of Cultural, Technological, Economic, and Health Innovations\n", - "\n", - "## Introduction\n", - "\n", - "This report provides an overview of various significant events across the globe, focusing on cultural, technological, economic, and health-related gatherings. These events highlight the interconnectedness of different sectors and the importance of collaboration and cultural exchange in addressing global challenges.\n", - "\n", - "## Cultural and Artistic Events\n", + "# Events Discussed\n", "\n", - "### Louvre Museum's Asian Art Exhibition\n", + "## Culinary Arts\n", "\n", - "The Louvre Museum in Paris has launched an Asian Art Exhibition curated by Sophia Lin, showcasing a diverse collection of artworks from countries such as China, Japan, Korea, and India. This exhibition aims to foster cultural exchange between East and West and is set to run for six months, attracting art enthusiasts globally [source: news_articles_texts.csv_8 (1)].\n", + "### Italian Food Festival in Rome\n", + "Renowned chefs like Antonio Rossi and Marco Tanzi shared their expertise at events in Rome, such as the Italian Food Festival, showcasing innovative approaches to traditional Italian cuisine [source: news_articles_texts.csv_160 (1), news_articles_texts.csv_92 (1)].\n", "\n", - "### Emily Rivera's Exhibition at the Metropolitan Art Gallery\n", + "### Gastronomy Weekend\n", + "The Gastronomy Weekend featured chefs like Maria Lopez and John Smith, promoting community engagement and cultural exchange through food [source: news_articles_texts.csv_362 (1)].\n", "\n", - "Emily Rivera's exhibition at the Metropolitan Art Gallery explores themes of identity and transformation. Organized with the Art Enthusiasts Society, it features artworks that delve into self-perception and the fluidity of identity, challenging and inspiring viewers [source: news_articles_texts.csv_68 (1)].\n", + "### Food Lovers Club Event\n", + "The Food Lovers Club celebrated chefs Maria Lopez and Ana Torres, who were praised for their innovative and traditional culinary techniques [source: news_articles_texts.csv_244 (1)].\n", "\n", - "### Emma Thompson's Cultural Exploration of Paris\n", + "### Wine and Dine Event\n", + "The Wine and Dine event at Riverfront Plaza featured chefs Maria Lopez and Ana Torres, who presented Mediterranean and Latin American dishes paired with wines [source: news_articles_texts.csv_364 (1)].\n", "\n", - "Acclaimed actress Emma Thompson visited Paris, focusing on the city's vibrant art scene, particularly the Louvre Museum. Her visit highlighted the interplay between different art forms and the importance of cultural institutions in preserving artistic heritage [source: news_articles_texts.csv_269 (1)].\n", + "### Gourmet Guild's Food Gala\n", + "The Gourmet Guild's food gala featured chefs Maria Lopez and John Smith, showcasing Mediterranean and American comfort foods [source: news_articles_texts.csv_242 (1)].\n", "\n", - "### Mia Liu's Fashion Collection at Paris Fashion Week\n", + "### Culinary Festival at City Park\n", + "The culinary festival at City Park, organized by the Local Chefs Union and Gourmet Guild, featured Chef Maria Lopez and offered a variety of gourmet dishes and interactive sessions [source: news_articles_texts.csv_243 (1)].\n", "\n", - "Designer Mia Liu unveiled her latest collection at Paris Fashion Week, known for its avant-garde approach and innovative techniques. Her collection is expected to influence global fashion trends, showcasing the importance of Paris Fashion Week as a platform for innovation [source: news_articles_texts.csv_309 (1)].\n", + "## Global Health and Economic Events\n", "\n", - "### Culinary Festivals\n", - "\n", - "Culinary festivals such as the Rome annual food festival and the Annual Food Festival at Riverfront Park highlight global food culture. These events feature renowned chefs like Chef Antonio and Chef Tom Wilson, blending traditional recipes with modern flair and emphasizing food as a universal language [source: news_articles_texts.csv_137 (1), news_articles_texts.csv_231 (1)].\n", - "\n", - "## Technological and Economic Forums\n", - "\n", - "### Tech Innovators Conferences\n", - "\n", - "The Tech Innovators Conferences held in global tech hubs like San Francisco, Austin, Silicon Valley, and Tokyo showcase cutting-edge technologies and innovations. These events emphasize AI advancements and the importance of responsible innovation and collaboration [source: news_articles_texts.csv_15 (1), news_articles_texts.csv_56 (1), news_articles_texts.csv_71 (1), news_articles_texts.csv_91 (1)].\n", + "### World Health Organization Meeting\n", + "The World Health Organization convened in Geneva to address issues like infectious diseases and vaccine equity [source: news_articles_texts.csv_220 (1)].\n", "\n", "### Global Economic Forum\n", + "The Global Economic Forum focused on economic stability and development, with participation from economists and the United Nations [source: news_articles_texts.csv_184 (1)].\n", "\n", - "The Global Economic Forum addresses market volatility and post-pandemic recovery, with discussions on digital currencies and blockchain technology. Economists like Robert Liu and Sarah Lin emphasize sustainable growth and international cooperation in economic policymaking [source: news_articles_texts.csv_77 (1), news_articles_texts.csv_105 (1)].\n", - "\n", - "### East Asia Summit and Asian Economic Forum\n", - "\n", - "The East Asia Summit and Asian Economic Forum in Beijing highlight Sino-Japanese cooperation in trade, technology, and sustainable development. Leaders like President Lin Wei and Prime Minister Hiro Tanaka discuss collaboration to enhance regional stability and prosperity [source: news_articles_texts.csv_382 (1)].\n", - "\n", - "## Health and Wellness Initiatives\n", - "\n", - "### Healthcare Reform\n", - "\n", - "Healthcare reform is a central political agenda for figures like Senator Linda Ng, Senator Jane Smith, and Governor Emma Li. Their proposals focus on making healthcare more accessible and affordable, reflecting a broader trend within the Democratic Party [source: news_articles_texts.csv_62 (1), news_articles_texts.csv_88 (1), news_articles_texts.csv_463 (1)].\n", - "\n", - "### WHO Conferences\n", - "\n", - "The World Health Organization (WHO) hosts conferences in Geneva to address global health challenges, focusing on communicable diseases, AI in healthcare, and socio-economic health factors. These events emphasize international collaboration for resilient health systems [source: news_articles_texts.csv_156 (1), news_articles_texts.csv_220 (1)].\n", - "\n", - "### Health and Wellness Expo in Chicago\n", - "\n", - "The Health and Wellness Expo in Chicago promotes modern lifestyle changes and their impact on well-being. Organized by the American Health Association, it includes workshops on nutrition, exercise, stress management, and mental health [source: news_articles_texts.csv_409 (1)].\n", - "\n", - "## Global Leadership and Climate Action\n", + "## International Relief Efforts\n", "\n", - "### Global Climate Action Forum\n", + "### Earthquake Relief in Bali\n", + "International relief efforts were mobilized in response to a devastating earthquake in Bali, with organizations like the Global Relief Network providing emergency aid and planning for long-term recovery [source: news_articles_texts.csv_121 (1)].\n", "\n", - "The Global Climate Action Forum in Berlin, organized by the Green Earth Initiative, focuses on climate change solutions. It emphasizes collaboration and innovation to combat climate change, influencing international agreements and fostering partnerships for sustainable progress [source: news_articles_texts.csv_214 (1)].\n", + "## Tennis Events\n", "\n", - "### Global Leadership Forum\n", + "### Wimbledon Championships\n", + "The Wimbledon Championships showcased both seasoned champions and rising stars, reaffirming its status as a premier sporting event [source: news_articles_texts.csv_279 (1)].\n", "\n", - "The Global Leadership Forum in London features political analyst James Carter, addressing emerging global trends such as technology in governance and sustainable development. The forum highlights the need for global collaboration to address these challenges [source: news_articles_texts.csv_325 (1)].\n", + "### Roger Federer's Return to Wimbledon\n", + "Roger Federer's return to Wimbledon was a significant highlight, inspiring fans and future generations of players [source: news_articles_texts.csv_138 (1)].\n", "\n", - "## Conclusion\n", + "### Serena Roy's Grand Slam Victory\n", + "Serena Roy clinched the Grand Slam title, adding another accolade to her career and inspiring new tennis enthusiasts [source: news_articles_texts.csv_460 (1)].\n", "\n", - "The events discussed in this report illustrate the diverse and interconnected nature of global challenges and innovations. From cultural exchanges and technological advancements to economic strategies and health initiatives, these events underscore the importance of collaboration and innovation in fostering sustainable progress and understanding across different sectors.\n" + "### Leo Martins at the City Tennis Open\n", + "Leo Martins' victory at the City Tennis Open demonstrated the competitive nature of the sport [source: news_articles_texts.csv_432 (1)].\n" ] } ], diff --git a/intelligence_toolkit/query_text_data/classes.py b/intelligence_toolkit/query_text_data/classes.py index c9054012..75055095 100644 --- a/intelligence_toolkit/query_text_data/classes.py +++ b/intelligence_toolkit/query_text_data/classes.py @@ -62,7 +62,7 @@ def __init__( relevance_test_batch_size: int, relevance_test_budget: int, irrelevant_community_restart: int, - analysis_update_interval: int + analysis_update_interval = 0: int ) -> None: """ Represents the configuration used to search for relevant text chunks. @@ -74,7 +74,7 @@ def __init__( relevance_test_batch_size (int): How many relevance tests to run in parallel at a time relevance_test_budget (int): How many relevance tests are permitted per query. Higher values may provide higher quality results at higher cost irrelevant_community_restart (int): When to restart testing communities in relevance order - analysis_update_interval (int): How many chunks to process before updating the commentary + analysis_update_interval (int): How many chunks to process before updating the analysis. Use 0 to skip analysis updates """ self.adjacent_test_steps = adjacent_test_steps self.community_relevance_tests = community_relevance_tests diff --git a/intelligence_toolkit/query_text_data/commentary.py b/intelligence_toolkit/query_text_data/commentary.py index be0bda87..59f84963 100644 --- a/intelligence_toolkit/query_text_data/commentary.py +++ b/intelligence_toolkit/query_text_data/commentary.py @@ -70,8 +70,9 @@ def format_structure(self): for theme_title, point_ids in self.structure["themes"].items(): output += f"- **{theme_title}**\n" for point_id in point_ids: - source_list = ", ".join([str(x) for x in self.structure["point_sources"][point_id]]) - output += f" - {self.structure['points'][point_id]} (sources: {source_list})\n" + if point_id in self.structure["point_sources"]: + source_list = ", ".join([str(x) for x in self.structure["point_sources"][point_id]]) + output += f" - {self.structure['points'][point_id]} (sources: {source_list})\n" return output def get_clustered_cids(self): diff --git a/intelligence_toolkit/query_text_data/prompts.py b/intelligence_toolkit/query_text_data/prompts.py index 9fc34d5b..68b5f4ba 100644 --- a/intelligence_toolkit/query_text_data/prompts.py +++ b/intelligence_toolkit/query_text_data/prompts.py @@ -165,6 +165,7 @@ - Points should be assigned to a single theme in a logical sequence that addresses the user query - Themes should contain at least two points if possible - Order themes in a logical sequence that addresses the user query +- Output themes need not be the same as input themes and should be regenerated as needed to maintain 3-7 themes overall --User query-- diff --git a/poetry.lock b/poetry.lock index c7f50c59..bae38f0d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -218,27 +218,6 @@ doc-rtd = ["autoapi (>=0.9.0)", "pydata-sphinx-theme (<=0.7.2)", "sphinx (>=4.2. test-tox = ["equinox", "mypy (>=0.800)", "numpy", "pandera", "pytest (>=4.0.0)", "sphinx", "typing-extensions (>=3.10.0.0)"] test-tox-coverage = ["coverage (>=5.5)"] -[[package]] -name = "beautifulsoup4" -version = "4.12.3" -description = "Screen-scraping library" -optional = false -python-versions = ">=3.6.0" -files = [ - {file = "beautifulsoup4-4.12.3-py3-none-any.whl", hash = "sha256:b80878c9f40111313e55da8ba20bdba06d8fa3969fc68304167741bbf9e082ed"}, - {file = "beautifulsoup4-4.12.3.tar.gz", hash = "sha256:74e3d1928edc070d21748185c46e3fb33490f22f52a3addee9aee0f4f7781051"}, -] - -[package.dependencies] -soupsieve = ">1.2" - -[package.extras] -cchardet = ["cchardet"] -chardet = ["chardet"] -charset-normalizer = ["charset-normalizer"] -html5lib = ["html5lib"] -lxml = ["lxml"] - [[package]] name = "blinker" version = "1.8.2" @@ -784,17 +763,6 @@ ssh = ["bcrypt (>=3.1.5)"] test = ["certifi", "cryptography-vectors (==43.0.3)", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] test-randomorder = ["pytest-randomly"] -[[package]] -name = "cssselect" -version = "1.2.0" -description = "cssselect parses CSS3 Selectors and translates them to XPath 1.0" -optional = false -python-versions = ">=3.7" -files = [ - {file = "cssselect-1.2.0-py2.py3-none-any.whl", hash = "sha256:da1885f0c10b60c03ed5eccbb6b68d6eff248d91976fcde348f395d54c9fd35e"}, - {file = "cssselect-1.2.0.tar.gz", hash = "sha256:666b19839cfaddb9ce9d36bfe4c969132c647b92fc9088c4e23f786b30f1b3dc"}, -] - [[package]] name = "cycler" version = "0.12.1" @@ -1113,35 +1081,6 @@ files = [ [package.extras] devel = ["colorama", "json-spec", "jsonschema", "pylint", "pytest", "pytest-benchmark", "pytest-cache", "validictory"] -[[package]] -name = "feedfinder2" -version = "0.0.4" -description = "Find the feed URLs for a website." -optional = false -python-versions = "*" -files = [ - {file = "feedfinder2-0.0.4.tar.gz", hash = "sha256:3701ee01a6c85f8b865a049c30ba0b4608858c803fe8e30d1d289fdbe89d0efe"}, -] - -[package.dependencies] -beautifulsoup4 = "*" -requests = "*" -six = "*" - -[[package]] -name = "feedparser" -version = "6.0.11" -description = "Universal feed parser, handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds" -optional = false -python-versions = ">=3.6" -files = [ - {file = "feedparser-6.0.11-py3-none-any.whl", hash = "sha256:0be7ee7b395572b19ebeb1d6aafb0028dee11169f1c934e0ed67d54992f4ad45"}, - {file = "feedparser-6.0.11.tar.gz", hash = "sha256:c9d0407b64c6f2a065d0ebb292c2b35c01050cc0dc33757461aaabdc4c4184d5"}, -] - -[package.dependencies] -sgmllib3k = "*" - [[package]] name = "filelock" version = "3.16.1" @@ -1684,16 +1623,6 @@ files = [ test = ["async-timeout", "pytest", "pytest-asyncio (>=0.17)", "pytest-trio", "testpath", "trio"] trio = ["async_generator", "trio"] -[[package]] -name = "jieba3k" -version = "0.35.1" -description = "Chinese Words Segementation Utilities" -optional = false -python-versions = "*" -files = [ - {file = "jieba3k-0.35.1.zip", hash = "sha256:980a4f2636b778d312518066be90c7697d410dd5a472385f5afced71a2db1c10"}, -] - [[package]] name = "jinja2" version = "3.1.4" @@ -2093,160 +2022,6 @@ files = [ {file = "llvmlite-0.43.0.tar.gz", hash = "sha256:ae2b5b5c3ef67354824fb75517c8db5fbe93bc02cd9671f3c62271626bc041d5"}, ] -[[package]] -name = "lxml" -version = "5.3.0" -description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API." -optional = false -python-versions = ">=3.6" -files = [ - {file = "lxml-5.3.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:dd36439be765e2dde7660212b5275641edbc813e7b24668831a5c8ac91180656"}, - {file = "lxml-5.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ae5fe5c4b525aa82b8076c1a59d642c17b6e8739ecf852522c6321852178119d"}, - {file = "lxml-5.3.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:501d0d7e26b4d261fca8132854d845e4988097611ba2531408ec91cf3fd9d20a"}, - {file = "lxml-5.3.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb66442c2546446944437df74379e9cf9e9db353e61301d1a0e26482f43f0dd8"}, - {file = "lxml-5.3.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9e41506fec7a7f9405b14aa2d5c8abbb4dbbd09d88f9496958b6d00cb4d45330"}, - {file = "lxml-5.3.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f7d4a670107d75dfe5ad080bed6c341d18c4442f9378c9f58e5851e86eb79965"}, - {file = "lxml-5.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:41ce1f1e2c7755abfc7e759dc34d7d05fd221723ff822947132dc934d122fe22"}, - {file = "lxml-5.3.0-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:44264ecae91b30e5633013fb66f6ddd05c006d3e0e884f75ce0b4755b3e3847b"}, - {file = "lxml-5.3.0-cp310-cp310-manylinux_2_28_ppc64le.whl", hash = "sha256:3c174dc350d3ec52deb77f2faf05c439331d6ed5e702fc247ccb4e6b62d884b7"}, - {file = "lxml-5.3.0-cp310-cp310-manylinux_2_28_s390x.whl", hash = "sha256:2dfab5fa6a28a0b60a20638dc48e6343c02ea9933e3279ccb132f555a62323d8"}, - {file = "lxml-5.3.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:b1c8c20847b9f34e98080da785bb2336ea982e7f913eed5809e5a3c872900f32"}, - {file = "lxml-5.3.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:2c86bf781b12ba417f64f3422cfc302523ac9cd1d8ae8c0f92a1c66e56ef2e86"}, - {file = "lxml-5.3.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:c162b216070f280fa7da844531169be0baf9ccb17263cf5a8bf876fcd3117fa5"}, - {file = "lxml-5.3.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:36aef61a1678cb778097b4a6eeae96a69875d51d1e8f4d4b491ab3cfb54b5a03"}, - {file = "lxml-5.3.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:f65e5120863c2b266dbcc927b306c5b78e502c71edf3295dfcb9501ec96e5fc7"}, - {file = "lxml-5.3.0-cp310-cp310-win32.whl", hash = "sha256:ef0c1fe22171dd7c7c27147f2e9c3e86f8bdf473fed75f16b0c2e84a5030ce80"}, - {file = "lxml-5.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:052d99051e77a4f3e8482c65014cf6372e61b0a6f4fe9edb98503bb5364cfee3"}, - {file = "lxml-5.3.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:74bcb423462233bc5d6066e4e98b0264e7c1bed7541fff2f4e34fe6b21563c8b"}, - {file = "lxml-5.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a3d819eb6f9b8677f57f9664265d0a10dd6551d227afb4af2b9cd7bdc2ccbf18"}, - {file = "lxml-5.3.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5b8f5db71b28b8c404956ddf79575ea77aa8b1538e8b2ef9ec877945b3f46442"}, - {file = "lxml-5.3.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2c3406b63232fc7e9b8783ab0b765d7c59e7c59ff96759d8ef9632fca27c7ee4"}, - {file = "lxml-5.3.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2ecdd78ab768f844c7a1d4a03595038c166b609f6395e25af9b0f3f26ae1230f"}, - {file = "lxml-5.3.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:168f2dfcfdedf611eb285efac1516c8454c8c99caf271dccda8943576b67552e"}, - {file = "lxml-5.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa617107a410245b8660028a7483b68e7914304a6d4882b5ff3d2d3eb5948d8c"}, - {file = "lxml-5.3.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:69959bd3167b993e6e710b99051265654133a98f20cec1d9b493b931942e9c16"}, - {file = "lxml-5.3.0-cp311-cp311-manylinux_2_28_ppc64le.whl", hash = "sha256:bd96517ef76c8654446fc3db9242d019a1bb5fe8b751ba414765d59f99210b79"}, - {file = "lxml-5.3.0-cp311-cp311-manylinux_2_28_s390x.whl", hash = "sha256:ab6dd83b970dc97c2d10bc71aa925b84788c7c05de30241b9e96f9b6d9ea3080"}, - {file = "lxml-5.3.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:eec1bb8cdbba2925bedc887bc0609a80e599c75b12d87ae42ac23fd199445654"}, - {file = "lxml-5.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:6a7095eeec6f89111d03dabfe5883a1fd54da319c94e0fb104ee8f23616b572d"}, - {file = "lxml-5.3.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:6f651ebd0b21ec65dfca93aa629610a0dbc13dbc13554f19b0113da2e61a4763"}, - {file = "lxml-5.3.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:f422a209d2455c56849442ae42f25dbaaba1c6c3f501d58761c619c7836642ec"}, - {file = "lxml-5.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:62f7fdb0d1ed2065451f086519865b4c90aa19aed51081979ecd05a21eb4d1be"}, - {file = "lxml-5.3.0-cp311-cp311-win32.whl", hash = "sha256:c6379f35350b655fd817cd0d6cbeef7f265f3ae5fedb1caae2eb442bbeae9ab9"}, - {file = "lxml-5.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:9c52100e2c2dbb0649b90467935c4b0de5528833c76a35ea1a2691ec9f1ee7a1"}, - {file = "lxml-5.3.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:e99f5507401436fdcc85036a2e7dc2e28d962550afe1cbfc07c40e454256a859"}, - {file = "lxml-5.3.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:384aacddf2e5813a36495233b64cb96b1949da72bef933918ba5c84e06af8f0e"}, - {file = "lxml-5.3.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:874a216bf6afaf97c263b56371434e47e2c652d215788396f60477540298218f"}, - {file = "lxml-5.3.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:65ab5685d56914b9a2a34d67dd5488b83213d680b0c5d10b47f81da5a16b0b0e"}, - {file = "lxml-5.3.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aac0bbd3e8dd2d9c45ceb82249e8bdd3ac99131a32b4d35c8af3cc9db1657179"}, - {file = "lxml-5.3.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b369d3db3c22ed14c75ccd5af429086f166a19627e84a8fdade3f8f31426e52a"}, - {file = "lxml-5.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c24037349665434f375645fa9d1f5304800cec574d0310f618490c871fd902b3"}, - {file = "lxml-5.3.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:62d172f358f33a26d6b41b28c170c63886742f5b6772a42b59b4f0fa10526cb1"}, - {file = "lxml-5.3.0-cp312-cp312-manylinux_2_28_ppc64le.whl", hash = "sha256:c1f794c02903c2824fccce5b20c339a1a14b114e83b306ff11b597c5f71a1c8d"}, - {file = "lxml-5.3.0-cp312-cp312-manylinux_2_28_s390x.whl", hash = "sha256:5d6a6972b93c426ace71e0be9a6f4b2cfae9b1baed2eed2006076a746692288c"}, - {file = "lxml-5.3.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:3879cc6ce938ff4eb4900d901ed63555c778731a96365e53fadb36437a131a99"}, - {file = "lxml-5.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:74068c601baff6ff021c70f0935b0c7bc528baa8ea210c202e03757c68c5a4ff"}, - {file = "lxml-5.3.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:ecd4ad8453ac17bc7ba3868371bffb46f628161ad0eefbd0a855d2c8c32dd81a"}, - {file = "lxml-5.3.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:7e2f58095acc211eb9d8b5771bf04df9ff37d6b87618d1cbf85f92399c98dae8"}, - {file = "lxml-5.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e63601ad5cd8f860aa99d109889b5ac34de571c7ee902d6812d5d9ddcc77fa7d"}, - {file = "lxml-5.3.0-cp312-cp312-win32.whl", hash = "sha256:17e8d968d04a37c50ad9c456a286b525d78c4a1c15dd53aa46c1d8e06bf6fa30"}, - {file = "lxml-5.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:c1a69e58a6bb2de65902051d57fde951febad631a20a64572677a1052690482f"}, - {file = "lxml-5.3.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8c72e9563347c7395910de6a3100a4840a75a6f60e05af5e58566868d5eb2d6a"}, - {file = "lxml-5.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e92ce66cd919d18d14b3856906a61d3f6b6a8500e0794142338da644260595cd"}, - {file = "lxml-5.3.0-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1d04f064bebdfef9240478f7a779e8c5dc32b8b7b0b2fc6a62e39b928d428e51"}, - {file = "lxml-5.3.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c2fb570d7823c2bbaf8b419ba6e5662137f8166e364a8b2b91051a1fb40ab8b"}, - {file = "lxml-5.3.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0c120f43553ec759f8de1fee2f4794452b0946773299d44c36bfe18e83caf002"}, - {file = "lxml-5.3.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:562e7494778a69086f0312ec9689f6b6ac1c6b65670ed7d0267e49f57ffa08c4"}, - {file = "lxml-5.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:423b121f7e6fa514ba0c7918e56955a1d4470ed35faa03e3d9f0e3baa4c7e492"}, - {file = "lxml-5.3.0-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:c00f323cc00576df6165cc9d21a4c21285fa6b9989c5c39830c3903dc4303ef3"}, - {file = "lxml-5.3.0-cp313-cp313-manylinux_2_28_ppc64le.whl", hash = "sha256:1fdc9fae8dd4c763e8a31e7630afef517eab9f5d5d31a278df087f307bf601f4"}, - {file = "lxml-5.3.0-cp313-cp313-manylinux_2_28_s390x.whl", hash = "sha256:658f2aa69d31e09699705949b5fc4719cbecbd4a97f9656a232e7d6c7be1a367"}, - {file = "lxml-5.3.0-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:1473427aff3d66a3fa2199004c3e601e6c4500ab86696edffdbc84954c72d832"}, - {file = "lxml-5.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a87de7dd873bf9a792bf1e58b1c3887b9264036629a5bf2d2e6579fe8e73edff"}, - {file = "lxml-5.3.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:0d7b36afa46c97875303a94e8f3ad932bf78bace9e18e603f2085b652422edcd"}, - {file = "lxml-5.3.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:cf120cce539453ae086eacc0130a324e7026113510efa83ab42ef3fcfccac7fb"}, - {file = "lxml-5.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:df5c7333167b9674aa8ae1d4008fa4bc17a313cc490b2cca27838bbdcc6bb15b"}, - {file = "lxml-5.3.0-cp313-cp313-win32.whl", hash = "sha256:c802e1c2ed9f0c06a65bc4ed0189d000ada8049312cfeab6ca635e39c9608957"}, - {file = "lxml-5.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:406246b96d552e0503e17a1006fd27edac678b3fcc9f1be71a2f94b4ff61528d"}, - {file = "lxml-5.3.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:8f0de2d390af441fe8b2c12626d103540b5d850d585b18fcada58d972b74a74e"}, - {file = "lxml-5.3.0-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1afe0a8c353746e610bd9031a630a95bcfb1a720684c3f2b36c4710a0a96528f"}, - {file = "lxml-5.3.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:56b9861a71575f5795bde89256e7467ece3d339c9b43141dbdd54544566b3b94"}, - {file = "lxml-5.3.0-cp36-cp36m-manylinux_2_28_x86_64.whl", hash = "sha256:9fb81d2824dff4f2e297a276297e9031f46d2682cafc484f49de182aa5e5df99"}, - {file = "lxml-5.3.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:2c226a06ecb8cdef28845ae976da407917542c5e6e75dcac7cc33eb04aaeb237"}, - {file = "lxml-5.3.0-cp36-cp36m-musllinux_1_2_x86_64.whl", hash = "sha256:7d3d1ca42870cdb6d0d29939630dbe48fa511c203724820fc0fd507b2fb46577"}, - {file = "lxml-5.3.0-cp36-cp36m-win32.whl", hash = "sha256:094cb601ba9f55296774c2d57ad68730daa0b13dc260e1f941b4d13678239e70"}, - {file = "lxml-5.3.0-cp36-cp36m-win_amd64.whl", hash = "sha256:eafa2c8658f4e560b098fe9fc54539f86528651f61849b22111a9b107d18910c"}, - {file = "lxml-5.3.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:cb83f8a875b3d9b458cada4f880fa498646874ba4011dc974e071a0a84a1b033"}, - {file = "lxml-5.3.0-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:25f1b69d41656b05885aa185f5fdf822cb01a586d1b32739633679699f220391"}, - {file = "lxml-5.3.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:23e0553b8055600b3bf4a00b255ec5c92e1e4aebf8c2c09334f8368e8bd174d6"}, - {file = "lxml-5.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9ada35dd21dc6c039259596b358caab6b13f4db4d4a7f8665764d616daf9cc1d"}, - {file = "lxml-5.3.0-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:81b4e48da4c69313192d8c8d4311e5d818b8be1afe68ee20f6385d0e96fc9512"}, - {file = "lxml-5.3.0-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:2bc9fd5ca4729af796f9f59cd8ff160fe06a474da40aca03fcc79655ddee1a8b"}, - {file = "lxml-5.3.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:07da23d7ee08577760f0a71d67a861019103e4812c87e2fab26b039054594cc5"}, - {file = "lxml-5.3.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:ea2e2f6f801696ad7de8aec061044d6c8c0dd4037608c7cab38a9a4d316bfb11"}, - {file = "lxml-5.3.0-cp37-cp37m-win32.whl", hash = "sha256:5c54afdcbb0182d06836cc3d1be921e540be3ebdf8b8a51ee3ef987537455f84"}, - {file = "lxml-5.3.0-cp37-cp37m-win_amd64.whl", hash = "sha256:f2901429da1e645ce548bf9171784c0f74f0718c3f6150ce166be39e4dd66c3e"}, - {file = "lxml-5.3.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c56a1d43b2f9ee4786e4658c7903f05da35b923fb53c11025712562d5cc02753"}, - {file = "lxml-5.3.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ee8c39582d2652dcd516d1b879451500f8db3fe3607ce45d7c5957ab2596040"}, - {file = "lxml-5.3.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fdf3a3059611f7585a78ee10399a15566356116a4288380921a4b598d807a22"}, - {file = "lxml-5.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:146173654d79eb1fc97498b4280c1d3e1e5d58c398fa530905c9ea50ea849b22"}, - {file = "lxml-5.3.0-cp38-cp38-manylinux_2_28_aarch64.whl", hash = "sha256:0a7056921edbdd7560746f4221dca89bb7a3fe457d3d74267995253f46343f15"}, - {file = "lxml-5.3.0-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:9e4b47ac0f5e749cfc618efdf4726269441014ae1d5583e047b452a32e221920"}, - {file = "lxml-5.3.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:f914c03e6a31deb632e2daa881fe198461f4d06e57ac3d0e05bbcab8eae01945"}, - {file = "lxml-5.3.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:213261f168c5e1d9b7535a67e68b1f59f92398dd17a56d934550837143f79c42"}, - {file = "lxml-5.3.0-cp38-cp38-win32.whl", hash = "sha256:218c1b2e17a710e363855594230f44060e2025b05c80d1f0661258142b2add2e"}, - {file = "lxml-5.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:315f9542011b2c4e1d280e4a20ddcca1761993dda3afc7a73b01235f8641e903"}, - {file = "lxml-5.3.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:1ffc23010330c2ab67fac02781df60998ca8fe759e8efde6f8b756a20599c5de"}, - {file = "lxml-5.3.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:2b3778cb38212f52fac9fe913017deea2fdf4eb1a4f8e4cfc6b009a13a6d3fcc"}, - {file = "lxml-5.3.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4b0c7a688944891086ba192e21c5229dea54382f4836a209ff8d0a660fac06be"}, - {file = "lxml-5.3.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:747a3d3e98e24597981ca0be0fd922aebd471fa99d0043a3842d00cdcad7ad6a"}, - {file = "lxml-5.3.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86a6b24b19eaebc448dc56b87c4865527855145d851f9fc3891673ff97950540"}, - {file = "lxml-5.3.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b11a5d918a6216e521c715b02749240fb07ae5a1fefd4b7bf12f833bc8b4fe70"}, - {file = "lxml-5.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:68b87753c784d6acb8a25b05cb526c3406913c9d988d51f80adecc2b0775d6aa"}, - {file = "lxml-5.3.0-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:109fa6fede314cc50eed29e6e56c540075e63d922455346f11e4d7a036d2b8cf"}, - {file = "lxml-5.3.0-cp39-cp39-manylinux_2_28_ppc64le.whl", hash = "sha256:02ced472497b8362c8e902ade23e3300479f4f43e45f4105c85ef43b8db85229"}, - {file = "lxml-5.3.0-cp39-cp39-manylinux_2_28_s390x.whl", hash = "sha256:6b038cc86b285e4f9fea2ba5ee76e89f21ed1ea898e287dc277a25884f3a7dfe"}, - {file = "lxml-5.3.0-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:7437237c6a66b7ca341e868cda48be24b8701862757426852c9b3186de1da8a2"}, - {file = "lxml-5.3.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:7f41026c1d64043a36fda21d64c5026762d53a77043e73e94b71f0521939cc71"}, - {file = "lxml-5.3.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:482c2f67761868f0108b1743098640fbb2a28a8e15bf3f47ada9fa59d9fe08c3"}, - {file = "lxml-5.3.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:1483fd3358963cc5c1c9b122c80606a3a79ee0875bcac0204149fa09d6ff2727"}, - {file = "lxml-5.3.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:2dec2d1130a9cda5b904696cec33b2cfb451304ba9081eeda7f90f724097300a"}, - {file = "lxml-5.3.0-cp39-cp39-win32.whl", hash = "sha256:a0eabd0a81625049c5df745209dc7fcef6e2aea7793e5f003ba363610aa0a3ff"}, - {file = "lxml-5.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:89e043f1d9d341c52bf2af6d02e6adde62e0a46e6755d5eb60dc6e4f0b8aeca2"}, - {file = "lxml-5.3.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:7b1cd427cb0d5f7393c31b7496419da594fe600e6fdc4b105a54f82405e6626c"}, - {file = "lxml-5.3.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:51806cfe0279e06ed8500ce19479d757db42a30fd509940b1701be9c86a5ff9a"}, - {file = "lxml-5.3.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ee70d08fd60c9565ba8190f41a46a54096afa0eeb8f76bd66f2c25d3b1b83005"}, - {file = "lxml-5.3.0-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:8dc2c0395bea8254d8daebc76dcf8eb3a95ec2a46fa6fae5eaccee366bfe02ce"}, - {file = "lxml-5.3.0-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:6ba0d3dcac281aad8a0e5b14c7ed6f9fa89c8612b47939fc94f80b16e2e9bc83"}, - {file = "lxml-5.3.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:6e91cf736959057f7aac7adfc83481e03615a8e8dd5758aa1d95ea69e8931dba"}, - {file = "lxml-5.3.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:94d6c3782907b5e40e21cadf94b13b0842ac421192f26b84c45f13f3c9d5dc27"}, - {file = "lxml-5.3.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c300306673aa0f3ed5ed9372b21867690a17dba38c68c44b287437c362ce486b"}, - {file = "lxml-5.3.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:78d9b952e07aed35fe2e1a7ad26e929595412db48535921c5013edc8aa4a35ce"}, - {file = "lxml-5.3.0-pp37-pypy37_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:01220dca0d066d1349bd6a1726856a78f7929f3878f7e2ee83c296c69495309e"}, - {file = "lxml-5.3.0-pp37-pypy37_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:2d9b8d9177afaef80c53c0a9e30fa252ff3036fb1c6494d427c066a4ce6a282f"}, - {file = "lxml-5.3.0-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:20094fc3f21ea0a8669dc4c61ed7fa8263bd37d97d93b90f28fc613371e7a875"}, - {file = "lxml-5.3.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:ace2c2326a319a0bb8a8b0e5b570c764962e95818de9f259ce814ee666603f19"}, - {file = "lxml-5.3.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:92e67a0be1639c251d21e35fe74df6bcc40cba445c2cda7c4a967656733249e2"}, - {file = "lxml-5.3.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd5350b55f9fecddc51385463a4f67a5da829bc741e38cf689f38ec9023f54ab"}, - {file = "lxml-5.3.0-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:4c1fefd7e3d00921c44dc9ca80a775af49698bbfd92ea84498e56acffd4c5469"}, - {file = "lxml-5.3.0-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:71a8dd38fbd2f2319136d4ae855a7078c69c9a38ae06e0c17c73fd70fc6caad8"}, - {file = "lxml-5.3.0-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:97acf1e1fd66ab53dacd2c35b319d7e548380c2e9e8c54525c6e76d21b1ae3b1"}, - {file = "lxml-5.3.0-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:68934b242c51eb02907c5b81d138cb977b2129a0a75a8f8b60b01cb8586c7b21"}, - {file = "lxml-5.3.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b710bc2b8292966b23a6a0121f7a6c51d45d2347edcc75f016ac123b8054d3f2"}, - {file = "lxml-5.3.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:18feb4b93302091b1541221196a2155aa296c363fd233814fa11e181adebc52f"}, - {file = "lxml-5.3.0-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:3eb44520c4724c2e1a57c0af33a379eee41792595023f367ba3952a2d96c2aab"}, - {file = "lxml-5.3.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:609251a0ca4770e5a8768ff902aa02bf636339c5a93f9349b48eb1f606f7f3e9"}, - {file = "lxml-5.3.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:516f491c834eb320d6c843156440fe7fc0d50b33e44387fcec5b02f0bc118a4c"}, - {file = "lxml-5.3.0.tar.gz", hash = "sha256:4e109ca30d1edec1ac60cdbe341905dc3b8f55b16855e03a54aaf59e51ec8c6f"}, -] - -[package.extras] -cssselect = ["cssselect (>=0.7)"] -html-clean = ["lxml-html-clean"] -html5 = ["html5lib"] -htmlsoup = ["BeautifulSoup4"] -source = ["Cython (>=3.0.11)"] - [[package]] name = "markdown-it-py" version = "3.0.0" @@ -2682,32 +2457,6 @@ doc = ["myst-nb (>=1.0)", "numpydoc (>=1.7)", "pillow (>=9.4)", "pydata-sphinx-t extra = ["lxml (>=4.6)", "pydot (>=2.0)", "pygraphviz (>=1.12)", "sympy (>=1.10)"] test = ["pytest (>=7.2)", "pytest-cov (>=4.0)"] -[[package]] -name = "newspaper3k" -version = "0.2.8" -description = "Simplified python article discovery & extraction." -optional = false -python-versions = "*" -files = [ - {file = "newspaper3k-0.2.8-py3-none-any.whl", hash = "sha256:44a864222633d3081113d1030615991c3dbba87239f6bbf59d91240f71a22e3e"}, - {file = "newspaper3k-0.2.8.tar.gz", hash = "sha256:9f1bd3e1fb48f400c715abf875cc7b0a67b7ddcd87f50c9aeeb8fcbbbd9004fb"}, -] - -[package.dependencies] -beautifulsoup4 = ">=4.4.1" -cssselect = ">=0.9.2" -feedfinder2 = ">=0.0.4" -feedparser = ">=5.2.1" -jieba3k = ">=0.35.1" -lxml = ">=3.6.0" -nltk = ">=3.2.1" -Pillow = ">=3.3.0" -python-dateutil = ">=2.5.3" -PyYAML = ">=3.11" -requests = ">=2.10.0" -tinysegmenter = "0.3" -tldextract = ">=2.0.1" - [[package]] name = "nh3" version = "0.2.18" @@ -4708,20 +4457,6 @@ urllib3 = ">=1.21.1,<3" socks = ["PySocks (>=1.5.6,!=1.5.7)"] use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] -[[package]] -name = "requests-file" -version = "2.1.0" -description = "File transport adapter for Requests" -optional = false -python-versions = "*" -files = [ - {file = "requests_file-2.1.0-py2.py3-none-any.whl", hash = "sha256:cf270de5a4c5874e84599fc5778303d496c10ae5e870bfa378818f35d21bda5c"}, - {file = "requests_file-2.1.0.tar.gz", hash = "sha256:0f549a3f3b0699415ac04d167e9cb39bccfb730cb832b4d20be3d9867356e658"}, -] - -[package.dependencies] -requests = ">=1.0.0" - [[package]] name = "requests-toolbelt" version = "1.0.0" @@ -5238,16 +4973,6 @@ enabler = ["pytest-enabler (>=2.2)"] test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test (>=5.5)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] type = ["importlib-metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (==1.12.*)", "pytest-mypy"] -[[package]] -name = "sgmllib3k" -version = "1.0.0" -description = "Py3k port of sgmllib." -optional = false -python-versions = "*" -files = [ - {file = "sgmllib3k-1.0.0.tar.gz", hash = "sha256:7868fb1c8bfa764c1ac563d3cf369c381d1325d36124933a726f29fcdaa812e9"}, -] - [[package]] name = "shellingham" version = "1.5.4" @@ -5317,17 +5042,6 @@ files = [ {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, ] -[[package]] -name = "soupsieve" -version = "2.6" -description = "A modern CSS selector implementation for Beautiful Soup." -optional = false -python-versions = ">=3.8" -files = [ - {file = "soupsieve-2.6-py3-none-any.whl", hash = "sha256:e72c4ff06e4fb6e4b5a9f0f55fe6e81514581fca1515028625d0f299c602ccc9"}, - {file = "soupsieve-2.6.tar.gz", hash = "sha256:e2e68417777af359ec65daac1057404a3c8a5455bb8abc36f1a9866ab1a51abb"}, -] - [[package]] name = "stack-data" version = "0.6.3" @@ -5597,37 +5311,6 @@ requests = ">=2.26.0" [package.extras] blobfile = ["blobfile (>=2)"] -[[package]] -name = "tinysegmenter" -version = "0.3" -description = "Very compact Japanese tokenizer" -optional = false -python-versions = "*" -files = [ - {file = "tinysegmenter-0.3.tar.gz", hash = "sha256:ed1f6d2e806a4758a73be589754384cbadadc7e1a414c81a166fc9adf2d40c6d"}, -] - -[[package]] -name = "tldextract" -version = "5.1.2" -description = "Accurately separates a URL's subdomain, domain, and public suffix, using the Public Suffix List (PSL). By default, this includes the public ICANN TLDs and their exceptions. You can optionally support the Public Suffix List's private domains as well." -optional = false -python-versions = ">=3.8" -files = [ - {file = "tldextract-5.1.2-py3-none-any.whl", hash = "sha256:4dfc4c277b6b97fa053899fcdb892d2dc27295851ab5fac4e07797b6a21b2e46"}, - {file = "tldextract-5.1.2.tar.gz", hash = "sha256:c9e17f756f05afb5abac04fe8f766e7e70f9fe387adb1859f0f52408ee060200"}, -] - -[package.dependencies] -filelock = ">=3.0.8" -idna = "*" -requests = ">=2.1.0" -requests-file = ">=1.4" - -[package.extras] -release = ["build", "twine"] -testing = ["black", "mypy", "pytest", "pytest-gitignore", "pytest-mock", "responses", "ruff", "syrupy", "tox", "types-filelock", "types-requests"] - [[package]] name = "tokenizers" version = "0.20.1" @@ -6411,4 +6094,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = ">=3.11,<3.13" -content-hash = "1eb5b39560132dcef73fb576f03d36b84b6da6536260d87f4dfb2cf100cd608f" +content-hash = "f175e6c904180dd55827f9ac72ac41e72dfa7f2c027cd79cbed67d494a143d93" diff --git a/pyproject.toml b/pyproject.toml index d91e4a8f..7f28f2c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,6 @@ graspologic = "^3.4.1" future = "^1.0.0" [tool.poetry.group.dev.dependencies] -newspaper3k = "^0.2.8" coverage = "^7.6.0" ruff = "^0.4.7" pyright = "^1.1.371" From 3090a9a9a88dac33f7d8006a929a4a971aad790d Mon Sep 17 00:00:00 2001 From: Darren Edge Date: Wed, 15 Jan 2025 16:18:03 +0000 Subject: [PATCH 10/11] Updated readme --- app/workflows/query_text_data/README.md | 30 ++++++++++++------- .../query_text_data/classes.py | 2 +- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/app/workflows/query_text_data/README.md b/app/workflows/query_text_data/README.md index 21d1bf93..815e126c 100644 --- a/app/workflows/query_text_data/README.md +++ b/app/workflows/query_text_data/README.md @@ -37,7 +37,7 @@ This file contains one news article per row, stored in the single column `mock_t Press `Process files` to prepare the data for analysis. After successfully processing the data, you will see a status message like the following: -`Chunked 500 files into 501 chunks of up to 500 tokens. Extracted concept graph with XXX concepts and XXX cooccurrences.` +`Chunked XXX files into XXX chunks of up to XXX tokens. Extracted concept graph with XXX concepts and XXX cooccurrences.` ### Query method @@ -61,23 +61,33 @@ Select a topic to view the graph of associated concepts. In the graph, concept n Select a concept node in the graph to view a list of matching text chunks on the right-hand side. -### Generating AI extended answers +### Generating AI research reports -Navigate to the `Generate AI extended answer` tab to query the data index (i.e., text embeddings plus concept graph) in a way that generates a long-form text answer. +Navigate to the `Generate AI research report` tab to query the data index (i.e., text embeddings plus concept graph) in a way that generates a long-form text answer. -Click on `Options` to expand the available controls, which are as follows: +Clicking on `Advanced Options` expands the available controls, which are as follows. These do not need adjusting for standard use. +- **Search options** + - `Tests/topic/round`. How many relevant tests to perform for each topic in each round. Larger values reduce the likelihood of prematurely discarding topics whose relevant chunks may not be at the top of the similarity-based ranking, but may result in smaller values of `Relevance test budget` being spread across fewer topics and thus not capturing the full breadth of the data. + - `Restart on irrelevant topics`. When this number of topics in a row fail to return any relevant chunks in their `Tests/topic/round`, return to the start of the topic ranking and continue testing `Tests/topic/round` text chunks from each topic with (a) relevance in the previous round and (b) previously untested text chunks. Higher values can avoid prematurely discarding topics that are relevant but whose relevant chunks are not at the top of the similarity-based ranking, but may result in a larger number of irrelevant topics being tested multiple times. + - `Test relevant neighbours`. If a text chunk is relevant to the query, then adjacent text chunks in the original document may be able to add additional context to the relevant points. The value of this parameter determines how many chunks before and after each relevant text chunk will be evaluated at the end of the process (or `Relevance test budget`) if they are yet to be tested. +- **Answer options** + - `Target chunks per cluster`. The average number of text chunks to target per cluster, which determines the text chunks that will be evaluated together and in parallel to other clusters. Larger values will generally result in more related text chunks being evaluated in parallel, but may also result in information loss from unprocessed content. + - `Show search process`. Show the search process in the UI, including the progress of chunk relevance tests and the search for relevant chunks. + - `Live analysis`. Enable live analysis of the text chunks as they are processed. This provides immediate feedback but slows down the overall process. + - `Analysis update interval`. The number of text chunks to process before updating the live analysis. Larger values will give faster final reports but also result in longer periods of time between updates. + - `Live commentary`. Enable live commentary of analysis themes after text chunks are processed. This provides a preview of report content while the final report is being generated. + +The `Query` and the `Relevance test budget` are required in all cases: + +- `Query`. The query or task that the user would like the AI to perform with respect to the data. - `Relevance test budget`. The query method works by asking an LLM to evaluate the relevance of potentially-relevant text chunks, returning a single token, yes/no judgement. This parameter allows the user to cap the number of relvance tests that may be performed prior to generating an answer using all relevant chunks. Larger budgets will generally give better answers for a greater cost. -- `Tests/topic/round`. How many relevant tests to perform for each topic in each round. Larger values reduce the likelihood of prematurely discarding topics whose relevant chunks may not be at the top of the similarity-based ranking, but may result in smaller values of `Relevance test budget` being spread across fewer topics and thus not capturing the full breadth of the data. -- `Restart on irrelevant topics`. When this number of topics in a row fail to return any relevant chunks in their `Tests/topic/round`, return to the start of the topic ranking and continue testing `Tests/topic/round` text chunks from each topic with (a) relevance in the previous round and (b) previously untested text chunks. Higher values can avoid prematurely discarding topics that are relevant but whose relevant chunks are not at the top of the similarity-based ranking, but may result in a larger number of irrelevant topics being tested multiple times. -- `Test relevant neighbours`. If a text chunk is relevant to the query, then adjacent text chunks in the original document may be able to add additional context to the relevant points. The value of this parameter determines how many chunks before and after each relevant text chunk will be evaluated at the end of the process (or `Relevance test budget`) if they are yet to be tested. -- `Relevant chunks/answer update`. Determines how many relevant chunks at a time are incorporated into the extended answer in progress. Higher values may require fewer updates, but may miss more details from the chunks provided. -Enter a query in the `Query` field and press `Search` to begin the process of searching for relevant text chunks. +Enter a query in the `Query` field, set a `Relevance test budget`, then press `Search` to begin the process of searching for relevant text chunks. For example, try `What are the main political events discussed?`. -The system will first identify relevant chunks before using batches of relevant chunks to update an extended answer in progress. Once this process has completed, a download button will appear after the contents of the extended report text. +The system will first identify relevant chunks before using batches of relevant chunks to update a research report in progress. Once this process has completed, a download button will appear after the contents of the extended report text. ### Generating AI answer reports diff --git a/intelligence_toolkit/query_text_data/classes.py b/intelligence_toolkit/query_text_data/classes.py index 75055095..28fa41d0 100644 --- a/intelligence_toolkit/query_text_data/classes.py +++ b/intelligence_toolkit/query_text_data/classes.py @@ -62,7 +62,7 @@ def __init__( relevance_test_batch_size: int, relevance_test_budget: int, irrelevant_community_restart: int, - analysis_update_interval = 0: int + analysis_update_interval: int = 0 ) -> None: """ Represents the configuration used to search for relevant text chunks. From 4634cc2b8bc318877663691e1f2244b8b574e3f2 Mon Sep 17 00:00:00 2001 From: Dayenne Souza Date: Thu, 16 Jan 2025 17:39:05 -0300 Subject: [PATCH 11/11] update poetry lock --- poetry.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poetry.lock b/poetry.lock index 0d73f84a..fc1e334e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -6055,4 +6055,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = ">=3.11,<3.13" -content-hash = "1cd07fa1aa9ddb5e56934ef2aac824fd7552aa99631f7e8ca49f7717679be200" +content-hash = "221ebd4036dc5fa366263552a86f900e5d441e30e1994dda05f4fdf0c3fc8471"