A method and device for retrieving question and answer content
By matching the vector values of question text and background text in the open platform, filtering background text with high similarity, and generating responses using a language model, the problem of the open platform's inability to obtain internal information is solved, achieving efficient and targeted question-and-answer content feedback.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QI AN XIN TECHNOLOGY GROUP INC
- Filing Date
- 2023-06-08
- Publication Date
- 2026-07-10
AI Technical Summary
In existing technologies, open platforms cannot access users' internal, unpublished information, resulting in poor relevance and efficiency of Q&A content.
By matching the second vector value of the question text information with the first vector value of the preset background text information, target background text information whose similarity meets the threshold is selected, and response information is generated using a preset language model. Combined with identity information, the relevance of the response is improved.
It improves the relevance and efficiency of Q&A feedback, and reduces usage costs.
Smart Images

Figure CN116881411B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, specifically to a method and apparatus for optimizing question-and-answer content retrieval. Additionally, it relates to an electronic device and a processor-readable storage medium. Background Technology
[0002] Currently, open platforms typically rely on fixed question-and-answer databases. They perform a hit calculation to match questions during retrieval and return answers to provide feedback. However, in practical applications, there is often some internal, non-public information that open platforms cannot obtain in advance. After a user enters a question, obtaining answers related to this non-public information is cumbersome, and answers can only be based on pre-trained content, resulting in poor relevance and efficiency in the responses. Summary of the Invention
[0003] To address this issue, the present invention provides a method and apparatus for optimizing the retrieval of question-and-answer content, thereby resolving the shortcomings of existing question-and-answer content retrieval optimization schemes, which generate responses with poor targeting.
[0004] In a first aspect, the present invention provides a method for optimizing the retrieval of question-and-answer content, comprising:
[0005] Obtain the second vector value of the input question text information;
[0006] Based on the second vector value and the first vector value corresponding to the preset background text information, the background text information corresponding to the first vector that is successfully matched is taken as the target background text information.
[0007] Based on the target background text information and the question text information, and by invoking a preset language model, a response is generated; wherein, the preset language model is used to generate a response to the question text information based on the target background text information.
[0008] Furthermore, the step of matching the second vector value with the first vector value corresponding to the preset background text information, and using the background text information corresponding to the successfully matched first vector as the target background text information, specifically includes:
[0009] Using the second vector value as an index, it is matched with the first vector value corresponding to the background text information stored in the preset index database to find the target first vector value whose similarity with the index meets the preset similarity threshold, and the background text information corresponding to the target first vector value is determined as the target background text information;
[0010] The index database is constructed by pre-acquiring the first vector value of the background text information and the background text information.
[0011] Furthermore, obtaining the first vector value of the background text information specifically includes: obtaining the background text information, segmenting the background text information based on a preset number of characters, and obtaining a corresponding first text data block; wherein, the number of characters is less than the number of retrieval characters input by the language model;
[0012] The first text data block is transformed into the corresponding first vector value based on the Embeddings embedding model.
[0013] Furthermore, obtaining the background text information specifically includes:
[0014] Obtain raw text information in various formats;
[0015] The original text information is format-converted to obtain standard text information in the target format, and the standard text information in the target format is determined as the background text information.
[0016] Furthermore, the second vector value of the input question text information is obtained, specifically including:
[0017] The input question text information is obtained, and the question text information is segmented based on a preset number of characters to obtain corresponding second text data blocks; wherein, the number of characters is less than the number of search characters input by the language model;
[0018] The second text data block is transformed into the corresponding second vector value based on the Embeddings embedding model.
[0019] Furthermore, before generating response information based on the target background text information and the question text information, and by invoking a preset language model, the method further includes: in response to an input identity selection request, determining the corresponding identity information from a predefined identity information list;
[0020] The step of generating response information based on the target background text information and the question text information, and by invoking a preset language model, specifically includes:
[0021] Based on the target background text information, the question text information, and the identity information, a preset language model is invoked to generate response information that matches the identity information; wherein, the identity information is used to determine the role corresponding to the language model when generating the response information.
[0022] Furthermore, the step of matching the second vector value with the first vector value corresponding to the preset background text information, and using the background text information corresponding to the successfully matched first vector as the target background text information, specifically includes:
[0023] Similarity calculation is performed based on the second vector value and the first vector value corresponding to the background text information to obtain multiple similarity values between the second vector value and the first vector value, and a preset number of background text information is selected as target background text information according to the size relationship of the similarity values.
[0024] Secondly, the present invention also provides a retrieval optimization device for question-and-answer content, comprising:
[0025] The second vector value acquisition unit is used to obtain the second vector value of the input question text information;
[0026] The target background text information acquisition unit is used to match the second vector value with the first vector value corresponding to the preset background text information, and take the background text information corresponding to the first vector that is successfully matched as the target background text information.
[0027] The question-and-answer content retrieval optimization unit is used to generate response information based on the target background text information and the question text information, and by calling a preset language model; wherein, the preset language model is used to generate response information that answers the question text information based on the target background text information.
[0028] Furthermore, the target background text information obtaining unit is specifically used for:
[0029] Using the second vector value as an index, it is matched with the first vector value corresponding to the background text information stored in the preset index database to find the target first vector value whose similarity with the index meets the preset similarity threshold, and the background text information corresponding to the target first vector value is determined as the target background text information;
[0030] The index database is constructed by pre-acquiring the first vector value of the background text information and the background text information.
[0031] Furthermore, obtaining the first vector value of the background text information specifically includes: obtaining the background text information, segmenting the background text information based on a preset number of characters, and obtaining a corresponding first text data block; wherein, the number of characters is less than the number of retrieval characters input by the language model;
[0032] The first text data block is transformed into the corresponding first vector value based on the Embeddings embedding model.
[0033] Furthermore, obtaining the background text information specifically includes:
[0034] Obtain raw text information in various formats;
[0035] The original text information is format-converted to obtain standard text information in the target format, and the standard text information in the target format is determined as the background text information.
[0036] Furthermore, the second vector value obtaining unit is specifically used for:
[0037] The input question text information is obtained, and the question text information is segmented based on a preset number of characters to obtain corresponding second text data blocks; wherein, the number of characters is less than the number of search characters input by the language model;
[0038] The second text data block is transformed into the corresponding second vector value based on the Embeddings embedding model.
[0039] Furthermore, before generating response information based on the target background text information and the question text information, and by invoking a preset language model, the system further includes: an identity information confirmation unit, used to determine the corresponding identity information from a predefined identity information list in response to an input identity selection request;
[0040] The question-and-answer content retrieval optimization unit is specifically used for:
[0041] Based on the target background text information, the question text information, and the identity information, a preset language model is invoked to generate response information that matches the identity information; wherein, the identity information is used to determine the role corresponding to the language model when generating the response information.
[0042] Furthermore, the target background text information obtaining unit is specifically used for:
[0043] Similarity calculation is performed based on the second vector value and the first vector value corresponding to the background text information to obtain multiple similarity values between the second vector value and the first vector value, and a preset number of background text information is selected as target background text information according to the size relationship of the similarity values.
[0044] Thirdly, the present invention also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the question-and-answer content retrieval optimization method as described in any of the preceding claims.
[0045] Fourthly, the present invention also provides a processor-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the question-and-answer content retrieval optimization method as described in any of the preceding claims.
[0046] The question-and-answer content retrieval optimization method provided by this invention obtains a second vector value of the input question text information, matches the second vector value with a first vector value corresponding to preset background text information, uses the background text information corresponding to the successfully matched first vector as the target background text information, and generates response information based on the target background text information and the question text information, and by calling a preset language model. This invention, by associating background text information and question text information, can effectively improve the relevance and efficiency of question content feedback, and significantly reduce usage costs. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 This is a flowchart illustrating the question-and-answer content retrieval optimization method provided in an embodiment of the present invention;
[0049] Figure 2 This is a schematic diagram of the structure of the question-and-answer content retrieval optimization device provided in an embodiment of the present invention;
[0050] Figure 3 This is a schematic diagram of the physical structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0052] It should be noted that the terms "first," "second," etc., in the specification and accompanying drawings of this application are used to distinguish similar users and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0053] In recent years, with the rapid development of artificial intelligence technology, there has been an increasing number of natural language processing tools driven by artificial intelligence technology, such as open platforms like ChatGPT (Chat Generative Pre-trained Transformer), which can typically engage in dialogue by understanding and learning human language and can also interact and communicate based on context.
[0054] The following describes in detail embodiments of the question-and-answer content retrieval optimization method based on the present invention. Figure 1 The diagram shown is a flowchart illustrating the question-and-answer content retrieval optimization method provided in an embodiment of the present invention. The specific process includes the following steps:
[0055] Step 101: Obtain the second vector value of the input question text information.
[0056] In this specific implementation step, the input question text information is acquired, and the question text information is segmented based on a preset number of characters to obtain corresponding second text data blocks; wherein, the number of characters is less than the number of search characters input by the language model; the second vector value corresponding to each of the second text data blocks is determined. Specifically, the number of characters can also be set according to actual needs, such as 20 or 30 characters. Based on this number of characters, the question text information is segmented using a preset word segmenter to obtain corresponding second text data blocks, i.e., trunks. The language model can refer to ChatGPT, etc., without specific limitation here. Further, a preset Embeddings model or the Embeddings function of ChatGPT can be used to convert the segmented second text data blocks into second vector values corresponding to each block, so as to match the first vector value with the local index database based on the second vector value.
[0057] In this embodiment of the invention, before performing this step, it is necessary to acquire raw text information in various formats in advance, then convert the raw text information to obtain standard text information in a unified target format (such as txt format), determine the standard text information in the target format as the background text information, acquire the first vector value of the background text information, and store the first vector value and the corresponding background text information in an index database. For example, raw text information in formats such as pdf and markdown is collected, and a preset format converter is used to uniformly convert the raw text information into txt format for subsequent processing.
[0058] Furthermore, after obtaining the background text information, it can be segmented based on a preset number of characters to obtain corresponding first text data blocks; wherein, the number of characters is less than the number of search characters input by the language model; and the first vector value corresponding to each of the first text data blocks is determined. Specifically, the number of characters can be set according to actual needs, such as 20 or 30 characters. This number of characters needs to be less than the number of search characters allowed by the language model. Based on this number of characters, the background text information is segmented using a preset word segmenter to obtain corresponding first text data blocks (trunks). The language model can refer to ChatGPT or a model with similar natural language analysis, organization, and processing capabilities, etc., without specific limitations here. Furthermore, a preset Embeddings model or ChatGPT's Embeddings function can be used to convert the segmented first text data blocks into first vector values (vectors) corresponding to each block, so as to write the first vector values and metadata into the local index database. Herein, the metadata is the background text information corresponding to the first vector value. The background text information can be text information related to the question text information that is not yet publicly available within the user's system. For example, a user asks a question about text A and hopes that the language model can provide an answer based on the publicly available content of text A; that is, the language model needs to provide an answer based on text A, and this answer needs to be related to the content of text A. Text A can refer to a book text or a news text, etc.
[0059] Step 102: Match the second vector value with the first vector value corresponding to the preset background text information, and take the background text information corresponding to the first vector that is successfully matched as the target background text information.
[0060] In this embodiment of the invention, using the second vector value as an index, a target first vector value whose similarity to the index meets a preset similarity threshold is found in the index database, and the background text information corresponding to the target first vector value is determined as the target background text information. Specifically, the target first vector value is a vector value whose similarity to the first vector value stored in the index database meets the preset similarity threshold, obtained by matching the second vector value. The target background text information refers to the background text information obtained from the background text information that corresponds to the target first vector value.
[0061] Step 103: Based on the target background text information and the question text information, and by calling a preset language model, generate response information; wherein, the preset language model is used to generate response information that answers the question text information based on the target background text information.
[0062] In this step, the target background text information, the question text information, and the predefined identity information can be packaged into a question data package. This question data package contains the target background text information, the question text information, and the predefined identity information, enabling the language model to generate response information suitable for the identity information based on the target background text information and identity information in the question data package. This replaces the original question-and-answer retrieval method, improving efficiency and relevance. The language model can refer to ChatGPT, etc., without specific limitations. It should be noted that the target background text information is the top few text pieces with the highest similarity to the question text information, i.e., the first few character segments, such as 200 or 300 characters. It should also be noted that before calling the preset language model based on the target background text information, the question text information, and the predefined identity information, a preset identity information list can be obtained in advance. This identity information list contains multiple identity information. In response to the user's input of an identity information selection request, the predefined identity information is retrieved from the identity information list to obtain response information matching the permission scope of the identity information. For example, the input question data package includes the message "Play the role of a composer, and generate a song based on the provided A-section material." Here, "composer" refers to the identity information; "A-section material" refers to the target background text information; and "generate a song" refers to the question text.
[0063] During implementation, by combining a local index database with ChatGPT's AI capabilities, accurate answers can be provided. Specifically, the user-input question text is segmented into blocks using a word segmenter. Embeddings technology is then used to convert the segmented trunks into vector values, obtaining a second vector value. This second vector value is substituted into the first vector value corresponding to the background text information in the local index database for relevance calculation. This yields a batch of background text information sorted from high to low similarity. The top three background texts with the highest similarity can be selected as target background text information, or they can be compared with a preset similarity threshold. Background text information with a similarity value greater than or equal to the threshold can be selected as target background text information. After determining the target background text information, the user-input question text is wrapped around the target background text information. The ChatGPT API is then called to obtain the response based on ChatGPT's return, and the response information is returned to the user.
[0064] The question-and-answer content retrieval optimization method described in this invention obtains a second vector value of the input question text information, matches the second vector value with a first vector value corresponding to preset background text information, uses the background text information corresponding to the successfully matched first vector as the target background text information, and generates response information based on the target background text information and the question text information, and by invoking a preset language model. This invention, by associating background text information and question text information, effectively improves the relevance and efficiency of question content feedback, and significantly reduces usage costs.
[0065] Corresponding to the question-and-answer content retrieval optimization method provided above, this invention also provides a question-and-answer content retrieval optimization device. Since the embodiments of this device are similar to the above method embodiments, the description is relatively simple. For relevant details, please refer to the description in the above method embodiment section. The embodiments of the question-and-answer content retrieval optimization device described below are merely illustrative. Please refer to... Figure 2 As shown, it is a structural schematic diagram of a question-and-answer content retrieval optimization device provided in an embodiment of the present invention.
[0066] The question-and-answer content retrieval optimization device of the present invention specifically includes the following parts:
[0067] The second vector value acquisition unit 201 is used to obtain the second vector value of the input question text information;
[0068] The target background text information acquisition unit 202 is used to match the second vector value with the first vector value corresponding to the preset background text information, and take the background text information corresponding to the successfully matched first vector as the target background text information.
[0069] The question-and-answer content retrieval optimization unit 203 is used to generate response information based on the target background text information and the question text information, and by calling a preset language model; wherein, the preset language model is used to generate response information that answers the question text information based on the target background text information.
[0070] Furthermore, the target background text information obtaining unit is specifically used for:
[0071] Using the second vector value as an index, it is matched with the first vector value corresponding to the background text information stored in the preset index database to find the target first vector value whose similarity with the index meets the preset similarity threshold, and the background text information corresponding to the target first vector value is determined as the target background text information;
[0072] The index database is constructed by pre-acquiring the first vector value of the background text information and the background text information.
[0073] Furthermore, obtaining the first vector value of the background text information specifically includes: obtaining the background text information, segmenting the background text information based on a preset number of characters, and obtaining a corresponding first text data block; wherein, the number of characters is less than the number of retrieval characters input by the language model;
[0074] The first text data block is transformed into the corresponding first vector value based on the Embeddings embedding model.
[0075] Furthermore, obtaining the background text information specifically includes:
[0076] Obtain raw text information in various formats;
[0077] The original text information is format-converted to obtain standard text information in the target format, and the standard text information in the target format is determined as the background text information.
[0078] Furthermore, the second vector value obtaining unit is specifically used for:
[0079] The input question text information is obtained, and the question text information is segmented based on a preset number of characters to obtain corresponding second text data blocks; wherein, the number of characters is less than the number of search characters input by the language model;
[0080] The second text data block is transformed into the corresponding second vector value based on the Embeddings embedding model.
[0081] Furthermore, before generating response information based on the target background text information and the question text information, and by invoking a preset language model, the system further includes: an identity information confirmation unit, used to determine the corresponding identity information from a predefined identity information list in response to an input identity selection request;
[0082] The question-and-answer content retrieval optimization unit is specifically used for:
[0083] Based on the target background text information, the question text information, and the identity information, a preset language model is invoked to generate response information that matches the identity information; wherein, the identity information is used to determine the role corresponding to the language model when generating the response information.
[0084] Furthermore, the target background text information obtaining unit is specifically used for:
[0085] Similarity calculation is performed based on the second vector value and the first vector value corresponding to the background text information to obtain multiple similarity values between the second vector value and the first vector value, and a preset number of background text information is selected as target background text information according to the size relationship of the similarity values.
[0086] The question-and-answer content retrieval optimization device described in this embodiment of the invention obtains a second vector value of the input question text information, matches the second vector value with a first vector value corresponding to preset background text information, uses the background text information corresponding to the successfully matched first vector as the target background text information, and generates response information based on the target background text information and the question text information, and by invoking a preset language model. This invention, by associating background text information and question text information, can effectively improve the relevance and efficiency of question content feedback, and significantly reduce usage costs.
[0087] Corresponding to the question-and-answer content retrieval optimization method provided above, this invention also provides an electronic device. Since the embodiment of this electronic device is similar to the method embodiment described above, it is described simply. For relevant details, please refer to the description in the method embodiment section above. The electronic device described below is merely illustrative. Figure 3The diagram shows a physical structure of an electronic device disclosed in an embodiment of the present invention. The electronic device may include a processor 301, a memory 302, and a communication bus 303. The processor 301 and the memory 302 communicate with each other via the communication bus 303 and communicate with external systems via a communication interface 304. The processor 301 can call logical instructions in the memory 302 to execute a question-and-answer content retrieval optimization method. This method includes: obtaining a second vector value of the input question text information; matching the second vector value with a first vector value corresponding to preset background text information, and using the background text information corresponding to the successfully matched first vector as the target background text information; generating response information based on the target background text information and the question text information, and by calling a preset language model; wherein the preset language model is used to generate response information that answers the question text information based on the target background text information.
[0088] Furthermore, the logical instructions in the aforementioned memory 302 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as memory chips, USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0089] On the other hand, embodiments of the present invention also provide a computer program product, the computer program product including a computer program stored on a processor-readable storage medium, the computer program including program instructions, and when the program instructions are executed by a computer, the computer is able to execute the question-and-answer content retrieval optimization method provided in the above-described method embodiments. This method includes: obtaining a second vector value of input question text information; matching the second vector value with a first vector value corresponding to preset background text information, and using the background text information corresponding to the successfully matched first vector as target background text information; generating response information based on the target background text information and the question text information, and by invoking a preset language model; wherein the preset language model is used to generate response information that answers the question text information based on the target background text information.
[0090] In another aspect, embodiments of the present invention also provide a processor-readable storage medium storing a computer program, which, when executed by a processor, implements the question-and-answer content retrieval optimization method provided in the above embodiments. The method includes: obtaining a second vector value of input question text information; matching the second vector value with a first vector value corresponding to preset background text information, and using the background text information corresponding to the successfully matched first vector as target background text information; generating response information based on the target background text information and the question text information, and by invoking a preset language model; wherein the preset language model is used to generate response information that answers the question text information based on the target background text information.
[0091] The processor-readable storage medium can be any available medium or data storage device that the processor can access, including but not limited to magnetic memory (e.g., floppy disk, hard disk, magnetic tape, magneto-optical disk (MO)), optical memory (e.g., CD, DVD, BD, HVD), and semiconductor memory (e.g., ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)).
[0092] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0093] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, 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 can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for optimizing the retrieval of question-and-answer content, characterized in that, include: Obtain the second vector value of the input question text information; Based on the second vector value and the first vector value corresponding to the preset background text information, the background text information corresponding to the first vector that is successfully matched is taken as the target background text information. Based on the target background text information and the question text information, and by invoking a preset language model, a response is generated; wherein, the preset language model is used to generate a response to the question text information based on the target background text information. Before obtaining the second vector value of the input question text information, the method further includes: The process involves acquiring raw text information in various formats, converting the raw text information to obtain standard text information in a unified target format, and defining the standard text information in the target format as the background text information; acquiring the first vector value corresponding to the background text information, and storing the first vector value and the background text information corresponding to the first vector value in an index database.
2. The method for optimizing the retrieval of question-and-answer content according to claim 1, characterized in that, The step of matching the second vector value with the first vector value corresponding to the preset background text information, and using the background text information corresponding to the successfully matched first vector as the target background text information, specifically includes: Using the second vector value as an index, it is matched with the first vector value corresponding to the background text information stored in the preset index database to find the target first vector value whose similarity with the index meets the preset similarity threshold, and the background text information corresponding to the target first vector value is determined as the target background text information; The index database is constructed by pre-acquiring the first vector value of the background text information and the background text information.
3. The method for optimizing the retrieval of question-and-answer content according to claim 2, characterized in that, The process of obtaining the first vector value of the background text information specifically includes: The background text information is obtained, and the background text information is segmented based on a preset number of characters to obtain a corresponding first text data block; wherein, the number of characters is less than the number of search characters input by the language model; The first text data block is transformed into the corresponding first vector value based on the Embeddings embedding model.
4. The method for optimizing the retrieval of question-and-answer content according to claim 3, characterized in that, The acquisition of the background text information specifically includes: Obtain raw text information in various formats; The original text information is format-converted to obtain standard text information in the target format, and the standard text information in the target format is determined as the background text information.
5. The method for optimizing the retrieval of question-and-answer content according to claim 1, characterized in that, Obtain the second vector value of the input question text information, specifically including: The input question text information is obtained, and the question text information is segmented based on a preset number of characters to obtain corresponding second text data blocks; wherein, the number of characters is less than the number of search characters input by the language model; The second text data block is transformed into the corresponding second vector value based on the Embeddings embedding model.
6. The method for optimizing the retrieval of question-and-answer content according to claim 1, characterized in that, Before generating response information based on the target background text information and the question text information, and by invoking a preset language model, the method further includes: in response to an input identity selection request, determining the corresponding identity information from a predefined identity information list; The step of generating response information based on the target background text information and the question text information, and by invoking a preset language model, specifically includes: Based on the target background text information, the question text information, and the identity information, a preset language model is invoked to generate response information that matches the identity information; wherein, the identity information is used to determine the role corresponding to the language model when generating the response information.
7. The method for optimizing the retrieval of question-and-answer content according to claim 1, characterized in that, The step of matching the second vector value with the first vector value corresponding to the preset background text information, and using the background text information corresponding to the successfully matched first vector as the target background text information, specifically includes: Similarity calculation is performed based on the second vector value and the first vector value corresponding to the background text information to obtain multiple similarity values between the second vector value and the first vector value, and a preset number of background text information is selected as target background text information according to the size relationship of the similarity values.
8. A retrieval optimization device for question-and-answer content, characterized in that, include: The second vector value acquisition unit is used to obtain the second vector value of the input question text information; The target background text information acquisition unit is used to match the second vector value with the first vector value corresponding to the preset background text information, and take the background text information corresponding to the first vector that is successfully matched as the target background text information. The question-and-answer content retrieval optimization unit is used to generate response information based on the target background text information and the question text information, and by calling a preset language model; wherein, the preset language model is used to generate response information that answers the question text information based on the target background text information. The question-and-answer content retrieval optimization device is used to: acquire raw text information in various formats, convert the raw text information to obtain standard text information in a unified target format, determine the standard text information in the target format as the background text information; acquire a first vector value corresponding to the background text information, and store the first vector value and the background text information corresponding to the first vector value in an index database.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the question-and-answer content retrieval optimization method as described in any one of claims 1 to 7.
10. A processor-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the question-and-answer content retrieval optimization method as described in any one of claims 1 to 7.