An intelligent retrieval method, device and storage medium for a knowledge base

By constructing a feature fusion model and a fine-ranking language model, the problems of feature information loss and insufficient generalization ability in the knowledge base retrieval system are solved, achieving higher retrieval accuracy and wider applicability.

CN116932694BActive Publication Date: 2026-05-29SHANDONG SYNTHESIS ELECTRONICS TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANDONG SYNTHESIS ELECTRONICS TECH
Filing Date
2023-07-19
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing technologies, intelligent retrieval systems for knowledge bases suffer from high loss of feature text information during the coarse-sorting stage and insufficient generalization ability during the fine-sorting stage, resulting in insufficient retrieval accuracy and generalization.

Method used

We construct a feature fusion model and a fine-ranking language model. The feature fusion model extracts knowledge base features, and the similarity algorithm and fine-ranking language model are combined for matching to improve retrieval accuracy and generalization.

Benefits of technology

By combining feature fusion and fine-ranking language models, the accuracy and generalization of knowledge base retrieval are improved, retrieval time is reduced, and the accuracy and applicability of retrieval results are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116932694B_ABST
    Figure CN116932694B_ABST
Patent Text Reader

Abstract

The application discloses an intelligent retrieval method and device for a knowledge base and a storage medium, and belongs to the technical field of information processing and artificial intelligence. The method comprises the following steps: acquiring a user question, and constructing a feature fusion model and a fine arrangement language model; extracting a knowledge text feature set of a preset knowledge base based on the feature fusion model, and associating the knowledge text feature set with the knowledge base to obtain a knowledge database; extracting a question feature of the user question based on the feature fusion model; matching the question feature with the knowledge database piece by piece, and calculating the similarity between the question feature and the knowledge text features of each knowledge point in the knowledge base based on a similarity algorithm to obtain a coarse arrangement set; and performing fine arrangement on the knowledge points of the knowledge base corresponding to the coarse arrangement set based on the fine arrangement language model by a text matching algorithm to obtain a retrieval result. The arrangement accuracy and the generalization of the intelligent retrieval for the knowledge base are improved by the method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical fields of information processing and artificial intelligence, and in particular to an intelligent retrieval method, device and storage medium for knowledge bases. Background Technology

[0002] Intelligent retrieval systems for knowledge bases represent a novel information retrieval approach, developed based on existing information retrieval technologies and models. The key difference between intelligent retrieval for knowledge bases and traditional information retrieval lies in its emphasis on semantics. Unlike information retrieval, which relies on literal, mechanical matching, intelligent retrieval for knowledge bases starts with the semantics and concepts of the text, revealing its inherent meaning. By achieving semantic and conceptual indexing, intelligent retrieval for knowledge bases improves recall and precision while reducing the user's search burden.

[0003] In existing intelligent retrieval systems targeting tens of thousands of professional knowledge bases, a common retrieval approach is to first perform coarse ranking followed by fine ranking. Coarse ranking involves extracting textual features from the knowledge base using a neural network language model, then calculating the distance between the textual features of the question and the pre-extracted textual features of each knowledge point in the knowledge base. This process only requires extracting features from the "question" once, resulting in fast matching speeds for tens of thousands of entries. Fine ranking involves using an interactive text matching algorithm to perform high-precision ranking of the hundreds of knowledge entries output from the coarse ranking, ultimately outputting Top 5, Top 10, etc. results. However, the coarse ranking stage suffers from significant information loss in the textual features. In the fine ranking stage, insufficient generalization ability of contrastive learning leads to insufficient accuracy.

[0004] Therefore, improving the ranking accuracy and generalization of intelligent retrieval of knowledge bases is an urgent problem to be solved. Summary of the Invention

[0005] This application provides an intelligent retrieval method, device, and storage medium for knowledge bases to solve the following technical problems: how to improve the ranking accuracy and generalization of intelligent retrieval for knowledge bases.

[0006] In a first aspect, embodiments of this application provide an intelligent retrieval method for a knowledge base, characterized in that the method includes: acquiring user questions and constructing a feature fusion model and a fine-ranking language model; extracting a preset knowledge text feature set of the knowledge base based on the feature fusion model, and associating the knowledge text feature set with the knowledge base to obtain a knowledge database; extracting question features of the user questions based on the feature fusion model; matching the question features with the knowledge database item by item, and calculating the similarity between the question features and the knowledge text features of each knowledge point in the knowledge base based on a similarity algorithm, and arranging the similarity in descending order to obtain a coarse-ranked set; and using a text matching algorithm based on the fine-ranking language model to fine-rank the knowledge points of the knowledge base corresponding to the coarse-ranked set, and arranging the matching results in descending order of matching degree to obtain retrieval results.

[0007] In one possible implementation, constructing a fusion feature model specifically includes: obtaining a standard representation feature model and a standard interaction vector feature model; concatenating the outputs of the standard representation feature model and the standard interaction vector feature model based on a preset Softmax function to obtain a preliminary feature fusion model; testing the preliminary feature fusion model, repeatedly adjusting the parameters of the preliminary feature fusion model, and constructing a feature fusion model when the output of the preliminary feature fusion model is greater than a parameter threshold.

[0008] In one possible implementation, constructing a refined ranking language model specifically includes: obtaining a standard refined ranking language model; training the standard refined ranking language model based on a binary contrastive learning loss function to obtain a first refined ranking language model; and adding adversarial noise to the first refined ranking language model training phase to obtain a refined ranking language model.

[0009] In one possible implementation, the standard refined ranking language model is trained based on a binary contrastive learning loss function to obtain a first refined ranking language model. Specifically, this includes: replacing the loss function within the standard refined ranking training model with the binary contrastive loss function to obtain a preliminary refined ranking language model; training the preliminary refined ranking language model; and obtaining the first refined ranking language model when the output of the preliminary refined ranking language model is greater than a preset parameter threshold; wherein the binary contrastive loss function is expressed by the following formula:

[0010] L=-log(σ(r ψ (x,y i )-r ψ (x,y j )))

[0011] Where L is the binary contrastive loss function, x is the problem feature, and y is the feature value. i and y jFor knowledge text features, r ψ (x,y i ) is (x,y i The similarity of r) ψ (x,y j ) is a sample (x, y) i The similarity between the two variables is σ, where σ is the Sigmoid function; or, the binary contrastive loss function can be expressed by the following formula:

[0012]

[0013] Where L is the binary contrastive loss function, x is the problem feature, and y is the feature value. i and y j For knowledge text features, k represents x and y. i and y j Quantity, Let be the sampling theorem function. For x, y i and y j The average expectation, r ψ (x,y i ) is (x,y i The similarity of r) ψ (x,y j ) is a sample (x, y) i The similarity between σ and σ is the Sigmoid function.

[0014] In one possible implementation, adversarial noise is added to the first refined language model training stage to obtain a refined language model. Specifically, this includes: before starting training the first refined language model, adding adversarial noise to a preset training set, and training the first refined language model based on the adversarial noise; obtaining the refined language model when the output of the first refined language model is greater than a preset parameter threshold; wherein the adversarial noise function is expressed by the following formula:

[0015]

[0016] in, For ordinary loss gradient, The gradient is calculated, where L is the binary opposition loss function, x is the problem feature, y is the knowledge text feature, θ is the neural network parameter, and ε is the hyperparameter.

[0017] In one possible implementation, the problem features are matched against the knowledge database one by one, and the similarity between the problem features and the knowledge text features of each knowledge point in the knowledge database is calculated based on a similarity algorithm. Specifically, this includes: acquiring the problem features and the knowledge database; matching the problem features against the knowledge text features in the knowledge database one by one; and calculating the similarity between the problem features and each knowledge text feature in the knowledge database using a similarity calculation formula to obtain the similarity between the problem features and each knowledge text feature in the knowledge database. The similarity calculation formula is expressed by the following formula:

[0018] Sim(T1,T2)=Softmax(∑α i f i (φ i (T1),φ i (T2))+Σβ j f j (φ j (T1),φ j (T2)))

[0019] Where Sim(T1,T2) represents the similarity between the question features and the knowledge text features, φ i φ j This refers to the different representation vector feature encoders and interactive feature encoders, f i f j These refer to the text representation vector feature extraction network and the interaction feature extraction network, respectively. T1 represents the question features, and T2 represents the knowledge text features. The parameters α and β in the formula are required to satisfy ∑α i +∑β j =1.

[0020] In one possible implementation, the α and β parameters in the formula are required to satisfy ∑α i +∑β j =1, specifically including: analyzing the values ​​of α and β using the Lagrange multiplier method, and / or iterating the values ​​of α and β continuously using the gradient descent method.

[0021] In one possible implementation, based on the refined ranking language model, a text matching algorithm is used to refine the knowledge points of the knowledge base corresponding to the coarse ranking set, and the matching results are arranged in descending order of matching degree to obtain the retrieval results. Specifically, this includes obtaining the knowledge base corresponding to the coarse ranking set; calculating the matching degree between the user question and each knowledge point in the knowledge base; arranging the similarity in descending order of value, selecting the knowledge point with the highest similarity as the best retrieval result, and selecting a preset first number of knowledge points with similarity in descending order as auxiliary retrieval results, thereby obtaining the retrieval results.

[0022] Secondly, embodiments of this application also provide an intelligent retrieval device for a knowledge base, characterized in that the device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: acquire a user question, and construct a feature fusion model and a fine-ranking language model; extract a preset knowledge text feature set of the knowledge base based on the feature fusion model, and associate the knowledge text feature set with the knowledge base to obtain a knowledge database; extract question features of the user question based on the feature fusion model; perform line-by-line matching of the question features with the knowledge database, and calculate the similarity between the question features and the knowledge text features of each knowledge point in the knowledge base based on a similarity algorithm, and arrange the similarity in descending order to obtain a coarse-ranked set; and perform fine-ranking of the knowledge points of the knowledge base corresponding to the coarse-ranked set using a text matching algorithm based on the fine-ranking language model, and arrange the matching results in descending order of matching degree to obtain retrieval results.

[0023] Thirdly, embodiments of this application also provide a non-volatile computer storage medium for intelligent retrieval of knowledge bases, storing computer-executable instructions, characterized in that the computer-executable instructions are configured to: acquire a user question, and construct a feature fusion model and a fine-ranking language model; extract a preset knowledge text feature set of the knowledge base based on the feature fusion model, and associate the knowledge text feature set with the knowledge base to obtain a knowledge database; extract question features of the user question based on the feature fusion model; match the question features with the knowledge database item by item, and calculate the similarity between the question features and the knowledge text features of each knowledge point in the knowledge base based on a similarity algorithm, and arrange the similarity in descending order to obtain a coarse-ranked set; and perform fine-ranking of the knowledge points of the knowledge base corresponding to the coarse-ranked set using a text matching algorithm based on the fine-ranking language model, and arrange the matching results in descending order of matching degree to obtain retrieval results.

[0024] This application provides an intelligent retrieval method, device, and storage medium for knowledge bases. It constructs a feature fusion model and a fine-ranking language model. The feature fusion model acquires features of the knowledge base, and user questions are obtained, with question features extracted based on the feature fusion model. First, in the coarse-ranking stage, a coarse-ranked set is obtained by comparing question features and question text features, thereby reducing the overall retrieval time. In the fine-ranking stage, a file matching algorithm for the fine-ranking language model, which incorporates anti-noise interference during training, matches the user questions with the knowledge points in the knowledge base corresponding to the coarse-ranked set. Retrieval results are given according to the matching results, thereby improving the ranking accuracy and generalization of intelligent retrieval of knowledge bases. Attached Figure Description

[0025] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0026] Figure 1 A flowchart illustrating an intelligent retrieval method for a knowledge base, provided as an embodiment of this application;

[0027] Figure 2 This is a schematic diagram of the internal structure of an intelligent retrieval device for a knowledge base, provided as an embodiment of this application. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0029] This application provides an intelligent retrieval method, device, and storage medium for knowledge bases to solve the following technical problems: how to improve the ranking accuracy and generalization of intelligent retrieval for knowledge bases.

[0030] The technical solutions proposed in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0031] Figure 1 This is a flowchart illustrating an intelligent retrieval method for a knowledge base, provided as an embodiment of this application. Figure 1 As shown in the figure, the intelligent retrieval method for knowledge base provided in this application embodiment specifically includes the following steps:

[0032] Step 1: Obtain user questions, build a feature fusion model, and build a fine-ranking language model.

[0033] Step 11: Construct a fusion feature model.

[0034] Before obtaining user questions, a feature fusion model needs to be built. The reason for building a feature fusion model is that if the features used in the coarse ranking process are only based on text representation features (such as Word2Vec) or only on text interaction features (such as BERT), it will result in the loss of feature information. This is because text representation features are static features; they only obtain the relative positions and number of characters in a text, and cannot obtain the meaning of characters based on context. Interactive text features, on the other hand, are dynamic features that can obtain the interdependencies between characters in a text. A word has different interaction vectors in different semantic contexts, and the meaning of the character can be obtained based on context.

[0035] In a specific example, the knowledge base contains two simple text snippets of knowledge points:

[0036] Knowledge Point 1. Want to eat steamed buns: How to order steamed buns;

[0037] Knowledge Point 2. Want to eat watermelon: How to order watermelon.

[0038] Users asked the following questions in an open format:

[0039] Question 1. Watermelon season is coming soon, and I want to eat this.

[0040] Question 2. The watermelon was good this morning, but the steamed buns were even better. I want to eat those again tomorrow.

[0041] In the text representation features, for question 1, we can obtain the character representation features "watermelon, eat this," which corresponds to knowledge point 2. For question 2, we can obtain the characters "watermelon, steamed bun, eat this," which correspond to knowledge points 1 and 2, respectively. The reason for this uncertain result is that the training data uses a fixed knowledge space and does not consider user individuality. This results in a stronger static representation of the knowledge space but a lack of dynamic interactive representation of user questions.

[0042] In the interactive vector representation features, for question 2, we can obtain the interactive features of the characters "watermelon, steamed buns are tastier, eat this". We can know that "this" in "eat this" refers to "steamed buns". Therefore, question 2 corresponds to knowledge point 1. It is trained using the relationship between user questions and knowledge points, and has a stronger interactive representation between user questions and knowledge points.

[0043] Text representation features offer fast recognition speed, while interactive text representation features boast high accuracy. However, text representation features cannot understand different phrasings of the same question, and interactive text features cannot comprehend static knowledge bases. In this embodiment, the user's question is a paragraph, so we need both text representation features and interactive text features. Therefore, it is necessary to fuse text representation features and interactive text features.

[0044] In this specific example, this embodiment fuses the standard representation feature model for obtaining text representation features and the standard interaction vector feature model for obtaining text interaction features, thereby enabling the fused feature model to simultaneously extract text representation features and text interaction features of the text.

[0045] Step 111: Obtain the standard representation feature model and the standard interaction vector feature model.

[0046] The standard representation feature model is a model capable of extracting text representation features, and the standard interaction vector feature model is a model capable of extracting text interaction vector features. Both the standard representation feature model and the standard interaction vector feature model mentioned here are existing technologies and will not be elaborated upon further.

[0047] Step 112: Based on the preset Softmax function, concatenate the outputs of the standard representation feature model and the standard interaction vector feature model to obtain a preliminary feature fusion model.

[0048] The Softmax function is a normalization exponential function. In this embodiment, it is used to normalize and integrate the feature outputs of the standard representation feature model and the standard interaction vector feature model to obtain a preliminary feature fusion model.

[0049] Step 113: Test the preliminary feature fusion model, repeatedly adjust the parameters of the preliminary feature fusion model, and construct the feature fusion model when the output of the preliminary feature fusion model is greater than the parameter threshold.

[0050] Because the standard representation feature model and the standard interaction vector feature model are different models, the initial feature fusion model needs to be adjusted after integrating their outputs to improve its accuracy and speed. During the debugging process, the outputs of individual standard representation feature models and standard interaction vector feature models are processed, and duplicate parts are removed to obtain comparison results. The outputs of the initial fusion model are compared with the comparison results to check their similarity. If the similarity is below a certain value, the outputs of individual standard representation feature models and standard interaction vector feature models are adjusted using the same method as for individual models, until the similarity exceeds a preset parameter threshold, at which point the feature fusion model is output. It is understood that the preset parameter threshold can be set manually.

[0051] Step 12: Construct a fine-grained language model.

[0052] Fine-grained language models are used to compare the similarity of two texts. However, standard fine-grained language models have insufficient learning and generalization capabilities. Since learning and generalization capabilities are key factors in ensuring the accuracy of fine-grained text under uncertain input conditions, it is necessary to obtain fine-grained language models with strong learning and generalization capabilities.

[0053] Step 121: Obtain the standard fine-ranking language model.

[0054] The standard fine-typesetting language model is used to compare the similarity of two texts, but the standard fine-typesetting language model has insufficient learning and generalization ability. The standard fine-typesetting language model is existing technology and will not be elaborated on here.

[0055] Step 122: Train the standard fine-ranking language model based on the binary contrastive learning loss function to obtain the first fine-ranking language model.

[0056] In this embodiment, two binary contrastive learning loss functions are provided to train the standard fine-ranking language model. The standard fine-ranking language model trained by the binary contrastive learning loss function can improve the information extraction accuracy of knowledge points and customer questions.

[0057] The first binary contrastive loss function is expressed by the following formula:

[0058] L=-log(σ(r ψ (x,y i )-r ψ (x,y j )))

[0059] Where L is the binary contrastive loss function, x is the problem feature, and y is the feature value. i and y j For knowledge text features, r ψ (x,yi ) is (x,y i The similarity of r) ψ (x,y j ) is a sample (x, y) i The similarity between ) and σ is the Sigmoid function;

[0060] The second binary contrastive loss function can be expressed by the following formula:

[0061]

[0062] Where L is the binary contrastive loss function, x is the problem feature, and y is the feature value. i and y j For knowledge text features, k represents x and y. i and y j Quantity, Let be the sampling theorem function, which means selecting two samples from the sample set k to calculate the loss function. For x, y i and y j The average expectation, r ψ (x,y i ) is (x,y i The similarity of r) ψ (x,y j ) is a sample (x, y) i The similarity between σ and σ is the Sigmoid function.

[0063] Step 123: Add adversarial noise to the first fine-ranked language model training stage to obtain the fine-ranked language model.

[0064] Because the standard fine-ranking language model has insufficient learning generalization ability, while the first fine-ranking language model trained with the binary contrastive learning loss function has an unchanged learning generalization ability, it is necessary to improve the learning generalization ability of the first fine-ranking language model. That is, by adding random noise to the input of the first fine-ranking language model during training, the learning generalization ability of the first fine-ranking language model for uncertain problems can be improved.

[0065] The anti-noise function is expressed by the following formula:

[0066]

[0067] In the above formula, For ordinary loss gradient, The gradient is calculated, where L is the binary opposition loss function, x is the problem feature, y is the knowledge text feature, θ is the neural network parameter, and ε is the hyperparameter.

[0068] It is understandable that different noises have different effects on the first fine-ranked language model. Therefore, by performing self-loss on the noise function, the noise completes self-adversarial behavior, thereby using more different noises to interfere with the first fine-ranked language model, so as to improve the learning and generalization ability of the first fine-ranked language model. When the adversarial noise function decays to 0, it means that the first fine-ranked language model has been interfered with by multiple random noises. That is, the output of the first fine-ranked language model after noise interference is the fine-ranked language model.

[0069] Step 13: Obtain user questions.

[0070] The customer questions obtained are text questions entered by the user. Depending on the specific application scenario in this embodiment, the method of obtaining user questions will also vary.

[0071] For example, on a webpage, user questions can be obtained through a webpage question editing box or through a microphone.

[0072] Step 2: Extract the knowledge text feature set of the preset knowledge base based on the feature fusion model, and associate the knowledge text feature set with the knowledge base to obtain the knowledge database.

[0073] The knowledge text feature set includes multiple knowledge text features, and the knowledge base is a database that stores multiple knowledge points. When a user enters a question, one or more knowledge points that are closest to the user's question are extracted from the database as the answer.

[0074] After obtaining the feature fusion module, it is necessary to extract the representation features and interaction vector features of knowledge points within the preset knowledge base using the feature fusion module. The representation features and interaction vector features are then fused to form knowledge text features. Each knowledge text feature corresponds to a knowledge point in the knowledge base; that is, the knowledge text feature set is associated with the knowledge database to obtain the knowledge database.

[0075] Step 3: Extract the problem features of the user's problem based on the feature fusion model.

[0076] Referring to step 2, the problem characteristics of the user's problem will not be elaborated here.

[0077] Step 4: Match the problem features with the knowledge database one by one, calculate the similarity between the problem features and the knowledge text features of each knowledge point in the knowledge base based on the similarity algorithm, and arrange the similarity in descending order to obtain a coarse set.

[0078] The similarity algorithm calculates the similarity using formulas for both question features and text features. After obtaining the user's question, the question features are matched against the set of knowledge text features in the knowledge database. Since this is only a coarse ranking, only the features need to be sorted. The sorted results are arranged in descending order of similarity to obtain the coarse ranking set. It's understandable that the precision of the coarse ranking set is inaccurate. For example, if the similarity between knowledge point a corresponding to knowledge text feature a and the user's question is 0.98, and the similarity between knowledge text feature a and the question feature is 0.90, and the similarity between knowledge point b corresponding to knowledge text feature b and the user's question is 0.95, then in the coarse ranking set, knowledge text feature a would rank lower than knowledge text feature b. This is clearly not realistic; therefore, the coarse ranking set only dynamically arranges the knowledge points.

[0079] Step 41: Obtain the problem features and the knowledge database.

[0080] The problem characteristics and knowledge database have already been obtained in steps 2 and 3, so they will not be repeated here.

[0081] Step 42: Match the problem features one by one with the knowledge text features in the knowledge database.

[0082] The problem features are combined with the knowledge text features in the knowledge database to form multiple sets. In a specific example, if the knowledge database contains 100 knowledge points, then the knowledge database contains 100 knowledge text features. The problem features are matched with the 100 knowledge text features to form 100 sets. The similarity of each set is calculated using the similarity calculation formula in step 43.

[0083] Step 43: Calculate the similarity between the question feature and each knowledge text feature in the knowledge database using the similarity calculation formula, so as to obtain the similarity between the question feature and each knowledge text feature in the knowledge database.

[0084] The similarity between question features and knowledge text features is automatically calculated using a similarity calculation formula, which is expressed as follows:

[0085] Sim(T1,T2)=Softmax(∑α i f i (φ i (T1),φ i (T2)

[0086] +Σβ j f j (φ j(T1),φ j (T2)))

[0087] Where Sim(T1,T2) represents the similarity between the question features and the knowledge text features, φ i φ j This refers to the different representation vector feature encoders and interactive feature encoders, f i f j These refer to the text representation vector feature extraction network and the interaction feature extraction network, respectively. T1 represents the question features, and T2 represents the knowledge text features. The parameters α and β in the formula are required to satisfy ∑α i +∑β j =1. Where α i and β j The parameters of the similarity calculation formula can be adjusted by changing α. i and β j To optimize the similarity calculation formula; where α i and β j To satisfy ∑α i +∑β j =1. The values ​​of α and β can be analyzed using the Lagrange multiplier method, and the values ​​of α and β can be iteratively analyzed using the gradient descent method. Both the Lagrange multiplier method and the gradient descent method are existing technologies and will not be elaborated here.

[0088] The optimization of the similarity calculation formula adopts the following method:

[0089] Select the question feature and knowledge text feature with a similarity of 1 as inputs to the similarity calculation formulas T1 and T2, respectively. Simultaneously, obtain the similarity scores output by the similarity calculation formulas. The closer the similarity score is to 1, the better the similarity calculation formula is optimized. Set an optimization threshold; when the similarity score output by the similarity calculation formula is less than the optimization threshold, modify α. i and β j The parameters are set until the similarity calculated by the similarity calculation formula is greater than or equal to the optimization threshold. It can be understood that the optimization threshold can be set manually.

[0090] Step 44: Select the knowledge text features of the second preset ratio in descending order of similarity to form a coarse set.

[0091] After calculating the similarity between the problem features and the knowledge text features, they are arranged in descending order of similarity. Then, knowledge text features of the second proportion in the knowledge database are selected in descending order of similarity. In specific cases, the second proportion is usually set to 10%, that is, 100 knowledge text features with the highest to lowest similarity are selected from 1000 knowledge points to form a coarse set.

[0092] Step 5: Based on the fine-ranking language model, the knowledge points of the knowledge base corresponding to the coarse-ranked set are fine-ranked using a text matching algorithm, and the matching results are arranged in descending order of matching degree to obtain the retrieval results.

[0093] In practice, the coarse sorting stage takes only a few milliseconds, but the coarse sort set obtained by sorting in the coarse sorting stage is not accurate enough, so it is necessary to perform fine sorting on the coarse sort set.

[0094] Step 51: Obtain the knowledge base corresponding to the coarse sort set.

[0095] That is, the knowledge points corresponding to the knowledge text features in the coarse ranking set are obtained through the coarse ranking set, and the knowledge base corresponding to the coarse ranking set is formed based on the above knowledge points.

[0096] Step 52: Calculate the matching degree between the user's question and each knowledge point in the knowledge base.

[0097] Coarse ranking is a similarity calculation based on question features and knowledge text features. Because the character length of the user question and the character length of the knowledge point are shortened, the accuracy of the retrieval is reduced while the calculation speed is improved. Here, the calculation is based on the complete user question and the complete knowledge point to calculate the matching degree between the user question and the knowledge point. The calculation here uses the fine ranking language model.

[0098] Step 53: Arrange the similarity scores in descending order of value, select the knowledge point with the highest similarity score as the best search result, and select a preset first number of knowledge points with similarity scores in descending order as auxiliary search results, thereby obtaining the search results.

[0099] The matching degree between the knowledge points in the calculated coarse ranking set and the customer's question is arranged in descending order to obtain the ranking list of matching degree with the customer's question. The first order is the knowledge point with the highest matching degree with the customer's question. This knowledge point is usually used as the best search result. In order to avoid the best search result not being the knowledge point needed by the customer, knowledge points will also be selected as auxiliary search results in descending order according to a preset first number.

[0100] The above are embodiments of the method proposed in this application. Based on the same inventive concept, embodiments of this application also provide an intelligent retrieval device for a knowledge base, the structure of which is as follows: Figure 2 As shown.

[0101] Figure 2 This is a schematic diagram of the internal structure of an intelligent retrieval device for a knowledge base, provided as an embodiment of this application. Figure 2 As shown, the device includes:

[0102] At least one processor 201;

[0103] And a memory 202 that is communicatively connected to at least one processor;

[0104] The memory 202 stores instructions executable by at least one processor. These instructions are executed by at least one processor 201 to enable the processor 201 to: acquire a user question and construct a feature fusion model and a fine-ranking language model; extract a set of knowledge text features from a preset knowledge base based on the feature fusion model, and associate the knowledge text feature set with the knowledge base to obtain a knowledge database; extract question features from the user question based on the feature fusion model; match the question features with the knowledge database line by line, calculate the similarity between the question features and the knowledge text features of each knowledge point in the knowledge base based on a similarity algorithm, and arrange the similarities in descending order to obtain a coarse-ranked set; and, based on the fine-ranking language model, perform fine-ranking on the knowledge points in the knowledge base corresponding to the coarse-ranked set using a text matching algorithm, and arrange the matching results in descending order of matching degree to obtain search results.

[0105] Some embodiments of this application provide corresponding to Figure 1 A non-volatile computer storage medium for intelligent retrieval of knowledge bases stores computer-executable instructions, which are configured to: acquire a user question and construct a feature fusion model and a fine-ranking language model; extract a preset set of knowledge text features from the knowledge base based on the feature fusion model, and associate the knowledge text feature set with the knowledge base to obtain a knowledge database; extract question features from the user question based on the feature fusion model; match the question features with the knowledge database line by line, calculate the similarity between the question features and the knowledge text features of each knowledge point in the knowledge base based on a similarity algorithm, and arrange the similarity in descending order to obtain a coarse-ranked set; and fine-rank the knowledge points in the knowledge base corresponding to the coarse-ranked set using a text matching algorithm based on the fine-ranking language model, and arrange the matching results in descending order of matching degree to obtain retrieval results.

[0106] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments for IoT devices and media are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0107] The systems, media, and methods provided in this application are one-to-one correspondences. Therefore, the systems and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the systems and media will not be repeated here.

[0108] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0109] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0110] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0111] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0112] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0113] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0114] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0115] It should also be noted that 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 limitation, 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.

[0116] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. An intelligent retrieval method for knowledge bases, characterized in that, The method includes: Obtain user questions, and build a feature fusion model and a fine-ranking language model; Based on the feature fusion model, a knowledge text feature set of a preset knowledge base is extracted, and the knowledge text feature set is associated with the knowledge base to obtain a knowledge database. The problem features of the user's question are extracted based on the feature fusion model; The problem features are matched against the knowledge database one by one, and the similarity between the problem features and the knowledge text features of each knowledge point in the knowledge database is calculated based on the similarity algorithm. The similarity scores are then arranged in descending order to obtain a coarse set. Based on the fine-ranking language model, the knowledge points of the knowledge base corresponding to the coarse-ranked set are fine-ranked using a text matching algorithm, and the matching results are arranged in descending order of matching degree to obtain the retrieval results. Constructing a fine-grained language model specifically includes: Obtain a standard fine-ranked language model; The standard fine-ranking language model is trained based on the binary contrastive learning loss function to obtain the first fine-ranking language model; In the training phase of the first refined language model, adversarial noise is added to the first refined language training to obtain a refined language model. The standard refined ranking language model is trained based on a binary contrastive learning loss function to obtain a first refined ranking language model, specifically including: Replace the loss function in the standard fine-ranking training model with the binary contrastive loss function to obtain a preliminary fine-ranking language model; Train the preliminary fine-ranking language model, and when the output of the preliminary fine-ranking language model is greater than a preset parameter threshold, obtain the first fine-ranking language model; The binary contrastive loss function is expressed by the following formula: Where L is the binary contrastive loss function, As a characteristic of the problem, and Features of knowledge text for similarity, similarity, For the Sigmoid function; or, The binary contrastive loss function can be expressed by the following formula: Where L is the binary contrastive loss function, As a characteristic of the problem, and For knowledge text features, k and Quantity, Let be the sampling theorem function. and average expectation, for similarity, similarity, For the Sigmoid function; Adding adversarial noise to the first refined language model training phase to obtain a refined language model, specifically including: Before training the first fine-ranked language model, adversarial noise is added to the input preset training set, and the first fine-ranked language model is trained based on the adversarial noise. When the output of the first refined language model is greater than a preset parameter threshold, a refined language model is obtained; wherein, the adversarial noise function is expressed by the following formula: in, For ordinary loss gradient, To find the gradient, It is a binary opposition loss function. As a characteristic of the problem, Features of knowledge text For neural network parameters, This is a hyperparameter.

2. The intelligent retrieval method for knowledge bases according to claim 1, characterized in that, Constructing a fusion feature model specifically includes: Obtain the standard representation feature model and the standard interaction vector feature model; The outputs of the standard representation feature model and the standard interaction vector feature model are concatenated based on the preset Softmax function to obtain a preliminary feature fusion model; The preliminary feature fusion model is tested, and the parameters of the preliminary feature fusion model are repeatedly adjusted. When the output of the preliminary feature fusion model is greater than the parameter threshold, a feature fusion model is constructed.

3. The intelligent retrieval method for knowledge bases according to claim 1, characterized in that, The problem features are matched against the knowledge database item by item, and the similarity between the problem features and the knowledge text features of each knowledge point in the knowledge base is calculated based on a similarity algorithm. Specifically, this includes: Obtain the problem characteristics and the knowledge database; Match the problem features one by one with the knowledge text features in the knowledge database; The similarity between the question feature and each knowledge text feature in the knowledge database is calculated using a similarity calculation formula to obtain the similarity between the question feature and each knowledge text feature in the knowledge database.

4. The intelligent retrieval method for knowledge bases according to claim 1, characterized in that, Based on the refined language model, a text matching algorithm is used to refine the knowledge points of the knowledge base corresponding to the coarse ranking set, and the matching results are arranged in descending order of matching degree to obtain the retrieval results, specifically including: Retrieve the knowledge base corresponding to the coarse-sorted set; Calculate the matching degree between the user question and each knowledge point in the knowledge base; The similarity scores are arranged in descending order of value. The knowledge point with the highest similarity is selected as the best search result. A preset number of knowledge points with similarity scores are selected as auxiliary search results in descending order of value, thereby obtaining the search results.

5. An intelligent retrieval device for knowledge bases, characterized in that, The device includes: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to: Obtain user questions, and build a feature fusion model and a fine-ranking language model; Based on the feature fusion model, a set of knowledge text features of a preset knowledge base is extracted, and the set of knowledge text features is associated with the knowledge base to obtain a knowledge database. The problem features of the user's question are extracted based on the feature fusion model; The problem features are matched against the knowledge database one by one, and the similarity between the problem features and the knowledge text features of each knowledge point in the knowledge database is calculated based on the similarity algorithm. The similarity scores are then arranged in descending order to obtain a coarse set. Based on the fine-ranking language model, the knowledge points of the knowledge base corresponding to the coarse-ranked set are fine-ranked using a text matching algorithm, and the matching results are arranged in descending order of matching degree to obtain the retrieval results. Constructing a fine-grained language model specifically includes: Obtain a standard fine-ranked language model; The standard fine-ranking language model is trained based on the binary contrastive learning loss function to obtain the first fine-ranking language model; In the training phase of the first refined language model, adversarial noise is added to the first refined language training to obtain a refined language model. The standard refined ranking language model is trained based on a binary contrastive learning loss function to obtain a first refined ranking language model, specifically including: Replace the loss function in the standard fine-ranking training model with the binary contrastive loss function to obtain a preliminary fine-ranking language model; Train the preliminary fine-ranking language model, and when the output of the preliminary fine-ranking language model is greater than a preset parameter threshold, obtain the first fine-ranking language model; The binary contrastive loss function is expressed by the following formula: Where L is the binary contrastive loss function, As a characteristic of the problem, and Features of knowledge text for similarity, similarity, For the Sigmoid function; or, The binary contrastive loss function can be expressed by the following formula: Where L is the binary contrastive loss function, As a characteristic of the problem, and For knowledge text features, k and Quantity, Let be the sampling theorem function. and average expectation, for similarity, similarity, For the Sigmoid function; Adding adversarial noise to the first refined language model training phase to obtain a refined language model, specifically including: Before training the first fine-ranked language model, adversarial noise is added to the input preset training set, and the first fine-ranked language model is trained based on the adversarial noise. When the output of the first refined language model is greater than a preset parameter threshold, a refined language model is obtained; wherein, the adversarial noise function is expressed by the following formula: in, For ordinary loss gradient, To find the gradient, It is a binary opposition loss function. As a characteristic of the problem, Features of knowledge text For neural network parameters, This is a hyperparameter.

6. A non-volatile computer storage medium for intelligent retrieval of knowledge bases, storing computer-executable instructions, characterized in that, The computer-executable instructions are set as follows: Obtain user questions, and build a feature fusion model and a fine-ranking language model; Based on the feature fusion model, a set of knowledge text features of a preset knowledge base is extracted, and the set of knowledge text features is associated with the knowledge base to obtain a knowledge database. The problem features of the user's question are extracted based on the feature fusion model; The problem features are matched against the knowledge database one by one, and the similarity between the problem features and the knowledge text features of each knowledge point in the knowledge database is calculated based on the similarity algorithm. The similarity scores are then arranged in descending order to obtain a coarse set. Based on the fine-ranking language model, the knowledge points of the knowledge base corresponding to the coarse-ranked set are fine-ranked using a text matching algorithm, and the matching results are arranged in descending order of matching degree to obtain the retrieval results. Constructing a fine-grained language model specifically includes: Obtain a standard fine-ranked language model; The standard fine-ranking language model is trained based on the binary contrastive learning loss function to obtain the first fine-ranking language model; In the training phase of the first refined language model, adversarial noise is added to the first refined language training to obtain a refined language model. The standard refined ranking language model is trained based on a binary contrastive learning loss function to obtain a first refined ranking language model, specifically including: Replace the loss function in the standard fine-ranking training model with the binary contrastive loss function to obtain a preliminary fine-ranking language model; Train the preliminary fine-ranking language model, and when the output of the preliminary fine-ranking language model is greater than a preset parameter threshold, obtain the first fine-ranking language model; The binary contrastive loss function is expressed by the following formula: Where L is the binary contrastive loss function, As a characteristic of the problem, and Features of knowledge text for similarity, similarity, For the Sigmoid function; or, The binary contrastive loss function can be expressed by the following formula: Where L is the binary contrastive loss function, As a characteristic of the problem, and For knowledge text features, k and Quantity, Let be the sampling theorem function. and average expectation, for similarity, similarity, For the Sigmoid function; Adding adversarial noise to the first refined language model training phase to obtain a refined language model, specifically including: Before training the first fine-ranked language model, adversarial noise is added to the input preset training set, and the first fine-ranked language model is trained based on the adversarial noise. When the output of the first refined language model is greater than a preset parameter threshold, a refined language model is obtained; wherein, the adversarial noise function is expressed by the following formula: in, For ordinary loss gradient, To find the gradient, It is a binary opposition loss function. As a characteristic of the problem, Features of knowledge text For neural network parameters, This is a hyperparameter.