From 56f6637e9d9052c4bc7724d2713573ac67141631 Mon Sep 17 00:00:00 2001 From: "A.J. Shulman" Date: Mon, 22 Jul 2024 13:20:36 -0400 Subject: works decently well --- src/client/views/nodes/ChatBox/tools/RAGTool.ts | 52 +++++++++---------------- 1 file changed, 18 insertions(+), 34 deletions(-) (limited to 'src/client/views/nodes/ChatBox/tools') diff --git a/src/client/views/nodes/ChatBox/tools/RAGTool.ts b/src/client/views/nodes/ChatBox/tools/RAGTool.ts index 4b29d6bce..c7175326c 100644 --- a/src/client/views/nodes/ChatBox/tools/RAGTool.ts +++ b/src/client/views/nodes/ChatBox/tools/RAGTool.ts @@ -22,7 +22,7 @@ export class RAGTool extends BaseTool<{ hypothetical_document_chunk: string }> { 1. Overall Structure: - [Main content with nested grounded_text tags] + [Main content with grounded_text tags interspersed with normal plain text (information that is not derived from chunks' information)] [Individual citation tags] @@ -33,21 +33,8 @@ export class RAGTool extends BaseTool<{ hypothetical_document_chunk: string }> { 2. Grounded Text Tag Structure: - Basic format: - - [Your generated text based on chunk information] - - - - Nested format: - - [General information] - - [More specific information] - - - - - Multiple citation indices: - - [Information synthesized from multiple chunks] + + [Your generated text based on information from a subset of a chunk (a citation's direct text)] 3. Citation Tag Structure: @@ -58,12 +45,11 @@ export class RAGTool extends BaseTool<{ hypothetical_document_chunk: string }> { 4. Detailed Grounded Text Guidelines: a. Wrap all information derived from chunks in grounded_text tags. - b. Nest grounded_text tags when presenting hierarchical or increasingly specific information or when a larger section of generated text is best grounded by one subset of a chunk and smaller sections of that generated text are best grounded by other subsets of either the same or different chunk(s). - c. Use a single grounded_text tag for closely related information that references the same citation (subset of text from a chunk). - d. Combine multiple citation indices for synthesized information from multiple citations. - e. Ensure every grounded_text tag has at least one corresponding citation. - f. Grounded text can be as short as a few words or as long as several sentences. - d. Avoid overlapping grounded_text tags; instead, use nesting or sequential tags. + b. DO NOT PUT ANYTHING THAT IS NOT DIRECTLY DERIVED FROM INFORMATION FROM CHUNKS (EITHER IMAGE, TABLE, OR TEXT) IN GROUNDED_TEXT TAGS. + c. Use a single grounded_text tag for suquential and closely related information that references the same citation. If other citations' information are used sequentially, create new grounded_text tags. + d. Ensure every grounded_text tag has up to a few corresponding citations (should not be more than 3 and only 1 is fine). Multiple citation indices should be separated by commas. + e. Grounded text can be as short as a few words or as long as several sentences. + f. Avoid overlapping or nesting grounded_text tags; instead, use sequential tags. 5. Detailed Citation Guidelines: a. Create a unique citation for each distinct piece of information from the chunks that is used to support grounded_text. @@ -71,35 +57,33 @@ export class RAGTool extends BaseTool<{ hypothetical_document_chunk: string }> { c. Specify the correct type: "text", "image", or "table". d. For text chunks, include only the relevant subset of the original text that the grounded_text is based on. e. For image/table chunks, leave the citation content empty. - f. One citation can be used for multiple grounded_text tags if they are based on the same information. - g. One text chunk can have multiple citations if different parts of the text have different important information. - h. !!!DO NOT OVERCITE - only include citations for information that is directly relevant to the grounded_text. + f. One citation can be used for multiple grounded_text tags if they are based on the same chunk information. + g. !!!DO NOT OVERCITE - only include citations for information that is directly relevant to the grounded_text. 6. Structural Integrity Checks: a. Ensure all opening tags have corresponding closing tags. b. Verify that all grounded_text tags have valid citation_index attributes. c. Check that all cited indices in grounded_text tags have corresponding citations. - d. Confirm proper nesting - tags opened last should be closed first. Example of grounded_text usage: Artificial Intelligence (AI) is revolutionizing various sectors, with healthcare experiencing significant transformations in areas such as diagnosis and treatment planning. - - In the field of medical diagnosis, AI has shown remarkable capabilities, particularly in radiology. For instance, AI systems have drastically improved mammogram analysis, achieving 99% accuracy at a rate 30 times faster than human radiologists. - - This advancement not only enhances the efficiency of healthcare systems but also significantly reduces the occurrence of false positives, leading to fewer unnecessary biopsies and reduced patient stress. - - - + + In the field of medical diagnosis, AI has shown remarkable capabilities, particularly in radiology. For instance, AI systems have drastically improved mammogram analysis, achieving 99% accuracy at a rate 30 times faster than human radiologists. + + + This advancement not only enhances the efficiency of healthcare systems but also significantly reduces the occurrence of false positives, leading to fewer unnecessary biopsies and reduced patient stress. + + Beyond diagnosis, AI is playing a crucial role in drug discovery and development. By analyzing vast amounts of genetic and molecular data, AI algorithms can identify potential drug candidates much faster than traditional methods. + This could potentially reduce the time and cost of bringing new medications to market, especially for rare diseases that have historically received less attention due to limited market potential. - [... rest of the content ...] -- cgit v1.2.3-70-g09d2