A program, answering device, and method for searching documents and providing answers to a question.
The program and device enhance document search accuracy by capturing pages as images, recognizing text into chunks, and using metadata and embedding vectors to visually indicate relevant sections, addressing inefficiencies in existing technologies.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- DEFIDE CO LTD
- Filing Date
- 2025-03-26
- Publication Date
- 2026-04-27
AI Technical Summary
Existing document search technologies, such as keyword search, chatbots, and retrieval augmented generation, fail to accurately identify the source document for answers and are inefficient in handling large document collections, lacking precision and source document identification.
A program and device that captures document pages as images, recognizes text into chunks, stores metadata linking chunks to page coordinates, and uses chunk search to visually indicate relevant document sections, employing embedding vectors and semantic ranking for accurate document retrieval and response generation.
Enables precise document search and answer provision by visually highlighting relevant document sections, improving accuracy and user understanding of answer sources in large document collections.
Smart Images

Figure 0007851525000001_ABST
Abstract
Description
Technical Field
[0002] , , , , ,
[0005] ,
[0001] ,
[0004] , , , , , ,
[0003]
[0001] The present invention relates to a technique for searching for and answering documents with respect to a user's question sentence.
Background Art
[0002] Conventionally, as a method for searching for a specific document from a document storage, there is keyword search. A user inputs keywords such as words or phrases as a search query. In response to this, it is compared with the keywords described in the documents stored in the document storage, and a document with a high degree of coincidence is answered as a search result.
[0003] Also, there is a technique for detecting a location in a document where a topic desired by a user is described (see, for example, Patent Document 1). According to this technique, a table is extracted from a document, an attribute is given as an annotation to the character string of the table, the document is divided into a plurality of sections according to the appearance ratio of the annotation, and a document internal location having an annotation that meets the search condition is detected.
[0004] Also, as another conventional technique, there is a technique for an interactive device that converses with humans and nature. According to this technique, by natural language processing, a user's question sentence is understood, and an appropriate answer sentence or information is returned. For example, in the case of a chatbot, it is incorporated into a website or an application and is utilized for various purposes such as customer support and information provision in an organization. It can respond regardless of the time zone, contributing to cost reduction of services and improvement of customer satisfaction.
[0005] Furthermore, as another conventional technique, there is a technique for retrieval augmented generation (RAG) (see, for example, Non-Patent Document 2). According to this technique, a large amount of text documents are divided into chunks, and a chunk having text similar to a query is searched using a vector database in which those chunks are embedded in n-dimensional vectors. A response sentence can be generated using a large language model (LLM) for a question sentence from a user and the searched chunk. [Prior art documents] [Patent Documents]
[0006] [Patent Document 1] Patent No. 6857212 [Non-patent literature]
[0007] [Non-Patent Document 1] AREFEEN Md Adnan (and 2 others), Optimizing LLM API Usage Costs by Reducing Related Company Data with a Novel Query-Conscious Approach, NEC Technical Report, Japan, NEC Corporation, March 29, 2024, Vol. 75, No. 2, pp. 101-106, [online], [Retrieved February 9, 2025], Internet<URL:https: / / jpn.nec.com / techrep / journal / g23 / n02 / 230219.html> [Non-Patent Document 2] PaddleOCR, Easy Japanese OCR with Python_Part 2, [online], [Searched February 9, 2025], Internet<URL:https: / / qiita.com / ku_a_i / items / d4c1ce70836b8035a449> [Overview of the Initiative] [Problems that the invention aims to solve]
[0008] As mentioned earlier, chatbots and search extension generators can provide answers based on a question. However, they cannot identify the source document for that answer. The answer is essentially a distillation of text from multiple documents. Furthermore, keyword search allows you to search the document storage using those keywords and find the documents. However, keyword search cannot improve the accuracy of document searches for a given question. Furthermore, the technology described in Patent Document 1 searches tables within documents and is not suitable for searching a large number of documents in response to a question. Also, according to Non-Patent Document 1, it is not possible to identify the document that serves as the basis for the answer.
[0009] Therefore, the present invention aims to provide a program, an answering device, and a method for searching for supporting documents in response to a user's question and providing an answer. [Means for solving the problem]
[0010] <<First Invention>> According to the present invention, in a program that causes a computer to function to search for documents stored in document storage in response to a user's question, For each document, there is a page storage that stores page images captured from each page, For each document, the text recognized from each page image is divided into predetermined chunks, and these chunks are stored in a chunk storage. For each chunk, a metadata storage system accumulates metadata that links the page image and coordinate range corresponding to the text description, A chunk search means that uses chunk storage to search for chunks of text that are related to the question text and meet predetermined conditions, Using metadata storage and page storage, the system displays the page image associated with the metadata corresponding to the searched chunk, and also provides a means for visually identifying and clearly indicating to the user the portion occupied by the coordinate range of the page image. It is characterized by enabling the computer to function in this way.
[0011] According to other embodiments of the program of the present invention, For each document, an image capture means captures each page as a page image and stores each page image in page storage. For each document, a chunking means recognizes text from each page image, divides the text into predetermined chunks, and stores multiple chunks in chunk storage. A metadata extraction means extracts metadata for each chunk, linking it to the page image and coordinate range corresponding to the text description, and stores this metadata in metadata storage. It is also preferable to make the computer function in this way.
[0012] According to other embodiments of the program of the present invention, The chunk search means searches for multiple chunks in order of relevance based on predetermined conditions for the question text. The response indication means displays the first page image of the first chunk with the highest relevance, visually identifying and indicating to the user the area occupied by the coordinate range of the first chunk. In response to user interaction, it also displays the second page image of the second chunk with the next highest relevance, visually identifying and indicating to the user the area occupied by the coordinate range of the second chunk. It is also preferable to make the computer function in this way.
[0013] According to other embodiments of the program of the present invention, A document is a document file based on a format that allows for the pasting of images, tables, graphs, video, or audio objects in addition to text. The chunking method recognizes objects from the page images of the document and treats each object as a single chunk. The metadata extraction means extracts metadata for each chunk, linking the page image and coordinate range corresponding to the text or object description portion. It is also preferable to make the computer function in this way.
[0014] According to other embodiments of the program of the present invention, The chunking means includes, for chunks of objects contained in a document, the text written as the header and / or footer of those objects. It is also preferable to cause the computer to function as described above.
[0015] According to another embodiment of the program of the present invention, For each document stored in the document storage, a tag designated by an operator is assigned, The chunk splitting means assigns the same tag to all chunks split from the same document, The chunk search means causes the user to input a user-specified tag together with the question sentence, and searches only for chunks to which the user-specified tag is assigned using the chunk storage It is also preferable to cause the computer to function as described above.
[0016] According to another embodiment of the program of the present invention, When a document is stored in the document storage and an operator designates a URL (Uniform Resource Locator) or a file path, scraping means for downloading the document from the URL or the file path and storing it in the document storage It is also preferable to cause the computer to function as described above.
[0017] [[ID=The response indication means further indicating the received response text to the user. It is also preferable to make the computer function in this way.
[0018] According to other embodiments of the program of the present invention, A question and answer history storage system that stores past questions and past answers explicitly given to the user in association with those questions, A hypothetical answer search means that uses a question and answer history storage to search for past answer sentences that correspond to question sentences similar to the current question sentence under predetermined conditions, as hypothetical answer sentences, A third embedding vector conversion means converts the hypothesis response sentence from tokens to embedding vectors, and make it work The response generation means further transmits the embedding vector of the hypothetical response, along with the embedding vector of the question and the embedding vector of the text based on a first predetermined number of chunks, to the generation AI server. It is also preferable to make the computer function in this way.
[0019] According to other embodiments of the program of the present invention, The response generation means, when the chunk search means determines that there is no search, The chunk search means includes a text embedding vector based on a second predetermined number of chunks with a high similarity to a predetermined condition, and sends a prompt to the generating AI server instructing it to create a query sentence that prompts the user to re-enter the question sentence. The AI server receives the query message, The inquiry will be clearly communicated to the user. It is also preferable to make the computer function in this way.
[0020] According to other embodiments of the program of the present invention, Each chunk has a token storage that accumulates text tokens and And make it work even better. The chunk search method searches chunks from chunk storage for chunks with embedding vectors similar to the embedding vector of the question, searches token storage for chunks with keywords similar to the keywords of the question, and then searches the text of the multiple found chunks for chunks with a high semantic relevance to the text of the question. It is also preferable to make the computer function in this way.
[0021] According to other embodiments of the program of the present invention, The chunk search method is, An embedded vector search means that uses chunk storage to sort chunks with embedded vectors similar to the embedded vector of the question sentence in order of similarity, and searches for a third predetermined number of chunks from the top as first candidates, A keyword search method that sorts chunks containing keywords matching the keywords in the question text in order of matching degree, and searches for a fourth predetermined number of chunks from the top as second candidates, A semantic ranking method that sorts the text of the first candidate chunk and the text of the second candidate chunk in order of semantic relevance to the question, and ultimately searches for a predetermined number of chunks from the top five. It is also preferable to make the computer function in this way.
[0022] According to other embodiments of the program of the present invention, The response text generation means, when the relevance of the top-ranked chunk found by the semantic ranking means of the chunk search means falls below a predetermined threshold, The generation AI server receives a prompt instructing it to create a query that prompts the user to re-enter the question, containing text embedding vectors in the top six predetermined chunks found by the semantic ranking method. The AI server receives the query message, The means of clearly indicating the answer is to clearly show the inquiry text to the user. It is also preferable to make the computer function in this way.
[0023] According to the present invention, in an answer device that searches for documents stored in document storage in response to a user's question, For each document, there is a page storage that stores page images captured from each page, For each document, the text recognized from each page image is divided into predetermined chunks, and these chunks are stored in a chunk storage. For each chunk, a metadata storage system accumulates metadata that links the page image and coordinate range corresponding to the text description, A chunk search means that uses chunk storage to search for chunks of text that are related to the question text and meet predetermined conditions, Using metadata storage and page storage, the system displays the page image associated with the metadata corresponding to the searched chunk, and also provides a means for visually identifying and clearly indicating to the user the portion occupied by the coordinate range of the page image. It is characterized by having the following features.
[0024] According to the present invention, in a method for a device that searches for documents stored in document storage in response to a user's question, The device is For each document, there is a page storage that stores page images captured from each page, For each document, the text recognized from each page image is divided into predetermined chunks, and these chunks are stored in a chunk storage. For each chunk, metadata storage accumulates metadata that links the page image and coordinate range corresponding to the text description. It has, The first step involves using chunk storage to search for chunks of text that are related to the question and meet certain conditions, The second step involves using metadata storage and page storage to display the page image associated with the searched chunk, and visually identifying and clearly indicating to the user the portion occupied by the coordinate range of that page image. It is characterized by performing the following.
[0025] <<The Second Invention>> According to the present invention, in a program that causes a computer to function to search for documents stored in document storage in response to a user's question, For each document, a chunking means divides the text based on each page into a first predetermined unit chunk, For each chunk, a first embedding vector conversion means converts the text into tokens and embedding vectors, For each chunk, there is a chunk storage that accumulates embedded vectors, Each chunk has a token storage where tokens are accumulated, A second embedding vector conversion means for converting the question text into an embedding vector, Using chunk storage and token storage, A chunk search method for searching chunks, A means of explicitly indicating the document corresponding to the searched chunk to the user, using document storage. to make the computer work, The chunk search method is, Search chunk storage for chunks with embedding vectors similar to the embedding vector in the question. An embedded search mechanism, Search token storage for chunks containing keywords similar to the keywords in the question. Keyword search methods and Search for chunks of text from multiple searched chunks that have a high semantic relevance to the text of the question. Semantic ranking methods and It is characterized by enabling the computer to function in this way.
[0026] According to other embodiments of the program of the present invention, The embedded vector search means is, Using chunk storage, chunks with embedding vectors similar to the embedding vector of the question are sorted in order of similarity, and a predetermined number of third chunks from the top are searched as the first candidate. Keyword search methods are, The chunks containing keywords that match the keywords in the question are sorted by their degree of relevance, and the top four predetermined chunks are searched as the second candidate. death, Semantic ranking methods are, The text of the first candidate chunk and the text of the second candidate chunk are sorted in order of semantic relevance to the question, and the top five predetermined chunks are ultimately searched. like Making the computer function is also desirable.
[0027] According to other embodiments of the program of the present invention, The embedded vector of the question and the embedded vectors for each chunk found by the chunk search means are sent to the generating AI server, and the system is further configured as a response generation means to receive the response from the generating AI server. The response indication means further indicating the received response text to the user. It is also preferable to make the computer function in this way.
[0028] According to other embodiments of the program of the present invention, The response generation means, when the relevance of the top-level chunk found by the chunk search means is below a predetermined threshold, The generation AI server receives a prompt that includes text embedding vectors from the top six predetermined chunks found by the chunk search method, and instructs the AI to create a query that prompts the user to re-enter the question. The AI server receives the query message, Clearly present the inquiry to the user and request further questions. It is also preferable to make the computer function in this way.
[0029] According to the present invention, in an answer device that searches for documents stored in document storage in response to a user's question, For each document, a chunking means divides the text based on each page into a first predetermined unit chunk, For each chunk, a first embedding vector conversion means converts the text into tokens and embedding vectors, For each chunk, there is a chunk storage that accumulates embedded vectors, Each chunk has a token storage where tokens are accumulated, A second embedding vector conversion means for converting the question text into an embedding vector, Using chunk storage and token storage, A chunk search method for searching chunks, A means of explicitly indicating the document corresponding to the searched chunk to the user, using document storage. It has, The chunk search method is, Search chunk storage for chunks with embedding vectors similar to the embedding vector in the question. An embedded search mechanism, Search token storage for chunks containing keywords similar to the keywords in the question. Keyword search methods and Search for chunks of text from multiple searched chunks that have a high semantic relevance to the text of the question. Semantic ranking methods and It is characterized by having the following features.
[0030] According to the present invention, in a method for a device that searches for documents stored in document storage in response to a user's question, The device is For each document, the first step is to divide the text based on each page into a first predetermined unit chunk, For each chunk, the second step is to convert the text into tokens and embedding vectors, The third step involves accumulating embedded vectors for each chunk in chunk storage, The fourth step involves accumulating tokens in token storage for each chunk, The fifth step is to convert the question text into an embedded vector, Using chunk storage and token storage, The sixth step in searching for chunks, The seventh step involves using document storage to explicitly show the user the document corresponding to the searched chunk. This is what does the following: The sixth step is, Search the chunk storage for chunks that have embedding vectors similar to the embedding vector of the question statement. Search the token storage for chunks containing keywords similar to the keywords in the question. Search for chunks of text from multiple searched chunks that have a high semantic relevance to the text of the question. do like It is characterized by execution. [Effects of the Invention]
[0031] According to the program, apparatus, and method of the present invention, it is possible to search for supporting documents and provide answers to a user's question. [Brief explanation of the drawing]
[0032] [Figure 1] This is an explanatory diagram showing how to register a document from the operator's terminal to the response device. [Figure 2] This is an example of documentation for the first invention. [Figure 3] This is a functional configuration diagram of the answering device according to the first invention. [Figure 4] This is an explanatory diagram of the image capture section. [Figure 5] This is an explanatory diagram of the chunk division portion in the first part of the present invention. [Figure 6] This is an example of chunk-specific metadata in the first part of the present invention. [Figure 7] This is a functional configuration diagram that further includes a response text generation unit that generates response text. [Figure 8] This is a functional configuration diagram that further includes a hypothesis response search unit for searching past response texts. [Figure 9]This is an explanatory diagram showing the chunk search section of the triple search for the first answer device of the present invention. [Figure 10] These are examples of display screens for terminals that communicate with the first and second answering devices of the present invention. [Figure 11] This is a functional configuration diagram of the answering device in the second part of the present invention. [Figure 12] This is an explanatory diagram showing the chunk search section of the triple search in the second part of the present invention. [Modes for carrying out the invention]
[0033] Embodiments of the present invention will be described in detail below with reference to the drawings.
[0034] Figure 1 is an explanatory diagram showing how a document is registered from the operator's terminal to the response device.
[0035] <Document Registration> According to Figure 1, the operator registers a large number of documents from terminal 21 to response device 1. Response device 1 functions as a website server and provides a user interface to the browser on user-operated terminal 21. The operator can upload and register documents stored in the local storage of terminal 21 to the response device 1. At this time, by specifying the file path in the local storage, multiple documents under that path can be uploaded and registered together. The operator can also specify a website URL (Uniform Resource Locator) on the internet as the location of the document to the response device 1.
[0036] An operator is defined as an information manager of a specific organization, such as a company, organization, or business. For example, they might transmit information about their company's products and services or company information to an unspecified number of users, or transmit company-managed information to a specific number of users who are employees.
[0037] The response device 1 has a document storage 10 that stores documents in a wide variety of formats. Here, a document must be content that includes at least the element of "text". The file format of the document may be, for example, the following: PDF (registered trademark) doc (Word (registered trademark)) ppt (PowerPoint (registered trademark), graph data) xls (Excel (registered trademark), table data) CSV (Table Text) txt (plain text) HTML (Markup Language Text) XML (Markup Language Text) Furthermore, document file formats may be converted between each other. Table data in xls format and table text in csv format can be converted between each other. Similarly, document data in doc or ppt format and document data in html format can also be converted between each other.
[0038] <Document-based path registration> According to Figure 1, the operator can specify the file path of the terminal 21's local storage to the response device 1. The operator can use the user interface of the response device 1 (displayed in the web browser of terminal 21) to display the index of multiple files under a specific folder in the local storage of terminal 21. Then, by selecting some or all of the index of those files and using "cut and paste" or "drag and drop," the operator can upload and register multiple files at once to the response device 1.
[0039] Alternatively, the operator may specify the URL of a website on the internet to the response device 1. According to Figure 1, the response device 1 has a scraping unit 13. When a URL or file path is specified by the operator, the scraping unit 13 accesses a website on the internet. It then downloads the document from the URL or file path and stores it in the document storage 10.
[0040] Furthermore, the operator can specify documents by including the wildcard "*" in the URL or file path. In this case, the scraping unit 13 downloads multiple documents simultaneously and stores them in the document storage 10.
[0041] Furthermore, if a URL or file path is specified by the operator, it is preferable to periodically crawl that URL or file path, download updated documents (site crawling), and update the document storage 10.
[0042] <Adding tags to documents> In another embodiment, a "tag (hashtag)" specified by the operator can be assigned to each document stored in the document storage 10. This identifies the theme or field based on the document. Users can assign tags after registering a document, or they can assign tags simultaneously with document registration. If multiple documents are specified simultaneously using the aforementioned wildcard, the operator can assign a single tag to all of those documents, thereby linking that same tag to them. According to Figure 1, the document has tags such as the following: https: / / www.abc.com / aaa / *.doc Three documents -> Tag "Development Department" https: / / www.abc.com / bbb / bbb.csv (No tags) C:\Document\ccc\*.txt Two documents -> Tag "Sales Department" C:\Document\Transportation Expenses.pdf Document (including table data) -> Tag "General Affairs Department" https: / / www.abc.com / route-map.html Document (presentation data) -> Tag "Human Resources Department" Furthermore, as will be explained later, a "tag" is used when a user sends a question to the answering device 1, allowing it to search only documents that have been tagged with that tag.
[0043] <<First Invention>> Figure 2 is an example of documentation for the first invention.
[0044] The first document to be searched in the present invention may be based on a format that allows for the insertion of "objects" such as images, tables, graphs, videos, or audio, in addition to "text." Specifically, these may be PDF, Doc, PPT, XLS, etc., and are used with applications. These documents can also contain embedded objects such as images and graphs (jpg, png, bmp, gif, etc.), tables (csv, xls, etc.), videos (wmv, mp4, etc.), and audio (wav, mp4, etc.). Of course, they can also contain text recognized from video or audio subtitles. However, the objects themselves that are attached to the document may or may not be text-recognizable. Text written around the objects will also be used in the search as semantic information for those objects.
[0045] Furthermore, the documents to be searched may be based on text-based formats. Specifically, these include formats such as txt, html, xml, and csv, which are commonly used with browsers and editors.
[0046] According to Figure 2, for example, the file "Transportation Expenses.pdf" is assumed to contain the following text and objects. Transportation expenses.pdf -> page 1 -> Text: AAA... Object: Image A Text: BBB... Page 2 -> Text: CCC... Object: Table C Text: DDD... Object: Graph D(d1, d2) Page 3 -> Text: 1. EEE... Text: 2. EEE...
[0047] Figure 3 is a functional configuration diagram of the answering device in the first invention.
[0048] The answering device 1 searches for documents pre-stored in the document storage 10 and provides answers to questions from the user from various perspectives. Users access the response device 1 by operating apps or browsers installed on their own terminal 22. Multiple users who have access to the response device 1 can send questions to the response device 1 and receive answers. In addition, while the embodiment of the present invention assumes that the question is in text form, it may also be obtained by capturing the user's spoken voice with a microphone and converting it into text using speech recognition.
[0049] According to Figure 3, the answering device 1 includes, in addition to the document storage 10, an image capture unit 113, a page storage 103, a chunk division unit 111, a metadata extraction unit 112, a chunk storage 101, a metadata storage 102, a chunk search unit 121, and an answer reveal unit 122. These functional components may be realized by executing a program that makes the computer installed in the answering device 1 function. Furthermore, the processing flow of these functional components can also be understood as the method by which the device answers a question.
[0050] The answering device 1, in response to various questions from the user, uses a chunk search unit 121 and an answer declaration unit 122 to search using page storage 103, chunk storage 101, and metadata storage 102, and then returns an answer. The solution here is to display an image of the document's page in response to the question, and then identify and display (for example, highlight) the section within that document that answers the question. This eliminates the need for the user to search through documents that have been searched for in relation to their question.
[0051] [Image capture section 113] The image capture unit 113 captures each page of a document as a "page image" (e.g., .jpg) and stores each page image in the page storage 103.
[0052] Figure 4 is an explanatory diagram of the image capture unit 113.
[0053] According to Figure 4, the document storage 10 contains a document, for example, the travel expenses.pdf shown in Figure 2. The travel expenses.pdf consists of three pages and, in addition to text, has objects such as image A, table C, and graph D pasted into it. The image capture unit 113 captures each page as a page image. Transportation expenses.pdf-> page1.jpg page2.jpg page3.jpg
[0054] [Page Storage 103] Page storage 103 stores page images, which are captured for each page of a document.
[0055] [Chunk division section 111] The chunk division unit 111 recognizes text from each page image for each document (Character Recognition / Reader). Specifically, the character recognition software can be open-source PaddleOCR® (see, for example, Non-Patent Document 2), Tesseract OCR®, or cloud-based APIs (Application Programming Interfaces) from Google®, Amazon®, etc. These technologies allow for high-precision text recognition by inputting a document, and output the coordinate ranges (top-left, top-right, bottom-right, and bottom-left coordinates) of that text. The text's coordinate ranges are represented as a rectangular bounding box.
[0056] Next, the chunk division unit 111 divides the text recognized from each page image into predetermined chunks for each document. These multiple chunks are then stored in the chunk storage 101. The chunk division unit 111 may divide the text in the document into chunks, for example, every 256 Japanese characters, as a predetermined unit. Here, the number of characters is not limited; for example, if N=2 in the character unit of N-gram, the text may be divided into chunks of 512 tokens. An N-gram is a text analysis algorithm that decodes parts of speech by treating a group of N consecutive words or characters as one token. Furthermore, when dividing text, the coordinate range may be adjusted to match a predetermined unit. For example, if the text has approximately 1000 characters, and the predetermined unit is 256 characters, the coordinate range should also be adjusted to approximately 1 / 4 of the total length.
[0057] In another embodiment, the chunk division unit 111 may divide the text recognized from each page image into chunks based on layout units, as a predetermined unit. If it is plain text, it may be divided not only by the number of characters but also by paragraphs. If it is HTML or XML, it may be divided not only by the number of characters but also by headers. Furthermore, the character recognition software described above can recognize the layout of the entire page image and divide and output the text.
[0058] Furthermore, the chunk division unit 111 recognizes objects from each page image and divides each object into a single chunk. At this time, it can also detect the coordinate range corresponding to the object's description within the page image.
[0059] Furthermore, in another embodiment, it is preferable that the chunk division unit 111 assigns the same "tag" to all chunks divided from the same document. This allows the tag to be used as a search query to search only for chunks that possess that tag.
[0060] Figure 5 is an explanatory diagram of the chunk division portion in the first aspect of the present invention.
[0061] As shown in Figure 5, for example, each page image based on the transportation expenses.pdf file is divided into chunks 1 to 9. page1.jpg -> Chunk 1 (text AAA...) Chunk 2 (Image A) Chunk 3 (text BBB...) page2.jpg -> Chunk 4 (Text CCC...) Chunk 5 (Image (Table C)) Chunk 6 (text DDD...) Chunk 7 (Image (Graph D)) page3.jpg -> Chunk 8 (text EEE···) Chunk 9 (text EEE...) Furthermore, the chunk division unit 111 associates text that can be recognized from objects (images, tables, graphs, etc.) pasted into the document with those objects.
[0062] In another embodiment, if text is recognized from an object, it is preferable to include that text in the chunk of that object. For chunk 2 in Figure 5, if the text aaa... is recognized from part of image A, that text may be included in chunk 2(content).
[0063] In another embodiment, the chunk division unit 111 may also include text described as the header and / or footer of an object for each chunk of that object. According to chunk 7 in Figure 5, the text described as header d1 and / or footer d2 for the image portion of the graph may also be included in the graph chunk.
[0064] In another embodiment, if matrix text is recognized from the table object, that text can also be formatted into a CSV file. According to chunk 5 in Figure 5, the table portion is formatted into matrix text, and each row is divided into chunks with the title row as the item. Here, each row is divided into chunks with the title row as the item. For example, the second row and subsequent rows of Table C in Figure 5 are divided into the following chunks. Departure point = Tokyo, Destination = Nagoya, Distance = 350km, Mode of transport = Shinkansen (bullet train), Cost = 10,500 yen Departure point = Tokyo, Destination = Osaka, Distance = 600km, Mode of transport = Shinkansen (bullet train), Cost = 13,870 yen Departure point = Osaka, Destination = Hiroshima, Distance = 300km, Mode of transport = Shinkansen (bullet train), Cost = 8,000 yen Departure point = Tokyo, Destination = Fukuoka, Distance = 1,500 km, Mode of transport = Airplane, Cost = 20,000 yen Departure point = Tokyo, Destination = Osaka, Distance = 600km, Mode of transport = Airplane, Cost = 16,000 yen ·················
[0065] [Chunk Storage 101] The chunk storage 101 stores text in chunks. The chunk storage 101 stores multiple chunks output from the chunk division unit 111.
[0066] [Metadata extraction unit 112] The metadata extraction unit 112 extracts metadata for each chunk, linking the page image and coordinate range corresponding to the text description portion. In other words, it extracts the location of the description portion corresponding to the chunk regarding the appearance of the document. Furthermore, it is preferable that the metadata also include a summary of the text corresponding to chunks in the document.
[0067] Figure 6 shows an example of metadata for each chunk.
[0068] According to Figure 6, metadata such as the following is extracted from a chunk containing text and images. (Chunk 1) -------------------------------------------------------------------------------- Metadata = { 'source_name': 'own-xxxxxxxxxxx / transportation expenses.pdf', 'source_url': '', 'page_number': 1, 'doctype': 'PDF', 's3_key': 'own-xxxxxxxxxxx / image / transportation_expenses_page1.jpg', 'layout_candidates': [ {'index_page': 1, 'lay_out': '170__1624__2292__2307__text', 'coordinates': '170__1624__2292__2307', 'label': 'text', 'content': / / the content in “text” layout }, ] } -------------------------------------------------------------------------------- source_name: The name of the document in which the chunk is contained. source_url: The URL or path from which the document containing the chunk was scraped. page_number: The page number (sheet number) in the document where the chunk exists. doctype: Document identifier s3_key: Captured page image layout_candidates: lay_out, coordinates: coordinate range Content: Summary text, object recognition text, header / footer
[0069] (Chunk 2) -------------------------------------------------------------------------------- Metadata = { 'source_name': 'own-xxxxxxxxxxx / transportation expenses.pdf', 'source_url': '', 'page_number': 1, 'doctype': 'PDF', 's3_key': 'own-xxxxxxxxxxx / image / transportation_expenses_page1.jpg', 'layout_candidates': [ {'index_page': 1, 'lay_out': '180__1724__2392__2507__text', 'coordinates': '180__1724__2592__2907', 'label': 'Image', 'content': / / the content in “image” layout }, ] } -------------------------------------------------------------------------------- According to chunk 2, image A is associated with the content.
[0070] [Metadata Storage 102] The metadata storage 102 stores metadata for each chunk, linking the "page image" and "coordinate range" corresponding to the text description. The metadata storage 102 stores the chunk-specific metadata output from the metadata extraction unit 112.
[0071] Furthermore, the chunk division unit 111, metadata extraction unit 112, and image capture unit 113 are not essential for processing, but are functional units for configuring the data to be stored in the chunk storage 101, metadata storage 102, and page storage 103. For documents in document storage 10, it is sufficient that they have been pre-processed and their associated information has been pre-stored in page storage 103, chunk storage 101, and metadata storage 102.
[0072] [Chunk Search Section 121] The chunk search unit 121 uses the chunk storage 101 as a search query for the user's question text and searches for multiple chunks in order of relevance based on predetermined conditions for the question text. Here, as the simplest example, an existing "keyword search" would suffice. A predetermined number of chunks are searched for in order of similarity to the question sentence that serves as the search query. Specifically, this may involve evaluating the degree of match between words included in the search query and words in the document. The "predetermined conditions" may be defined as exceeding a predetermined threshold based on similarity, or as selecting a predetermined number of chunks from the top when sorted by similarity. In addition, it is sufficient if a predetermined number of chunks can be searched using various other conditions. Furthermore, according to the embodiment shown in Figure 9, which will be described later, the search accuracy of the chunk search unit 121 can be improved by performing a search based on relevance as a predetermined condition. Specifically, a triple search is realized by combining embedded vector search, keyword search, and semantic ranking.
[0073] In a further embodiment of the present invention, all chunks divided from the same document may be assigned the same "tag". In this case, the chunk search unit 121 prompts the user to input a user-specified "tag" along with the query. Then, using the chunk storage 101, it searches only for chunks that have been assigned the user-specified tag.
[0074] [Answer Explanation Section 122] The answer indication unit 122 takes the user's question text as input. The answer indication unit 122 then uses the metadata storage 102 and page storage 103 to display the "page image" associated with the metadata corresponding to the chunk found in the question text. Furthermore, it visually identifies and indicates to the user the portion occupied by the "coordinate range" of that page image. In other words, when answering a question text with a document found through a search, it not only displays the corresponding page image of the document but also indicates the descriptive portion of the document corresponding to the chunk in question text. For example, it is preferable to highlight it to make it clear to the user. The user can immediately see the descriptive portion that answers the question text without having to search for it within the searched document. In this case, it is also preferable to clearly show the user a summary of the text contained in the metadata's content. From the user's perspective, seeing the summary in addition to the specific descriptive part of the document makes it easier to understand. Furthermore, the answer specification unit 122 outputs the question text to the answer text generation unit 123.
[0075] The answer disclosure unit 122 discloses the page image and coordinate range to the user in order of relevance determined by the chunk search unit 121. First, the first page image of the most relevant chunk is displayed, visually identifying and clearly indicating to the user the area occupied by the coordinate range of the first chunk. Next, in response to user interaction, the second page image of the second most relevant chunk is displayed, visually identifying and clearly indicating to the user the area occupied by the coordinate range of the second chunk.
[0076] Figure 7 is a functional configuration diagram that further includes a response text generation unit for generating response text.
[0077] As shown in Figure 7, the system can not only respond to a user's question by clearly displaying a page image of the document and the corresponding text, but also by providing a "response text" to the question. This makes it easier for the user to understand the answer to their question. The chunk search unit 121 searches for chunks from the question text based on embedding vectors, and generates an answer text using the embedding vectors of those chunks.
[0078] According to Figure 7, compared to Figure 2 mentioned above, the answer device 1 further includes an embedded vector conversion unit 115, a second embedded vector conversion unit 125, and an answer text generation unit 123. These functional components may also be realized by executing a program that makes the computer mounted on the answer device function.
[0079] [First embedded vector transformation unit 115] The first embedding vector conversion unit 115 converts the text from tokens to embedding vectors for each chunk. The chunk storage 101 stores the chunk-by-chunk embedding vectors output from the first embedding vector conversion unit 115. [Second embedded vector transformation unit 125] The second embedding vector conversion unit 125 converts the question text from tokens to embedding vectors.
[0080] The first embedded vector conversion unit 115 and the second embedded vector conversion unit 125 convert text into embedded vectors using the API (Application Programming Interface) of a Large Language Model (LLM). Large-scale language models are a type of deep learning model that has been trained on large amounts of text data. Based on neural network architectures such as Transformer, they can understand context and process natural language. For example, OpenAI's Embedding API, ada®, is one such example. These models are pre-trained with general linguistic knowledge from large text corpora.
[0081] Converting text to embedded vectors requires both a tokenization function for the text and an embedded vectorization function for the tokens.
[0082] <Tokenization function> Tokenization is the process of converting a group of N consecutive words or characters into a single token (part-of-speech analysis and extraction of frequency of occurrence), as seen in N-grams. Tokenized data looks like this, for example: -------------------------------------------------------------------------------- doc_freqs= [{'I': 1, 'A reliable A': 1, 'Special information': 1, 'Use': 1, 'Can': 1, 't': 1, 'Technology': 1, ', various': 1, 'n': 1, 'A': 1, 'Use': 1, 'Hold': 1, 'and': 1, ···}] idf= {'I': 0.0, 'Certain A': 0.0, 'Special Report': 0.0, 'Use': -0.02997260220672989, 'Can': 0.0, 'I': -0.02997260220672989, 'Technology': 0.0, ···} average_idf: -0.11989040882691956 avg_dl: 476 doc_len: [356, 596] emailizer: '' -------------------------------------------------------------------------------- doc_freq: Tokenized (part-of-speech) data using Ngrams and the frequency of occurrence of each token. IDF: Tokenized data using Ngrams and the inverse document frequency of each token. average_idf: Average value of reverse document frequency avg_dl: Average number of units in a chunk doc_len: String length of the chunk data tokenizer: Type of tokenization to use
[0083] <Embedded Vectorization Function> Embedding vectorization is a process that uses machine learning models to convert tokens extracted from text into high-dimensional embedding vectors that numerically represent their meaning and characteristics. By embedding vectorizing text, the semantic features of words and sentences can be represented as numerical arrays. This allows for quantitative analysis of similarities and relationships between texts.
[0084] [Token Storage 105] The token storage 105 stores text tokens for each chunk. The tokens are extracted by the first embedded vector transformation unit 115.
[0085] [Chunk Search Section 121] The chunk search unit 121 searches the chunk storage 101 for a predetermined number of chunks whose embedding vectors are similar to the embedding vector of the question text under predetermined conditions. In the simplest case, the similarity between the embedding vector of the question text and the embedding vector of the chunk text may be calculated using cosine similarity or Euclidean distance. Specifically, the chunk search unit 121 in the present invention searches the chunk storage 101 for chunks that have embedding vectors similar to the embedding vector of the question sentence, searches the token storage 105 for chunks that have keywords similar to the keywords of the question sentence, and searches the text of the multiple searched chunks for chunks that have a high semantic relevance to the text of the question sentence.
[0086] [Answer sentence generation unit 123] The answer generation unit 123 receives the question from the answer revealing unit 122 and a predetermined number of texts based on a predetermined number of chunks from the chunk search unit 121. The answer generation unit 123 then sends the embedded vector of the question and the embedded vector of the first predetermined number of chunks of text to the generation AI server 3, and receives the answer from the generation AI server 3. The answer is output to the answer revealing unit 122 and further revealed to the user.
[0087] Here, Generative Artificial Intelligence (Generative Artificial Intelligence) Server 3 is a system that understands the context of a question and generates natural language text. Examples include OpenAI's ChatGPT (registered trademark), Anthropic's Claude (registered trademark), Google's Gemini (registered trademark), and Meta's Llama (registered trademark). These are pre-trained using general linguistic knowledge derived from large text corpora.
[0088] The response generation unit 123 creates a "prompt" that instructs the system to generate a response from the question and a predetermined number of texts. The simplest prompt is, for example, as follows: -------------------------------------------------------------------------------- For the following question, generate an answer by referring to the following embedded vectors. #Question ············ #EmbeddedVector1 ············ #EmbeddedVector2 ············ #EmbeddedVector3 ············ -------------------------------------------------------------------------------- The response generation unit 123 outputs the response received from the generation AI server 3 to the response specification unit 122. This allows the answer display unit 122 to display a "page image" to the user, "highlight" the descriptive portion related to the question, and further display the "answer text" to the user.
[0089] <If the chunk search unit 121 determines that no results were found> When the chunk search unit 121 determines that there is no search result, the response text generation unit 123 sends a prompt to the generation AI server 3 instructing the following: (prompt) User's question • A second predetermined number of chunks with high similarity to the predetermined conditions in the chunk search unit 121 Text embedding vector based on Instructions for creating a query that prompts the user to re-enter the question.
[0090] Furthermore, in an embodiment in which the chunk search unit 121 determines that no search is found, the relevance of the top-level chunk found by the semantic ranking unit 1213 (described later) may be less than or equal to a predetermined threshold. In this case, the text embedding vectors of the sixth predetermined number of chunks from the top, found by the semantic ranking unit 1213, are included in the prompt.
[0091] The response generation unit 123 then receives the inquiry from the generation AI server 3 and presents the inquiry as a response to the user. This allows the user to consider the inquiry, create a new question, and send it to the response device 1.
[0092] Figure 8 is a functional configuration diagram that further includes a hypothesis response search unit for searching past response texts.
[0093] According to Figure 8, compared to Figure 7, it further includes a question-answer history storage 104, a hypothesis answer text search unit 124, and a third embedded vector conversion unit 126.
[0094] [Question and Answer History Storage 104] The question and answer history storage 104 stores past questions and the corresponding past answers that were explicitly given to the user in response to those questions. Here, the question text received from the user and the answer text output by the answer specification unit 122 in response to that question text are stored in association.
[0095] [Hypothesis Response Text Search Unit 124] The hypothesis answer search unit 124 uses the question answer history storage 104 to search for past answer sentences that correspond to question sentences similar to the current question sentence under predetermined conditions, and uses these as hypothesis answer sentences. The current question is used as the search query to search the question-answer history storage 104. Here, keyword search as described above may be used, or other search methods that improve search accuracy, such as semantic ranking, may be used. Also, the hypothetical answer sentence may be more than one sentence. However, when searching for multiple sentences, it is preferable that the search methods for each hypothetical answer sentence are different. Multiple sentences based on different concepts can be used as hypothetical answers.
[0096] [Third embedded vector transformation unit 126] The third embedding vector conversion unit 126 converts the hypothesis response sentence from tokens to embedding vectors. The embedding vectors of the hypothesis response sentence are output to the response indication unit 122.
[0097] The response indication unit 122 then outputs the embedding vector of the hypothetical response sentence to the response sentence generation unit 123. As a result, the response text generation unit 123 further transmits the embedding vector of the hypothetical response text, along with the embedding vector of the question text and the embedding vector of the text based on a first predetermined number of chunks, to the generation AI server 3. At this time, the simplest prompt sent to the generating AI server 3 would be something like the following: -------------------------------------------------------------------------------- For the following questions, please generate answers by referring to the following hypothetical answers and each text provided. #Question ············ #Hypothesis response ············ #EmbeddedVector1 ············ #EmbeddedVector2 ············ #EmbeddedVector3 ············ --------------------------------------------------------------------------------
[0098] Figure 9 is an explanatory diagram showing the chunk search section of the triple search for the first answer device of the present invention.
[0099] According to Figure 9, the chunk search unit 121 includes an embedded vector search unit 1211, a keyword search unit 1212, and a semantic ranking unit 1213. This allows for the search of chunks containing text related to the question.
[0100] [Embedded vector search unit 1211] The embedded vector search unit 1211 uses the chunk storage 101 to sort chunks that have embedded vectors similar to the embedded vector of the question text in order of similarity, and searches for a predetermined third number of chunks from the top as the first candidate. For example, using cosine similarity or Euclidean distance, the system searches for, for example, 15 chunks (a predetermined number) of the most similar items (first candidates). In this case, it is preferable to use not only the embedding vector of the question but also the embedding vector of the hypothesis answer output from the hypothesis answer search unit 124 shown in Figure 8. For example, the system may search for chunks in order of their similarity to the embedding vector of the question and the embedding vector of the hypothesis answer.
[0101] [Keyword Search Section 1212] The keyword search unit 1212 sorts chunks containing keywords that match the keywords in the question text in order of matching degree, and searches for a predetermined number of chunks from the top four as second candidates. For example, the search will find up to 7 chunks (a second predetermined number) of keywords, starting with the ones with the highest keyword relevance.
[0102] The keyword search unit 1212 may use a statistical algorithm such as BM25 (Okapi BM (Best Matching) 25). This allows the text of each chunk in response to the question to be ranked in order of score.
[0103] BM25 is an improved algorithm based on TF-IDF (Term Frequency - Inverse Document Frequency). It considers word frequency (TF), determining that words appearing more frequently in a text are more important. Conversely, it also considers inverse document frequency (IDF), determining that words in a search query that are common words appearing in many texts are less important. On the other hand, words that appear only in specific texts are considered more important. A distinctive feature of BM25 is its consideration of text length. Generally, longer texts tend to contain more words, and therefore have a higher word frequency. BM25 compensates for this effect by considering text length. BM25 combines these factors to score the importance of the text. A higher score indicates greater relevance to the search query, resulting in a higher ranking in search results.
[0104] The keyword search unit 1212 in the chunk search unit 121 of the present invention is not limited to BM25, and may be based on existing keyword search or on other algorithms. Here, instead of using the text of each chunk in the chunk storage 101 as the search target, the tokens of each chunk in the token storage 105 may be used. As shown in Figure 7, the tokens converted by the tokenization functions of the first embedded vector conversion unit 115 and the second embedded vector conversion unit 125 are used. The tokens of the chunk text converted by the first embedded vector conversion unit 115 are stored in the token storage 105. As a result, the keyword search unit 1212 can use the token storage 105 to rank the tokens of chunks similar to the tokens of the question sentence in descending order of similarity.
[0105] [Semantic Ranking Section 1213] The semantic ranking unit 1213 sorts the text of the first candidate chunks (e.g., 15 items) and the text of the second candidate chunks (e.g., 7 items) in descending order of semantic relevance to the question, and ultimately selects a fifth predetermined number of chunks from the top. That is, it selects 3 items (the fifth predetermined number) from 22 texts (= 15 items + 7 items).
[0106] Semantic ranking, unlike keyword search, uses techniques such as natural language processing and machine learning to understand the meaning, context, and intent of a search query, and then ranks the results in order of relevance. In particular, it inherits the advantages of fuzzy search and, through syntactic and semantic analysis, can rank search results higher if they are closer to the meaning of the search query. Specific examples include Microsoft's Azure OpenAI (registered trademark) and Google's BERT (Bidirectional Encoder Representations from Transformers).
[0107] <If the semantic ranking unit 1213 of the chunk search unit 121 determines that no search was found> When the semantic ranking unit 1213 of the chunk search unit 121 determines that there is no search, the response text generation unit 123 sends the following prompt to the generation AI server 3 if the relevance of the top-level chunk found by the semantic ranking unit 1213 is below a predetermined threshold. (prompt) User's question • Text in the top 6 predetermined chunks retrieved by the Semantic Ranking Unit 1213 Instructions for creating a query that prompts the user to re-enter the question.
[0108] In response, the response generation unit 123 receives the inquiry from the generation AI server 3 and explicitly presents the inquiry as a response to the user. This allows the user to consider the inquiry, create a new question, and send it to the response device 1.
[0109] Figure 10 shows an example of the display screen of a terminal communicating with the first answering device of the present invention.
[0110] On the display of terminal 22 accessing response device 1, selection buttons are displayed to prompt the user to initially specify the tags "General Affairs Department" and "Human Resources Department". -------------------------------------------------------------------------------- (S1) Please tell us what your inquiry is. General Affairs Department Human resources department --------------------------------------------------------------------------------
[0111] Let's assume the user selected "General Affairs Department". -------------------------------------------------------------------------------- (S2) Please tell us what your inquiry is. General Affairs Department --------------------------------------------------------------------------------
[0112] The user enters their inquiry as something related to the tag "General Affairs Department". -------------------------------------------------------------------------------- (S3) List transportation information from Tokyo to Osaka. --------------------------------------------------------------------------------
[0113] The answering device 1 uses a chunk search unit 121 to search for multiple chunks in order of relevance based on predetermined conditions for the question text. Here, the chunk search unit 121 searches the chunk storage 101 based on the question text "List transportation information from Tokyo to Osaka." Then, it searches for multiple chunks according to their relevance. <Chunk 5> • Transportation expenses page2.jpg, coordinate range of Table C Departure point = Tokyo, Destination = Osaka, Distance = 600km, Mode of transport = Shinkansen (bullet train), Cost = 13,870 yen <Chunk 3> • Route map page1.jpg, text coordinate range The airfare from Tokyo to Osaka is 16,000 yen.
[0114] Then, the response device 1 sends the embedded vectors of the searched chunks 5 and 3 to the generation AI server 3 to generate a response sentence. The response device 1 then sends the following response sentence back to the user. -------------------------------------------------------------------------------- (S4) Departure point: Tokyo Destination: Transportation and fare to Osaka: 1. Transportation: Shinkansen (bullet train) Cost: 13,870 yen Reference document: [Transportation expenses] 2. Transportation: Airplane Cost: 16,000 yen Reference document: [Route] --------------------------------------------------------------------------------
[0115] Let's assume the user selects [Transportation Expenses] as option 1. Then, response device 1 displays the following page image to the user. ------------------------------------------------------------------------------- (S5) [Transportation fee page2.jpg] Departure point = Tokyo, Destination = Osaka, Distance = 600km, Mode of transport = Shinkansen (bullet train), Cost = 13,870 yen ············· --------------------------------------------------------------------------------
[0116] This allows the user to view the page image for transportation expenses (transportation expenses page1.jpg). It also visually identifies (highlights) the portion of the page image occupied by the coordinate range, making it clear to the user. The entire description corresponding to the searched chunk may be highlighted, or only the string specified in the metadata corresponding to that chunk may be highlighted. Furthermore, since chunk 5 is the most relevant, it may be acceptable to display the page image for transportation expenses from the start without requiring user selection.
[0117] The user can then select the next option 2 (chunk 3) [route] by performing their own "next page operation". This causes the answer indication unit 122 of the answer device 1 to display the second page image (route.jpg) of the next most relevant second chunk, visually identifying and indicating to the user the portion occupied by the coordinate range of the second page image. -------------------------------------------------------------------------------- (S6)[Transportation fee page1.jpg] Tokyo to Osaka: 16,000 yen ············· --------------------------------------------------------------------------------
[0118] This allows users to view the specific documents that support the answers, while maintaining the original appearance of the information. This provides users with a new search experience for the question.
[0119] <<Regarding the second invention>> Figure 11 is a functional configuration diagram of the answering device in the second part of the present invention.
[0120] According to Figure 11, compared to the answer device 1 in Figure 2, this simply searches for documents. Also, similar to Figure 7, it uses embedded vectors. The chunk search unit 121 searches the chunk storage 101 for chunks with embedding vectors similar to the embedding vector of the question, searches the token storage 105 for chunks with keywords similar to the keywords of the question, and then searches the text of the multiple chunks found for chunks that have a high semantic relevance to the text of the question.
[0121] Figure 12 is an explanatory diagram showing the chunk search section of the triple search in the second part of the present invention.
[0122] According to Figure 12, the functional configuration of the chunk search unit 121 is exactly the same as that of Figure 9. Here, the chunks found by the semantic ranking unit 1213 are output to the answer declaration unit 122. The response display unit 122 searches the document storage 10 for a document corresponding to the searched chunk and can display that document to the user.
[0123] Furthermore, the answer device 1 in the second version of the present invention can also be configured by combining it with the answer text generation unit 123 shown in Figure 7 of the first version of the present invention. The response generation unit 123 prompts the user to re-enter a question if the relevance of the top-level chunk found by the chunk search unit 121 falls below a predetermined threshold. In this case, the response generation unit 123 sends a prompt to the generation AI server 3 that includes text embedding vectors from the sixth predetermined number of top-level chunks found by the chunk search unit 121, instructing it to create a query message to prompt the user to re-enter a question message. The generation AI server 3 then receives the query message, displays it to the user, and requests further questions.
[0124] As described in detail above, the program, apparatus, and method of the present invention can search for supporting documents and provide answers to user questions.
[0125] The present invention, as described above, is based on RAG (Retrieval Augmented Generation) technology and applies a large-scale language model of Natural Language Processing to the search. Using the large-scale language model, for example, a company's own large volume of business documents can be used as the search target. Furthermore, using the generation AI, documents can be searched in a question format, and answers that are easy for the user to understand can be generated. Moreover, the user can see at a glance the parts of the searched documents that correspond to the questions.
[0126] Various changes, modifications, and omissions to the scope of the technical concept and viewpoint of the present invention can be readily made by those skilled in the art with respect to the various embodiments of the present invention described above. The above description is merely illustrative and is not intended to limit the present invention in any way. The present invention is limited only to what is limited by the claims and their equivalents. [Explanation of Symbols]
[0127] 1 Answer device 10 Document Storage 101 chunk storage 102 Metadata Storage 103-page storage 104 Question and Answer History Storage 105 Token Storage 111 Chunk division section 112 Metadata Extraction Unit 113 Image Capture Section 115 First embedded vector transformation unit 121 Chunk Search Section 1211 Embedded Vector Search Unit 1212 Keyword Search Section 1213 Semantic Ranking Department 122 Answer Explanation Part 123 Answer sentence generation section 124 Hypothesis Response Text Search Unit 125 Second embedded vector transformation unit 13. Scraping Section 21 Operator's terminal 22 User terminals 3. Generation AI Server
Claims
1. In a program that causes a computer to function to search for documents stored in document storage in response to a user's question, For each document, a chunking means divides the text based on each page into a first predetermined unit chunk, For each chunk, a first embedding vector conversion means converts the text into tokens and embedding vectors, For each chunk, there is a chunk storage that accumulates embedded vectors, Each chunk has a token storage where tokens are accumulated, A second embedding vector conversion means for converting the question text into an embedding vector, A chunk search means for searching chunks using chunk storage and token storage, A means of explicitly indicating the document corresponding to the searched chunk to the user, using document storage. to make the computer work, The chunk search method is, An embedded search means for searching chunks from chunk storage for chunks that have an embedded vector similar to the embedded vector of the question text, A keyword search method that searches for chunks containing keywords similar to the keywords in the question from token storage, A semantic ranking method that searches for chunks of text from multiple searched chunks that have a high semantic relevance to the text of the question, and A program characterized by its ability to make a computer function.
2. The embedded vector search means uses chunk storage to sort chunks having embedded vectors similar to the embedded vector of the question sentence in order of similarity, and searches for a third predetermined number of chunks from the top as first candidates. The keyword search method sorts chunks containing keywords that match the keywords in the question text in order of matching degree, and searches for a fourth predetermined number of chunks from the top as second candidates. The semantic ranking method sorts the text of the first candidate chunk and the text of the second candidate chunk in order of semantic relevance to the question, and ultimately searches for a predetermined number of chunks up to the fifth from the top. The program according to claim 1, characterized in that it causes the computer to function in such a way.
3. The embedded vector of the question and the embedded vectors for each chunk found by the chunk search means are sent to the generating AI server, and the system is further configured as a response generation means to receive the response from the generating AI server. The response indication means further indicating the received response text to the user. The program according to claim 1 or 2, characterized in that it causes the computer to function in such a way.
4. The response generation means, when the relevance of the top-level chunk found by the chunk search means is below a predetermined threshold, The generation AI server receives a prompt that includes text embedding vectors from the top six predetermined chunks found by the chunk search method, and instructs the AI to create a query that prompts the user to re-enter the question. The AI server generates the query message, Clearly present the inquiry to the user and request further questions. The program according to claim 1 or 2, characterized in that it causes the computer to function in such a way.
5. In a response device that searches for documents stored in document storage in response to a user's question, For each document, a chunking means divides the text based on each page into a first predetermined unit chunk, For each chunk, a first embedding vector conversion means converts the text into tokens and embedding vectors, For each chunk, there is a chunk storage that accumulates embedded vectors, Each chunk has a token storage where tokens are accumulated, A second embedding vector conversion means for converting the question text into an embedding vector, A chunk search means for searching chunks using chunk storage and token storage, A means of explicitly indicating the document corresponding to the searched chunk to the user, using document storage. It has, The chunk search method is, An embedded search means for searching chunks from chunk storage for chunks that have an embedded vector similar to the embedded vector of the question text, A keyword search method that searches for chunks containing keywords similar to the keywords in the question from token storage, A semantic ranking method that searches for chunks of text from multiple searched chunks that have a high semantic relevance to the text of the question, and An answering device characterized by having the following features.
6. In a method for a device to respond to a user's question by searching for documents stored in document storage, The device is For each document, the first step is to divide the text based on each page into a first predetermined unit chunk, For each chunk, the second step is to convert the text into tokens and embedding vectors, The third step involves accumulating embedded vectors for each chunk in chunk storage, The fourth step involves accumulating tokens in token storage for each chunk, The fifth step is to convert the question text into an embedded vector, The sixth step involves searching for chunks using chunk storage and token storage, The seventh step involves using document storage to explicitly show the user the document corresponding to the searched chunk. This is what does the following: The sixth step is, Search the chunk storage for chunks that have embedding vectors similar to the embedding vector of the question statement. Search the token storage for chunks containing keywords similar to the keywords in the question. Search for chunks of text from multiple searched chunks that have a high semantic relevance to the text of the question. A method for answering questions using an apparatus, characterized by being performed in such a manner.
Citation Information
Patent Citations
Information processing system, information processing method, and program
JP7538364B1
Traditional Chinese medicine question and answer method and device based on long document retrieval enhancement generation and medium
CN117828050A
Document search system, document search device and method
JP6857212B2
JPP7538364B
Method for improving answer accuracy for generative ai-based multiple questions
KR102711560B1