Semantic retrieval method and device, electronic equipment, storage medium and program product

By using the semantic retrieval model to perform multiple segmentation, classification and reorganization of semantic text, combined with transfer learning and evaluation modules, the problem of inaccurate semantic retrieval in existing technologies is solved, and a more efficient semantic retrieval effect is achieved.

CN120670628APending Publication Date: 2025-09-19CHINA MOBILE GROUP ZHEJIANG +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510624559.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-15
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing semantic retrieval methods result in inaccurate retrieval results due to inaccurate segmentation and understanding of query language.

Method used

A semantic retrieval model is used to perform various segmentation, classification, and reorganization of semantic text through reorganization units. The reorganization results are retrieved and evaluated in combination with transfer learning and evaluation modules to obtain the optimal retrieval results.

Benefits of technology

It improves the accuracy and efficiency of semantic retrieval, comprehensively decomposes semantic text through multiple segmentation methods, realizes the reorganization and retrieval of category segmentation phrases, and improves the accuracy and efficiency of retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670628A_ABST
    Figure CN120670628A_ABST
Patent Text Reader

Abstract

The invention provides a semantic retrieval method and device, electronic equipment, a storage medium and a program product, and relates to the technical field of artificial intelligence. According to the method, the semantic text can be more comprehensively disassembled by fusing multiple types of segmentation, and the problem of inaccurate semantic retrieval caused by inaccurate segmentation in traditional semantic retrieval is solved. According to the method, the category segmentation phrases are recombined, retrieved and evaluated through the semantic retrieval model, real evaluation is conducted according to the retrieval result of each recombining action, then the optimal retrieval result is obtained, and the retrieval accuracy is improved. According to the method, the efficiency of retrieval according to the recombination result is improved through transfer learning, and then the retrieval efficiency of the semantic retrieval model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a semantic retrieval method, device, electronic device, storage medium and program product. Background Art

[0002] With the development of big models, various industries have gradually begun to adopt them to assist in daily work. In the communications field, big models are mainly used for document query, data query, tool orchestration, etc. Methods for triggering big model invocation include process automation and question-and-answer triggering. However, both invocation methods require first understanding the query language input to the big model, performing semantic segmentation and content retrieval on the structured or unstructured query language input to obtain search results.

[0003] The segmentation and understanding of query language also greatly affects the accuracy of the retrieval results output by the final large model. For example, matching database table names during data queries will greatly affect the generation of the final Structured Query Language (SQL) statement. For knowledge question answering, different retrieval methods can also lead to significant differences in the matching of knowledge documents. Existing segmentation is mostly through fixed-length, naive segmentation, or semantic grammar segmentation. However, for vertical fields, semantic grammar may not be able to adapt to the private nouns or daily spoken language of different fields. Segmentation errors will also be added to the retrieval process. Whether it is the more traditional keyword search, vector search, or retrieval-augmented generation (RAG) hybrid search, the segmentation problem of the query language itself greatly affects the accuracy of the search.

[0004] In summary, the existing semantic retrieval is inaccurate due to the inaccurate segmentation and understanding of the query language. Summary of the Invention

[0005] The present invention provides a semantic retrieval method, device, electronic device, storage medium and program product, which are used to solve the defect of inaccurate semantic retrieval in the prior art and improve the accuracy of semantic retrieval.

[0006] In a first aspect, the present invention provides a semantic retrieval method, comprising: inputting semantic text submitted by a user into a semantic retrieval model, and obtaining the optimal retrieval result of the semantic text output by the semantic retrieval model; wherein the semantic retrieval model includes an execution module and an evaluation module, the execution module includes a reorganization unit and a retrieval unit, the reorganization unit is used to perform various segmentations, classifications and reorganizations on the semantic text to obtain a reorganization result, the retrieval unit is used to perform transfer learning and retrieval on the reorganization result to obtain a retrieval result, and the evaluation module is used to calculate a reward value of the retrieval result, and determine the optimal retrieval result based on the reward value.

[0007] In one embodiment, the retrieval unit includes an encoder, and the retrieval unit is used to obtain retrieval results: perform feature extraction on the reorganization results to obtain source domain features; encode the source domain features based on the encoder to migrate the source domain features to target domain features; and perform retrieval based on the target domain features to obtain retrieval results.

[0008] In one embodiment, the reorganization unit is used to obtain a reorganization result: the semantic text is segmented in multiple ways to obtain a segmented word set of the semantic text; the segmented words in the segmented word set are classified based on at least one attention feature of the semantic text to obtain multiple category segmented phrases of different categories; the multiple category segmented phrases are adaptively arranged and combined, and a reorganization result is obtained based on the arrangement and combination results.

[0009] In one embodiment, the attention feature is obtained based on the following steps: performing convolution feature extraction on the semantic text based on the first convolution kernel to obtain the attention feature, the first convolution kernel is obtained by weighted processing of the second convolution kernel based on the attention weight of the second convolution kernel, the spatial dimension attention weight of the second convolution kernel, the input channel attention weight of the second convolution kernel, and the output channel attention weight of the second convolution kernel.

[0010] In one embodiment, the evaluation module is used to obtain a reward value by matching the search results with the semantic text, obtaining the number of keywords in the search results and the degree of association of the search results with respect to the semantic text according to the matching results; and calculating the reward value based on the number of keywords and the degree of association.

[0011] In one embodiment, the retrieval unit is trained based on a preset model, based on sample reorganization results of sample segmentation phrases, sample retrieval results of the sample reorganization results, and reward values ​​of the sample retrieval results. The preset model includes a source domain policy network, an initial encoder, and a target domain policy network: the source domain policy network is trained based on the sample reorganization results to obtain a trained source domain policy network; the optimal sample retrieval result is obtained based on the reward value, and aligned features are obtained based on the sample reorganization result and the optimal sample retrieval result; the aligned features are sequentially input into the initial encoder and the source domain policy network to obtain linear intermediate layer features of the source domain policy network; the aligned features are input into the target domain policy network to obtain linear intermediate layer features of the target domain policy network; a feature vector is obtained based on the linear intermediate layer features of the source domain policy network and the linear intermediate layer features of the target domain policy network; Based on the feature vector, the parameters of the preset model are adjusted until the loss value of the loss function of the preset model is minimized to obtain a retrieval unit. The loss function is determined based on the migration performance of the preset model for the sample reorganization result to the target domain state, and the target domain state is determined based on the optimal sample retrieval result.

[0012] In a second aspect, the present invention provides a semantic retrieval device, comprising: an acquisition module, used to input the semantic text submitted by the user into a semantic retrieval model, and obtain the optimal retrieval result of the semantic text output by the semantic retrieval model; wherein the semantic retrieval model includes an execution module and an evaluation module, the execution module includes a reorganization unit and a retrieval unit, the reorganization unit is used to perform various segmentations, classifications and reorganizations on the semantic text to obtain a reorganization result, the retrieval unit is used to perform transfer learning and retrieval on the reorganization result to obtain a retrieval result, and the evaluation module is used to calculate the reward value of the retrieval result, and determine the optimal retrieval result based on the reward value.

[0013] In a third aspect, the present invention further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, any of the above-mentioned semantic retrieval methods is implemented.

[0014] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which implements any of the above-mentioned semantic retrieval methods when executed by a processor.

[0015] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, which implements any of the above-mentioned semantic retrieval methods when executed by a processor.

[0016] The semantic retrieval method, device, electronic device, storage medium, and program product provided by the present invention achieve a more comprehensive decomposition of semantic text by integrating multiple segmentations, solving the problem of inaccurate semantic retrieval caused by inaccurate segmentation in traditional semantic retrieval. By reorganizing, retrieving, and evaluating the category segmentation phrases through the semantic retrieval model, a true evaluation is performed on each reorganization action based on its retrieval results, thereby obtaining the optimal retrieval results and improving the accuracy of the retrieval. The present invention improves the efficiency of retrieval based on the reorganization results through transfer learning, thereby improving the retrieval efficiency of the semantic retrieval model. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 This is one of the flow charts of the semantic retrieval method provided by the present invention.

[0019] Figure 2 It is a schematic diagram of the process of obtaining the recombination result provided by the present invention.

[0020] Figure 3 This is the second flowchart of the semantic retrieval method provided by the present invention.

[0021] Figure 4 It is a structural diagram of the semantic retrieval device provided by the present invention.

[0022] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0023] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0024] The following combination Figure 1-Figure 5 The semantic retrieval method, device and electronic device of the present invention are described.

[0025] Figure 1 This is one of the flow charts of the semantic retrieval method provided by the present invention, such as Figure 1As shown, the semantic retrieval method includes the following steps.

[0026] S100: Input the semantic text submitted by the user into the semantic retrieval model to obtain the optimal retrieval result of the semantic text output by the semantic retrieval model; wherein, the semantic retrieval model includes an execution module and an evaluation module, the execution module includes a reorganization unit and a retrieval unit, the reorganization unit is used to perform various segmentation, classification and reorganization on the semantic text to obtain the reorganization result, the retrieval unit is used to perform transfer learning and retrieval on the reorganization result to obtain the retrieval result, and the evaluation module is used to calculate the reward value of the retrieval result and determine the optimal retrieval result based on the reward value.

[0027] The semantic text submitted by the user is segmented in multiple rounds, and the segmentation results are classified to obtain multiple category segmentation phrases.

[0028] For example, consider the semantic text "What was the bandwidth and spectrum distribution of cells in City A where 5G users had poor perceptions last Friday?" Using two segmentation methods yields two different segmentation results. Result 1: Last Friday, 5G users in City A had poor perceptions of cell bandwidth and spectrum distribution. Result 2: Last Friday, 5G users in City A had poor perceptions of cell bandwidth and spectrum distribution. After aligning these two segmentation methods, we perform text classification based on multiple dimensions, including time, subject, features, and entities.

[0029] The semantic retrieval model includes a deep strategic reinforcement learning model. All category-segmented phrases are input into the semantic retrieval model. The semantic retrieval model comprises an execution module and an evaluation module. The execution module's recombination unit permutes and combines the category-segmented words in the various category-segmented phrases and generates recombination results based on the permutation and combination results. The execution module's retrieval unit, combined with transfer learning, performs a search on each recombination result to obtain the retrieval results.

[0030] like Figure 3 As shown, unlike traditional reinforcement learning, which uses a single action, the actions of this invention include semantic text segmentation and the reorganization of category-segmented words. Each reorganization result corresponds to one action. The evaluation module evaluates the search results corresponding to each reorganization result by calculating a reward value. The reorganization result with the highest reward value is considered the optimal reorganization result, and the search result of the optimal reorganization result is considered the optimal search result.

[0031] The semantic retrieval method provided by the embodiment of the present invention achieves a more comprehensive decomposition of semantic text by integrating multiple segmentations, solving the problem of inaccurate semantic retrieval caused by inaccurate segmentation in traditional semantic retrieval. By reorganizing, retrieving, and evaluating the category segmentation phrases through the semantic retrieval model, a true evaluation is performed on each reorganization action based on its retrieval results, thereby obtaining the optimal retrieval results and improving the accuracy of the retrieval. The present invention improves the efficiency of retrieval based on the reorganization results through transfer learning, thereby improving the retrieval efficiency of the semantic retrieval model.

[0032] Based on the above embodiment, the retrieval unit includes an encoder, and the retrieval unit is used to obtain the retrieval results, specifically including the following steps: Perform feature extraction on the recombinant results to obtain source domain features; Encode the source domain features based on the encoder to transfer the source domain features to the target domain features; Retrieval is performed based on the target domain features to obtain retrieval results.

[0033] The retrieval unit consists of a trained source-domain policy network, a trained target-domain policy network, and an encoder. Both the source-domain policy network and the target-domain policy network consist of deep neural networks. The source-domain policy network extracts features from the recombined results to obtain source-domain features. The encoder adaptively transforms the source-domain features output by the source-domain policy network to transfer the source-domain features to the target-domain features corresponding to the target-domain policy network. The target-domain policy network retrieves the target-domain features and outputs the most accurate and fastest retrieval results corresponding to the recombined results.

[0034] The present invention realizes transfer learning from reorganization results to retrieval results through the encoder, improves the retrieval efficiency and retrieval accuracy of the execution module, and is conducive to improving the efficiency and accuracy of the optimal retrieval result.

[0035] Based on the above embodiment, the recombination unit is used to obtain the recombination result, which specifically includes the following steps: Segment the semantic text in various ways to obtain the segmented word set of the semantic text; Classify the segmented words in the segmented word set based on the attention feature of at least one semantic text to obtain multiple category segmented word groups of different categories; Adaptively permutate and combine multiple category segmentation phrases, and obtain reorganization results based on the permutation and combination results.

[0036] The attention feature is obtained based on the following steps: convolution feature extraction is performed on the semantic text based on the first convolution kernel to obtain the attention feature. The first convolution kernel is obtained by weighted processing of the second convolution kernel based on the attention weight of the second convolution kernel, the spatial dimension attention weight of the second convolution kernel, the input channel attention weight of the second convolution kernel, and the output channel attention weight of the second convolution kernel.

[0037] Segment the semantic text in various ways to obtain a set of segmented words. For example, segment the semantic text into fixed-length words to obtain multiple segmented words. Determine a minimum length for the semantic text based on the semantic grammar, and segment the semantic text based on the minimum length to obtain multiple segmented words. A segmented word set is obtained based on all the segmented words.

[0038] The segmented words in the segmented word set are classified based on the attention features of the semantic text to obtain multiple category segmented word groups of different categories.

[0039] For example, a deep learning classification algorithm based on the Residual Network-D (ResNet-D) is constructed. First, global average pooling is performed on the semantic text input by the user, and then preliminary features are obtained through a fully connected layer and an activation function (for example, ReLU).

[0040] The attention weight of the second convolution kernel, the spatial dimension attention weight of the second convolution kernel, the input channel attention weight of the second convolution kernel, the output channel attention weight of the second convolution kernel, and the second convolution kernel are weighted to varying degrees to obtain multiple first convolution kernels. Preliminary features are extracted based on each first convolution kernel to obtain each attention feature (e.g., time, subject, feature, entity, etc.). The segmented words in the segmented word set are classified based on each attention feature to obtain multiple segmented word groups of different categories.

[0041] ; in, is the first convolution kernel, is the attention weight of the second convolution kernel, is the output channel attention weight of the second convolution kernel, is the input channel attention weight of the second convolution kernel, is the spatial dimension attention weight of the second convolution kernel, is the second convolution kernel, is the attention feature, is the preliminary feature of semantic text, is the number of attention features.

[0042] The present invention can meet different feature representation requirements by performing different degrees of weighted processing on attention weights, spatial dimension attention weights, input channel attention weights and output channel attention weights.

[0043] The present invention classifies the segmented word set through an improved deep learning classification method, realizes classification according to different attention features of semantic text, improves the accuracy of classification, and is conducive to improving the efficiency of subsequent reorganization of category segmentation words in category segmentation phrases.

[0044] Based on the above embodiment, the evaluation module is used to obtain the reward value, and the specific steps are as follows: Matching the search results with the semantic text, and obtaining the number of keywords in the search results and the degree of relevance of the search results to the semantic text based on the matching results; The reward value is calculated based on the number of keywords and the degree of relevance.

[0045] In the semantic retrieval model (a deep strategic reinforcement learning model) of this invention, reward calculation determines the agent's behavioral strategy and learning outcomes. Rewards are the immediate feedback the execution module receives from the environment after performing an action, used to evaluate the effectiveness of that action. By designing a manager function based on the number of keywords in the search results and the relevance of the search results to the semantic context, with the goal of maximizing the reward, we ensure that the execution module learns towards achieving its specific goals and selects the optimal action.

[0046] For each search result, the search result is matched against the semantic text (used to determine the text-standardized search result). Based on the matching results, the number of keywords in the search result and the degree of relevance of the search result to the semantic text are obtained. Based on the number of keywords and the degree of relevance, a reward value is calculated for the reorganization result corresponding to the search result. The search result with the largest reward value is considered the optimal search result. The reorganization result with the largest reward value is considered the optimal reorganization result.

[0047] The embodiment of the present invention designs a reward value by taking into account the number of keywords and the degree of association, thereby achieving a true evaluation of each reorganization action based on its search results, thereby obtaining the optimal search results and improving the accuracy of the search.

[0048] Based on the above embodiment, the retrieval unit is trained based on the sample reorganization results of the sample segmented phrases, the sample retrieval results of the sample reorganization results, and the reward values ​​of the sample retrieval results on the basis of a preset model. The preset model includes a source domain policy network, an initial encoder, and a target domain policy network: The source domain policy network is trained based on the sample reorganization results to obtain a trained source domain policy network; Obtain the optimal sample retrieval result based on the reward value, and obtain the aligned features based on the sample reorganization result and the optimal sample retrieval result; The aligned features are sequentially input into the initial encoder and the source domain policy network to obtain the linear intermediate layer features of the source domain policy network; Input the aligned features into the target domain policy network to obtain the linear intermediate layer features of the target domain policy network; Obtain a feature vector based on the linear intermediate layer features of the source domain policy network and the linear intermediate layer features of the target domain policy network; Based on the feature vector, the parameters of the preset model are adjusted until the loss value of the loss function of the preset model is minimized to obtain a retrieval unit. The loss function is determined based on the migration performance of the preset model for the sample reorganization result to the target domain state, and the target domain state is determined based on the optimal sample retrieval result.

[0049] The semantic retrieval model of the present invention is aimed at the retrieval requirements with low latency. It improves the efficiency of each reorganized retrieval by adding transfer learning, and improves the adaptability of the semantic retrieval model to different texts by iterating the retrieval results of the source domain and the target domain. For similar question-answering methods in different fields, the complexity of the iteration of the reinforcement learning model can be reduced through the mechanism of transfer learning, thereby improving the efficiency of reasoning. In the transfer learning algorithm, the source domain and the target domain are involved. The initial parameters and weights of the model learning are completed based on part of the training set. In the iterative reasoning process, the corresponding target domain corresponds to the target task. After the model obtains the initial parameters and weights in the source domain, it is migrated to the target domain, and the fine-tuning model can meet the target task.

[0050] The preset model includes a source domain policy network, an initial encoder, and a target domain policy network. The preset model includes a trained neural network module that can reorganize category segmentation phrases.

[0051] Obtain multiple sample reorganization results of the multiple sample segmented phrases and multiple sample retrieval results of the multiple sample reorganization results, and train an initial execution model based on the multiple sample reorganization results and the multiple sample retrieval results.

[0052] The source domain policy network is trained based on the results of multiple sample recombinations. The intermediate layers of the target domain policy network are initialized to the same structure as the source domain policy network trained on the source domain state (results of multiple sample recombinations). The target domain state (determined based on sample retrieval results) is fed into the initial encoder for dimensionality alignment and the target domain policy network for feature extraction. The initial encoder uses a deep neural network based on mutual information to map the target domain state to a vector representation with the same dimensionality as the source domain state. This generates an aligned feature vector, aligning the state spaces of different regions. The aligned feature vector is then fed into the source domain policy network to extract linear intermediate layer features and transfer them to the target domain policy network.

[0053] ; in, is the linear intermediate layer feature of the source domain policy network, is the linear intermediate layer feature of the target domain policy network, is the weight matrix of the source domain policy network, is the weight matrix of the target domain policy network, is the adaptive weight parameter, is the initial encoder, is the aligned feature, is the bias of the source domain policy network, is the bias of the target domain policy network, For weighted and The feature vector is used to adjust the parameters of the preset model (including the initial encoder).

[0054] In the early stages of training, Close to 1, eigenvector Mainly by Composition, making full use of the characteristics of the source domain state (multiple sample recombinant results). As the training progresses, Gradually decrease to 0, Gradual transition Lead and realize the gradual transfer of knowledge. After activation function The migration process is performed at each layer of the policy network.

[0055] Mutual information (MI) is a measure of the amount of information one random variable contains about another random variable and is an important metric for measuring the statistical correlation between two variables. Mutual information is obtained by taking the target domain state as the random input and the output of the initial encoder as the random variable and rewriting the lower bound of the mutual information using a variational distribution.

[0056] ; in, For mutual information, The target domain state is used as random input The entropy of time, The target domain state is used as random input, and the output of the initial encoder is As the entropy of a random variable, for and The variational distribution of for and The approximate true conditional distribution of is the KL divergence, for and The migration performance evaluation index of the preset model under the approximate true conditional distribution, for and Migration performance evaluation indicators of preset models under variational distribution, It is the migration performance evaluation indicator of the preset model under KL divergence.

[0057] Determine the loss function of the preset model.

[0058] ; in, for, for and Migration performance evaluation indicators of preset models under variational distribution, is a random input (target domain state) and The variational distribution of the random variable (the output of the initial encoder).

[0059] Based on the multiple sample reorganization results and the multiple sample retrieval results, the preset model is trained until the loss value of the loss function of the preset model is minimized, thereby obtaining an execution module.

[0060] The present invention simulates the actions of the solution space of segmentation results, reorganization results and retrieval results based on the multi-agent idea of ​​mutual information strategy, thereby improving the accuracy of the execution module's understanding of the intention of the semantic text.

[0061] This invention uses transfer learning to train a source domain policy network, an initial encoder, and a target domain policy network, thereby generating an execution module. This improves the efficiency of retrieval based on reorganized results. Based on the execution module's performance in migrating sample reorganized results to the target domain state, a loss function is determined, improving the transfer learning performance of the retrieval unit.

[0062] The semantic retrieval device provided by the present invention is described below. The semantic retrieval device described below and the semantic retrieval method described above can be referenced to each other.

[0063] like Figure 4 As shown, a semantic retrieval device includes: an acquisition module 401, which is used to input the semantic text submitted by the user into the semantic retrieval model, and obtain the optimal retrieval result of the semantic text output by the semantic retrieval model; wherein the semantic retrieval model includes an execution module and an evaluation module, the execution module includes a reorganization unit and a retrieval unit, the reorganization unit is used to perform various segmentation, classification and reorganization on the semantic text to obtain a reorganization result, the retrieval unit is used to perform transfer learning and retrieval on the reorganization result to obtain a retrieval result, and the evaluation module is used to calculate the reward value of the retrieval result and determine the optimal retrieval result based on the reward value.

[0064] The semantic retrieval device provided by the embodiment of the present invention achieves a more comprehensive decomposition of semantic text by integrating multiple segmentations, solving the problem of inaccurate semantic retrieval caused by inaccurate segmentation in traditional semantic retrieval. The semantic retrieval model is used to reorganize, retrieve, and evaluate the category segmentation phrases, and a true evaluation is performed on each reorganization action based on its retrieval results, thereby obtaining the optimal retrieval results and improving the accuracy of the retrieval. The present invention improves the efficiency of retrieval based on the reorganization results through transfer learning, thereby improving the retrieval efficiency of the semantic retrieval model.

[0065] In one embodiment, the retrieval unit includes an encoder, and the acquisition module 401 is used to: extract features from the reorganization results to obtain source domain features; encode the source domain features based on the encoder to migrate the source domain features to target domain features; and perform retrieval based on the target domain features to obtain retrieval results.

[0066] In one embodiment, the acquisition module 401 is used to: segment the semantic text in multiple ways to obtain a segmented word set of the semantic text; classify the segmented words in the segmented word set based on at least one attention feature of the semantic text to obtain multiple category segmented phrases of different categories; adaptively arrange and combine the multiple category segmented phrases, and obtain a reorganization result based on the arrangement and combination results.

[0067] In one embodiment, the acquisition module 401 is used to: perform convolution feature extraction on the semantic text based on the first convolution kernel to obtain the attention feature, and the first convolution kernel is obtained by weighted processing of the second convolution kernel based on the attention weight of the second convolution kernel, the spatial dimension attention weight of the second convolution kernel, the input channel attention weight of the second convolution kernel, and the output channel attention weight of the second convolution kernel.

[0068] In one embodiment, the acquisition module 401 is used to: match the search results and the semantic text, obtain the number of keywords in the search results and the degree of association of the search results with the semantic text according to the matching results; and calculate the reward value based on the number of keywords and the degree of association.

[0069] In one embodiment, the retrieval unit is trained based on a preset model, based on sample reorganization results of sample segmentation phrases, sample retrieval results of the sample reorganization results, and reward values ​​of the sample retrieval results. The preset model includes a source domain policy network, an initial encoder, and a target domain policy network: the source domain policy network is trained based on the sample reorganization results to obtain a trained source domain policy network; the optimal sample retrieval result is obtained based on the reward value, and aligned features are obtained based on the sample reorganization results and the optimal sample retrieval result; the aligned features are sequentially input into the initial encoder and the source domain policy network to obtain linear intermediate layer features of the source domain policy network; the aligned features are input into the target domain policy network to obtain linear intermediate layer features of the target domain policy network; a feature vector is obtained based on the linear intermediate layer features of the source domain policy network and the linear intermediate layer features of the target domain policy network; the parameters of the preset model are adjusted based on the feature vector until the loss value of the loss function of the preset model is minimized, thereby obtaining the retrieval unit, the loss function being determined based on the migration performance of the preset model for the sample reorganization results to the target domain state, and the target domain state being determined based on the optimal sample retrieval result.

[0070] Figure 4 An example of a physical structure diagram of an electronic device is shown below. Figure 4 As shown, the electronic device may include: a processor 410, a communications interface 420, a memory 430, and a communications bus 440. The processor 410, the communications interface 420, and the memory 430 communicate with each other via the communications bus 440. The processor 410 may invoke logic instructions in the memory 430 to execute a semantic retrieval method, which includes: inputting semantic text submitted by a user into a semantic retrieval model, and obtaining an optimal retrieval result for the semantic text output by the semantic retrieval model. The semantic retrieval model includes an execution module and an evaluation module. The execution module includes a reorganization unit and a retrieval unit. The reorganization unit is configured to perform various segmentation, classification, and reorganization on the semantic text to obtain a reorganized result. The retrieval unit is configured to perform transfer learning and retrieval on the reorganized result to obtain a retrieval result. The evaluation module is configured to calculate a reward value for the retrieval result and determine the optimal retrieval result based on the reward value.

[0071] Furthermore, the logic instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0072] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the semantic retrieval method provided by the above methods, which includes: inputting the semantic text submitted by the user into a semantic retrieval model, and obtaining the optimal retrieval result of the semantic text output by the semantic retrieval model; wherein the semantic retrieval model includes an execution module and an evaluation module, the execution module includes a reorganization unit and a retrieval unit, the reorganization unit is used to perform multiple segmentations, classifications and reorganizations on the semantic text to obtain reorganization results, the retrieval unit is used to perform transfer learning and retrieval on the reorganization results to obtain retrieval results, and the evaluation module is used to calculate the reward value of the retrieval result, and determine the optimal retrieval result based on the reward value.

[0073] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the semantic retrieval method provided by the above-mentioned methods, the method comprising: inputting the semantic text submitted by the user into a semantic retrieval model, and obtaining the optimal retrieval result of the semantic text output by the semantic retrieval model; wherein the semantic retrieval model comprises an execution module and an evaluation module, the execution module comprises a reorganization unit and a retrieval unit, the reorganization unit is used to perform various segmentations, classifications and reorganizations on the semantic text to obtain a reorganization result, the retrieval unit is used to perform transfer learning and retrieval on the reorganization result to obtain a retrieval result, and the evaluation module is used to calculate the reward value of the retrieval result, and determine the optimal retrieval result based on the reward value.

[0074] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0075] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.

[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A semantic retrieval method, characterized in that: include: The semantic text submitted by the user is input into the semantic retrieval model to obtain the optimal retrieval result of the semantic text output by the semantic retrieval model; wherein the semantic retrieval model includes an execution module and an evaluation module, the execution module includes a reorganization unit and a retrieval unit, the reorganization unit is used to perform various segmentation, classification and reorganization on the semantic text to obtain a reorganization result, the retrieval unit is used to perform transfer learning and retrieval on the reorganization result to obtain a retrieval result, and the evaluation module is used to calculate the reward value of the retrieval result and determine the optimal retrieval result based on the reward value.

2. The semantic retrieval method according to claim 1, characterized in that: The retrieval unit includes an encoder, and the retrieval unit is used to obtain the retrieval result: Performing feature extraction on the recombinant result to obtain source domain features; Encoding the source domain features based on the encoder to transfer the source domain features to target domain features; A search is performed based on the target domain features to obtain the search results.

3. The semantic retrieval method according to claim 1, characterized in that: The recombination unit is used to obtain the recombination result: Segmenting the semantic text in a variety of ways to obtain a segmented word set of the semantic text; classifying the segmented words in the segmented word set based on at least one attention feature of the semantic text to obtain a plurality of category segmented word groups of different categories; Adaptively permuting and combining the plurality of category segmented phrases, and obtaining the reorganization result based on the permutation and combination result.

4. The semantic retrieval method according to claim 3, characterized in that: The attention features are obtained based on the following steps: Convolution features are extracted from the semantic text based on the first convolution kernel to obtain the attention feature, wherein the first convolution kernel is obtained by weighted processing of the second convolution kernel based on the attention weight of the second convolution kernel, the spatial dimension attention weight of the second convolution kernel, the input channel attention weight of the second convolution kernel, and the output channel attention weight of the second convolution kernel.

5. The semantic retrieval method according to claim 1, characterized in that: The evaluation module is used to obtain the reward value: Matching the search result with the semantic text, and obtaining the number of keywords in the search result and the degree of relevance of the search result to the semantic text according to the matching result; The reward value is calculated based on the number of keywords and the degree of association.

6. The semantic retrieval method according to claim 1, characterized in that: The retrieval unit is trained based on a preset model, the sample reorganization results of the sample segmentation phrases, the sample retrieval results of the sample reorganization results, and the reward value of the sample retrieval results. The preset model includes a source domain policy network, an initial encoder, and a target domain policy network: Training the source domain policy network based on the sample reorganization result to obtain a trained source domain policy network; Obtaining an optimal sample retrieval result based on the reward value, and obtaining aligned features based on the sample reorganization result and the optimal sample retrieval result; Inputting the aligned features into the initial encoder and the source domain policy network in sequence to obtain linear intermediate layer features of the source domain policy network; Inputting the aligned features into the target domain policy network to obtain linear intermediate layer features of the target domain policy network; Acquire a feature vector based on the linear intermediate layer features of the source domain policy network and the linear intermediate layer features of the target domain policy network; The parameters of the preset model are adjusted based on the feature vector until the loss value of the loss function of the preset model is minimized, thereby obtaining the retrieval unit. The loss function is determined based on the migration performance of the preset model for the sample reorganization result to the target domain state, and the target domain state is determined based on the optimal sample retrieval result.

7. A semantic search device, characterized in that: include: An acquisition module is used to input the semantic text submitted by the user into a semantic retrieval model to obtain the optimal retrieval result of the semantic text output by the semantic retrieval model; wherein the semantic retrieval model includes an execution module and an evaluation module, the execution module includes a reorganization unit and a retrieval unit, the reorganization unit is used to perform multiple segmentation, classification and reorganization on the semantic text to obtain a reorganization result, the retrieval unit is used to perform transfer learning and retrieval on the reorganization result to obtain a retrieval result, and the evaluation module is used to calculate the reward value of the retrieval result and determine the optimal retrieval result based on the reward value.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the semantic retrieval method according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the semantic retrieval method according to any one of claims 1 to 6 is implemented.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the semantic retrieval method according to any one of claims 1 to 6 is implemented.