Information acquisition method and device
By recording information in a hierarchical manner in the information database and utilizing similarity retrieval and information association, the problem of low efficiency in searching for reference information in the information database by electronic devices is solved, and faster output information generation is achieved.
Patent Information
- Application Number
- CN202511764545.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-02-27
AI Technical Summary
In the existing technology, electronic devices are inefficient at searching for reference information in information databases, resulting in a long time to obtain output information.
The information in the database is classified into different information levels. The first and second information are processed by the first model to generate reference information, which is then input into the second model to generate output information. The search scope is narrowed by using similarity retrieval and information association.
By obtaining information in a hierarchical manner, the scope of the query is narrowed, the efficiency of obtaining reference information is improved, and thus the speed of generating output information is accelerated.
Smart Images

Figure CN121579740A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information processing technology, and in particular to an information acquisition method and apparatus. Background Technology
[0002] In related technologies, electronic devices can utilize pre-deployed models, such as large language models or other generative models, to process acquired input information and obtain output information. To improve the accuracy of the output information, the electronic device can first obtain relevant reference information from a database based on the input information, and then process the reference information and input information together to obtain the output information.
[0003] For example, electronic devices can obtain relevant reference materials for input questions, and generate answers to questions based on the reference materials and questions.
[0004] Currently, electronic devices require a considerable amount of time to search through databases based on input information to obtain reference information, resulting in low efficiency in obtaining reference information. Summary of the Invention
[0005] Therefore, this application discloses the following technical solution:
[0006] A first aspect of this application provides an information acquisition method, the method comprising:
[0007] Obtain input information;
[0008] First information is obtained from the first information level based on the input information;
[0009] In response to the first information satisfying the target condition, second information is obtained from the second information level according to the input information, wherein the first information level and the second information level are different information sets in the information database, and the information in the information database is recorded hierarchically in the information database;
[0010] The first information and the second information are processed by the first model to obtain reference information generated by the first model. The reference information is used to input the second model together with the input information, and the second model is used to generate output information corresponding to the input information.
[0011] Optionally, obtaining the second information from the second information level based on the input information includes:
[0012] Based on the first information, candidate information is determined from the second information level;
[0013] The second information is determined from the candidate information based on the input information.
[0014] Optionally, determining candidate information from the second information level based on the first information includes:
[0015] The candidate information is determined from the second information level based on the information association relationship corresponding to the first information, wherein the information association relationship corresponding to the first information indicates that there is at least one piece of information in the second information level that is associated with the first information.
[0016] Optionally, obtaining the first information from the first information level based on the input information includes:
[0017] Based on the input information, a similarity retrieval is performed on the information in the first information level to obtain the first information, wherein the similarity between the first information and the input information satisfies a first similarity threshold.
[0018] Obtaining the second information from the second information level based on the input information includes:
[0019] The similarity of the information in the second information level is retrieved based on the input information to obtain the second information. The similarity between the second information and the input information satisfies a second similarity threshold, wherein the first similarity threshold is lower than the second similarity threshold.
[0020] Optionally, the step of obtaining the second information from the second information level based on the input information in response to the first information satisfying the target condition includes:
[0021] In response to the fact that the similarity between the first information and the input information is lower than the target similarity threshold, the second information is obtained from the second information level based on the input information.
[0022] Optionally, processing the first information and the second information through the first model includes:
[0023] In response to the fact that the similarity between the second information and the input information is higher than the target similarity threshold, the first information and the second information are processed by the first model.
[0024] Optionally, the method further includes:
[0025] The target similarity threshold is determined based on the target parameters of the input information, whereby the target parameters are used to characterize the complexity of the information.
[0026] Optionally, the first information level and the second information level are obtained by the third model processing multiple pieces of information based on the prompt information. The prompt information represents the importance of each piece of information in the corresponding dialogue context, and the importance of information in the first information level is higher than that of information in the second information level.
[0027] Optionally, the method further includes:
[0028] Obtain third input information;
[0029] Determine the hierarchical information corresponding to the third input information in the information database;
[0030] If the hierarchical information indicates that the third input information corresponds to the second information hierarchy, then the third input information is imported into the second information hierarchy;
[0031] Determine the first associated information corresponding to the third input information from the first information level, and record the information association relationship between the third input information and the first associated information.
[0032] A second aspect of this application provides an information acquisition device, comprising:
[0033] The input unit is used to obtain input information;
[0034] Obtaining a unit, used for:
[0035] First information is obtained from the first information level based on the input information;
[0036] In response to the first information satisfying the target condition, second information is obtained from the second information level according to the input information, wherein the first information level and the second information level are different information sets in the information database, and the information in the information database is recorded hierarchically in the information database;
[0037] The processing unit is configured to process the first information and the second information through a first model to obtain reference information generated by the first model. The reference information is used to input the second model together with the input information, and the second model is used to generate output information corresponding to the input information. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0039] Figure 1 This is a flowchart of an information acquisition method provided in an embodiment of this application;
[0040] Figure 2 This is a schematic diagram illustrating an information association relationship provided in an embodiment of this application;
[0041] Figure 3 This is a flowchart illustrating the addition of third input information provided in an embodiment of this application;
[0042] Figure 4 This is a schematic diagram of an information acquisition device provided in an embodiment of this application;
[0043] Figure 5 This is a schematic diagram of another information acquisition device provided in the embodiments of this application. Detailed Implementation
[0044] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0045] This application provides an information acquisition method. Please refer to [link to relevant documentation]. Figure 1 The method may include the following steps.
[0046] S101, obtain input information.
[0047] S102, obtain the first information from the first information level according to the input information.
[0048] S103, in response to the first information satisfying the target condition, the second information is obtained from the second information level according to the input information, wherein the first information level and the second information level are different information sets in the information database, and the information in the information database is recorded hierarchically in the information database.
[0049] S104, the first information and the second information are processed by the first model to obtain reference information generated by the first model. The reference information is used to input the second model together with the input information, and the second model is used to generate output information corresponding to the input information.
[0050] The first and second models can be the same model or two different models. Both the first and second models can be generative patterns with information generation capabilities; for example, the first and second models can be the same large language model or two different large language models. The information base can be a knowledge base used for enhanced retrieval (RAG), with reference information serving as the knowledge recall result of enhanced retrieval.
[0051] When the first model and the second model are the same large language model, different prompts can be input into the large language model to generate reference information and obtain output information.
[0052] For example, when reference information is needed, the prompt information input to the large language model can indicate that the large language model should integrate the first information, the second information, and other information obtained from the information base based on the input information to form reference information; when output information is needed, the prompt information input to the large language model can indicate that the large language model should use the reference information as a basis to generate a response to the input information.
[0053] The beneficial effect of this embodiment is that the information contained in the information database is recorded hierarchically. When obtaining reference information based on input information, the first and second information corresponding to the input information in each information level are obtained layer by layer. This can narrow the scope of the query when obtaining reference information, and it is not necessary to query all the information contained in the information database to obtain the reference information. Compared with the method of querying all information in the information database based on input information in related technologies, this solution can improve the efficiency of obtaining reference information, thereby facilitating the faster acquisition of output information.
[0054] The information acquisition method of this embodiment can be executed by any electronic device with information processing capabilities. The form of the electronic device is not limited, such as a mobile phone, laptop computer, tablet computer, desktop computer, etc.
[0055] The form and content of the input information are not limited. In terms of form, the input information can include any one or more of text, image, and audio information, or other possible information formats. In terms of content, the input information can be a question entered by the user, a text document uploaded to an electronic device, a photograph, etc. As an example, the input information can be a question in any of the following text formats:
[0056] Question 1, "Why did we ultimately choose React?"
[0057] Question 2, "How skilled is the team in React?"
[0058] In step S102, the electronic device can perform similarity retrieval on the information contained in the first information level according to the input information, that is, determine the similarity between each piece of information in the first information level and the input information, and determine the first information based on the similarity.
[0059] Optionally, the electronic device can perform similarity retrieval on the information in the first information level based on the input information, sort the information in the first information level in descending order of similarity, and obtain the first N pieces of information as the first information.
[0060] The value of N can be set as needed, such as setting N to 1, 3, or other values. Taking N equal to 1 as an example, the information with the highest similarity to the input information in the first information level can be obtained as the first information.
[0061] Optionally, when the electronic device executes S102, it can also perform similarity retrieval on the information in the first information level based on the input information to obtain the first information, and the similarity between the first information and the input information satisfies the first similarity threshold.
[0062] Meeting the first similarity threshold can include information that is greater than the first similarity threshold, or information that is greater than or equal to the first similarity threshold. That is, the electronic device can obtain information in the first information level whose similarity to the input information is greater than or equal to the first similarity threshold as the first information.
[0063] Optionally, the two methods for obtaining the first information can be used together. For example, information whose similarity meets the first similarity threshold can be retrieved first as the first information. If no information whose similarity meets the first similarity threshold is found at the first information level, the first N information is obtained by sorting the information in descending order of similarity as the first information.
[0064] There are no restrictions on how the similarity between the input information and any information in the information database can be determined. For example, a pre-built model capable of extracting information features can be used to extract the information feature vector of the input information and the information feature vector of an information in the information database, and the cosine similarity between the two information feature vectors can be calculated as the similarity between the input information and an information in the information database.
[0065] Optionally, if the first information obtained in S102 does not meet the target conditions, then S103 can be skipped, and the first model can be used directly to process the first information to obtain reference information. The reference information and input information can then be input into the second model to obtain output information.
[0066] If the first information in S102 satisfies the target condition, then S103 can be executed to obtain the second information from the information database. The information database is a database containing multiple pre-collected information items. In this embodiment, the information database records the contained information hierarchically; that is, the information contained in the information database is divided into multiple information levels. Each information level is an information set of the information database, and this information set contains at least one piece of information recorded in the information database. The information contained in different information levels does not overlap; that is, each piece of information is contained in only one information level, and there is no situation where different information levels contain the same information. The multiple information levels include at least the aforementioned first information level and second information level.
[0067] In step S103, the electronic device can perform similarity retrieval on the information contained in the second information level based on the input information, that is, determine the similarity between the information contained in the second information level and the input information respectively, and determine the second information based on the similarity.
[0068] Optionally, the electronic device can perform a similarity search on the information in the second information level based on the input information, sort the information in the second information level in descending order of similarity, and obtain the top N pieces of information as the second information; or, when the electronic device executes S102, it can also perform a similarity search on the information in the second information level based on the input information to obtain the second information, wherein the similarity between the second information and the input information satisfies a second similarity threshold. Satisfying the second similarity threshold can include being greater than the second similarity threshold, or being greater than or equal to the second similarity threshold.
[0069] The above method of obtaining second information from the second information level through similarity retrieval can be found in the previous section on obtaining first information from the second information level through similarity retrieval, and will not be repeated here.
[0070] In this embodiment, the first similarity threshold and the second similarity threshold can be set as needed, and the specific values are not limited. Optionally, the first similarity threshold can be set lower than the second similarity threshold. The advantage of setting the second similarity threshold to be greater than the first similarity threshold is that it increases the similarity between the obtained second information and the input information, and avoids the similarity of the obtained second information being too low, which would affect the accuracy of the output information obtained based on the second information.
[0071] Optionally, second information is obtained from the second information level based on the input information, including:
[0072] Based on the first information, alternative information is determined from the second information level;
[0073] The second piece of information is determined from the alternative information based on the input information.
[0074] In this embodiment, the electronic device can filter out information associated with the first information from the information contained in the second information level, use the information associated with the first information as candidate information, and filter out information that is not associated with the first information, so as not to be candidate information.
[0075] There are multiple possibilities for the first piece of information, and the alternative information includes information associated with each piece of first information.
[0076] Similarly, when determining alternative information at any information level, the alternative information includes information associated with each piece of information obtained at the previous information level.
[0077] One way to determine candidate information is to select information with high similarity to the first information based on the similarity between the information in the first and second information levels, and filter out information in the second information level with low similarity to the first information. For example, the information in the second information level can be sorted in descending order according to the similarity to the first information, and the top M (e.g., 10, 20) or a certain percentage (e.g., 50%, 30%) of the information in the second information level can be selected as candidate information.
[0078] One way to determine the second information from the candidate information based on the input information is to perform a similarity search on each candidate information in the second information hierarchy based on the input information, so as to determine the second information from the candidate information. The method of performing similarity search on the candidate information is the same as the method of performing similarity search on information in the second information hierarchy described above, and will not be repeated here.
[0079] The beneficial effect of this embodiment is that, compared with the method of obtaining the second information directly from all the information at the second information level, first filtering candidate information and then determining the second information from the candidate information based on the input information can reduce the query range when querying the second information based on the input information, thereby improving the efficiency of obtaining the second information.
[0080] Another alternative method for determining candidate information from the second information level based on the first information is:
[0081] Based on the information association relationship corresponding to the first information, candidate information is determined from the second information level. The information association relationship corresponding to the first information indicates that there is at least one piece of information in the second information level that is associated with the first information.
[0082] To implement the aforementioned method for determining candidate information, the electronic device can determine and record the information relationships within each information level when dividing the information in the database into multiple information levels. Furthermore, the electronic device can determine and record the information relationships between the new information and existing information each time new information is added to the database.
[0083] For each piece of information, the information association relationship represents that the information is associated with at least one piece of information in the next information level. Here, the next information level refers to the information level below the current information level.
[0084] One way to determine the information association of a piece of information is to determine whether the information is associated with each piece of information in the next information level, and record the index (such as the information number, identifier, etc.) of each piece of information associated with it in the next information level as the information association of the information.
[0085] by Figure 2 For example, Figure 2 The circles represent information recorded in the database, and the lines connecting the circles represent the information relationships. For information 1 in the first information level, the information relationship of information 1 includes the index of information 4 and the index of information 5, to represent that information 1 is associated with the next information level, that is, information 4 and information 5 in the second information level; for information 5 in the second information level, the information relationship of information 5 includes the index of information C and the index of information D, to represent that information 5 is associated with the next information level, that is, information C and information D in the third information level.
[0086] Based on the pre-recorded information relationships, the information relationships of the first information can be obtained from the information database, and then information related to the first information can be found as candidate information in the second information level based on the information relationships of the first information.
[0087] Combination Figure 2 For example, assuming the first piece of information is information 2, then based on the information association relationship of information 2, information 6, information 7 and information 8 in the second information level can be determined as candidate information, and then the second information can be determined from information 6, information 7 and information 8.
[0088] Optionally, the method for determining whether two pieces of information are related can be as follows: if the similarity between the two pieces of information is greater than a preset information association threshold, then the two pieces of information can be determined to be related; if the similarity between the two pieces of information is less than or equal to the information association threshold, then the two pieces of information can be determined to be unrelated. The specific value of the information association threshold can be set as needed and is not limited.
[0089] Optionally, to determine whether two pieces of information are related, for each information level in the information database other than the first information level, determine whether the information is related to the information in the previous information level as follows:
[0090] Determine the similarity between the current information and every piece of information in the previous information level, find the information with the highest similarity, and determine the association between the current information and the information with the highest similarity in the previous information level; the current information refers to any information other than the first information level, and the previous information level refers to the information level above the information level where the current information is located.
[0091] Taking information 6 as an example, we can determine the similarity between information 6 and every piece of information in the first information level, find the piece of information with the highest similarity, and determine that information 6 is associated with the piece of information with the highest similarity in the first information level.
[0092] Based on the information association relationship of the first information, the candidate information can be determined without calculating the similarity of information in the first and second information levels, thus improving the efficiency of determining the candidate information.
[0093] Any piece of information in the database that satisfies the target condition can include: the similarity between the information and the input information is less than the target similarity threshold; conversely, if the similarity between the information and the input information is greater than or equal to the target similarity threshold, then the information does not satisfy the target condition.
[0094] Any piece of information in the information database that satisfies the target condition may include: the similarity between the information and the input information is less than the target similarity threshold, and the information level to which the information belongs is not the last information level in the information database; conversely, if the similarity between the information and the input information is greater than or equal to the target similarity threshold, or if the information belongs to the last information level in the information database, then the information does not satisfy the target condition.
[0095] For any piece of information in the information database to satisfy the target condition, it may also include: the similarity between the information and the input information is less than the target similarity threshold, and the information level of the information is not the Kth information level in the information database, where K is a preset integer, K is greater than 1 and less than or equal to the total number of information levels in the information database; conversely, if the similarity between the information and the input information is greater than or equal to the target similarity threshold, or if the information belongs to the Kth information level in the information database, then the information does not satisfy the target condition.
[0096] The K value can be set by the user or configured automatically by the electronic device. If it is necessary to improve the efficiency of obtaining output information, a smaller K value can be set to avoid querying too many information levels in the information database. If it is necessary to improve the accuracy and richness of the obtained output information, a larger K value can be set to obtain richer reference information.
[0097] Based on the above target conditions, in response to the first information satisfying the target conditions, obtaining the second information from the second information level according to the input information may include:
[0098] In response to the fact that the similarity between the first information and the input information is lower than the target similarity threshold, the second information is obtained from the second information level based on the input information.
[0099] If the similarity between the first information and the input information is greater than or equal to the target similarity threshold, then there is no need to obtain the second information; the first model can be used directly to process the first information to obtain the reference information.
[0100] The target similarity threshold can be set as needed without limitation. The target similarity threshold can be greater than the first similarity threshold and also greater than the second similarity threshold. Furthermore, if the information library contains three or more information levels, the target similarity threshold can be greater than the similarity threshold used in each information level.
[0101] Optionally, if it is impossible to obtain second information with a similarity that meets the second similarity threshold in the second information level based on the input information, or if it is impossible to determine alternative information in the second information level based on the first information, the first model can be used directly to process the first information to obtain reference information.
[0102] Optionally, processing the first information and the second information through the first model may include:
[0103] In response to the fact that the similarity between the second information and the input information is higher than the target similarity threshold, the first information and the second information are processed by the first model.
[0104] In this embodiment, if it is determined that the second information does not meet the target conditions after obtaining the second information, the first information and the second information can be processed by the first model to obtain reference information. If it is determined that the second information meets the target conditions, information can continue to be obtained from the third information level of the information database based on the input information until the information obtained from the information database meets the target conditions.
[0105] Optionally, if multiple pieces of information are obtained at any information level based on the input information, then as long as the similarity of at least one piece of information is higher than the target similarity threshold, it can be determined that the information obtained at that information level does not meet the target conditions, and the step of generating reference information using the first model is executed, without obtaining information at subsequent information levels.
[0106] Furthermore, if multiple pieces of information are obtained at any information level based on the input information, and the similarity of some of these pieces of information is not higher than the target similarity threshold, when generating reference information using the first model, only the information with similarity higher than the target similarity threshold and related information can be processed, while information with similarity not higher than the target similarity threshold and not related to the information with similarity higher than the target similarity threshold will not be processed.
[0107] Alternatively, when generating reference information using the first model, all information obtained up to the point of time based on the input information can be processed, regardless of whether the similarity of this information is higher than the target similarity threshold.
[0108] For example, suppose we obtain two pieces of second information. One piece of second information has a similarity higher than the target similarity threshold, and the other piece of second information has a similarity lower than the target similarity threshold. When the first model generates reference information, it can input both the first information and the two pieces of second information into the first model to generate reference information, or it can input both the first information and the second information with a similarity higher than the target similarity threshold into the first model to generate reference information.
[0109] After obtaining the first information and the second information, the first information, the second information, and the prompt message indicating that the first model generates reference information can be input into the first model together, so that the first model responds to the prompt message indicating that the first model generates reference information, processes the first information and the second information, and obtains the reference information.
[0110] The prompt information indicating that the first model generates reference information can instruct the first model to generate reference information according to any one or more of the following requirements.
[0111] Firstly, when generating reference information, the information obtained from various information levels of the information database based on the input information should be analyzed to ensure that the generated reference information has a high degree of logical integrity.
[0112] Secondly, the generated reference information can include valid information that is useful for the second model to process the input information, but does not include invalid information that is not useful for the second model to process the input information.
[0113] The usefulness of information obtained from a database can be measured by its similarity to the input information. For example, information with a similarity less than a threshold can be identified as having no effect on processing the input information, while information with a similarity greater than the threshold can be identified as having useful effect on processing the input information. Here, the threshold can be equal to the similarity threshold used at a certain information level in the database, such as the second similarity threshold, or it can be other pre-set thresholds.
[0114] Thirdly, in the generated reference information, the order of information obtained from the information database should be consistent with the order of information at the information level in the information database. Among them, the order of multiple pieces of information belonging to the same information level can be determined according to the logical relationship between the multiple pieces of information.
[0115] For example, if the reference information includes first information and second information, then the first information should be placed before the second information, that is, the first information should appear before the second information.
[0116] If reference information is obtained by processing the first information, the second information, and the third information according to the first model, and the obtained reference information includes the second information and the third information, then the second information should be placed before the third information.
[0117] After obtaining the reference information, the reference information, input information, and prompt information indicating that the second model generates output information can be input into the second model together. The second model responds to the prompt information indicating that the second model generates output information by processing the input information based on the reference information and obtaining the output information corresponding to the input information.
[0118] In the above embodiments, the first and second information levels are merely examples. The information database may include three or more information levels, such as a first information level, a second information level, a third information level, and a fourth information level. When there are three or more information levels, if the second information satisfies the target condition, the third information can be obtained at the third information level based on the input information; if the third information satisfies the target condition, the fourth information can be obtained at the fourth information level based on the input information.
[0119] In other words, starting from the first information level, if the information obtained from the input information in an information level meets the target conditions, the information of the next information level can be obtained from the input information until the information obtained at a certain level does not meet the target conditions, or the similarity of the information obtained from the input information cannot meet the corresponding similarity threshold in the next information level. Then, the first model can be used to process the information obtained from each information level based on the input information to obtain reference information.
[0120] The methods for obtaining the third information, the fourth information, and the subsequent information at more information levels based on the input information can all refer to the method for obtaining the second information based on the input information in the foregoing embodiments, and will not be repeated here.
[0121] For example, when obtaining the third piece of information, alternative information can be determined from the third information level based on the second information; the third piece of information can be determined from the alternative information based on the input information, and so on for subsequent information levels. Optionally, when obtaining the corresponding information from each information level based on the input information, the aforementioned similarity retrieval method can be used. Furthermore, the similarity threshold used when performing similarity retrieval at each information level can increase with the increase of the information level. For example, the third similarity threshold is greater than the second similarity threshold, and the fourth similarity threshold is greater than the third similarity threshold.
[0122] The target similarity threshold used in this embodiment can be a pre-configured fixed threshold or a dynamic threshold. For the case of a dynamic threshold, the method in this embodiment may include the following steps for determining the target similarity threshold:
[0123] The target similarity threshold is determined based on the target parameters of the input information. The target parameters are used to characterize the complexity of the information.
[0124] The target similarity threshold can be negatively correlated with the complexity of the input information represented by the target parameters. That is, the higher the complexity of the input information, the smaller the target similarity threshold, and the lower the complexity of the input information, the larger the target similarity threshold.
[0125] The target parameters can be determined based on any one or more indicators of the input information, without any restrictions.
[0126] Taking text information as an example, the target parameter can be determined based on any one or more indicators such as the text length, average sentence length, average word frequency, and entity word ratio of the input information. If it is determined based on one of the indicators, the target parameter can be equal to that indicator of the input information. If it is determined based on multiple indicators, the target parameter can be obtained by fusing the multiple indicators through direct summation or weighted summation.
[0127] The text length of the input information represents the total number of characters contained in the input information.
[0128] The average sentence length of the input information refers to the average length of all sentences contained in the input information. Sentences can be divided based on punctuation marks that indicate the end of a sentence in the input information (such as periods, question marks, etc.). The length of a sentence is the number of characters contained in the sentence.
[0129] Average word frequency (IF) can be equal to the average word frequency of all entity words in the input information. A lower word frequency indicates that the entity word is less frequently used and has higher complexity; conversely, a higher word frequency indicates lower complexity. A higher average word frequency in the input information indicates lower complexity. The word frequency of an entity word refers to the frequency with which that entity word appears in a pre-collected corpus. The corpus can include a large amount of user comments and articles collected from one or more open-source online platforms or databases over a past period (e.g., the last 30 days).
[0130] The entity word ratio refers to the ratio obtained by dividing the total number of entity words in the input information by the total number of words in the input information. Entity words include, but are not limited to, nouns, verbs, and adjectives, which are words with specific meanings. Words other than entity words that usually do not have specific meanings are generally called function words. Function words include, but are not limited to, prepositions, conjunctions, and articles.
[0131] The reason why setting a negative correlation between the target similarity threshold and the complexity of the input information is that each piece of information in the database contains a limited amount of information and is generally low in complexity. If the complexity of the input information is high, a piece of information in the database may only be related to a part of the input information and not to the other parts, thus leading to a generally low similarity between the information in the database and the input information. Therefore, setting a lower target similarity threshold when the complexity of the input information is high can avoid the situation where the similarity of information in the database is too low due to an excessively high target similarity threshold, resulting in insufficient information to generate reference information.
[0132] In addition to the target similarity threshold, the first similarity threshold and the second similarity threshold can also be determined based on the target parameters, and can also be negatively correlated with the complexity of the input information.
[0133] The beneficial effect of this embodiment is that by determining the target similarity threshold based on the target parameters of the input information, the determined target similarity threshold can be matched with the input information. This can avoid the situation where the target similarity threshold is too low, resulting in the information obtained from the information database being unable to support the output information generated by the second model, and also avoid the situation where the target similarity threshold is too high, resulting in insufficient information obtained from the information database as a reference.
[0134] Optionally, the first and second information levels are obtained by the third model processing multiple pieces of information based on the prompt information. The prompt information represents the importance of each piece of information in the corresponding dialogue context in which the third model outputs multiple pieces of information. The importance of information in the first information level is higher than that of information in the second information level.
[0135] The third model can be a generative model with information generation capabilities, such as a large language model. Alternatively, the third model can be another neural network model specifically designed to assess the importance of information.
[0136] The third model and the first model can be the same model, or they can be two different models.
[0137] In this embodiment, multiple pieces of information for building the information database can be obtained first. The sources of these multiple pieces of information are not limited. For example, they can be obtained by the second model from the historical dialogue between the second model and the user, or they can be extracted by the second model from articles uploaded by the user or searched through the network.
[0138] After obtaining multiple pieces of information, you can input all of the information and the prompts indicating the importance of the third model's output together into the third model, or you can input each piece of information and the prompts indicating the importance of the third model's output into the third model one by one to obtain the importance of each piece of information in the corresponding dialogue context.
[0139] Specifically, for information extracted from historical dialogues, the corresponding dialogue context can include the historical dialogue to which the information belongs; for information extracted from articles, the corresponding dialogue context can include the article to which the information belongs; furthermore, the prompt information representing the importance of the third model output can also be used to instruct the third model to infer which dialogue contexts the information may appear in based on the input information, so as to determine the importance of the information based on the dialogue context inferred by the third model.
[0140] The importance determined by the third model can be represented by a hierarchy, with level one representing the highest level of importance, level two representing a lower level of importance than level one, level three representing a lower level of importance than level two, and so on.
[0141] Once the importance level is determined, multiple pieces of information can be divided into multiple information levels based on their importance to establish the aforementioned information database. Information with higher importance is placed in the earlier information level, and information with lower importance is placed in the later information level. For example, information with importance level one is placed in the first information level, information with importance level two is placed in the second information level, information with importance level three is placed in the third information level, and so on.
[0142] After dividing the information into levels, the information relationships of each piece of information can be determined one by one and recorded in the information database so that the candidate information for each information level can be determined based on the information relationships.
[0143] The advantage of the above method for determining information hierarchy is that it divides multiple pieces of information into information hierarchy according to their importance, with higher-importance information hierarchy first and lower-importance information hierarchy last. This allows for priority acquisition of higher-importance information when obtaining reference information, which improves the efficiency of obtaining reference information and enhances the role of the obtained reference information in generating output information for the second model. It also avoids obtaining reference information that is too low in importance to be used in generating output information.
[0144] Optional, please see Figure 3 The method in this embodiment can also record new information in the information database in the following manner.
[0145] S301, obtain the third input information.
[0146] S302, determine the hierarchical information corresponding to the third input information in the information database.
[0147] S303, if the hierarchical information represents the third input information corresponding to the second information level, then the third input information is imported into the second information level.
[0148] S304, determine the first associated information corresponding to the third input information from the first information level, and record the information association relationship between the third input information and the first associated information.
[0149] S305, if the hierarchical information represents the third input information corresponding to the first information level, then the third input information is imported into the first information level.
[0150] In S301, the third input information can be extracted from historical dialogues, from articles, or from the current dialogue between the second model and the user.
[0151] In S302, the prompt information indicating the importance of the third model and the third input information can be input into the third model together to obtain the importance of the third input information output by the third model, and then the hierarchical information can be determined based on the importance.
[0152] If the importance of the third input information is the same as the importance of the information at the second information level in the information database, then the hierarchical information is determined to represent the second information level corresponding to the third input information; if the importance of the third input information is the same as the importance of the information at the first information level in the information database, then the hierarchical information is determined to represent the first information level corresponding to the third input information.
[0153] Information at different information levels in the information database can be stored in different areas. In S303, the third input information can be directly added to the area corresponding to the second information level to complete the import of the third input information. Alternatively, the information database can record the information level to which each piece of information belongs in a list format. Each information level corresponds to a list or a row in a list, and the list or a row in the list records the index of the information at the corresponding information level. In S303, the third input information can be added to the information database, and the index of the third input information can be recorded in the list or the row corresponding to the second information level to complete the import of the third input information.
[0154] In step S304, each piece of information in the first information level can be traversed to determine whether each piece of information in the first information level is associated with the third input information. In order to identify a piece of information associated with the third input information in the first information level, this piece of information associated with the third input information in the first information level is taken as the first associated information, and then the information association relationship between the third input information and the first associated information is recorded.
[0155] The method for determining whether each piece of information in the first information level is related to the third input information can be found in the method for determining whether two pieces of information are related in the foregoing embodiments, and will not be repeated here.
[0156] In some optional embodiments, if the similarity between the third input information and each piece of information in the first information level is less than or equal to the information association threshold, it can be determined that the third input information and each piece of information in the first information level are not associated. In this case, the third input information can be exported from the second information level and imported into the first information level.
[0157] The method for importing the third input information into the first information level can be found in S303, which describes the method for importing the third input information into the second information level. It will not be repeated here.
[0158] The method in this embodiment can import newly added information into the corresponding information level in the information database in real time according to its importance, and record the information relationship between the newly added information and the original information, thereby improving the richness of the information database.
[0159] Furthermore, when there are three or more information levels in the information database, the way to determine the level information corresponding to the third input information in the information database is that if the importance of the third input information is consistent with the importance of the information of the Xth information level (referring to any information level), then the level information is determined to represent the Xth information level corresponding to the third input information.
[0160] If the importance of the third input information is lower than that of the information at the last information level in the information database, an information level can be added after the last information level, and the level information can be determined to represent the new information level corresponding to the third input information.
[0161] For example, if the importance of the third input information is lower than that of the last information level in the information database, that is, the importance of the information at the third information level, the level information is determined to represent the newly added fourth information level corresponding to the third input information.
[0162] For information databases with three or more information levels, after determining the level information, the third input information can be directly imported into the corresponding information level indicated by the level information, such as importing the Xth information level or a newly added information level.
[0163] After importing, if the third input information corresponds to the first information level in the information database, the process of recording new information can be ended. If the third input information corresponds to any information level in the information database other than the first information level, the information association relationship of the third input information can be determined and recorded according to the following steps:
[0164] Determine the associated information corresponding to the third input information from the previous information level, and record the information association relationship between the third input information and the associated information.
[0165] The implementation of the above steps can be found in S304. It is only necessary to replace the first information level with the previous information level and the first associated information with the associated information in the implementation of S304. No further details are provided.
[0166] The previous information level refers to the information level above the information level corresponding to the third input information. For example, if the third input information is imported into the fifth information level, then the previous information level is the fourth information level.
[0167] In some optional embodiments, if the similarity between the third input information and each piece of information in the previous information level is less than or equal to the information association threshold, it can be determined that the third input information and each piece of information in the previous information level are not associated. In this case, the third input information can be exported from the current information level and imported into the previous information level. Then, the associated information can be searched in the information level above the newly imported information level. If it is not found, it can be imported into the previous information level again, and so on.
[0168] For example, after importing the third input information into the fourth information level, if it is found that the similarity between each piece of information in the third information level and the third input information is less than or equal to the information association threshold, the third input information can be exported from the fourth information level and imported into the third information level. Subsequently, if information with a similarity greater than the information association threshold is found in the second information level, it is identified as associated information, and the information association relationship between the third input information and the associated information is recorded.
[0169] If the similarity between each piece of information in the second information level and the third input information is found to be less than or equal to the information association threshold, the third input information can be exported from the third information level and imported into the second information level. This process continues until the third input information is imported into the first information level or an associated information with a similarity greater than the information association threshold is found.
[0170] The implementation process of the information acquisition method in this embodiment is illustrated below with examples.
[0171] Based on the second model, during the dialogue with the user, the electronic device extracts the information A "selecting a front-end framework" that needs to be added to the information database from the user's input "we need to select a front-end framework for the new project". The third model determines that the importance of information A is level one, so information A is imported into the first information level.
[0172] From the user's input "The project timeline is tight and needs to be delivered quickly", information B "Time is tight and needs to be delivered quickly" is extracted. The importance of information B is determined to be level two through the third model. Therefore, information B is imported into the second information level. After import, it is determined that information B is associated with information A in the first information level. Thus, the information association relationship is recorded: information A and information B are associated.
[0173] From the user's input "React has a rich ecosystem, high development efficiency, and meets our needs", we extract information C "React development efficiency is high". Through the third model, we determine that the importance of information C is level two. We import information C into the second information level and determine that information C is associated with information A in the first information level. Thus, we record the information association relationship: information A and information C are associated.
[0174] Extract information D "The team is familiar with React" from the user's input "Team members are all quite familiar with React". Determine the importance of information D as level three. Import information D into the third information level. Determine the relationship between information D and information C in the second information level. Then record the information relationship: information C and information D are related.
[0175] From the user's input "Previously used React Native to develop mobile projects", information E "has React Native development experience" is extracted. The importance of information E is determined to be level four. Information E is imported into the fourth information level. Information E is determined to be related to information D in the third information level. Therefore, the information association relationship is recorded: information D and information E are related.
[0176] At this point, the information database includes the following information levels.
[0177] First information level: Information A, selects the front-end framework, and is associated with Information B and Information C;
[0178] Second information level: Information B, which is time-sensitive and requires rapid delivery;
[0179] Information C, which relates to React's high development efficiency, is connected to information D.
[0180] The third information level: Information D, the team is familiar with React, and it is related to Information E;
[0181] Fourth information level: Information E, with React Native experience.
[0182] Assuming we obtain the input information "Why did we ultimately choose React?", we determine the target similarity threshold to be 0.85;
[0183] Based on the input information, information A that meets the first similarity threshold is obtained in the first information level as the first information. The similarity between information A and the input information is 0.7, which is less than the target similarity threshold. Therefore, information A meets the target condition.
[0184] In response to the first information satisfying the target condition, information B and information C associated with information A are identified as candidate information. Among the candidate information, information B and information C whose similarity satisfies the second similarity threshold are obtained as the second information. The similarity of information B is 0.8, the similarity of information C is 0.9, and the similarity of information C is greater than the target similarity threshold.
[0185] In response to the second information not meeting the target conditions, stop obtaining information, input information A, information B and information C into the first model, generate the reference information "React framework was chosen because React has high development efficiency and can meet the needs of rapid project delivery" and provide it to the second model.
[0186] Assuming the input information is "How skilled is the team in React?", the target similarity threshold is set at 0.85;
[0187] Information A is obtained in the first information level and is used as the first information. The similarity of information A is 0.5, which is less than 0.85. The first information satisfies the target condition.
[0188] Information B and C are obtained in the second information level. The similarity between information B and information C is 0.6, which is less than 0.85. Therefore, the second information satisfies the target condition.
[0189] Information D is obtained in the third information level and is used as the third information. The similarity of information D is 0.7, which is less than 0.85. The third information satisfies the target condition.
[0190] Information E is obtained as the fourth information in the fourth information level. The similarity of information E is 0.88, which is greater than 0.85. Therefore, the fourth information does not meet the target condition.
[0191] Stop acquiring information, input information A, B, C, D and E together into the first model, generate the reference information "The team is familiar with the React technology stack, has previous experience in React Native mobile development, and has a good technical foundation" and provide it to the second model.
[0192] This application also provides an information acquisition device, see [link to relevant documentation]. Figure 4 The device includes:
[0193] Input unit 401 is used to obtain input information;
[0194] The obtaining unit 402 is used to: obtain first information from the first information level according to the input information;
[0195] In response to the first information satisfying the target condition, the second information is obtained from the second information level according to the input information, wherein the first information level and the second information level are different information sets in the information database, and the information in the information database is recorded hierarchically in the information database;
[0196] The processing unit 403 is used to process the first information and the second information through the first model to obtain reference information generated by the first model. The reference information is used to input the second model together with the input information, and the second model is used to generate output information corresponding to the input information.
[0197] Optionally, the obtaining unit 402 obtains second information from the second information level based on the input information, including:
[0198] Based on the first information, alternative information is determined from the second information level;
[0199] The second piece of information is determined from the alternative information based on the input information.
[0200] Optionally, the obtaining unit 402 determines candidate information from the second information level based on the first information, including:
[0201] Based on the information association relationship corresponding to the first information, candidate information is determined from the second information level. The information association relationship corresponding to the first information indicates that there is at least one piece of information in the second information level that is associated with the first information.
[0202] Optionally, the obtaining unit 402 obtains the first information from the first information level based on the input information, including:
[0203] Based on the input information, a similarity search is performed on the information in the first information level to obtain the first information. The similarity between the first information and the input information meets the first similarity threshold.
[0204] The obtaining unit 402 obtains second information from the second information level based on the input information, including:
[0205] The similarity of the information in the second information level is retrieved based on the input information to obtain the second information. The similarity between the second information and the input information meets the second similarity threshold, wherein the first similarity threshold is lower than the second similarity threshold.
[0206] Optionally, in response to the first information satisfying the target condition, the obtaining unit 402 obtains the second information from the second information level based on the input information, including:
[0207] In response to the fact that the similarity between the first information and the input information is lower than the target similarity threshold, the second information is obtained from the second information level based on the input information.
[0208] Optionally, the processing unit 403 processes the first information and the second information through the first model, including:
[0209] In response to the fact that the similarity between the second information and the input information is higher than the target similarity threshold, the first information and the second information are processed by the first model.
[0210] Optional, please see Figure 5 This is a schematic diagram of an information acquisition device provided in another embodiment of this application. The information acquisition device may include the aforementioned input unit 401, acquisition unit 402, and processing unit 403, and may also include:
[0211] The determining unit 501 is used to determine the target similarity threshold based on the target parameters of the input information. The target parameters are used to characterize the complexity of the information.
[0212] Optionally, the first and second information levels are obtained by the third model processing multiple pieces of information based on the prompt information. The prompt information represents the importance of each piece of information in the corresponding dialogue context in which the third model outputs multiple pieces of information. The importance of information in the first information level is higher than that of information in the second information level.
[0213] Optionally, the information acquisition device may further include an update unit 502, used for:
[0214] Obtain third input information;
[0215] Determine the hierarchical information corresponding to the third input information in the information database;
[0216] If the hierarchical information represents the third input information corresponding to the second information level, then the third input information is imported into the second information level.
[0217] Determine the first associated information corresponding to the third input information from the first information level, and record the information association relationship between the third input information and the first associated information.
[0218] The working principle of the information acquisition device in this embodiment can be found in the relevant steps of the information acquisition method in the foregoing embodiment, and will not be repeated here.
[0219] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For ease of description, the above systems or devices are described by dividing them into various modules or units based on their functions. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware components.
[0220] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a 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 various embodiments or some parts of the embodiments of this application.
[0221] Finally, it should be noted that in this document, relational terms such as first, second, third, and fourth are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. The above descriptions are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. An information acquisition method, the method comprising: Obtain input information; First information is obtained from the first information level based on the input information; In response to the first information satisfying the target condition, second information is obtained from the second information level according to the input information, wherein the first information level and the second information level are different information sets in the information database, and the information in the information database is recorded hierarchically in the information database; The first information and the second information are processed by the first model to obtain reference information generated by the first model. The reference information is used to input the second model together with the input information, and the second model is used to generate output information corresponding to the input information.
2. The method according to claim 1, wherein obtaining the second information from the second information level based on the input information comprises: Based on the first information, candidate information is determined from the second information level; The second information is determined from the candidate information based on the input information.
3. The method according to claim 2, wherein determining candidate information from the second information level based on the first information includes: The candidate information is determined from the second information level based on the information association relationship corresponding to the first information, wherein the information association relationship corresponding to the first information indicates that there is at least one piece of information in the second information level that is associated with the first information.
4. The method according to claim 1, wherein obtaining the first information from the first information level based on the input information comprises: Based on the input information, a similarity retrieval is performed on the information in the first information level to obtain the first information, wherein the similarity between the first information and the input information satisfies a first similarity threshold. Obtaining the second information from the second information level based on the input information includes: The similarity of the information in the second information level is retrieved based on the input information to obtain the second information. The similarity between the second information and the input information satisfies a second similarity threshold, wherein the first similarity threshold is lower than the second similarity threshold.
5. The method according to claim 1, wherein obtaining the second information from the second information level based on the input information in response to the first information satisfying the target condition comprises: In response to the fact that the similarity between the first information and the input information is lower than the target similarity threshold, the second information is obtained from the second information level based on the input information.
6. The method according to claim 5, wherein processing the first information and the second information through the first model comprises: In response to the fact that the similarity between the second information and the input information is higher than the target similarity threshold, the first information and the second information are processed by the first model.
7. The method according to claim 5, further comprising: The target similarity threshold is determined based on the target parameters of the input information, whereby the target parameters are used to characterize the complexity of the information.
8. The method according to claim 1, wherein the first information level and the second information level are obtained by processing multiple pieces of information based on prompt information instructing the third model, wherein the prompt information represents the importance of each piece of information in the corresponding dialogue context instructing the third model to output the multiple pieces of information, and the importance of information in the first information level is higher than the importance of information in the second information level.
9. The method according to claim 3, further comprising: Obtain third input information; Determine the hierarchical information corresponding to the third input information in the information database; If the hierarchical information indicates that the third input information corresponds to the second information hierarchy, then the third input information is imported into the second information hierarchy; Determine the first associated information corresponding to the third input information from the first information level, and record the information association relationship between the third input information and the first associated information.
10. An information acquisition device, comprising: The input unit is used to obtain input information; Obtaining a unit, used for: First information is obtained from the first information level based on the input information; In response to the first information satisfying the target condition, second information is obtained from the second information level according to the input information, wherein the first information level and the second information level are different information sets in the information database, and the information in the information database is recorded hierarchically in the information database; The processing unit is configured to process the first information and the second information through a first model to obtain reference information generated by the first model. The reference information is used to input the second model together with the input information, and the second model is used to generate output information corresponding to the input information.