Text matching method, device, storage medium and product

By extracting key features of text data and converting them into natural language text fragments, and matching them with a deep neural network model of self-attention mechanism, the problems of low text matching accuracy and poor algorithm universality in the existing technology are solved, and a more efficient and general text matching method is achieved.

CN114741470BActive Publication Date: 2025-03-14ALIBABA CLOUD COMPUTING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210273353.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-18
Publication Date
2025-03-14
Estimated Expiration
2042-03-18

AI Technical Summary

Technical Problem

In the prior art, text matching methods rely on construction features, resulting in low accuracy of matching results, and need to adjust the text matching algorithm according to the adaptability of the changes in construction features, and the algorithm is less versatile.

Method used

By obtaining the text data to be matched, extracting its key features, and using a text template that matches the key features to convert it into natural language text fragments, and finally matching using a deep neural network model of self-attention mechanism.

Benefits of technology

The accuracy of text matching results is improved, the steps of artificially constructing features are avoided, the universality of text matching algorithms is enhanced, and the increase in key features is adapted to the increase of key features without adjusting the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114741470B_ABST
    Figure CN114741470B_ABST
Patent Text Reader

Abstract

The present application provides a text matching method, device, storage medium and product, the method comprising: obtaining first text data and second text data to be matched, extracting key features of the first text data and the second text data respectively, using a text template matching the key features to convert the key features into corresponding natural language text fragments, using a deep neural network model with a self-attention mechanism to match the natural language text fragments corresponding to the first text data and the second text data respectively, so as to obtain the matching results of the first text data and the second text data. The method of the present application can be applied in the intelligent matching scenario of government policies and regulations and related enterprises, and by utilizing the high-order feature extraction capability of deep neural networks, it can realize the semantic understanding and matching of natural language texts of government policy and regulation text data and enterprise text data, thereby eliminating the need to manually construct features based on text features, thereby improving the accuracy of matching results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to artificial intelligence technology, and in particular to a text matching method, device, storage medium and product. Background Art

[0002] With the development of artificial intelligence technology, artificial intelligence technology has been applied in many fields. Among them, the application of artificial intelligence in the field of text matching is the basic guarantee of data search engines.

[0003] At present, when performing text matching, the original text features of two texts are generally obtained, and then the structural features for matching are constructed based on the original text features, and the corresponding text matching algorithm is used to match based on the structural features. Therefore, the quality of the matching results depends largely on the quality of the structural features, resulting in low accuracy of the matching results, and when the structural features change, the text matching algorithm needs to be adaptively adjusted, making the versatility of the text matching algorithm poor. Summary of the invention

[0004] The present application provides a text matching method, device, storage medium and product to solve the problems in the prior art of using a text matching method that relies on structural features to perform text matching, the accuracy of the matching results is low, and the text matching algorithm needs to be adaptively adjusted according to changes in structural features, and the text matching algorithm has poor versatility.

[0005] In a first aspect, an embodiment of the present application provides a text matching method, comprising:

[0006] Acquire first text data and second text data to be matched;

[0007] extracting key features of the first text data and the second text data respectively;

[0008] Using a text template that matches the key feature to convert the key feature into a corresponding natural language text segment;

[0009] A deep neural network model using a self-attention mechanism is used to match the natural language text segments corresponding to the first text data and the second text data respectively, so as to obtain a matching result of the first text data and the second text data.

[0010] In a second aspect, an embodiment of the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0011] The memory stores computer-executable instructions;

[0012] The processor executes the computer-executable instructions stored in the memory to implement the method according to the first aspect.

[0013] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.

[0014] In a fourth aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements the method described in the first aspect when executed by a processor.

[0015] The present application provides a text matching method, device, storage medium and product, which obtains the first text data and the second text data to be matched, respectively extracts the key features of the first text data and the second text data, uses a text template matching the key features to convert the key features into corresponding natural language text fragments, and uses a deep neural network model of a self-attention mechanism to match the natural language text fragments corresponding to the first text data and the second text data, so as to obtain the matching results of the first text data and the second text data. Since the key features of the first text data and the second text data to be matched are extracted, and the key features are converted into corresponding natural language text fragments using a text template matching the key features, the key features can retain the semantic information and context information unique to the natural language text. Moreover, the deep learning neural network model of the self-attention mechanism has a high-order feature extraction capability, which can more accurately understand and match the complex semantics of the natural language text, thereby eliminating the need to artificially construct structural features based on text features, thereby improving the accuracy of the matching results. In addition, when the key features are increased, it is only necessary to use the corresponding text template to convert the increased key features into corresponding natural language text fragments, and use the original deep neural network model of the self-attention mechanism for further text matching, without adjusting the model, which effectively guarantees the versatility of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0017] Figure 1 A flowchart of a text matching method provided in an embodiment of the present application;

[0018] Figure 2 A schematic diagram of the structure of a deep neural network model with a self-attention mechanism provided in an embodiment of the present application;

[0019] Figure 3 A flowchart of another text matching method provided in an embodiment of the present application;

[0020] Figure 4A flowchart of another text matching method provided in an embodiment of the present application;

[0021] Figure 5 A schematic diagram of a smart matching scenario between government policies and regulations and related enterprises provided in an embodiment of the present application;

[0022] Figure 6 A schematic diagram of another intelligent matching scenario of government policies and regulations and related enterprises provided in an embodiment of the present application;

[0023] Figure 7 A schematic diagram of the structure of a text matching device provided in an embodiment of the present application;

[0024] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0025] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0026] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application.

[0027] The terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. In the description of the following embodiments, "multiple" means more than two, unless otherwise clearly and specifically defined.

[0028] In order to clearly understand the technical solution of the present application, the solution of the prior art is first introduced in detail.

[0029] In the prior art, when performing text matching, it is first necessary to obtain the original text features of the two texts, and then artificially construct the structural features for matching based on the original text features. The existing text matching algorithm is used to match based on the structural features. Traditional text matching algorithms can be, for example, the Term Frequency-Inverse Document Frequency (TF-IDF) algorithm and the Jaccard algorithm.

[0030] Then, when constructing the structural features according to the original text features, for example, the weight of each feature in the original text features in the semantics is calculated based on experience, and each feature and the corresponding weight are used as the structural features. When the corresponding text matching algorithm is used to match according to the structural features, each feature and the weight of each feature in the semantics are input into the corresponding text matching algorithm model in order from large to small weights for text matching. Since the accuracy of the matching result depends largely on whether the calculated weight of each feature is accurate, the accuracy of the matching result is low. In addition, the existing text matching algorithm model pre-sets the order and number of input features. If the order or number of input features is to be changed, the text matching algorithm needs to be adaptively adjusted, resulting in poor versatility of the text matching algorithm model.

[0031] Since the accuracy of the matching results will be low when the construction features are constructed according to artificial experience, the advantages of natural language texts with sufficient semantic information and contextual information can be used to match the text using unified and standardized natural language texts. Correspondingly, the deep learning neural network model of the self-attention mechanism has the ability to extract high-order features, which can more accurately understand and match the complex semantics of natural language texts, and the model structure is independent of the length of the input natural language text, so the deep learning neural network model of the self-attention mechanism can be used for text matching to ensure the versatility of the model. Therefore, when the present application performs text matching, the key features of the first text data and the second text data to be matched can be extracted, and the key features can be converted into corresponding natural language text fragments using a text template matching the key features, and the deep neural network model of the self-attention mechanism is used to perform text matching based on the natural language text fragments, so that there is no need to artificially construct construction features based on text features, thereby improving the accuracy of the matching results. In addition, when the key features increase, it is only necessary to use the corresponding text template to convert the increased key features into corresponding natural language text fragments, and use the original self-attention mechanism of the deep neural network model for further text matching, without adjusting the model, effectively ensuring the versatility of the model.

[0032] The following is an introduction to the application scenarios of the text matching method provided in this application.

[0033] The present application can be applied to a paper duplicate checking system. Specifically, the paper text data entered by the user in the text input box of the paper duplicate checking system can be obtained, and then a plurality of pre-stored document text data can be obtained from the database, and the key features of the paper text data and the document text data can be extracted respectively, such as the experimental method adopted, the experimental device used, the experimental effect obtained, etc., and the key features can be converted into corresponding natural language text fragments using a text template matching the key features. For example, the text template can be [Experimental method: feature value 1, experimental device: feature value 2, experimental effect: feature value 3]. Among them, "feature value 1" represents the feature value corresponding to the "experimental method" feature, "feature value 2" represents the feature value corresponding to the "experimental device" feature, and "feature value 3" represents the feature value corresponding to the "experimental effect".

[0034] A deep neural network model with a self-attention mechanism is used to match the natural language text fragments corresponding to the paper text data and the literature text data, thereby obtaining the matching results of the paper text data and the literature text data, i.e., the paper duplication checking results.

[0035] The present application can also be applied to the intelligent reply system. Specifically, the first text data sent by the user containing the question to be answered can be obtained, and then a plurality of pre-stored second text data for reply can be obtained from the database, and the key features of the first text data and the second text data can be extracted respectively, and converted into corresponding natural language text fragments using corresponding templates, and then the natural language text fragments corresponding to the first text data and the second text data can be matched respectively using the deep neural network model of the self-attention mechanism, so as to obtain the final text data for reply.

[0036] It is understandable that the text matching method provided in the present application can also be applied to other related application scenarios, which will not be described in detail here.

[0037] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0038] Figure 1A flowchart of a text matching method provided in an embodiment of the present application is provided. The embodiment of the present application provides a text matching method to solve the problem that the text matching method that relies on structural features is used in the prior art to perform text matching, the accuracy of the matching result is low, and the text matching algorithm needs to be adaptively adjusted according to the changes in structural features, and the versatility of the text matching algorithm is poor. The execution subject of the text matching method provided in this embodiment can be a text matching device. In practical applications, the text matching device can be implemented by a computer program, such as application software, etc., or by a medium storing relevant computer programs, such as a USB flash drive, a CD, etc., or it can also be implemented by a physical device that integrates or installs relevant computer programs, such as a chip, a board, etc.

[0039] In addition, the text matching device can be located in an electronic device. The electronic device can be a digital computer representing various forms, such as a cellular phone, a smart phone, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers.

[0040] like Figure 1 As shown, the text matching method provided in this embodiment includes the following steps:

[0041] Step 101: Obtain first text data and second text data to be matched.

[0042] Step 102: extract key features of the first text data and the second text data respectively.

[0043] Step 103: Use a text template that matches the key feature to convert the key feature into a corresponding natural language text segment.

[0044] Step 104: Use a deep neural network model with a self-attention mechanism to match the natural language text segments corresponding to the first text data and the second text data, respectively, to obtain a matching result of the first text data and the second text data.

[0045] Specifically, the text matching device can first obtain the first text data and the second text data to be matched. The first text data and the second text data are the text data corresponding to the two parties to be matched, respectively. The first text data and the second text data can be pre-stored in a database. When a text matching instruction or request sent by a user with matching authority is received, the corresponding first text data and the second text data can be obtained from the database.

[0046] In one example, a text matching device receives a first matching request sent by a first user with first matching permission, and the first matching request includes first text information to be matched. The text matching device can obtain corresponding first text data from a database based on the first text information, and obtain all second text data stored in the database based on the first matching request.

[0047] In another example, the text matching device receives a second matching request sent by a second user with second matching permission, and the second matching request includes second text information to be matched. The text matching device can obtain corresponding second text data from the database based on the second text information, and obtain all first text data stored in the database based on the second matching request.

[0048] The first matching permission is different from the second matching permission, and the first user is different from the second user. For example, in a paper duplicate checking system, the first matching permission may be the permission to match an unpublished paper with a published document, and the first user may be the paper author, and the second matching permission may be the permission to match a published document with an unpublished paper, and the second user may be the paper reviewer.

[0049] After obtaining the first text data and the second text data to be matched, since both the first text data and the second text data contain a lot of redundant information that is not helpful for text matching, text matching processing of the redundant information will cause unnecessary waste of resources. Therefore, the text matching device can extract the key features of the first text data and the second text data respectively, that is, extract valuable key information from the first text data and the second text data.

[0050] Specifically, a pre-trained feature extraction model can be used to extract key features of the first text data and the second text data, but the specific extraction method is not limited in this embodiment. It is understandable that based on different application scenarios, the training samples used to train the feature extraction model are different, and the trained feature extraction model will also be different, but it will match the first text data and the second text data in the application scenario.

[0051] After respectively extracting the key features of the first text data and the second text data, the text matching device may use a text template that matches the key features to convert the key features into corresponding natural language text segments.

[0052] Specifically, in practical applications, the PROMPT text template algorithm can be used to convert key features into corresponding natural language text segments. The PROMPT text template algorithm is an algorithm that converts key features into corresponding natural language text segments in the form of a text template.

[0053] After converting the key features into corresponding natural language text fragments, the text matching device can use a deep neural network model with a self-attention mechanism to match the natural language text fragments corresponding to the first text data and the second text data respectively to obtain the matching results of the first text data and the second text data. Figure 2 A schematic diagram of the structure of a deep neural network model with a self-attention mechanism provided in an embodiment of the present application, such as Figure 2 As shown, the deep neural network model of the self-attention mechanism provided in this embodiment includes a multi-head self-attention layer, a first dropout layer, a first summation and normalization layer, a forward neural network layer, a second dropout layer, a second summation and normalization layer, a summation pooling layer and a Sigmoid classifier, wherein the multi-head self-attention layer, the first dropout layer, the first summation and normalization layer, the forward neural network layer, the second dropout layer and the second summation and normalization layer together constitute a transformation (Transformer) encoder.

[0054] The text matching method provided in this embodiment obtains the first text data and the second text data to be matched, respectively extracts the key features of the first text data and the second text data, uses the text template matching the key features to convert the key features into corresponding natural language text fragments, and uses the deep neural network model of the self-attention mechanism to match the natural language text fragments corresponding to the first text data and the second text data, so as to obtain the matching results of the first text data and the second text data. Since the key features of the first text data and the second text data to be matched are extracted, and the key features are converted into corresponding natural language text fragments by using the text template matching the key features, the key features can retain the semantic information and context information unique to the natural language text. Moreover, the deep learning neural network model of the self-attention mechanism has the ability to extract high-order features, and can more accurately understand and match the complex semantics of the natural language text, so that there is no need to artificially construct structural features based on text features, thereby improving the accuracy of the matching results. In addition, when the key features are increased, it is only necessary to use the corresponding text template to convert the increased key features into corresponding natural language text fragments, and use the original deep neural network model of the self-attention mechanism for further text matching, without adjusting the model, which effectively guarantees the versatility of the model.

[0055] Based on the above implementation, in an optional implementation, in step 103, using a text template matching the key feature to convert the key feature into a corresponding natural language text segment specifically includes:

[0056] Determine the feature type of the key feature; determine the text template that matches the key feature according to the feature type; and convert the key feature into a corresponding natural language text segment according to the format of the matching text template.

[0057] In this embodiment, in order to convert the key features into corresponding natural language text fragments, the text matching device can first determine the feature type of the key features. Among them, the feature type of the key features can include fixed-value features and Boolean features. Fixed-value features refer to features with fixed feature values, which can be character strings, date type features, and numeric type features, such as experimental names and publication dates in paper duplication checking scenarios. Boolean features refer to features that are neither "true" nor "false", that is, binary classification features, such as "whether it is a core journal" and so on.

[0058] After determining the feature type of the key feature, the text matching device may determine a text template that matches the key feature according to the feature type, and convert the key feature into a corresponding natural language text segment according to the format of the matched text template.

[0059] In an optional implementation manner, the feature type of the key feature is a fixed-value feature. Accordingly, when the text matching device determines the text template matching the key feature according to the feature type, the method specifically includes:

[0060] The text template matching the key feature is determined as a key-value pair format template according to the fixed value feature. When the text matching device converts the key feature into a corresponding natural language text segment according to the format of the matching text template, it specifically includes:

[0061] The matching key features are converted into corresponding natural language text fragments according to the key-value pair format of the matching text template.

[0062] Specifically, the key-value pair format template may be [feature name: feature value], where the feature name is the key (key) and the feature value is its corresponding value (value). Accordingly, the text matching device may convert the matched key features into corresponding natural language text segments according to the format of [feature name: feature value], such as [published date: 2019-01-15].

[0063] In this embodiment, the text template that matches the key feature is determined to be a key-value pair format template according to the fixed value feature, and the matched key feature is converted into a corresponding natural language text fragment according to the key-value pair format of the matched text template. Since the key-value pair format is a format that highlights semantics and context information, the text template is determined to be a key-value pair format template, and after the matched key feature is converted into a corresponding natural language text fragment according to the key-value pair format of the matched text template, the natural language fragment can highlight semantics and context information. In addition, the deep learning model using the self-attention mechanism can extract features more accurately, further improving the accuracy of text matching.

[0064] In another optional implementation, the feature type of the key feature is a Boolean feature. Accordingly, when the text matching device determines the text template matching the key feature according to the feature type, the method specifically includes:

[0065] According to the Boolean feature, the text template matching the key feature is determined as the true value format template.

[0066] In a possible case, when the text matching device converts the matched key features into corresponding natural language text segments according to the key-value pair format of the matched text template, the method specifically includes:

[0067] If the key feature is determined to be a true value, the matched key feature is converted into a corresponding natural language text segment according to the true value format of the matched text template.

[0068] Exemplarily, the key feature is "is a core journal", then the text matching device can convert the matching key features into corresponding natural language text segments according to the truth value format template, such as [is a core journal].

[0069] In another possible situation, if it is determined that the key feature is not a true value, such as "not a core journal", the text matching device does not need to convert the key feature that is not a true value into a corresponding natural language text segment according to the truth value format template.

[0070] In this embodiment, the text template that matches the key feature is determined to be a truth value format template based on the Boolean feature. If the key feature is determined to be a truth value, the matched key feature is converted into a corresponding natural language text fragment according to the truth value format of the matched text template. Since the Boolean feature refers to a feature that is neither "true" nor "false", that is, a binary classification feature, a truth value format template can be used as a text template for the key feature whose feature type is a Boolean feature, so that only the truth value, that is, the valid key feature, can be converted into a corresponding natural language text fragment, and the natural language text fragment can be made more semantically prominent. Therefore, when the deep learning neural network model with a self-attention mechanism is used for feature extraction, the extracted features are more accurate, thereby further improving the accuracy of text matching.

[0071] Figure 3 A flowchart of another text matching method provided in an embodiment of the present application is as follows: Figure 3 As shown, based on any of the above implementations, step 104 uses a deep neural network model with a self-attention mechanism to match the natural language text segments corresponding to the first text data and the second text data respectively to obtain a matching result of the first text data and the second text data, specifically including the following steps:

[0072] Step 1041: input the natural language text fragments corresponding to the first text data and the second text data respectively into a deep neural network model of the self-attention mechanism.

[0073] Step 1042: Use the deep neural network model of the self-attention mechanism to match the natural language text segment of the first text data with the natural language text segment corresponding to the second text data.

[0074] Step 1043: Use the deep neural network model of the self-attention mechanism to output the matching result of the first text data and the second text data.

[0075] In this embodiment, the text matching device may first input the natural language text segment corresponding to the first text data and the natural language text segment corresponding to the second text data into the text matching device. Figure 2 In the deep neural network model of the self-attention mechanism shown in FIG. Specifically, the input can be V1-V n , where V1 is the first character in the input natural language text segment, V n The last character in the input natural language text segment.

[0076] The natural language text segment corresponding to the first text data and the natural language text segment corresponding to the second text data are respectively input into Figure 2After the model shown, the text matching device can use the deep neural network model of the self-attention mechanism to match the natural language text segment of the first text data with the natural language text segment corresponding to the second text data. Specifically, Figure 2 As shown, the first layer of the model is a multi-head self-attention layer, which is used to calculate the weight for each character in the input natural language text fragment, so as to obtain the important fragments in the natural language text according to the calculated weights, and temporarily discard some text fragments from the network according to a certain probability through the first discard layer to prevent overfitting, and use the first summation and normalization layer to sum and normalize the weights, normalize them to a probability distribution between 0 and 1, and use the forward neural network layer to perform nonlinear classification to obtain the classification boundary, and use the second discard layer and the second summation and normalization layer to repeat the above process, and use the summation and pooling layer to reduce the dimensionality of the data, and then use the Sigmoid classifier to obtain the final classification result, that is, the matching result of the first text data and the second text data.

[0077] After obtaining the matching result of the first text data and the second text data, a deep neural network model with a self-attention mechanism can be used to output the matching result of the first text data and the second text data.

[0078] In this embodiment, the natural language text segments corresponding to the first text data and the second text data are respectively input into the deep neural network model of the self-attention mechanism, the natural language text segment of the first text data and the natural language text segment corresponding to the second text data are matched using the deep neural network model of the self-attention mechanism, and the matching result of the first text data and the second text data is output using the deep neural network model of the self-attention mechanism. Since the deep learning neural network model of the self-attention mechanism has the ability to extract high-order features, it can more accurately understand and match the complex semantics of the natural language text, and thus can effectively improve the accuracy of the matching results.

[0079] Based on any of the above embodiments, in an optional embodiment, the above text matching method can be applied to the intelligent matching scenario of government policies and regulations and related enterprises. Accordingly, the first text data can be government policy and regulation text data, and the second text data can be enterprise text data. Exemplarily, the government policy and regulation text data can specifically include enterprise support policy text data, regulatory compliance legal text data, etc., which is not limited in this embodiment.

[0080] Figure 4 A flowchart of another text matching method provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the text matching method provided in this embodiment includes the following steps:

[0081] Step 401: Obtain government policy and regulation text data and enterprise text data to be matched.

[0082] Step 402: extract key features of the government policy and regulation text data and the enterprise text data respectively.

[0083] Step 403: Use a text template that matches the key feature to convert the key feature into a corresponding natural language text segment.

[0084] Step 404: Use a deep neural network model with a self-attention mechanism to match the natural language text fragments corresponding to the government policy and regulation text data and the enterprise text data, respectively, to obtain matching results of the government policy and regulation text data and the enterprise text data.

[0085] In this embodiment, in order to realize the intelligent matching of government policies and regulations with relevant enterprises, the text matching device can first obtain the government policies and regulations text data and enterprise text data to be matched. Specifically, the government policies and regulations text data and enterprise text data can be pre-stored in a database, and when a matching request triggered by a user with matching authority is received, the corresponding government policies and regulations text data and enterprise text data can be obtained from the database.

[0086] After obtaining the government policy and regulation text data and enterprise text data to be matched, the text matching device can respectively extract the key features of the government policy and regulation text data and the enterprise text data, that is, extract valuable key information from the government policy and regulation text data and the enterprise text data.

[0087] In an optional implementation, in step 402, extracting key features of the government policy and regulation text data specifically includes:

[0088] A strategic entity extraction model is used to extract key entities in the government policy and regulation text data; key texts in the government policy and regulation text data are extracted; the key texts are any one or more of the following texts: title, project description information, acceptance conditions; the key entities and the key texts are determined as key features of the government policy and regulation text data.

[0089] In this embodiment, in order to extract the key features of the government policy and regulation text data, the text matching device can use a pre-established policy entity extraction model to extract the key entities in the government policy and regulation text data. Specifically, the government policy and regulation text data can be input into a pre-established policy entity extraction model, and the policy entity extraction model can output the key entities in the government policy and regulation text data. Among them, the key entities may include the industries, industries, enterprise qualifications, enterprise types, etc. to which the government policies and regulations apply. In practical applications, industries can be specifically divided into a 4-level industry system, 20 major industry categories, and more than 1,500 minor industry categories. Industries can be specifically divided into a 4-level industry system, 23 major industry categories, and more than 2,500 minor industry categories.

[0090] After extracting the key entities in the government policy and regulation text data, the text matching device can also extract the key text in the government policy and regulation text data, wherein the key text can be any one or more of the title, project description information, and acceptance conditions in the government policy and regulation text. The project description information is an objective description of the project in the government policy and regulation, such as "support for e-commerce applications", and the acceptance conditions are the conditions that enterprises applying for the project must meet.

[0091] In an optional embodiment, when the text matching device extracts the key text in the government policy and regulation text data, it can specifically extract the text data at a preset position, and determine the text data at the preset position as the key text in the government policy and regulation text data. For example, the position of the 1st to 10th characters in the government policy and regulation text data can be used as the preset position, then the text matching device can extract the text data at the 1st to 10th character positions from the government policy and regulation text data, and determine the text data at the 1st to 10th character positions as the key text in the government policy and regulation text data. In one example, the position of the 1st to 10th characters in the government policy and regulation text data can be the position of the title in the government policy and regulation text, that is, the key text in the government policy and regulation text data extracted is the title in the government policy and regulation text.

[0092] After extracting key entities and key texts from the government policy and regulation text data, the text matching device may determine the key entities and key texts as key features of the government policy and regulation text data.

[0093] Based on the above-mentioned second embodiment, in another optional implementation manner, in step 402, extracting key features of enterprise text data specifically includes:

[0094] A data table corresponding to the enterprise text data is obtained, wherein the data table includes a plurality of key fields; a key field at a preset position is extracted from the data table; and the key field at the preset position is determined as a key feature of the enterprise text data.

[0095] In this embodiment, in order to extract the key features of the enterprise text data, the text matching device can obtain the data table corresponding to the enterprise text data from the database. In practical applications, each enterprise has a pre-built enterprise portrait and stores it in the form of a data table. The data table includes multiple key fields, each of which is stored in a different position in the data table. Specifically, it can include the enterprise's industry information, industrial information, registration information, revenue, enterprise qualifications, scientific research capabilities, and enterprise honors.

[0096] In addition, it should be noted that the industries and industrial systems used in constructing corporate portraits are consistent with the industries and industrial systems used in government policies and regulations.

[0097] After obtaining the data table corresponding to the enterprise text data, the text matching device can extract the key field of the preset position from the data table, and determine the key field of the preset position as the key feature of the enterprise text data. For example, the preset position can be the position of the 5th to 10th characters, then the text matching device can extract the key field of the 5th to 10th character position from the data table, and determine the key field of the 5th to 10th character position as the key feature of the enterprise text data. In one example, the key field of the 5th to 10th character position can be the industry information of the enterprise, that is, the industry information of the enterprise is determined as the key feature of the enterprise text data.

[0098] After respectively extracting the key features of the government policy and regulation text data and the enterprise text data, the text matching device can use a text template that matches the key features to convert the key features into corresponding natural language text fragments, and use a deep neural network model with a self-attention mechanism to match the natural language text fragments corresponding to the government policy and regulation text data and the enterprise text data, so as to obtain the matching results of the government policy and regulation text data and the enterprise text data. For the specific conversion and matching methods, please refer to the relevant content of the aforementioned embodiment one, which will not be repeated here.

[0099] For example, the natural language text fragment corresponding to the key features of government policy and regulation text data is: [Project name: 2020 Four-level Enterprise Cultivation and Selection, Industry: Manufacturing, Industry: Industry]. The natural language text fragment corresponding to the key features of enterprise text data is: [Industry (Level 1): Manufacturing, Date of Establishment: 2019-01-15, Registered Capital: 5 million, It is a scaled enterprise].

[0100] Based on any one of the above-mentioned embodiments, in an optional embodiment, the text matching method can be specifically applied in an application scenario of government policy and regulation matching related enterprises. Accordingly, step 401 specifically includes: receiving an enterprise matching request triggered by a first user, wherein the enterprise matching request includes government policy and regulation information to be matched; obtaining corresponding government policy and regulation text data based on the government policy and regulation information; and obtaining multiple pre-stored enterprise text data based on the enterprise matching request.

[0101] In this embodiment, the text matching device may receive an enterprise matching request triggered by a first user, wherein the first user may be a user with enterprise matching authority. Specifically, Figure 5 A schematic diagram of a smart matching scenario of government policies and regulations and related enterprises provided in an embodiment of the present application, such as Figure 5 As shown in the enterprise matching system interface on the left, users with enterprise matching permissions can input the government policy and regulation information to be matched through the input box in the middle of the interface, and click the "Start Matching" button below the input box to trigger the enterprise matching request. Therefore, the enterprise matching request can include the government policy and regulation information to be matched, and the government policy and regulation information can specifically be the title of the government policy and regulation, for example Figure 5 The "2020 Construction Enterprise Promotion Qualification Grade Evaluation" entered in, or the specific release time of government policies and regulations, etc., this embodiment does not limit this.

[0102] After receiving the enterprise matching request triggered by the first user, the text matching device can obtain the corresponding government policy and regulation text data according to the government policy and regulation information. For example, in one example, the text matching device can search and obtain the government policy and regulation text data corresponding to the title in the database according to the title of the government policy and regulation in the enterprise matching request. In another example, the text matching device can search and obtain the government policy and regulation text data corresponding to the corresponding release time in the database according to the specific release time of the government policy and regulation in the enterprise matching request.

[0103] After obtaining the government policy and regulation text data, the text matching device may also obtain a plurality of pre-stored enterprise text data from the database according to the enterprise matching request. Specifically, in one example, the plurality of enterprise text data may be all enterprise text data stored in the database.

[0104] In this embodiment, when obtaining government policy and regulation text data and enterprise text data to be matched, an enterprise matching request triggered by a first user is received, and the enterprise matching request includes government policy and regulation information to be matched. The corresponding government policy and regulation text data is obtained according to the government policy and regulation information, and the pre-stored multiple enterprise text data are obtained according to the enterprise matching request. The text matching method can be applied to the application scenario of government policy and regulation matching related enterprises, so that relevant enterprises that can match government policies and regulations can be accurately found, and intelligent recommendations of government policies and regulations can be made, effectively improving the redemption efficiency of government policies and regulations.

[0105] After obtaining the government policy and regulation text data and enterprise text data to be matched, and obtaining the matching results of the government policy and regulation text data and the enterprise text data according to the method provided in the above embodiment, in an optional implementation, the text matching device can display multiple enterprise text data in order from large to small according to the matching rate of the corresponding matching results.

[0106] In practical applications, the obtained matching results may include the matching rate of each enterprise text data and the government policy and regulation text data. In one example, each enterprise text data may be arranged in order of matching rate from large to small, and the enterprise text data with a matching rate greater than or equal to a preset threshold may be displayed, for example, the enterprise text data with a matching rate greater than or equal to 50% may be displayed. In another example, each enterprise text data may be arranged in order of matching rate from large to small, and a preset number of enterprise text data may be obtained from front to back for display, for example, the enterprise text data with the top ten matching rates may be displayed, such as Figure 5 As shown in the enterprise matching result interface of government policies and regulations on the middle right, the interface displays the text data of the top ten companies with the matching rate in the enterprise matching results of government policies and regulations titled "2020 Construction Enterprise Promotion Qualification Grade Selection".

[0107] Based on any one of the above-mentioned implementations, in another optional implementation, the text matching method can also be specifically applied in an application scenario in which an enterprise matches relevant government policies and regulations. Accordingly, step 401 also specifically includes: receiving a government policy and regulation matching request triggered by a second user, wherein the government policy and regulation matching request includes enterprise information to be matched; obtaining corresponding enterprise text data based on the enterprise information; and obtaining multiple pre-stored government policy and regulation text data based on the government policy and regulation matching request.

[0108] In this embodiment, the text matching device may receive a government policy and regulation matching request triggered by a second user, wherein the second user may be a user with government policy and regulation matching authority. Specifically, Figure 6A schematic diagram of another intelligent matching scenario of government policies and regulations and related enterprises provided in an embodiment of the present application, such as Figure 6 As shown in the left figure of the government policy and regulation matching system interface, users with government policy and regulation matching permissions can enter the enterprise information to be matched in the input box in the middle of the interface, and click the "Start Matching" button below the input box to trigger the government policy and regulation matching request. Therefore, the government policy and regulation matching request can include the enterprise information to be matched, and the enterprise information can specifically be the enterprise name, for example Figure 6 The "A Company" entered in, or the company's registration information, etc., are not limited in this embodiment.

[0109] After receiving the government policy and regulation matching request triggered by the second user, the text matching device can obtain the corresponding enterprise text data according to the enterprise information. For example, in one example, the text matching device can search and obtain the enterprise text data corresponding to the enterprise name in the database according to the enterprise name in the government policy and regulation matching request. In another example, the text matching device can search and obtain the enterprise text data corresponding to the corresponding registration information in the database according to the registration information of the enterprise in the government policy and regulation matching request.

[0110] After obtaining the enterprise text data, the text matching device can also obtain multiple pre-stored government policy and regulation text data from the database according to the government policy and regulation matching request. Specifically, the multiple government policy and regulation text data can be all the government policy and regulation text data stored in the database, or can be multiple government policy and regulation text data with a specific release time after a preset time. This embodiment does not limit this.

[0111] In this embodiment, when obtaining the government policy and regulation text data and enterprise text data to be matched, a government policy and regulation matching request triggered by a second user is received, the government policy and regulation matching request includes the enterprise information to be matched, the corresponding enterprise text data is obtained according to the enterprise information, and the pre-stored multiple government policy and regulation text data are obtained according to the government policy and regulation matching request. The text matching method can be applied to the application scenario of matching relevant government policies and regulations for enterprises, so that enterprise users can quickly find government policies and regulations related to them, and realize personalized matching between enterprises and government policies and regulations.

[0112] After obtaining the government policy and regulation text data and enterprise text data to be matched, and obtaining the matching results of the government policy and regulation text data and the enterprise text data according to the method provided in the above embodiments, in another optional implementation, the text matching device can display multiple government policy and regulation text data in order from large to small according to the matching rate of the corresponding matching results.

[0113] In practical applications, the obtained matching results may include the matching rate of each government policy and regulation text data and the enterprise text data. In one example, each government policy and regulation text data may be arranged in descending order according to the matching rate, and the government policy and regulation text data with a matching rate greater than or equal to a preset threshold may be displayed, for example, the government policy and regulation text data with a matching rate greater than or equal to 50% may be displayed. In another example, each government policy and regulation text data may be arranged in descending order according to the matching rate, and a preset number of government policy and regulation text data may be obtained from front to back for display, for example, the government policy and regulation text data with the top ten matching rates may be displayed, such as Figure 6 As shown in the government policy and regulation matching result interface of the enterprise on the right, the interface displays the government policy and regulation text data of the top ten matching rates among the government policy and regulation matching results of the enterprise named "Enterprise A".

[0114] The text matching method provided in this embodiment obtains the government policy and regulation text data and enterprise text data to be matched, respectively extracts the key features of the government policy and regulation text data and the enterprise text data, uses the text template matching the key features to convert the key features into corresponding natural language text fragments, and uses the deep neural network model of the self-attention mechanism to match the natural language text fragments corresponding to the government policy and regulation text data and the enterprise text data, so as to obtain the matching results of the government policy and regulation text data and the enterprise text data. That is to say, in the embodiment of the present application, the high-order feature extraction ability of the deep neural network can be used to realize the semantic understanding and matching of the natural language text of the government policy and regulation text data and the enterprise text data, so that there is no need to artificially construct structural features based on text features, which improves the accuracy of the intelligent matching results of government policies and regulations and related enterprises. In addition, the above method can accurately find relevant enterprises that can match government policies and regulations, and by actively matching and reminding relevant enterprises, it can realize the intelligent recommendation of government policies and regulations, and transform from the traditional inefficient "enterprise looking for policy" mode to the automated "policy looking for enterprise" mode, greatly improving the efficiency of government policy and regulation redemption, and forming scaled product capabilities.

[0115] Figure 7 A schematic diagram of the structure of a text matching device provided in an embodiment of the present application is shown in FIG. Figure 7As shown, the text matching device provided in this embodiment includes: an acquisition module 71, an extraction module 72, a conversion module 73 and a matching module 74. Among them, the acquisition module 71 is used to obtain the first text data and the second text data to be matched. The extraction module 72 is used to extract the key features of the first text data and the second text data respectively. The conversion module 73 is used to convert the key features into corresponding natural language text fragments using a text template that matches the key features. The matching module 74 is used to match the natural language text fragments corresponding to the first text data and the second text data respectively using a deep neural network model with a self-attention mechanism to obtain the matching results of the first text data and the second text data.

[0116] In an optional implementation, the conversion module 73 includes a determination unit and a conversion unit. The determination unit is used to determine the feature type of the key feature; determine the text template that matches the key feature according to the feature type. The conversion unit is used to convert the key feature into a corresponding natural language text segment according to the format of the matching text template.

[0117] In an optional implementation manner, the feature type of the key feature is a fixed-value feature. The determining unit is specifically configured to determine that the text template matching the key feature is a key-value pair format template according to the fixed-value feature. The converting unit is specifically configured to convert the matching key feature into a corresponding natural language text segment according to the key-value pair format of the matching text template.

[0118] In an optional implementation manner, the feature type of the key feature is a Boolean feature. The determination unit is further specifically configured to determine, based on the Boolean feature, that the text template matched by the key feature is a true value format template. The conversion unit is further specifically configured to, if the key feature is determined to be a true value, convert the matched key feature into a corresponding natural language text segment according to the true value format of the matched text template.

[0119] In an optional implementation, the matching module 74 includes an input unit, a matching unit, and an output unit. The input unit is used to input the natural language text segments corresponding to the first text data and the second text data into the deep neural network model of the self-attention mechanism. The matching unit is used to match the natural language text segment of the first text data with the natural language text segment corresponding to the second text data using the deep neural network model of the self-attention mechanism. The output unit is used to output the matching result of the first text data and the second text data using the deep neural network model of the self-attention mechanism.

[0120] In an optional implementation manner, the first text data is government policy and regulation text data, and the second text data is enterprise text data.

[0121] In an optional implementation, the extraction module 72 is specifically used to extract key entities in the government policy and regulation text data using a policy entity extraction model; extract key texts in the government policy and regulation text data; the key texts are any one or more of the following texts: title, project description information, acceptance conditions; determine the key entities and the key texts as key features of the government policy and regulation text data.

[0122] In an optional implementation, the extraction module 72 is further specifically used to obtain a data table corresponding to the enterprise text data, wherein the data table includes multiple key fields; extract the key fields at a preset position from the data table; and determine the key fields at the preset position as key features of the enterprise text data.

[0123] In an optional implementation, the acquisition module 71 is specifically used to receive an enterprise matching request triggered by a first user, wherein the enterprise matching request includes government policy and regulation information to be matched; obtain corresponding government policy and regulation text data based on the government policy and regulation information; and obtain multiple pre-stored enterprise text data based on the enterprise matching request.

[0124] In an optional implementation manner, the text matching device further comprises: a display module. The display module is used to display the plurality of enterprise text data in the order of the matching rates of the corresponding matching results from large to small.

[0125] In an optional implementation, the acquisition module 71 is further specifically used to receive a government policy and regulation matching request triggered by a second user, wherein the government policy and regulation matching request includes enterprise information to be matched; obtain corresponding enterprise text data based on the enterprise information; and obtain multiple pre-stored government policy and regulation text data based on the government policy and regulation matching request.

[0126] In an optional implementation manner, the display module is further used to display a plurality of government policy and regulation text data in descending order according to the matching rates of the corresponding matching results.

[0127] It should be noted that the technical solutions and effects implemented by the text matching device provided in this embodiment can be found in the relevant contents of the aforementioned method embodiments, which will not be repeated here.

[0128] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 8 As shown, the present application also provides an electronic device 800 , including: a memory 801 and a processor 802 .

[0129] The memory 801 is used to store programs. Specifically, the program may include program codes, and the program codes include computer-executable instructions. The memory 801 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.

[0130] The processor 802 is used to execute the program stored in the memory 801 .

[0131] The computer program is stored in the memory 801 and is configured to be executed by the processor 802 to implement the text matching method provided in any embodiment of the present application. The relevant description can be understood by referring to the relevant descriptions and effects corresponding to the steps in the accompanying drawings, and no further details are given here.

[0132] In this embodiment, the memory 801 and the processor 802 are connected via a bus. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0133] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. The computer program is executed by a processor to implement the text matching method provided in any embodiment of the present application.

[0134] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the text matching method provided by any embodiment of the present application.

[0135] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0136] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0137] In addition, each functional module in each embodiment of the present application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0138] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable text matching device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or the block diagram to be implemented. The program code can be executed completely on the machine, partially on the machine, partially on the machine as an independent software package and partially on a remote machine or completely on a remote machine or server.

[0139] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0140] In addition, although each operation is described in a specific order, this should be understood as requiring such operation to be performed in the specific order shown or in a sequential order, or requiring that all illustrated operations should be performed to obtain desired results. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the application. Some features described in the context of a separate embodiment can also be implemented in a single implementation in combination. On the contrary, the various features described in the context of a single implementation can also be implemented in multiple implementations individually or in any suitable sub-combination mode.

[0141] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0142] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A text matching method, characterized in that: include: Acquire first text data and second text data to be matched; extracting key features of the first text data and the second text data respectively; Determining a text template matching the key feature according to a feature type of the key feature, wherein the feature type of the key feature includes a fixed value feature and a Boolean feature; Converting the key features into corresponding natural language text segments according to the format of the matching text template; A deep neural network model using a self-attention mechanism is used to match the natural language text segments corresponding to the first text data and the second text data respectively, so as to obtain a matching result of the first text data and the second text data.

2. The method according to claim 1, characterized in that Before determining the text template matching the key feature according to the feature type of the key feature, the method further includes: The feature type of the key feature is determined.

3. The method according to claim 2, characterized in that The feature type of the key feature is a fixed value feature; The step of determining the text template matching the key feature according to the feature type includes: Determine, according to the fixed value feature, that the text template matching the key feature is a key-value pair format template; The step of converting the key features into corresponding natural language text segments according to the format of the matching text template includes: The matched key features are converted into corresponding natural language text segments according to the key-value pair format of the matched text template.

4. The method according to claim 2, characterized in that: The feature type of the key feature is a Boolean feature; The step of determining the text template matching the key feature according to the feature type includes: Determine, according to the Boolean feature, that the text template matching the key feature is a true value format template; The step of converting the matched key features into corresponding natural language text segments according to the key-value pair format of the matched text template includes: If it is determined that the key feature is a true value, the matched key feature is converted into a corresponding natural language text segment according to the true value format of the matched text template.

5. The method according to any one of claims 1 to 4, characterized in that: The first text data is government policy and regulation text data, and the second text data is enterprise text data.

6. The method according to claim 5, characterized in that Extract key features of the government policy and regulation text data, including: Using a strategic entity extraction model to extract key entities in the government policy and regulation text data; Extract key text from the government policy and regulation text data; the key text is any one or more of the following texts: title, project description information, acceptance conditions; The key entities and the key texts are determined as key features of the government policy and regulation text data.

7. The method according to claim 5, characterized in that The obtaining of the government policy and regulation text data and the enterprise text data to be matched includes: Receiving an enterprise matching request triggered by a first user, wherein the enterprise matching request includes government policy and regulation information to be matched; Acquire corresponding government policy and regulation text data according to the government policy and regulation information; A plurality of pre-stored enterprise text data is acquired according to the enterprise matching request.

8. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.

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

Citation Information

Patent Citations

  • Text information processing method, system and device and computer readable storage medium

    CN111460827A

  • Text matching method, device and equipment and storage medium

    CN112307179A