Document processing method and device, electronic equipment and medium
By using a large language model to process the embedded vectors and inverted index of preset documents, the problem of manual screening of search content from massive documents is solved, and efficient document retrieval and analysis is achieved.
Patent Information
- Application Number
- CN202311800270.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-25
- Publication Date
- 2025-06-27
AI Technical Summary
In the prior art, the time-consuming and inefficient result is caused by the practitioner manually screening the required content from a large number of documents.
By obtaining the query intent of the query text entered by the user, the large language model is used to search and process the embedded vectors and inverted index of the preset document to generate reply text, thereby achieving efficient screening and retrieval of massive documents.
It improves document processing efficiency, reduces the time for manual screening and retrieval, and realizes efficient retrieval and analysis of massive financial documents.
Smart Images

Figure CN120216614A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of big data processing and artificial intelligence, and particularly to a document processing method, device, electronic device and medium. Background Art
[0002] In the financial field, a large amount of content is generated every day, such as various financial news in the securities market, stock market quotes, industry and company research reports, financial reports and information announcements of listed companies, product promotions of fund trust insurance companies, and other massive content information. These content information often exists in the form of text documents or image documents; financial institutions and financial practitioners need to collect these public financial documents for investment analysis and auxiliary decision-making. The existing technology usually requires practitioners to manually screen and retrieve the required content from these massive public financial documents, which is time-consuming and inefficient. Summary of the Invention
[0003] Embodiments of the present invention provide a document processing method, device, electronic device and medium, which solve the problems of long time consumption and low efficiency caused by practitioners manually screening and retrieving the required content from a large number of documents in the prior art.
[0004] In a first aspect, an embodiment of the present invention provides a document processing method, the method comprising:
[0005] Obtaining the query intention of a query text input by a user;
[0006] Retrieving a target text according to the query intention to obtain a retrieval result;
[0007] Processing the retrieval result by using a large language model to obtain a reply text of the query text;
[0008] Wherein, the target text includes the embedded vector and inverted index of a preset document.
[0009] Optionally, before obtaining the query intention of the query text input by the user, the method further comprises:
[0010] Obtaining the preset document;
[0011] Parsing the preset document to obtain a structured text;
[0012] Performing vectorization processing and index construction processing on the structured text to obtain a target text.
[0013] Optionally, the parsing the preset document to obtain a structured text includes:
[0014] Performing format conversion on the target text to obtain a first text;
[0015] Use an optical character recognition model to recognize the first text to obtain first text information;
[0016] Use a table recognition model to recognize the first text to obtain first table information;
[0017] Generate the structured text based on the first text information and the first table information.
[0018] Optionally, the vectorization processing and index construction processing of the structured text to obtain the target text include:
[0019] Convert the structured text into a second text in a preset format;
[0020] Slice the second text to obtain a third text after slicing;
[0021] Extract features from the third text to generate feature information;
[0022] Perform vectorization processing on the feature information to generate an embedded vector of the feature information;
[0023] Construct an index of the feature information and the embedded vector to obtain an inverted index;
[0024] Obtain the target text based on the embedded vector and the inverted index.
[0025] Optionally, the retrieval of the target text according to the query intent to obtain the retrieval result includes:
[0026] Perform a recall process on the target text according to the query intent to obtain a fourth text;
[0027] Retrieve the fourth text to obtain the retrieval result.
[0028] Optionally, the processing of the retrieval result using a large language model to obtain the response text of the query text includes:
[0029] Construct a prompt instruction according to the retrieval result;
[0030] Input the prompt instruction into the large language model for processing to obtain the response text of the query text;
[0031] Wherein, the prompt instruction is used to instruct the large language model to generate the response text of the retrieval result.
[0032] Optionally, the obtaining of the query intent in the query text input by the user includes:
[0033] Obtain the query text input by the user;
[0034] The query intention of the user is obtained by using an intention recognition model to recognize the query text.
[0035] In a second aspect, an embodiment of the present invention further provides a document processing device, which includes:
[0036] A first acquisition module, configured to acquire the query intention of the query text input by the user;
[0037] A retrieval module, configured to retrieve the target text according to the query intention to obtain a retrieval result;
[0038] A first processing module, configured to use a large language model to process the retrieval result to obtain a reply text for the query text;
[0039] Wherein, the target text includes the embedded vector and inverted index of the preset document.
[0040] Optionally, the device further includes:
[0041] A second acquisition module, configured to acquire the preset document before acquiring the query intention of the query text input by the user;
[0042] An analysis module, configured to analyze the preset document to obtain structured text;
[0043] A second processing module, configured to perform vectorization processing and index construction processing on the structured text to obtain the target text.
[0044] Optionally, the analysis module includes:
[0045] A first conversion sub-module, configured to perform format conversion on the target text to obtain a first text;
[0046] A first recognition sub-module, configured to use an optical character recognition model to recognize the first text to obtain first text information;
[0047] A second recognition sub-module, configured to use a table recognition model to recognize the first text to obtain first table information;
[0048] A first generation sub-module, configured to generate the structured text based on the first text information and the first table information.
[0049] Optionally, the second processing module includes:
[0050] A second conversion sub-module, configured to convert the structured text into a second text in a preset format;
[0051] A slicing sub-module, configured to slice the second text to obtain a sliced third text;
[0052] A feature extraction sub-module, configured to extract features from the third text to generate feature information;
[0053] A vectorization processing sub-module, configured to perform vectorization processing on the feature information to generate an embedded vector of the feature information;
[0054] An index construction sub-module, configured to construct an index of the feature information and the embedded vector to obtain an inverted index;
[0055] The target text is obtained based on the embedded vector and the inverted index.
[0056] Optionally, the retrieval module includes:
[0057] A recall processing sub-module, configured to perform recall processing on the target text according to the query intention to obtain a fourth text;
[0058] A retrieval sub-module, configured to retrieve the fourth text to obtain a retrieval result.
[0059] Optionally, the first processing module includes:
[0060] A construction sub-module, configured to construct a prompt instruction according to the retrieval result;
[0061] A processing sub-module, configured to input the prompt instruction into a large language model for processing to obtain a reply text of the query text;
[0062] Wherein, the prompt instruction is used to instruct the large language model to generate a reply text of the retrieval result.
[0063] Optionally, the first acquisition module includes:
[0064] An acquisition sub-module, configured to acquire a query text input by a user;
[0065] An identification sub-module, configured to identify the query text by using an intention recognition model to obtain the query intention of the user.
[0066] In a third aspect, an embodiment of the present invention further provides an electronic device, including: a memory, a processor, and a program stored on the memory and executable on the processor;
[0067] The processor is configured to read the program in the memory to implement the steps in the document processing method as described in the first aspect.
[0068] Fourthly, an embodiment of the present invention further provides a readable storage medium for storing a program, which when executed by a processor implements the steps in the document processing method described in the first aspect.
[0069] In an embodiment of the present application, the query intention of the query text input by the user is obtained; the target text is retrieved according to the query intention to obtain a retrieval result; the retrieval result is processed by a large language model to obtain a reply text of the query text; wherein, the target text includes the embedded vector and the inverted index of the preset document. Through the above method, a dialogue in the form of natural language interaction is realized using a large language model, which helps practitioners in the financial industry to efficiently screen and retrieve the required content from a large number of financial documents, improving the document processing efficiency. Description of the Drawings
[0070] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments of the present invention. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0071] Figure 1 is a flowchart of a document processing method provided by an embodiment of the present invention;
[0072] Figure 2 is a flowchart of another document processing method provided by an embodiment of the present invention;
[0073] Figure 3 is a structural block diagram of a document processing device provided by an embodiment of the present invention;
[0074] Figure 4 is a structural diagram of an electronic device provided by an embodiment of the present invention. Detailed Embodiments
[0075] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments of the present invention belong to the scope of protection of the present invention.
[0076] See Figure 1 , Figure 1 is a flowchart of the document processing method provided by an embodiment of the present invention, which can be applied to the scenario of screening and retrieving a large number of financial documents.
[0077] Figure 1It is a flowchart of the document processing method provided by an embodiment of the present invention. As Figure 1 shown, the method specifically includes the following steps:
[0078] Step 101, obtain the query intention of the query text input by the user.
[0079] Among them, when the user needs to screen and retrieve a large number of financial field documents, the user can input the text he wants to query, and obtain the query intention from the query text input by the user, so as to obtain a response text corresponding to the user's query intention subsequently.
[0080] As an optional implementation manner, obtaining the query intention in the query text input by the user includes:
[0081] Obtain the query text input by the user;
[0082] Use an intention recognition model to recognize the query text to obtain the user's query intention.
[0083] Specifically, the query text input by the user in the form of text input can be obtained, or the query text input by the user through voice input can be obtained. Of course, it can also be other methods, and the embodiments of the present invention do not make specific limitations on this. The intention recognition model is a natural language processing model used to determine the intention or purpose of the user during a conversation. Common model algorithms include Naive Bayes, Support Vector Machine, and Decision Tree, etc. Using the intention recognition model to recognize the query text, for example, the user's query intention can be obtained.
[0084] As an optional implementation manner, before step 101 of obtaining the query intention of the query text input by the user, the method further includes:
[0085] Obtain the preset document;
[0086] Parse the preset document to obtain structured text;
[0087] Perform vectorization processing and index construction processing on the structured text to obtain target text.
[0088] Specifically, before the user conducts a query, it is necessary to first obtain the document to be retrieved, and then process the obtained document to be retrieved. The document to be retrieved can be a large number of image documents existing in the financial field. The forms of image documents include, for example, industry reports, seller research reports, product promotion posters, enterprise introduction briefings, etc. These contents are often stored in PDF documents in the form of rich text or images. Parse the PDF document to obtain structured text, and then perform vectorization processing and index construction processing on the structured text to obtain the target text containing embedded vectors and inverted indexes, and store the target text in the database to form a relational database and a vector database.
[0089] As an alternative implementation, the parsing of the preset document to obtain structured text includes:
[0090] Convert the format of the target text to obtain the first text;
[0091] Use an optical character recognition model to recognize the first text to obtain the first text information;
[0092] Use a table recognition model to recognize the first text to obtain the first table information;
[0093] Generate the structured text based on the first text information and the first table information.
[0094] Specifically, convert the PDF document into images, with each page of the document converted into one image; then use a layout detection model for each image to identify the bounding boxes (bounding boxes) and coordinates of layout areas such as "title", "text paragraph", "table", "picture", etc. in the image. Use an optical character recognition model to recognize the bounding boxes and coordinates of each character in the "title", "text paragraph", "picture"; use a table recognition model to recognize the coordinates of each cell in the table and the content of the cell, and convert the bounding boxes and coordinates of each character in the "title", "text paragraph", "picture" and the coordinates and content of each cell into a structured text format.
[0095] The embodiments of the present invention can process documents in rich text format with various layouts, and solve the problems of cross-page paragraphs and tables in typesetting.
[0096] As an alternative implementation, the vectorization processing and index construction processing of the structured text to obtain the target text includes:
[0097] Convert the structured text into a second text in a preset format;
[0098] Slice the second text to obtain the sliced third text;
[0099] Extract features from the third text to generate feature information;
[0100] Perform vectorization processing on the feature information to generate an embedded vector of the feature information;
[0101] Construct an index of the feature information and the embedded vector to obtain an inverted index;
[0102] Obtain the target text based on the embedded vector and the inverted index.
[0103] Specifically, after completing the parsing of the image visual document, structured text is obtained, and the structured text is reconstructed and converted into text in HTML format. For the reconstructed HTML document, using the text slicing model, the document is sliced according to paragraphs, length, and semantic content. For the sliced document data, using feature models such as text summarization models, text classification models, information extraction models, and keyword extraction models, respectively generate features of the document and fragments such as the document summary, document type, fragment summary, fragment keywords, and fragment key information of the whole document. Using the text vectorization model, generate embedded vectors of the document summary, fragment summary, keywords, and fragment key information. Then construct an inverted index of keywords, document types, key information, and embedded vectors. Obtain the target text based on the embedded vector and the inverted index.
[0104] Step 102, retrieve the target text according to the query intent to obtain a retrieval result.
[0105] Among them, the target text includes the embedded vector and inverted index of a preset document. The preset document can be a large number of financial documents, such as image documents or text documents. Retrieving the target text according to the query intent can obtain multiple retrieval results.
[0106] As an optional implementation manner, the retrieving the target text according to the query intent to obtain a retrieval result includes: performing a recall process on the target text according to the query intent to obtain a fourth text; retrieving the fourth text to obtain a retrieval result.
[0107] Specifically, according to the query intent and the inverted index in the database, using the intent document recall module, recall document fragments related to the user's query intent from a large number of documents; then use the retrieval model to retrieve the recalled document fragments and fragment features to obtain multiple retrieval results, sort the multiple retrieval results, and select the top K results with higher rankings as the retrieval results. Among them, the retrieval model can be a dual retrieval model, and K is a positive integer.
[0108] Step 103: Use a large language model to process the retrieval results to obtain a response text for the query text.
[0109] Among them, the large language model LLM (Large Language Model) can be GPT, BERT (Bidirectional Encoder Representation from Transformers), etc.
[0110] As an alternative implementation, the use of a large language model to process the retrieval results to obtain a response text for the query text includes: constructing a prompt instruction according to the retrieval results; inputting the prompt instruction into the large language model for processing to obtain a response text for the query text; where the prompt instruction is used to instruct the large language model to generate a response text for the retrieval results.
[0111] Specifically, according to the retrieved segment content corresponding to the K retrieval results obtained by retrieving the target text, a prompt instruction is constructed, and the prompt instruction is used to instruct the large language model to generate a response text for the retrieval results in a preset format. Input the firmware prompt into the domain large language model, and use the generation and summarization ability of the domain large language model to generate a response text for the user's query text.
[0112] The embodiment of the present invention uses a large language model to implement a dialogue in the form of natural language interaction, helping financial industry practitioners efficiently screen and retrieve the required content from a large number of financial domain documents, and improving the document processing efficiency.
[0113] Figure 2 It is a flowchart of another document processing method provided by the embodiment of the present invention.
[0114] As Figure 2 shown: For a large number of image documents in the financial field, the image documents are usually stored in PDF. First, convert the PDF document into images, and each page of the document is converted into an image. For each image, use a layout detection model to identify the bounding boxes (bounding boxes) and coordinates of layout areas such as "title", "text paragraph", "table", "picture", etc. in the image. Then use the optical character recognition ORC model to identify the bounding boxes and coordinates of each character in the "title", "text paragraph", "picture"; use the table model to identify the coordinates of each cell in the table and the content of the cell. The content recognized by the OCR model and the content recognized by the table recognition are converted into a structured text format:
[0115] {"doc_name":"", "page_number":1, "layouts":
[0116] {"bbox":[x1,y1,x2,y2],label:"title","content":{"tokens":["金","Rong"],"bboxes":[[x1,y1,x2,y2],[x1,y1,x2,y2]]}},
[0117] {"bbox":[x1,y1,x2,y2],label:"text","content":{"tokens":["金","Rong"],"bboxes":[[x1,y1,x2,y2],[x1,y1,x2,y2]]}},
[0118] {"bbox":[x1,y1,x2,y2],label:"table","cells":[{"cell_text":"years","cell_box":[[x1,y1,x2,y2],[x1,y1,x2,y2]]}], "html":" Number of years ”},
[0119] {"bbox":[x1,y1,x2,y2],label:"figure","content":{"tokens":["金","Rong"],"bboxes":[[x1,y1,x2,y2],[x1,y1,x2,y2]]},"figure_name":figure_path}
[0120] ]}
[0121] After completing the image visual document parsing, the structured text is obtained and reconstructed into HTML format text. During the reconstruction process, the cross-page text and table content can be automatically merged, and the paged image documents can be merged into a text document to obtain HTML format text.
[0122] For the reconstructed HTML document, the text slicing model is used to slice the reconstructed HTML document according to paragraphs, length, and semantic content. For the sliced document data, feature models such as text summary model, text classification model, information extraction model, and keyword extraction model are used to generate document and fragment features such as document summary, document type, fragment summary, fragment keyword, and fragment key information of the entire document. The text vectorization model is used to generate document summary and fragment summary to obtain a relational database and a vector database.
[0123] For the query text of the user's query, use the intent recognition model to understand the user's current query according to the user conversation context and generate a complete user query intent. For example: Input: "User: What is the sales revenue of XX Company in the third quarter of 2023? BoT: 31 million, User: What about the first quarter?" Output: {"intent": "Sales revenue", "entity": {"company": "XX Company", "year": "2023", "quarter": "1"}, "query": "What is the sales revenue of XX Company in the first quarter of 2023?"}
[0124] According to the output of the intent model and the inverted index in the database, recall the document fragments related to the user's query intent from a large number of documents; then use the dual retrieval model to retrieve the top-K results from the retrieved document fragments and fragment features. Based on the fragment content of the retrieved top-k retrieval results, construct a prompt instruction and input it into the domain large language model, and use the generation and summarization ability of the domain large prediction model to generate the reply content of the user's query result.
[0125] In the embodiment as Figure 1 shown, this method can be executed by a document processing device as Figure 3 shown. Please refer to Figure 3 , the document processing device 300 includes:
[0126] The first acquisition module 301 is used to acquire the query intent of the query text input by the user;
[0127] The retrieval module 302 is used to retrieve the target text according to the query intent to obtain a retrieval result;
[0128] The first processing module 303 is used to process the retrieval result by using a large language model to obtain the reply text of the query text;
[0129] Wherein, the target text includes the embedded vector and inverted index of the preset document.
[0130] Optionally, the device 300 further includes:
[0131] The second acquisition module is used to acquire the preset document before acquiring the query intent of the query text input by the user;
[0132] The parsing module is used to parse the preset document to obtain structured text;
[0133] The second processing module is used to perform vectorization processing and index construction processing on the structured text to obtain the target text.
[0134] Optionally, the parsing module includes:
[0135] A first conversion sub-module for converting the format of the target text to obtain a first text;
[0136] A first recognition sub-module for recognizing the first text using an optical character recognition model to obtain first text information;
[0137] A second recognition sub-module for recognizing the first text using a table recognition model to obtain first table information;
[0138] A first generation sub-module for generating the structured text based on the first text information and the first table information.
[0139] Optionally, the second processing module includes:
[0140] A second conversion sub-module for converting the structured text into a second text in a preset format;
[0141] A slicing sub-module for slicing the second text to obtain a sliced third text;
[0142] A feature extraction sub-module for extracting features from the third text to generate feature information;
[0143] A vectorization processing sub-module for performing vectorization processing on the feature information to generate an embedded vector of the feature information;
[0144] An index construction sub-module for constructing an index of the feature information and the embedded vector to obtain an inverted index;
[0145] The target text is obtained based on the embedded vector and the inverted index.
[0146] Optionally, the retrieval module 302 includes:
[0147] A recall processing sub-module for performing recall processing on the target text according to the query intent to obtain a fourth text;
[0148] A retrieval sub-module for retrieving the fourth text to obtain a retrieval result.
[0149] Optionally, the first processing module 303 includes:
[0150] A construction sub-module for constructing a prompt instruction according to the retrieval result;
[0151] A processing sub-module for inputting the prompt instruction into a large language model for processing to obtain a response text to the query text;
[0152] Among them, the prompt instruction is used to instruct the large language model to generate a response text for the retrieval result.
[0153] Optionally, the first acquisition module 301 includes:
[0154] An acquisition sub-module, configured to acquire a query text input by a user;
[0155] An identification sub-module, configured to identify the query text by using an intent recognition model to obtain the user's query intent.
[0156] The document processing apparatus 300 provided by the embodiments of the present application can execute the above method embodiments, and its implementation principle and technical effects are similar, which will not be elaborated herein.
[0157] It should be noted that the division of units in the embodiments of the present application is illustrative, only a logical function division, and there may be other division methods in actual implementation. In addition, in each embodiment of the present application, each functional unit may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of a software functional unit.
[0158] If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a processor-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc that can store program codes.
[0159] As Figure 4 shown, the embodiments of the present application provide an electronic device, including: a memory 402, a processor 401, and a program stored on the memory 402 and executable on the processor 401; the processor 401 is configured to read the program in the memory 402 to implement the steps in the document processing method as described above.
[0160] The embodiments of the present application also provide a readable storage medium. A program is stored on the readable storage medium. When the program is executed by a processor, it implements each process of the above-mentioned embodiment of the document processing method and can achieve the same technical effects. To avoid repetition, it will not be elaborated here. Among them, the readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic memories (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical memories (such as compact disks (CD), digital versatile discs (DVD), Blu-ray discs (BD), high-definition versatile discs (HVD), etc.), and semiconductor memories (such as read-only memories (ROM), erasable programmable read-only memories (EPROM), electrically erasable programmable read-only memories (EEPROM), non-volatile memories (NAND FLASH), solid-state disks (SSD)).
[0161] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or device including the element.
[0162] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, disk, optical disc), and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0163] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific implementation manners. The above specific implementation manners are merely illustrative rather than restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.
Claims
1. A document processing method, characterized in that, The method includes: Obtaining the query intention of the query text input by the user; Retrieving the target text according to the query intention to obtain a retrieval result; Using a large language model to process the retrieval result to obtain a response text for the query text; Wherein, the target text includes the embedded vectors and inverted index of the preset document.
2. The document processing method according to claim 1, wherein Before obtaining the query intention of the query text input by the user, the method further includes: Obtaining the preset document; Parsing the preset document to obtain a structured text; Performing vectorization processing and index construction processing on the structured text to obtain the target text.
3. The document processing method according to claim 2, wherein The parsing the preset document to obtain a structured text includes: Converting the format of the target text to obtain a first text; Using an optical character recognition model to recognize the first text to obtain first text information; Using a table recognition model to recognize the first text to obtain first table information; Generating the structured text based on the first text information and the first table information.
4. The document processing method according to claim 2 or 3, characterized in that, The performing vectorization processing and index construction processing on the structured text to obtain the target text includes: Converting the structured text into a second text in a preset format; Slicing the second text to obtain a third text after slicing; Extracting features from the third text to generate feature information; Performing vectorization processing on the feature information to generate the embedded vector of the feature information; Constructing an index of the feature information and the embedded vector to obtain an inverted index; Obtaining the target text based on the embedded vector and the inverted index.
5. The document processing method according to claim 1, wherein The retrieving the target text according to the query intention to obtain a retrieval result includes: Performing a recall process on the target text according to the query intention to obtain a fourth text; Retrieving the fourth text to obtain a retrieval result.
6. The document processing method according to claim 1, wherein The using a large language model to process the retrieval result to obtain a response text for the query text includes: Constructing a prompt instruction according to the retrieval result; Inputting the prompt instruction into the large language model for processing to obtain a response text for the query text; Wherein, the prompt instruction is used to instruct the large language model to generate a response text for the retrieval result.
7. The document processing method according to claim 1, wherein The obtaining the query intention in the query text input by the user includes: Obtaining the query text input by the user; Using an intention recognition model to recognize the query text to obtain the query intention of the user.
8. A document processing apparatus, characterized in that, The device includes: A first obtaining module, configured to obtain the query intention of the query text input by the user; A retrieval module, configured to retrieve the target text according to the query intention to obtain a retrieval result; A first processing module, configured to use a large language model to process the retrieval result to obtain a response text for the query text; Wherein, the target text includes the embedded vectors and inverted index of the preset document.
9. An electronic device, comprising: A memory, a processor, and a program stored on the memory and executable on the processor; characterized in that The processor is configured to read the program in the memory to implement the steps in the method according to any one of claims 1 to 7.
10. A readable storage medium for storing a program, characterized in that, When the described program is executed by a processor, it implements the steps in the method according to any one of claims 1 to 7.