Information processing method and device, computer equipment, readable storage medium and program product
By processing candidate entries collection based on similarity and target word filtering in big model technology, the problem of low accuracy of answer information is solved, and a higher degree of correlation and accuracy is achieved, and the user experience is improved.
Patent Information
- Application Number
- CN202411060188.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-11-15
AI Technical Summary
In existing large-scale model technology, when information retrieval and generation model are combined, the accuracy of the answer information is low, mainly due to the single evaluation method, the correlation between the generated answer information and the question is not high.
By filtering the similarity between the question information and the target knowledge vector library and the target word, a set of candidate entries is obtained, and these candidate entries are processed in combination with the preset answer information generation model to improve the accuracy and correlation of the answer information. The specific steps include: filtering the first candidate entry set based on the similarity algorithm, filtering the second candidate entry set based on the target word, optimizing the similarity sorting of candidate entry through the reordering model, and using the answer scope template information to define the field of the answer .
Without increasing the matching time, improve the accuracy and efficiency of candidate entries matching, improve the quality of answer information, and enhance user experience.
Smart Images

Figure CN118964571A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of large model technology, and in particular to an information processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the rapid development of technology in the field of big models, a technology that combines information retrieval and generation models has emerged. Specifically, it retrieves a large amount of information, generally multiple candidate article paragraphs determined in the knowledge base according to the semantic similarity between the question information, to obtain answer information. The evaluation method is relatively simple, resulting in low accuracy of the generated answer information. Summary of the invention
[0003] Based on this, it is necessary to provide an information processing method, device, computer equipment, computer-readable storage medium and computer program product that can improve the correlation between the generated answer information and the question and improve the accuracy of the answer information in response to the above technical problems.
[0004] In a first aspect, the present application provides an information processing method, comprising:
[0005] Based on the similarities between the question information and multiple terms in the target knowledge vector library, a first candidate term set is obtained;
[0006] Among the multiple entries included in the target knowledge vector library, screening is performed based on the target word included in the question information to obtain a second set of candidate entries;
[0007] The first candidate term set and the second candidate term set are processed by a preset answer information generation model to obtain target answer information corresponding to the question information.
[0008] In this embodiment, a first set of candidate terms can be obtained through similarity screening and a second set of candidate terms can be obtained through target word screening. By combining the first set of candidate terms and the second set of candidate terms with the answer information generation model to obtain answer information, the accuracy and efficiency of candidate term matching can be improved without adding additional matching time. By processing more accurate candidate terms through a large model, the quality of the obtained answer information can be further improved.
[0009] In one embodiment, the method further comprises:
[0010] Based on the document structure detection model, the page data is identified to obtain each document structure of the page data, and based on each document structure, the entry corresponding to the page data is obtained;
[0011] Based on the local target word database, the target word information in each of the entries is counted, and each of the entries is encoded through a feature extraction model to obtain an entry feature vector, wherein the target word information includes the target word type in the entry and the number of target words of each target word type;
[0012] Based on the target word information of each entry and the entry feature vector of each entry, a target knowledge vector library is obtained.
[0013] In this embodiment, segmentation based on the obtained document structure can improve the completeness of information retention, effectively improve the ability to parse structured information, and improve the ability to extract structured information of data knowledge, thereby expanding the scope of application.
[0014] In one embodiment, the obtaining of the first candidate entry set based on the similarity between the question information and a plurality of entries in the target knowledge vector library comprises:
[0015] Encode the problem information through the feature extraction model to obtain the problem feature vector;
[0016] Based on a first similarity algorithm, calculating first similarities between the question feature vector and each term in the target knowledge vector library;
[0017] Screening is performed based on each of the first similarities to obtain a first set of candidate terms.
[0018] In this embodiment, each term is screened by calculating the cosine similarity between each term and the question feature vector, thereby improving the degree of association between each candidate term included in the candidate term set and the question information.
[0019] In one embodiment, the first candidate term set and the second candidate term set are processed by a preset answer information generation model to obtain target answer information corresponding to the question information, including:
[0020] Determining a target candidate term set based on the first candidate term set and the second candidate term set;
[0021] The target candidate entry set is processed by a preset answer information generation model to obtain target answer information corresponding to the question information.
[0022] In this embodiment, by further screening the first candidate term set and the second candidate term set, the correlation between the information input into the large language model and the question information can be further improved, and the influence of the relevant candidate terms on the large language model can be reduced.
[0023] In one embodiment, determining a target candidate term set based on the first candidate term set and the second candidate term set includes:
[0024] By using the re-ranking model, second similarities between the question information and each term in the first candidate term set and each term in the second candidate term set are calculated respectively;
[0025] Re-screening is performed based on each of the second similarities to obtain a target candidate term set.
[0026] In this embodiment, the similarities between each first candidate term and the second candidate term and the question information are recalculated and sorted through the re-ranking model, and a set of target candidate terms is obtained in descending order of similarity, which enriches the calculation dimension of the similarity. The accurately sorted set of target candidate terms is input into the large language model, which can further improve the quality of the output target answer information.
[0027] In one embodiment, the processing of the target candidate entry set by a preset answer information generation model to obtain target answer information corresponding to the question information includes:
[0028] Determine answer range template information based on the range of the question information;
[0029] The target candidate entry set and the answer range template information are input into a preset answer information generation model to obtain target answer information corresponding to the question information, and the target answer information matches the answer range template information.
[0030] In this embodiment, the answer information output by the large language model is further limited by the answer range template information to ensure the degree of match between the domain of the output target answer information and the domain of the question information, thereby further improving the experience of the user who inputs the question information.
[0031] In a second aspect, the present application further provides an information processing device, comprising:
[0032] A first determination module, configured to obtain a first candidate entry set based on similarities between the question information and a plurality of entries in the target knowledge vector library;
[0033] A second determination module is used to screen multiple entries included in the target knowledge vector library based on the target word included in the question information to obtain a second candidate entry set;
[0034] The answer information determination module is used to process the first candidate term set and the second candidate term set through a preset answer information generation model to obtain target answer information corresponding to the question information.
[0035] In one embodiment, the device further comprises:
[0036] An identification module, used to identify the page data based on the document structure detection model, obtain each document structure of the page data, and obtain the entry corresponding to the page data based on each document structure;
[0037] A statistical module, for counting target word information in each of the entries based on a local target word database, and encoding each of the entries through a feature extraction model to obtain an entry feature vector, wherein the target word information includes the target word type in the entry and the number of target words of each target word type;
[0038] The vector library determination module is used to obtain a target knowledge vector library based on the target word information of each entry and the entry feature vector of each entry.
[0039] In one embodiment, the first determining module is specifically configured to:
[0040] Encode the problem information through the feature extraction model to obtain the problem feature vector;
[0041] Based on a first similarity algorithm, calculating first similarities between the question feature vector and each term in the target knowledge vector library;
[0042] Screening is performed based on each of the first similarities to obtain a first set of candidate terms.
[0043] In one embodiment, the second determining module is specifically configured to:
[0044] Determining a target candidate term set based on the first candidate term set and the second candidate term set;
[0045] The target candidate entry set is processed by a preset answer information generation model to obtain target answer information corresponding to the question information.
[0046] In one embodiment, the answer information determination module is specifically used to:
[0047] By using the re-ranking model, second similarities between the question information and each term in the first candidate term set and each term in the second candidate term set are calculated respectively;
[0048] Re-screening is performed based on each of the second similarities to obtain a target candidate term set.
[0049] In one embodiment, the answer information determination module is specifically used to:
[0050] Determine answer range template information based on the range of the question information;
[0051] The target candidate entry set and the answer range template information are input into a preset answer information generation model to obtain target answer information corresponding to the question information, and the target answer information matches the answer range template information.
[0052] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0053] Based on the similarities between the question information and multiple terms in the target knowledge vector library, a first candidate term set is obtained;
[0054] Among the multiple entries included in the target knowledge vector library, screening is performed based on the target word included in the question information to obtain a second set of candidate entries;
[0055] The first candidate term set and the second candidate term set are processed by a preset answer information generation model to obtain target answer information corresponding to the question information.
[0056] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0057] Based on the similarities between the question information and multiple terms in the target knowledge vector library, a first candidate term set is obtained;
[0058] Among the multiple entries included in the target knowledge vector library, screening is performed based on the target word included in the question information to obtain a second set of candidate entries;
[0059] The first candidate term set and the second candidate term set are processed by a preset answer information generation model to obtain target answer information corresponding to the question information.
[0060] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0061] Based on the similarities between the question information and multiple terms in the target knowledge vector library, a first candidate term set is obtained;
[0062] Among the multiple entries included in the target knowledge vector library, screening is performed based on the target word included in the question information to obtain a second set of candidate entries;
[0063] The first candidate term set and the second candidate term set are processed by a preset answer information generation model to obtain target answer information corresponding to the question information.
[0064] The above-mentioned information processing method, device, computer equipment, computer-readable storage medium and computer program product, wherein the method includes: obtaining a first set of candidate terms based on the similarity between the question information and multiple terms in the target knowledge vector library; screening the multiple terms contained in the target knowledge vector library based on the target words contained in the question information to obtain a second set of candidate terms; processing the first set of candidate terms and the second set of candidate terms through a preset answer information generation model to obtain target answer information corresponding to the question information.
[0065] By adopting this method, the first candidate term set can be obtained through similarity screening and the second candidate term set can be obtained through target word screening. By combining the first candidate term set and the second candidate term set with the answer information generation model to obtain answer information, the accuracy and matching efficiency of the candidate terms can be improved without adding additional matching time. Based on the processing of more accurate candidate terms through a large model, the quality of the obtained answer information can be further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0067] Figure 1 is a flowchart of an information processing method in an embodiment;
[0068] Figure 2 A schematic diagram of a process for obtaining a target knowledge vector library in one embodiment;
[0069] Figure 3 A schematic diagram of a flow chart of a step of determining a first candidate entry set in one embodiment;
[0070] Figure 4 A flowchart of the step of generating target answer information in one embodiment;
[0071] Figure 5 A schematic diagram of a process for obtaining a target candidate entry set in one embodiment;
[0072] Figure 6A flowchart of steps for generating target answer information based on answer range template information in one embodiment;
[0073] Figure 7 A schematic diagram of a process for generating a semantic knowledge vector library with keyword statistical information in one embodiment;
[0074] Figure 8 is a flowchart of an information processing method in another embodiment;
[0075] Fig. 9 is a structural block diagram of an information processing device in one embodiment;
[0076] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0077] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0078] In an exemplary embodiment, Figure 1 As shown, an information processing method is provided, and the method is applied to a terminal as an example for explanation. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. The above-mentioned terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented with an independent server or a server cluster composed of multiple servers. In this embodiment, the information processing method includes the following steps:
[0079] Step 102: obtaining a first set of candidate terms based on the similarities between the question information and a plurality of terms in the target knowledge vector library.
[0080] Among them, the question information can be input by the user through the terminal device; the target knowledge vector library can be a database containing at least multiple target words, and the target words can be keywords, such as key words, etc.; the first candidate entry set can include multiple first candidate entries, and the first candidate entries can be determined based on the cosine similarity between the question information and each entry in the target knowledge vector library.
[0081] Specifically, the terminal can receive question information input by the user device, and based on the question information, calculate the similarity between each entry contained in the target knowledge vector library, and based on the similarity of each entry, filter each entry contained in the target knowledge vector library to obtain multiple first candidate entries that meet the filtering conditions, that is, obtain a first candidate entry set.
[0082] Step 104 , screening multiple entries included in the target knowledge vector library based on the target word included in the question information to obtain a second set of candidate entries.
[0083] The target word may be a keyword, and the target word included in the question information may be a keyword included in the question information, for example, it may be determined by performing keyword detection on the question information through a preset keyword detection algorithm and a local keyword database.
[0084] Specifically, the terminal can determine multiple keywords included in the local keyword database, and perform keyword detection on the question information through a preset keyword detection algorithm and multiple keywords included in the local keyword database to determine the keywords in the local keyword database included in the question information. Based on this, the terminal can screen multiple entries included in the target knowledge vector library based on the keywords included in the question information, remove entries that do not contain keywords, retain entries that contain keywords, and obtain a second candidate entry set.
[0085] Step 106: Process the first candidate term set and the second candidate term set using a preset answer information generation model to obtain target answer information corresponding to the question information.
[0086] Among them, the preset answer information generation model can be an LLM model, that is, a large language model, which is used to generate answer information; the first candidate term set can include multiple first candidate terms, and the second candidate term set can include multiple second candidate terms; the target answer information corresponding to the question information can be the answer information output by the information processing method to the user device.
[0087] Specifically, the terminal can filter the first candidate term set and the second candidate term set to obtain filtering results, and process the filtering results through a preset answer information generation model to obtain target answer information matching the question information, that is, target answer information used to answer the question information input by the user device.
[0088] In the above information processing method, a first set of candidate terms is obtained based on the similarity between the question information and multiple terms in the target knowledge vector library; among the multiple terms contained in the target knowledge vector library, a second set of candidate terms is obtained based on the target words contained in the question information; the first set of candidate terms and the second set of candidate terms are processed through a preset answer information generation model to obtain the target answer information corresponding to the question information.
[0089] By adopting this method, the first candidate term set can be obtained through similarity screening and the second candidate term set can be obtained through target word screening. By combining the first candidate term set and the second candidate term set with the answer information generation model to obtain answer information, the accuracy and matching efficiency of the candidate terms can be improved without adding additional matching time. Based on the processing of more accurate candidate terms through a large model, the quality of the obtained answer information can be further improved.
[0090] In an exemplary embodiment, Figure 2 As shown, the information processing method also includes:
[0091] Step 202 , based on the document structure detection model, the page data is identified to obtain each document structure of the page data, and based on each document structure, the entries corresponding to the page data are obtained.
[0092] The document structure detection model may be a document structure detection model based on YOLOv8, and the page data may include at least data of the pdf type or data of the ppt or ppt.x type. The document structure may include a text structure, which may include a table structure, irregular paragraphs, and titles in the page data.
[0093] Specifically, the terminal can identify the document structure in each page data through the document structure detection model to obtain the text structure in each page data. The terminal can segment and divide each page data according to the obtained text structures to obtain multiple entries corresponding to the page data. For example, a table data in the page data can be divided into an entry, and so on.
[0094] In one example, the terminal can parse the page data through the DeepDoc document parsing module to obtain the entries corresponding to the page data; specifically, the terminal can identify data of various data types such as PPT / PDF / Doc / JPEG / Xml through the DeepDoc document parsing module, and extract structured information in files such as PDF / PPT; for example, a document structure detection model based on YOLOv8 can be used to identify the document structure in the page, and text structures such as tables, irregular paragraphs, and titles in the page can be extracted respectively.
[0095] Step 204 , based on the local target word database, statistics are collected on the target word information in each entry, and each entry is encoded through a feature extraction model to obtain an entry feature vector.
[0096] The target word information includes the target word type in the entry and the number of target words of each target word type, the local target word database may be a local keyword database, which may include multiple keywords; the target word information may be keyword information. The feature extraction model may be an embedding model, which is used to determine the feature vector.
[0097] Specifically, for each entry, the terminal can determine whether the entry contains the target word based on multiple target words contained in the local target word database, and if the target word is contained, the number of target words contained. The terminal can obtain the target word type contained in each entry and the number of target words of each target word type. The terminal can encode the entry through the feature extraction model to obtain the entry feature vector corresponding to the entry.
[0098] In one example, the terminal can segment the text according to the parsed text structures, that is, each table and each paragraph is segmented into a table, rather than segmented according to a fixed length, to the greatest extent possible to ensure that the parsed structural information is not destroyed. While segmenting the entry, a dictionary will be generated based on the keywords in the local keyword database to calculate the number of keywords contained in the entry.
[0099] Step 206: Obtain a target knowledge vector library based on the target word information of each entry and the entry feature vector of each entry.
[0100] Specifically, the terminal may combine the target word type and the number of target words of each target word type in the target word information of each entry, and the entry feature vectors corresponding to each entry to obtain a target knowledge vector library, that is, a semantic knowledge vector library with keyword statistical information.
[0101] In one example, for each entry, the terminal may obtain a semantic knowledge vector library with keyword statistical information according to the descending order of the number of keywords contained in the entry and the entry feature vector corresponding to each entry.
[0102] In this embodiment, segmentation based on the obtained document structure can improve the completeness of information retention, effectively improve the ability to parse structured information, and improve the ability to extract structured information of data knowledge, thereby expanding the scope of application.
[0103] In an exemplary embodiment, Figure 3 As shown, the specific implementation process of the step of "obtaining a first candidate entry set based on the similarities between the question information and multiple entries in the target knowledge vector library" may include:
[0104] Step 302: Encode the question information through a feature extraction model to obtain a question feature vector.
[0105] The feature extraction model may be an embedding model, which is used to determine the feature vector.
[0106] Specifically, the terminal may encode the problem data corresponding to the problem information through a feature extraction model to obtain an encoding result, and determine the encoding result as a problem feature vector.
[0107] Step 304: Calculate the first similarity between the question feature vector and each term in the target knowledge vector library based on the first similarity algorithm.
[0108] The first similarity algorithm may be a cosine similarity algorithm.
[0109] Specifically, the terminal can calculate the cosine similarity between the question feature vector and each term included in the target knowledge vector library by using the cosine similarity algorithm. For example, for each term, the terminal can calculate the cosine similarity between the question feature vector corresponding to the question information and the term feature vector corresponding to the term. In one example, the terminal can calculate the cosine feature between the term feature vector of the i-th term and the question feature vector by using the following formula:
[0110]
[0111] Among them, S represents the cosine similarity set between the user question semantic vector (question feature vector) and all knowledge vectors (term feature vectors) in the semantic knowledge vector library, S i represents the cosine similarity between the user question semantic vector and the i-th knowledge vector in the semantic knowledge vector library, The semantic vector representing the question, Represents the i-th knowledge vector in the semantic knowledge vector library.
[0112] Step 306: Screening is performed based on each first similarity to obtain a first candidate term set.
[0113] Specifically, the terminal may screen the terms corresponding to each first similarity according to the size of each first similarity, obtain the first similarity that satisfies the similarity condition, and determine the term corresponding to the first similarity that satisfies the similarity condition as the first candidate term; wherein the similarity condition may be that the first similarity is greater than a preset similarity threshold, the preset similarity threshold may be determined based on an actual application scenario, and the similarity condition may also be that each first similarity is arranged in order from large to small, and the first similarities of the previous target number are determined as the first similarities that satisfy the similarity condition. The target number may be determined based on an actual application scenario.
[0114] In this embodiment, each term is screened by calculating the cosine similarity between each term and the question feature vector, thereby improving the degree of association between each candidate term included in the candidate term set and the question information.
[0115] In an exemplary embodiment, Figure 4 As shown, the specific implementation process of the step of "processing the first candidate term set and the second candidate term set by a preset answer information generation model to obtain target answer information corresponding to the question information" may include:
[0116] Step 402: Determine a target candidate term set based on the first candidate term set and the second candidate term set.
[0117] Specifically, the terminal may screen each first candidate term in the first candidate term set and each second candidate term in the second candidate term set to obtain a target candidate term, and obtain a target candidate term set based on the screened multiple target candidate terms.
[0118] Step 404: Process the target candidate term set through a preset answer information generation model to obtain target answer information corresponding to the question information.
[0119] The preset answer information generation model may be a trained large language generation model, which is used to process the input information to obtain answer information matching the input information. The target answer information corresponding to the question information may be the answer information output to the user device to answer the question information input by the user device.
[0120] Specifically, the terminal can input the target candidate term set into a preset answer information generation model to perform enhancement processing on the preset answer information generation model, obtain the output result of the preset answer information generation model, and determine that the output result is the target answer information corresponding to the question information.
[0121] In this embodiment, by further screening the first candidate term set and the second candidate term set, the correlation between the information input into the large language model and the question information can be further improved, and the influence of the relevant candidate terms on the large language model can be reduced.
[0122] In an exemplary embodiment, Figure 5 As shown, the specific implementation process of the step of "determining the target candidate entry set based on the first candidate entry set and the second candidate entry set" may include:
[0123] Step 502: Calculate the second similarity between the question information and each term in the first candidate term set and each term in the second candidate term set respectively through the re-ranking model.
[0124] The re-ranking model may be a pre-trained deep learning model, which is used to output the similarity between the question feature vector corresponding to the question information and each candidate term.
[0125] Specifically, the terminal can first perform deduplication processing on each first candidate term included in the first candidate term set and each second candidate term included in the second candidate term set. For example, the first candidate terms that are repeated with the second candidate terms in the second candidate term set can be eliminated in the first candidate term set; for example, the second candidate terms that are repeated with the first candidate terms in the second candidate term set can be eliminated; based on this, the terminal can obtain the first candidate term set after deduplication processing and the second candidate term set after deduplication processing.
[0126] In this way, the terminal can reorder the first candidate term set after deduplication processing and the second candidate term set after deduplication processing through a pre-trained reordering model, and obtain the second similarity between each first candidate term contained in the first candidate term set after deduplication processing and the question feature vector corresponding to the question information, and the second similarity between each second candidate term contained in the second candidate term set after deduplication processing and the question feature vector corresponding to the question information.
[0127] Step 504: re-screen based on each second similarity to obtain a target candidate term set.
[0128] Specifically, the terminal can screen the entries corresponding to each second similarity according to the size of each second similarity, obtain the second similarity that meets the similarity condition, and determine the candidate entry corresponding to the second similarity that meets the similarity condition as the target candidate entry; the similarity condition can be that the second similarity is greater than a preset similarity threshold, and the preset similarity threshold can be determined based on the actual application scenario. The similarity condition can also be to arrange the second similarities from large to small, and determine the second similarities of the previous target number as the second similarities that meet the similarity condition. The target number can be determined based on the actual application scenario. The target candidate entries included in the target candidate entry set can be arranged in order from large to small according to the second similarities of each candidate entry.
[0129] In this embodiment, the similarities between each first candidate term and the second candidate term and the question information are recalculated and sorted through the re-ranking model, and a set of target candidate terms is obtained in descending order of similarity, which enriches the calculation dimension of the similarity. The accurately sorted set of target candidate terms is input into the large language model, which can further improve the quality of the output target answer information.
[0130] In an exemplary embodiment, Figure 6 As shown, the specific implementation process of the step of "processing the target candidate entry set through a preset answer information generation model to obtain the target answer information corresponding to the question information" may include:
[0131] Step 602: Determine answer range template information based on the range of question information.
[0132] The answer scope template information may be a promp template, for example, template information representing a technical field.
[0133] Specifically, the terminal may determine the answer range template information based on the field or scope of the question information, for example, by formatting the field information of the question information to obtain the answer range template information for representing the field of the question information.
[0134] Step 604: input the target candidate term set and the answer range template information into a preset answer information generation model to obtain the target answer information corresponding to the question information.
[0135] Among them, the target answer information matches the answer range template information.
[0136] Specifically, the target candidate term set includes target candidate terms arranged in order of the second similarity from large to small. The terminal can input the target candidate term set and the answer range template information determined based on the question information into a preset answer information generation model to obtain the model output result, and determine the template output result as the target answer information corresponding to the question information.
[0137] In one example, the terminal can process the target candidate term set through a preset answer information generation model to obtain multiple initial answer information, and filter the multiple answer information through the answer range template information to obtain initial answer information that matches the field information represented by the answer range template information, that is, the target answer information.
[0138] In this embodiment, the answer information output by the large language model is further limited by the answer range template information to ensure the degree of match between the domain of the output target answer information and the domain of the question information, thereby further improving the experience of the user who inputs the question information.
[0139] In the following, in conjunction with a specific embodiment, a detailed description of the specific implementation process of the above information processing method may include: Figure 7 As shown, the terminal can parse the page data through the DeepDoc document parsing module to obtain the entries corresponding to the page data; specifically, the terminal can identify data of various data types such as PPT / PDF / Doc / JPEG / Xml through the DeepDoc document parsing module, and extract structured information from files such as PDF / PPT; for example, a document structure detection model based on YOLOv8 can be used to identify the document structure in the page, and text structures such as tables, irregular paragraphs, and titles in the page can be extracted respectively.
[0140] The terminal can use the cosine similarity algorithm to calculate the cosine similarity between the question feature vector and each term included in the target knowledge vector library. For example, for each term, the term feature vectors corresponding to each term are obtained by extracting the features of the term through the embedding model; the terminal obtains the cosine similarity between the question feature vector corresponding to the question information and the term feature vector corresponding to the term. In an example, the terminal can calculate the cosine feature between the term feature vector of the i-th term and the question feature vector by the following formula:
[0141]
[0142] Among them, S represents the cosine similarity set between the user question semantic vector (question feature vector) and all knowledge vectors (term feature vectors) in the semantic knowledge vector library, S irepresents the cosine similarity between the user question semantic vector and the i-th knowledge vector in the semantic knowledge vector library, The semantic vector representing the question, Represents the i-th knowledge vector in the semantic knowledge vector library.
[0143] For each entry, the terminal can obtain a semantic knowledge vector library with keyword statistical information according to the descending order of the number of keywords contained in the entry and the entry feature vector corresponding to each entry.
[0144] like Figure 8 As shown, it can be a process of obtaining the target answer information corresponding to the question information, including a multi-way recall module for terms and a reranker term re-arrangement module. The terminal can extract features of the question information (query) through the embedding model to obtain a question feature vector. Cosine similarity matching is performed on the question feature vector and the semantic knowledge vector library with keyword statistical information to obtain a candidate term set 1 (a first candidate term set); the question information is processed based on the local keyword database, and the result is screened in the semantic knowledge vector library with keyword statistical information based on whether the keyword is contained to obtain a candidate term set 2 (a second candidate term set), and the first candidate term set and the second candidate term set are re-ranked by the reranker model to obtain a target candidate term set, and the target candidate term set and prompt are input into the large language model (LLM) to obtain the target answer information (answer), and the target answer information is returned to the user device.
[0145] Specifically, the terminal obtains the cosine similarity between the question feature vector corresponding to the question information and the term feature vector corresponding to the term, and according to the similarity matching result, takes the first N candidate terms from the cosine similarity set according to the similarity score. If keywords are included, the candidate term set matched by semantic similarity will be preprocessed according to the detected keywords, and the terms that do not contain keywords will be filtered out to obtain the final candidate term set 1. Since the local semantic knowledge vector library not only stores the semantic vectors of the segmented terms, but also counts the keyword information contained in the terms, keyword matching is performed in the semantic knowledge vector library according to the detected keywords to obtain candidate term set 2. According to the matching principle, it can be inferred that the same terms may exist in candidate term set 1 and candidate term set 2, so it is necessary to filter the terms.
[0146] The deduplicated candidate term set is then re-ranked by the rerangker model. The reranker re-ranking based on the deep learning model does not depend on the score or relative position of the document in the recall result, and is applicable to both single-way recall and multi-way recall. The re-ranking operation more effectively determines the semantic relevance between the document and the query, re-ranks the results more finely, and filters out low-relevance matching results. While improving the generation efficiency of the large language model, it reduces the misleading effect of low-relevance terms on the answers generated by the large language model. In addition, the precise and accurate term sorting is also conducive to improving the quality of the answers generated by the large language model. Finally, the re-ranked candidate term set is input into the large language model together with the promp template, which is enhanced by the large language model to generate the final answer and feedback to the user.
[0147] The information processing method provided in this embodiment can enhance the ability to extract text structured information, can achieve adaptive entry division based on text structure, has strong applicability to the analysis of various types of text data, and has high quality of knowledge base data construction; it can improve the accuracy and efficiency of keyword matching. Given a local keyword database, the accuracy of keyword matching can reach 99%, and almost no additional matching time is added. The information processing method provided in this embodiment can improve the quality of question and answer responses and enhance user experience through keyword matching, screening of semantic cosine similarity matching results based on keywords, entry deduplication, reranker re-ranking, etc.
[0148] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0149] Based on the same inventive concept, the embodiment of the present application also provides an information processing device for implementing the above-mentioned information processing method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the one or more information processing device embodiments provided below can refer to the limitations on the information processing method above, and will not be repeated here.
[0150] In an exemplary embodiment, Fig. 9 As shown, an information processing device 900 is provided, including:
[0151] A first determination module 901 is used to obtain a first candidate entry set based on similarities between the question information and multiple entries in the target knowledge vector library;
[0152] A second determination module 902 is used to filter multiple entries included in the target knowledge vector library based on the target word included in the question information to obtain a second candidate entry set;
[0153] The answer information determination module 903 is used to process the first candidate term set and the second candidate term set through a preset answer information generation model to obtain target answer information corresponding to the question information.
[0154] In one embodiment, the device further comprises:
[0155] An identification module, used to identify the page data based on the document structure detection model, obtain each document structure of the page data, and obtain the entry corresponding to the page data based on each document structure;
[0156] A statistical module, for counting target word information in each of the entries based on a local target word database, and encoding each of the entries through a feature extraction model to obtain an entry feature vector, wherein the target word information includes the target word type in the entry and the number of target words of each target word type;
[0157] The vector library determination module is used to obtain a target knowledge vector library based on the target word information of each entry and the entry feature vector of each entry.
[0158] In one embodiment, the first determining module is specifically configured to:
[0159] Encode the problem information through the feature extraction model to obtain the problem feature vector;
[0160] Based on a first similarity algorithm, calculating first similarities between the question feature vector and each term in the target knowledge vector library;
[0161] Screening is performed based on each of the first similarities to obtain a first set of candidate terms.
[0162] In one embodiment, the second determining module is specifically configured to:
[0163] Determining a target candidate term set based on the first candidate term set and the second candidate term set;
[0164] The target candidate entry set is processed by a preset answer information generation model to obtain target answer information corresponding to the question information.
[0165] In one embodiment, the answer information determination module is specifically used to:
[0166] By using the re-ranking model, second similarities between the question information and each term in the first candidate term set and each term in the second candidate term set are calculated respectively;
[0167] Re-screening is performed based on each of the second similarities to obtain a target candidate term set.
[0168] In one embodiment, the answer information determination module is specifically used to:
[0169] Determine answer range template information based on the range of the question information;
[0170] The target candidate entry set and the answer range template information are input into a preset answer information generation model to obtain target answer information corresponding to the question information, and the target answer information matches the answer range template information.
[0171] Each module in the above information processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0172] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.10As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, an information processing method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0173] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0174] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps described in the above embodiment when executing the computer program.
[0175] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps described in the above embodiment are implemented.
[0176] In one embodiment, a computer program product is provided, including a computer program, which implements the steps described in the above embodiment when executed by a processor.
[0177] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0178] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0179] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0180] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. An information processing method, characterized in that: The method comprises: Based on the similarities between the question information and multiple terms in the target knowledge vector library, a first candidate term set is obtained; Among the multiple entries included in the target knowledge vector library, screening is performed based on the target word included in the question information to obtain a second set of candidate entries; The first candidate term set and the second candidate term set are processed by a preset answer information generation model to obtain target answer information corresponding to the question information.
2. The method according to claim 1, characterized in that The method further comprises: Based on the document structure detection model, the page data is identified to obtain each document structure of the page data, and based on each document structure, the entry corresponding to the page data is obtained; Based on the local target word database, the target word information in each of the entries is counted, and each of the entries is encoded through a feature extraction model to obtain an entry feature vector, wherein the target word information includes the target word type in the entry and the number of target words of each target word type; Based on the target word information of each entry and the entry feature vector of each entry, a target knowledge vector library is obtained.
3. The method according to claim 1, characterized in that: The first candidate entry set is obtained based on the similarity between the question information and the multiple entries in the target knowledge vector library, including: Encode the problem information through the feature extraction model to obtain the problem feature vector; Based on a first similarity algorithm, calculating first similarities between the question feature vector and each term in the target knowledge vector library; Screening is performed based on each of the first similarities to obtain a first set of candidate terms.
4. The method according to claim 1, characterized in that: The step of processing the first candidate term set and the second candidate term set by a preset answer information generation model to obtain target answer information corresponding to the question information includes: Determining a target candidate term set based on the first candidate term set and the second candidate term set; The target candidate entry set is processed by a preset answer information generation model to obtain target answer information corresponding to the question information.
5. The method according to claim 4, characterized in that The step of determining a target candidate entry set based on the first candidate entry set and the second candidate entry set includes: By using the re-ranking model, second similarities between the question information and each term in the first candidate term set and each term in the second candidate term set are calculated respectively; Re-screening is performed based on each of the second similarities to obtain a target candidate term set.
6. The method according to claim 1, characterized in that The step of processing the target candidate entry set by a preset answer information generation model to obtain target answer information corresponding to the question information includes: Determine answer range template information based on the range of the question information; The target candidate entry set and the answer range template information are input into a preset answer information generation model to obtain target answer information corresponding to the question information, and the target answer information matches the answer range template information.
7. An information processing device, characterized in that: The device comprises: A first determination module, configured to obtain a first candidate entry set based on similarities between the question information and a plurality of entries in the target knowledge vector library; A second determination module is used to screen multiple entries included in the target knowledge vector library based on the target word included in the question information to obtain a second candidate entry set; The answer information determination module is used to process the first candidate term set and the second candidate term set through a preset answer information generation model to obtain target answer information corresponding to the question information.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Question-answer text matching method and device based on artificial intelligence, medium and electronic equipment
CN111259647A
RAG mixed retrieval method and device for improving accuracy of large language model
CN118277522A
Medical text mixed retrieval method and system
CN118363981A
