Matching model training method, object matching method and computer equipment
Through the obtaining and processing information of the government industry in government service scenarios, training high -accuracy matching models, the problem of low efficiency and accuracy of government service matching tasks in existing technologies, and achieved more efficient matching tasks.
Patent Information
- Application Number
- CN202310889861.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-19
- Publication Date
- 2025-01-28
AI Technical Summary
The prior art cannot effectively match at least two events or events and matters in government service scenarios, resulting in low task matching efficiency and accuracy.
By obtaining the information of the government industry, the mask processing generates training data sets to train the target matching task model to improve the diversity and accuracy of the matching model.
The efficiency and accuracy of the matching model determine the matching tasks, can identify the terms of the government industry, the semantics of sentences in the text, and the tasks of multi -government affairs, and improve the accuracy of downstream matching tasks.
Smart Images

Figure CN119377659A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a matching model training method, an object matching method, an apparatus, a computer device and a storage medium. Background Art
[0002] With the rapid development of Internet technology, more and more Internet-based service systems have begun to appear or have been applied in different service fields. For example, the Internet and government service technology system applied to government service agencies has begun to be built. However, while building the Internet and government service technology system, it also has to face many problems, such as the matching accuracy of at least two events or events and matters.
[0003] In the related art, since the pre-trained corpus does not include data related to government services, in the scenario of government services, it is impossible to match at least two events or events and matters, etc., which affects the task matching efficiency of government services. Summary of the invention
[0004] The embodiments of the present application provide a matching model training method, an object matching method, an apparatus, a computer device and a storage medium, which can improve the diversity of training matching model samples, train a matching model with high matching accuracy, and thereby improve the efficiency and accuracy of the matching model in determining matching tasks.
[0005] According to a first aspect of an embodiment of the present application, a matching model training method is provided, comprising:
[0006] Obtain government industry information;
[0007] Performing mask processing on the first object to obtain a first training data set, wherein the first object includes at least one of the following: government affairs industry information and knowledge triplet information corresponding to the government affairs industry information;
[0008] The initial matching task model is trained using the first training data set to obtain a target matching task model.
[0009] According to a second aspect of an embodiment of the present application, there is provided an object matching method, including:
[0010] Receiving a matching request sent by a user terminal, where the matching request includes first government affairs industry information;
[0011] Inputting the first government affairs industry information into the target matching task model to obtain target matching information matching the first government affairs industry information;
[0012] Send target matching information to the user end;
[0013] Among them, the target matching task model is trained by a first training data set, a second training data set and a manually annotated supervised text data set. The first training data set is determined by a first object, and the first object includes at least one of the following: government affairs industry information, and knowledge triple information corresponding to the government affairs industry information. The second training data set is determined by sentences marked with classification identifiers in the government affairs industry information; the target matching information includes at least one of the following: events similar to the first government affairs industry information, matters to which the first government affairs industry information belongs, and processing departments corresponding to the first government affairs industry information.
[0014] According to a third aspect of an embodiment of the present application, there is provided an object matching method, including:
[0015] Receiving a matching request sent by a user terminal, where the matching request includes first government affairs industry information;
[0016] According to the matching request, a target matching scenario corresponding to the matching request is obtained, where the target matching scenario includes a task recall matching scenario and a task sorting matching scenario;
[0017] According to the target matching scenario, a target matching task model is obtained, wherein the target matching task model is trained by a first training data set, a second training data set, and a manually annotated supervised text data set, the first training data set is determined by a first object, the first object includes at least one of the following: government industry information, knowledge triple information corresponding to the government industry information, the second training data set is determined by sentences marked by classification identifiers in the government industry information, and the target matching task model includes a first sub-target matching task model corresponding to a task recall matching scenario and a second sub-target matching task model corresponding to a task sorting matching scenario;
[0018] Inputting the first government affairs industry information into the first sub-goal matching task model to obtain candidate matching information corresponding to the first government affairs industry information;
[0019] Input the candidate matching information into the second sub-target matching task model to obtain target matching information corresponding to the first government affairs industry information, wherein the target matching information includes at least one of the following: an event similar to the first government affairs industry information, a matter to which the first government affairs industry information belongs, and a processing department corresponding to the first government affairs industry information;
[0020] Send target matching information to the user end.
[0021] According to a fourth aspect of an embodiment of the present application, a matching model training device is provided, including:
[0022] Acquisition module, used to obtain government affairs industry information;
[0023] A processing module, configured to perform mask processing on a first object to obtain a first training data set, wherein the first object includes at least one of the following: government affairs industry information, and knowledge triplet information corresponding to the government affairs industry information;
[0024] The training module is used to train the initial matching task model using the first training data set to obtain a target matching task model.
[0025] According to a fifth aspect of an embodiment of the present application, there is provided an object matching device, including:
[0026] A receiving module, used for receiving a matching request sent by a user terminal, wherein the matching request includes first government affairs industry information;
[0027] A processing module, used for inputting the first government affairs industry information into the target matching task model to obtain target matching information matching the first government affairs industry information;
[0028] Among them, the target matching task model is trained by a first training data set, a second training data set and a manually annotated supervised text data set. The first training data set is determined by a first object, and the first object includes at least one of the following: government affairs industry information, and knowledge triple information corresponding to the government affairs industry information. The second training data set is determined by sentences marked with classification identifiers in the government affairs industry information; the target matching information includes at least one of the following: events similar to the first government affairs industry information, matters to which the first government affairs industry information belongs, and processing departments corresponding to the first government affairs industry information.
[0029] According to a sixth aspect of an embodiment of the present application, there is provided an object matching device, including:
[0030] A receiving module, used for receiving a matching request sent by a user terminal, wherein the matching request includes first government affairs industry information;
[0031] An acquisition module is used to acquire a target matching scenario corresponding to the matching request according to the matching request, where the target matching scenario includes a task recall matching scenario and a task sorting matching scenario;
[0032] The acquisition module is also used to acquire a target matching task model according to a target matching scenario, wherein the target matching task model is trained by a first training data set, a second training data set, and a manually annotated supervised text data set, the first training data set is determined by a first object, the first object includes at least one of the following: government industry information, knowledge triple information corresponding to the government industry information, the second training data set is determined by sentences marked by classification identifiers in the government industry information, and the target matching task model includes a first sub-target matching task model corresponding to a task recall matching scenario and a second sub-target matching task model corresponding to a task sorting matching scenario;
[0033] A processing module, used for inputting the first government affairs industry information into the first sub-goal matching task model to obtain candidate matching information corresponding to the first government affairs industry information;
[0034] The processing module is further used to input the candidate matching information into the second sub-target matching task model to obtain target matching information corresponding to the first government affairs industry information, wherein the target matching information includes at least one of the following: an event similar to the first government affairs industry information, a matter to which the first government affairs industry information belongs, and a processing department corresponding to the first government affairs industry information;
[0035] The sending module is used to send target matching information to the user end.
[0036] According to a seventh aspect of an embodiment of the present application, there is provided a computer device, including: a memory and a processor;
[0037] A memory for storing a computer program;
[0038] A processor is used to execute a computer program stored in a memory, and when the computer program is run, the processor executes the steps of the matching model training method shown in the first aspect, or the steps of the object matching method shown in any aspect of the second aspect or the third aspect.
[0039] According to an eighth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a computer device, the computer device executes the steps of the matching model training method shown in the first aspect, or the steps of the object matching method shown in any of the second or third aspects.
[0040] According to the ninth aspect of the embodiments of the present application, a computer program product is provided, including a computer program. When the computer program is executed by a computer device, the computer device executes the steps of the matching model training method shown in the first aspect, or the steps of the object matching method shown in any of the second aspect or the third aspect.
[0041] In the matching model training method, device, computer equipment and storage medium in the embodiment of the present application, the first training data set is obtained by obtaining government industry information and performing masking processing on the first object, wherein the first object includes at least one of the following: government industry information and knowledge triple information corresponding to the government industry information; then, the initial matching task model is trained through the first training data set to obtain the target matching task model. In this way, by masking the accumulated massive government industry information and the knowledge triple information corresponding to the government industry information, the first training data set after masking the keywords, entities and triple information in the government industry information is obtained. In this way, the initial matching task model is trained and learned through the first training data set obtained by masking different types of information, so as to train a target matching task model that can recognize government industry terms, sentence semantics in government industry texts, and tasks in multiple government fields, and obtain a target matching task model with high task matching accuracy, thereby achieving the accuracy of determining downstream matching tasks through the target matching task model. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The present application may be better understood from the following description of specific embodiments of the present application in conjunction with the accompanying drawings, wherein the same or similar figure numbers represent the same or similar features.
[0043] Figure 1 is a flow chart showing a matching model training method according to an embodiment;
[0044] Figure 2 is a schematic diagram showing a process of determining a first training data set in a matching model training method according to an embodiment;
[0045] Figure 3 is a schematic diagram showing a flow chart of determining a second training data set in a matching model training method according to an embodiment;
[0046] Figure 4 is one of the schematic diagrams showing events in a matching model training method according to an embodiment;
[0047] Figure 5 is a second schematic diagram showing events in a matching model training method according to an embodiment;
[0048] Figure 6 is a schematic diagram showing a flow chart of an object matching method according to an embodiment;
[0049] Figure 7 is a flow chart showing another object matching method according to an embodiment;
[0050] Figure 8is a schematic structural diagram showing a matching model training device according to an embodiment;
[0051] Fig. 9 is a schematic structural diagram showing an object matching device according to an embodiment;
[0052] Fig.10 is a schematic structural diagram showing another object matching device according to an embodiment;
[0053] Fig.11 FIG. 4 is a schematic diagram showing the hardware structure of a computer device according to an embodiment. DETAILED DESCRIPTION
[0054] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and Examples. It should be understood that the specific embodiments described herein are only configured to explain the present application and are not configured to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0055] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0056] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0057] In order to solve the above problems, an embodiment of the present application provides a matching model training method for government industry information. On the basis of mastering general knowledge with a general large model, on the one hand, it can mine the sentence semantics and knowledge triple information in the government industry information to conduct large-scale unsupervised and supervised joint training; on the other hand, it introduces manually annotated supervised text data sets accumulated from actual industry services to design industry-specific tasks; and, for various different matching architectures in each matching scenario, different initial matching task models are provided, so that the trained target matching task model can recognize government industry terminology, sentence semantics in government industry texts, and target matching task models for tasks in multiple government fields, thereby obtaining a target matching task model with high task matching accuracy, thereby achieving the goal of improving the accuracy of determining downstream matching tasks through the target matching task model.
[0058] Here, the matching architecture can include a sentence vector algorithm architecture based on a twin network (Sentence Embeddingsusing Siamese BERT-Networks, SentenceBert), a sentence vector algorithm architecture based on simple contrastive learning (Simple Contrastive Learning of Sentence Embeddings, SimCSE), a sentence vector algorithm architecture based on cosine similarity (cosine sentence, CoSent), and an interactive algorithm architecture.
[0059] Based on this, the following are combined Figures 1 to 8 The matching model training process and the object matching process are explained.
[0060] Figure 1 It is a flowchart showing a matching model training method according to an embodiment.
[0061] like Figure 1 As shown, the matching model training method provided in the embodiment of the present application may include:
[0062] Step 110, obtaining government industry information; Step 120, performing mask processing on the first object to obtain a first training data set, wherein the first object includes at least one of the following: government industry information, and knowledge triple information corresponding to the government industry information; Step 130, training the initial matching task model through the first training data set to obtain a target matching task model.
[0063] In this way, by masking the accumulated massive government industry information and the knowledge triple information corresponding to the government industry information, the first training data set after masking the keywords, entities and triple information in the government industry information is obtained. The initial matching task model is trained and learned by the first training data set obtained by masking different types of information to train a target matching task model that can recognize government industry terminology, sentence semantics in government industry texts, and tasks in multiple government fields, and obtain a target matching task model with high task matching accuracy, thereby achieving the goal of improving the accuracy of determining downstream matching tasks through the target matching task model.
[0064] The above steps are described in detail below, as shown below.
[0065] Involving step 110, a massive amount of government industry information is collected in the embodiment of the present application, wherein the government industry information may include matter text, event text and government industry knowledge, wherein the government industry knowledge includes two types of data: industry terminology and industry triples.
[0066] In step 120, the first training data set in the embodiment of the present application may include at least one of the following samples: a first spliced sample, a second spliced sample, a first masked sample, and a second masked sample. Here, the embodiment of the present application provides the following four methods to determine the above four samples, as shown below.
[0067] In one or more possible embodiments, the first training data set includes a first concatenated sample, and the knowledge triple information includes a head entity word, a relation word, and a tail entity word. Based on this, step 120 may specifically include:
[0068] Masking is performed on at least one of the head entity word, the relation word, and the tail entity word to obtain masked triplet information;
[0069] The information obtained by splicing the mask triplet information and the government affairs industry information is determined as the first splicing sample.
[0070] Exemplarily, the first training data set is determined based on a mask strategy of knowledge graph triples. Figure 2 As shown in the figure, the government affairs industry information is "What is the phone number and address of the Civil Affairs Bureau? I want to go there to apply for a marriage certificate." Here, based on the government affairs industry information, the knowledge triple "marriage certificate-organizer-Civil Affairs Bureau" can be obtained, where the head entity word is "marriage certificate", the relation word is "organizer", and the tail entity word is "Civil Affairs Bureau". Here, the relation word can be directly extracted from the government affairs industry information, or it can be generated based on the content of the government affairs industry information.
[0071] Next, one of the head entity word, the relation word, and the tail entity word can be masked according to probability. The head entity word is masked to obtain masked triple information such as "###-organizer-Civil Affairs Bureau", and / or the relation word is masked to obtain masked triple information such as "marriage certificate-####-Civil Affairs Bureau", and / or the tail entity word is masked to obtain masked triple information such as "marriage certificate-organizer-###".
[0072] Furthermore, the information obtained by splicing masked triple information such as "###-organizer-Civil Affairs Bureau" and "What is the phone number and address of the Civil Affairs Bureau? I want to apply for a marriage certificate" is determined as the first splicing sample 1, the information obtained by splicing masked triple information such as "marriage certificate-####-Civil Affairs Bureau" and "What is the phone number and address of the Civil Affairs Bureau? I want to apply for a marriage certificate" is determined as the first splicing sample 2, and the information obtained by splicing masked triple information such as "marriage certificate-organizer-###" and "What is the phone number and address of the Civil Affairs Bureau? I want to apply for a marriage certificate" is determined as the first splicing sample 3. Based on this, the first splicing sample 1, the first splicing sample 2, and the first splicing sample 3 can all be added to the first training data set.
[0073] Therefore, the initial matching task model can be trained by the first training data set to identify knowledge triples, entity words and relationship words in government industry information.
[0074] Here, entity words in the embodiment of the present application can be words for abstract things and entity things in the knowledge graph, such as people, places, organizations, concepts, etc. Relation words can be words for internal attributes and external relationships of things involved in the knowledge graph, such as relationship words between people, relationship words between people and organizations, relationship words between concepts and certain objects.
[0075] In one or more other possible embodiments, the first training data set includes the second spliced sample. Based on this, step 120 may specifically include:
[0076] Masking at least one entity word in the government affairs industry information to obtain masked entity information;
[0077] The information obtained by splicing the masked entity information and the knowledge triplet information is determined as the second splicing sample.
[0078] Exemplarily, still taking the above example, a random masking algorithm can be used to mask at least one entity word in "May I ask what is the telephone number and address of the Civil Affairs Bureau? I want to go to apply for a marriage certificate.", where at least one entity word is such as "Civil Affairs Bureau," "telephone," "address," and "marriage certificate." In this way, multiple masked entity information can be obtained, such as "May I ask what is the telephone number and address of ###? I want to apply for a marriage certificate," "May I ask what is the ## and address of ###? I want to apply for a marriage certificate," "May I ask what is the telephone number and address of the Civil Affairs Bureau? I want to go to apply for ###," and so on.
[0079] At this time, you can splice "Marriage Certificate-Organizer-Civil Affairs Bureau" with "Please ask what is the phone number and address of ###, I want to apply for a marriage certificate" to get the second splicing sample 1, splice "Marriage Certificate-Organizer-Civil Affairs Bureau" with "Please ask what is the ## and address of ###, I want to apply for a marriage certificate" to get the second splicing sample 2, and so on.
[0080] In one or more possible embodiments, the first training data set includes a first mask sample, and the government industry information includes at least one of the following: a keyword, an entity word. Based on this, step 120 may specifically include:
[0081] Masking at least one of the keywords and entity words in the government affairs industry information to obtain first masked government affairs information;
[0082] The first masked government affairs information is determined as the first masked sample.
[0083] For example, for the mask strategy of keywords and entity words of government industry information, Figure 3 As shown, the government affairs industry information is "I am a resident of XX community. The road section near my home is flooded, posing a safety hazard. I hope the relevant departments will deal with it as soon as possible." At this point, the entity "road section" and the keyword "flooding" in the government affairs industry information can be masked to obtain the first masked sample, that is, "I am a resident of XX community. The ## near my home has ## phenomenon, posing a safety hazard. I hope the relevant departments will deal with it as soon as possible."
[0084] In this way, the probability of keyword masking in government industry information can be increased.
[0085] Based on the above example, in one example, the first training data set also includes a second mask sample. Based on this, the matching model training method provided in the embodiment of the present application may also include:
[0086] When the proportion of the masked part in the first masked government affairs information is less than or equal to the first threshold, masking the first word in the first masked government affairs information to obtain second masked government affairs word information, where the first word is determined by a random algorithm;
[0087] The second masked government affairs information is determined as the second masked sample.
[0088] For example, taking the above example, if the masked part of the first masked government information, i.e., "I am a resident of XX community, ## phenomenon has occurred in the ## near my home, posing a safety hazard. I hope the relevant departments will deal with it as soon as possible", is less than or equal to 15% of the first masked government information, then the first word such as "XX community" and "safety hazard" is randomly selected in the first masked government information for masking to obtain the second masked government word information, such as "I am a ## in XX community, ## phenomenon has occurred in the ## near my home, posing a ####. I hope the relevant departments will deal with it as soon as possible."
[0089] It should be noted that in one or more possible embodiments, before executing step 120, it can be determined based on the government affairs industry information whether there is knowledge triple information corresponding to the government affairs industry information. If it is determined that there is knowledge triple information corresponding to the government affairs industry information, the first two methods mentioned above can be used to determine the first training data set. Conversely, if it is determined that there is no knowledge triple information corresponding to the government affairs industry information, the last two methods mentioned above can be used to determine the first training data set.
[0090] Thus, in an embodiment of the present application, by designing word-level tasks and full-word mask prediction based on industry terminology knowledge, in order to better enhance the initial matching task model's understanding of industry domain data, the present application incorporates industry terminology knowledge based on random full-word mask prediction tasks, and implements masking on keywords, entities, and knowledge triplet information. In this way, compared with only using a random masking strategy, this method can better improve the modeling of local context dependencies and global context dependencies of the initial matching task model for government industry information.
[0091] In step 130, the embodiment of the present application can train the initial matching task model through the first training data set to obtain the target matching task model; or can train the initial matching task model through the first training data set and the target training data set to obtain the target matching task model, wherein the target training data set can include at least one of the following: the second training data set, the manually annotated text matching data set. Based on this, the step 130 is specifically described below for the above different situations.
[0092] In one or more possible embodiments, step 130 may specifically include:
[0093] The initial matching task model is trained by using the first training data set and the second training data set to obtain a target matching task model;
[0094] Based on this, before step 130, the matching model training method provided in the embodiment of the present application may further include:
[0095] According to the sentence level, the sentences in the government affairs industry information are classified and labeled to obtain a second training data set.
[0096] Here, the sentence level in the embodiment of the present application can be the basic unit of language application after the punctuation marks divide the text paragraphs, or it can be a structure composed of words or words (phrases) that can express meaning, where punctuation marks include but are not limited to quotation marks, brackets, dashes, ellipsis marks, emphasis marks, connectors, separators, book title marks, proper noun marks, etc.
[0097] The second training data set in the embodiment of the present application may include at least one of the following samples: a first classification identification sample, a second classification identification sample, and a third classification identification sample. Here, the embodiment of the present application provides the following method to determine the aforementioned samples, as shown below.
[0098] In one or more possible examples, the second training data set includes first classification identification samples. Based on this, step 130 may specifically include:
[0099] According to the sentence level, the government affairs industry information is divided into M sentences, where M is a positive integer;
[0100] Get the distance between any two sentences in M sentences;
[0101] When the distance represents that any two sentences are adjacent sentences, the first classification mark is used to classify and mark any two sentences to obtain a first classification mark sample.
[0102] For example, Figure 4As shown, government affairs industry information may include the content in event 1. Event 1 is divided according to each punctuation mark, so that 5 sentences can be obtained. The distance between any two sentences in the 5 sentences, such as "XXX works in Xinbei District" and "He is a fresh graduate of XXX College in 2022", is calculated respectively. If the distance between any two sentences is 2, and the distance 2 is less than the preset threshold 5, it indicates that any two sentences are adjacent sentences. At this time, "XXX works in Xinbei District" and "He is a fresh graduate of XXX College in 2022" can be classified and marked by the first classification mark such as "0", and the first classification mark sample is obtained, that is, "XXX works in Xinbei District" [0] and "He is a fresh graduate of XXX College in 2022" [0]. Alternatively, the government industry information can be "XX works in Xinbei District and is a 2022 graduate of XXX College". At this time, the sentence can be divided according to the structure that can express meaning composed of words or phrases (phrases), and two sentences are obtained, namely "XX works in Xinbei District" and "XX is a 2022 graduate of XXX College".
[0103] In another one or more possible examples, the government affairs industry information includes N government affairs industry event texts, where N is a positive integer; the second training data set also includes a second classification identification sample. Based on this, the matching model training method provided in the embodiment of the present application may also include:
[0104] Performing semantic analysis on each of the M sentences to obtain a sentence relationship between at least two of the M sentences, wherein the sentence relationship includes a first sentence relationship, and the first sentence relationship indicates that at least two sentences belong to the same government affairs industry event text among the N government affairs industry event texts;
[0105] Through the second classification mark, the sentences in the M sentences that meet the first sentence relationship are classified and marked to obtain second classification mark samples.
[0106] For example, Figure 5As shown, the government affairs industry information may include two government affairs industry event texts, namely, event 1 and event 2. Event 1 is divided according to each punctuation mark, so that 5 sentences can be obtained. Similarly, event 2 is divided according to each punctuation mark, and 6 sentences can be obtained. At this time, M is 11. Then, semantic analysis is performed on each of the 11 sentences to obtain the first sentence relationship between at least two of the 11 sentences, such as "XXX works in Xinbei District" and "but has not received subsidies so far" belong to the same government affairs industry event text, that is, both are in event 1 and are the same event. At this time, "XXX works in Xinbei District" and "but has not received subsidies so far" can be classified and marked by the second classification mark such as "1", and the second classification mark samples can be obtained, namely "XXX works in Xinbei District" [1] and "but has not received subsidies so far" [1].
[0107] It should be noted that here, in addition to using the second classification identifier to classify and mark the sentences in the M sentences that meet the relationship with the first sentence to obtain the second classification identifier sample, the second classification identifier can also be used to classify and mark the sentences in the M sentences that are not marked with the first classification identifier and meet the relationship with the first sentence to obtain the second classification identifier sample.
[0108] For example, still using the above example, since "XXX works in Xinbei District" has been marked with the first classification mark, in this example, "but has not received any subsidy so far" can be classified and marked with the second classification mark such as "1" to obtain the second classification mark sample, namely "but has not received any subsidy so far" [1].
[0109] In one or more possible examples, the second training data set further includes a third classification identification sample; the sentence relationship further includes a second sentence relationship, and the second sentence relationship represents that at least two sentences belong to different government affairs industry event texts in the N government affairs industry event texts. Based on this, the matching model training method provided in the embodiment of the present application may also include:
[0110] Through the third classification mark, the sentences in the M sentences that meet the second sentence relationship are classified and marked to obtain third classification mark samples.
[0111] For example, Figure 5As shown, still using the above example, semantic analysis is performed on each of the 11 sentences to obtain the second sentence relationship between at least two of the 11 sentences, such as "XXX works in Xinbei District" and "XXX identifies that one of the breads he purchased through store A was moldy" belong to different government industry event texts, that is, "XXX works in Xinbei District" in event 1, and "XXX identifies that one of the breads he purchased through store A was moldy" in event 2, which are different events. At this time, "XXX works in Xinbei District" and "XXX identifies that one of the breads he purchased through store A was moldy" can be classified and marked by the third classification mark such as "2" to obtain the second classification mark sample, namely "XXX works in Xinbei District"[2] and "XXX identifies that one of the breads he purchased through store A was moldy"[2].
[0112] It should be noted that in some scenarios, only one classification identifier may be marked for each sentence, so that the priority of the three classification identifiers involved above may be that the priority of the first classification identifier is higher than the priority of the second classification identifier and the priority of the second classification identifier. In other scenarios, at least one of the three classification identifiers may be marked for each sentence, which is not limited here.
[0113] Therefore, the embodiment of the present application expands the traditional two-category unsupervised sentence-level task of next sentence prediction and improves it into a three-category problem, namely, adjacent sentences, non-adjacent sentences but belonging to the same event, and sentences belonging to different events. In this way, by designing sentence-level tasks and semantic distance judgment tasks, the initial matching task model is trained to understand the structure and semantics of government industry texts, so as to identify the semantics of sentences in government industry texts.
[0114] In one or more other possible embodiments, step 130 may specifically include:
[0115] The initial matching task model is trained by using the first training data set and the manually annotated text matching data set to obtain a target matching task model;
[0116] Based on this, before step 130, the matching model training method provided in the embodiment of the present application may further include:
[0117] From the actual government affairs industry data of the downstream task nodes, where the downstream task nodes are nodes that have provided government affairs services;
[0118] Receive user input of actual government affairs industry data;
[0119] In response to the tag input, the tagged actual government affairs industry data is determined as a manually annotated text matching data set.
[0120] Exemplarily, the matching task is the most common task in the government affairs industry. Therefore, after the model has a certain general semantic matching ability in the pre-training stage, it is fine-tuned through the actual government affairs industry data of the actual downstream tasks to improve the accuracy of the training initial matching task model. Due to the differences in the annotation standards of different matching data sets, in order to prevent the model from being confused during the training process, the embodiment of the present application constructs a multi-task training sample by means of a prompt language model (Prompt) to enhance the semantic understanding ability of the model, that is, to obtain 13 open source manually annotated text matching data sets, covering various fields, and adding pre-training tasks. For urban event data, most of them contain matters, and the events of item labels can be considered similar. Combined with the characteristics of government event data, a manually annotated text matching data set for similar event matching or event-matter matching tasks is provided.
[0121] In one or more possible embodiments, based on this, step 130 may specifically include:
[0122] In the case where the initial matching task model includes k initial matching task models, according to the matching scenario, a target initial matching task model corresponding to the matching scenario is obtained from the k initial matching task models;
[0123] The target initial matching task model is trained using the first training data set, the second training data set and the manually annotated supervised text data set to obtain a target matching task model.
[0124] It should be noted that when the matching scenario is a task recall matching scenario, the target initial matching task model is a dual-tower matching model; when the matching scenario is a task sorting matching scenario, the target initial matching task model is an interactive matching model. For example, in actual services in industry-related scenarios, matching models are usually used in the recall and sorting stages. In the recall stage, for speed considerations, when the matching scenario is a task recall matching scenario, the target initial matching task model used in the embodiment of the present application is a dual-tower matching model. In the sorting stage, an interactive matching model with better results but slower reasoning speed is used.
[0125] In this way, various matching architectures were used in various previous matching scenarios, and it is difficult for a single pre-training model to achieve improved results on all architectures. Therefore, the embodiments of the present application design and integrate different pre-training paradigms for different matching architecture goals to adapt to various actual downstream application scenarios. By combining supervised matching data sets in the government affairs field and the general field for matching pre-training, the model can have a certain general semantic matching ability in the pre-training stage, and the effect of fine-tuning on downstream tasks will also be better.
[0126] Therefore, a first training data set can be obtained by acquiring government industry information and performing mask processing on the first object, wherein the first object includes at least one of the following: government industry information and knowledge triple information corresponding to the government industry information; then, the sentences in the government industry information are classified and labeled at the sentence level to obtain a second training data set; then, the initial matching task model is trained using the first training data set, the second training data set and the manually annotated supervised text data set to obtain a target matching task model. In this way, by masking the accumulated massive government industry information and the knowledge triple information corresponding to the government industry information, a first training data set is obtained after masking the keywords, entities and triple information in the government industry information; then, according to the sentence level, combined with semantic analysis, the sentences in the government industry information are classified and labeled to obtain a second training data set, so as to improve the initial matching task model's ability to understand the structure and semantics of the government industry information. In addition, since the annotation standards of different data sets are different, in order to prevent the initial matching task model from being confused during the training process, the present application provides an open source manually annotated supervised text data set covering various government fields. In this way, the initial matching task model is trained and learned through different types of data sets to train a target matching task model that can recognize government industry terminology, sentence semantics in government industry texts, and tasks in multiple government fields, so as to obtain a target matching task model with high task matching accuracy, thereby achieving the goal of improving the accuracy of determining downstream matching tasks through the target matching task model.
[0127] In addition, after step 130, the matching model training method provided in the embodiment of the present application may further include:
[0128] Receiving a matching request sent by a user terminal, the matching request including target government affairs industry information;
[0129] According to the matching request, a target matching scenario corresponding to the matching request is obtained, where the target matching scenario includes a task recall matching scenario and a task sorting matching scenario;
[0130] Input the target government affairs industry information into the target matching task model corresponding to the double-tower matching model to obtain candidate matching information corresponding to the target government affairs industry information;
[0131] Inputting the candidate matching information into the target matching task model corresponding to the interactive matching model to obtain the target matching information corresponding to the target government affairs industry information;
[0132] Sending target matching information to the user terminal. Based on this, the matching model training method provided in the embodiment of the present application may also include:
[0133] The target matching task model corresponding to the dual-tower matching model is adjusted through the candidate matching information; and the target matching task model corresponding to the interactive matching model is adjusted through the target matching information.
[0134] It should be noted that the initial matching task model in the embodiment of the present application can be a large-scale natural language processing pre-training model (Bidirectional Encoder Representations from Transformers, BERT).
[0135] Therefore, through the pre-training and fine-tuning paradigm model of the BERT model, the SOTA BERT model ChineseRoberta can be used as the base to collect the first training data set and the second training data set, and the initial matching task model is trained in the first stage based on the first training data set and the second training data set. Then, the effect is verified through the actual downstream government industry data, and a target matching task model that can identify government industry terminology, sentence semantics in government industry texts, and tasks in multiple government fields is obtained, thereby obtaining a target matching task model with high task matching accuracy, and then achieving the goal of improving the accuracy of determining downstream matching tasks through the target matching task model.
[0136] In summary, the matching model training method provided in the embodiment of the present application, in order to inject industry knowledge into the pre-trained model, precipitates a large amount of industry unsupervised text and ten thousand-level industry knowledge, and realizes the modeling of local context dependence and global context dependence of the mask-enhanced model for industry text at the keyword, entity, and triple level through knowledge masking. Compared with the random full-word masking strategy (without integrating industry terminology knowledge), the model pre-trained by the masking strategy integrating industry terminology knowledge is 1.7 points higher on average in the evaluation index in the fine-tuning of matching and extraction downstream tasks. In the pre-training stage, in order to enhance the model's understanding of the sentence structure and semantics of industry data, in addition to unsupervised tasks, similar event matching tasks are designed in combination with the characteristics of industry data, and 13 public data matching data sets are collected at the same time. Samples are constructed in the form of prompt language models (Prompt), so that the model has a certain general semantic matching ability in the pre-training stage, and the effect of fine-tuning on downstream tasks will also be better. Experiments show that the pre-trained model that integrates supervised matching data sets in the government affairs field and the general field is 4.1 points higher on average in the fine-tuning evaluation index of downstream matching tasks.
[0137] It should be noted that the matching model training method provided in the embodiment of the present application can inherit various matching architectures (SentenceBert, SimCSE, CoSent, interactive) into the pre-trained model, can be applied to different application scenarios in the downstream government field, and has been verified in repeated event recognition, event matching scenarios, and power scenarios.
[0138] Based on the above trained target matching task model, the present application embodiment provides an application method for its target matching task model, namely, an object matching method, specifically combining Figure 6 to Figure 7 Provide explanation.
[0139] In one or more possible embodiments, an object matching process provided by the embodiment of the present application is as follows: Figure 6 shown.
[0140] Figure 6 is a flowchart illustrating an object matching method according to an embodiment.
[0141] like Figure 6 As shown, the object matching method provided in the embodiment of the present application may include:
[0142] Step 610, receiving a matching request sent by a user terminal, where the matching request includes first government affairs industry information;
[0143] Step 620, inputting the first government affairs industry information into the target matching task model to obtain target matching information matching the first government affairs industry information;
[0144] Among them, the target matching task model is trained by a first training data set, a second training data set and a manually annotated supervised text data set. The first training data set is determined by a first object, and the first object includes at least one of the following: government affairs industry information, and knowledge triple information corresponding to the government affairs industry information. The second training data set is determined by sentences marked with classification identifiers in the government affairs industry information; the target matching information includes at least one of the following: events similar to the first government affairs industry information, matters to which the first government affairs industry information belongs, and processing departments corresponding to the first government affairs industry information.
[0145] In one or more other possible embodiments, another object matching process provided by the embodiment of the present application is as follows: Figure 7 shown.
[0146] Figure 7 is a flowchart illustrating another object matching method according to an embodiment.
[0147] like Figure 7 As shown, the object matching method provided in the embodiment of the present application may include:
[0148] Step 710, receiving a matching request sent by a user terminal, where the matching request includes first government affairs industry information;
[0149] Step 720, according to the matching request, obtaining a target matching scenario corresponding to the matching request, the target matching scenario including a task recall matching scenario and a task sorting matching scenario;
[0150] Step 730, according to the target matching scenario, obtaining a target matching task model, wherein the target matching task model is trained by a first training data set, a second training data set, and a manually annotated supervised text data set, the first training data set is determined by a first object, the first object includes at least one of the following: government industry information, knowledge triple information corresponding to the government industry information, the second training data set is determined by sentences marked by classification identifiers in the government industry information, and the target matching task model includes a first sub-target matching task model corresponding to the task recall matching scenario and a second sub-target matching task model corresponding to the task sorting matching scenario;
[0151] Step 740, inputting the first government affairs industry information into the first sub-goal matching task model to obtain candidate matching information corresponding to the first government affairs industry information;
[0152] Step 750, inputting the candidate matching information into the second sub-target matching task model to obtain target matching information corresponding to the first government industry information, wherein the target matching information includes at least one of the following: an event similar to the first government industry information, a matter to which the first government industry information belongs, and a processing department corresponding to the first government industry information;
[0153] Step 760: Send target matching information to the user terminal.
[0154] For example, if the first government affairs industry information is "What is the telephone number and address of the Civil Affairs Bureau? I want to apply for a marriage certificate", at this time, the matching request is for the Civil Affairs Department to provide feedback based on its first government affairs industry information. Then, first, the target matching scenario to which its matching request belongs must be determined, and the target matching scenario includes a task recall matching scenario and a task sorting matching scenario. If the target matching scenario is a task recall matching scenario, it can be understood as the department that processes the first government affairs industry information. At this time, the target matching task model can be obtained according to the target matching scenario, wherein the target matching task model is trained by the first training data set, the second training data set, and the manually annotated supervised text data set. The first training data set is determined by the first object, and the first object includes at least one of the following: government affairs industry information, knowledge triple information corresponding to the government affairs industry information, and the second training data set is determined by sentences in the government affairs industry information that are marked by classification identifiers. The target matching task model includes a first sub-target matching task model corresponding to the task recall matching scenario and a second sub-target matching task model corresponding to the task sorting matching scenario. Furthermore, the first government affairs industry information is input into the first sub-target matching task model to obtain candidate matching information corresponding to the first government affairs industry information, such as matching to the civil affairs department related to the first government affairs industry information. Since the civil affairs department can provide a variety of government affairs services, the candidate matching information can be information such as marriage, divorce, and disaster relief. Then, the candidate matching information is input into the second sub-target matching task model to obtain target matching information corresponding to the first government affairs industry information. For example, it can match the matters related to the first government affairs industry information, namely, the marriage registration group, other user terminals also inquire about the matters related to the handling of marriage certificates in the civil affairs bureau, and the content of the historical reply to the handling of marriage certificates in the civil affairs bureau. In this way, the target matching information corresponding to the first government affairs industry information can be returned to the user terminal, or the first government affairs industry information can be sent to the civil affairs department so that the civil affairs department can reply to it.
[0155] It should be clear that the present application is not limited to the specific configurations and processes described in the above embodiments and shown in the figures. For the convenience and brevity of description, a detailed description of the known methods is omitted here, and the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, which will not be repeated here.
[0156] Based on the same inventive concept, the embodiment of the present application provides a matching model training device corresponding to the matching model training method involved above. Figure 8 Provide detailed explanation.
[0157] Figure 8 It is a schematic diagram showing the structure of a matching model training device according to an embodiment.
[0158] like Figure 8 As shown, the matching model training device 80 may specifically include:
[0159] The acquisition module 801 is used to acquire government affairs industry information;
[0160] The processing module 802 is used to perform mask processing on the first object to obtain a first training data set, where the first object includes at least one of the following: government industry information and knowledge triplet information corresponding to the government industry information;
[0161] The training module 803 is used to train the initial matching task model using the first training data set to obtain a target matching task model.
[0162] Based on this, the matching model training device 80 provided in an embodiment of the present application is described in detail below.
[0163] In one or more possible embodiments, the matching model training device 80 in the embodiment of the present application may further include a first determination module; wherein,
[0164] The processing module 802 may be specifically configured to, when the first training data set includes the first concatenated sample and the knowledge triple information includes the head entity word, the relation word and the tail entity word, perform mask processing on at least one of the head entity word, the relation word and the tail entity word to obtain masked triple information;
[0165] The first determination module is used to determine the information obtained by splicing the mask triplet information and the government affairs industry information as the first splicing sample.
[0166] In another or more possible embodiments, the matching model training device 80 in the embodiment of the present application may further include a second determination module; wherein,
[0167] The processing module 802 may be specifically configured to, when the first training data set includes the second concatenated sample, perform masking processing on at least one entity word in the government affairs industry information to obtain masked entity information;
[0168] The second determination module is used to determine the information obtained by splicing the mask entity information and the knowledge triple information as a second splicing sample.
[0169] In one or more possible embodiments, the matching model training device 80 in the embodiment of the present application may further include a third determination module; wherein,
[0170] The processing module 802 may be specifically configured to, when the first training data set includes a first mask sample and the government affairs industry information includes at least one of the following: a keyword and an entity word, perform mask processing on at least one of the keywords and entity words in the government affairs industry information to obtain the first masked government affairs information;
[0171] The third determination module is used to determine the first masked government affairs information as the first masked sample.
[0172] In another or more possible embodiments, the matching model training device 80 in the embodiment of the present application may further include a mask module and a fourth determination module; wherein,
[0173] a masking module, configured to mask a first word in the first masked government information to obtain second masked government word information, when the first training data set also includes a second masked sample and the proportion of the masked portion in the first masked government information is less than or equal to a first threshold, wherein the first word is determined by a random algorithm;
[0174] The fourth determination module is used to determine the second masked government affairs information as the second masked sample.
[0175] In one or more possible embodiments, the matching model training device 80 in the embodiment of the present application may further include a marking module; wherein,
[0176] Classifying and labeling the sentences in the government affairs industry information at the sentence level to obtain a second training data set;
[0177] The training module 803 can be specifically used to train the initial matching task model using the first training data set and the second training data set to obtain a target matching task model.
[0178] In one or more possible embodiments, the matching model training device 80 in the embodiment of the present application may further include a division module; wherein,
[0179] A division module, used for dividing the government affairs industry information according to the sentence level to obtain M sentences when the second training data set includes the first classification identification sample, where M is a positive integer;
[0180] The acquisition module 801 may also be used to acquire the distance between any two sentences in the M sentences;
[0181] The marking module 803 may also be used to, when the distance characterizes any two sentences as adjacent sentences, classify and mark the any two sentences using the first classification mark to obtain a first classification mark sample.
[0182] In one or more possible embodiments, the matching model training device 80 in the embodiment of the present application may further include an analysis module; wherein:
[0183] An analysis module, for performing semantic analysis on each of the M sentences when the government affairs industry information includes N government affairs industry event texts, where N is a positive integer, to obtain a sentence relationship between at least two sentences in the M sentences, wherein the sentence relationship includes a first sentence relationship, and the first sentence relationship indicates that at least two sentences belong to the same government affairs industry event text in the N government affairs industry event texts;
[0184] The marking module 803 may also be used to classify and mark the sentences in the M sentences that meet the first sentence relationship through the second classification mark to obtain second classification mark samples.
[0185] In yet another one or more possible embodiments, the marking module 803 can also be used to, when the second training data set also includes a third classification identification sample; the sentence relationship also includes a second sentence relationship, and the second sentence relationship represents that at least two sentences belong to different government affairs industry event texts among N government affairs industry event texts, classify and mark the sentences in the M sentences that meet the second sentence relationship through the third classification identification to obtain a third classification identification sample.
[0186] In one or more possible embodiments, the acquisition module 801 may also be used to, when the initial matching task model includes k initial matching task models, acquire a target initial matching task model corresponding to the matching scenario from the k initial matching task models according to the matching scenario;
[0187] The training module 804 can also be used to train the target initial matching task model using the first training data set, the second training data set and the manually annotated supervised text data set to obtain the target matching task model.
[0188] In yet another one or more possible embodiments, the matching scenario is a task recall matching scenario, and the target initial matching task model is a dual-tower matching model;
[0189] The matching scenario is a task ranking matching scenario, and the target initial matching task model is an interactive matching model.
[0190] Therefore, the matching model training device in the embodiment of the present application obtains the government industry information and performs masking on the first object to obtain the first training data set, wherein the first object includes at least one of the following: government industry information, knowledge triple information corresponding to the government industry information; then, the initial matching task model is trained through the first training data set to obtain the target matching task model. In this way, by masking the accumulated massive government industry information and the knowledge triple information corresponding to the government industry information, the first training data set after masking the keywords, entities and triple information in the government industry information is obtained. In this way, the initial matching task model is trained and learned through the first training data set obtained by masking different types of information, so as to train a target matching task model that can recognize government industry terms, sentence semantics in government industry texts, and tasks in multiple government fields, and obtain a target matching task model with high task matching accuracy, thereby achieving the accuracy of determining downstream matching tasks through the target matching task model.
[0191] Based on the same inventive concept, the embodiment of the present application provides an object matching device corresponding to the object matching method involved above. Fig. 9 Provide detailed explanation.
[0192] Fig. 9 is a schematic structural diagram showing an object matching device according to an embodiment.
[0193] like Fig. 9 As shown, the object matching device 90 in the embodiment of the present application may specifically include:
[0194] The receiving module 901 is used to receive a matching request sent by a user terminal, where the matching request includes first government affairs industry information;
[0195] Processing module 902, used for inputting the first government affairs industry information into the target matching task model to obtain target matching information matching the first government affairs industry information;
[0196] Among them, the target matching task model is trained by a first training data set, a second training data set and a manually annotated supervised text data set. The first training data set is determined by a first object, and the first object includes at least one of the following: government affairs industry information, and knowledge triple information corresponding to the government affairs industry information. The second training data set is determined by sentences marked with classification identifiers in the government affairs industry information; the target matching information includes at least one of the following: events similar to the first government affairs industry information, matters to which the first government affairs industry information belongs, and processing departments corresponding to the first government affairs industry information.
[0197] Based on the same inventive concept, the embodiment of the present application provides an object matching device corresponding to the object matching method involved above. Fig.10 Provide detailed explanation.
[0198] Fig.10 FIG. 4 is a schematic diagram showing the structure of another object matching device according to an embodiment.
[0199] like Fig.10 As shown, the object matching device 100 in the embodiment of the present application may specifically include:
[0200] The receiving module 1001 is used to receive a matching request sent by a user terminal, where the matching request includes first government affairs industry information;
[0201] An acquisition module 1002 is used to acquire a target matching scenario corresponding to the matching request according to the matching request, where the target matching scenario includes a task recall matching scenario and a task sorting matching scenario;
[0202] The acquisition module 1002 is also used to acquire a target matching task model according to a target matching scenario, wherein the target matching task model is trained by a first training data set, a second training data set, and a manually annotated supervised text data set, the first training data set is determined by a first object, the first object includes at least one of the following: government industry information, knowledge triple information corresponding to the government industry information, the second training data set is determined by sentences marked by classification identifiers in the government industry information, and the target matching task model includes a first sub-target matching task model corresponding to a task recall matching scenario and a second sub-target matching task model corresponding to a task sorting matching scenario;
[0203] Processing module 1003, used for inputting the first government affairs industry information into the first sub-goal matching task model to obtain candidate matching information corresponding to the first government affairs industry information;
[0204] The processing module 1003 is further used to input the candidate matching information into the second sub-target matching task model to obtain target matching information corresponding to the first government affairs industry information, wherein the target matching information includes at least one of the following: an event similar to the first government affairs industry information, a matter to which the first government affairs industry information belongs, and a processing department corresponding to the first government affairs industry information;
[0205] The sending module 1004 is used to send the target matching information to the user end.
[0206] Fig.11 FIG. 4 is a schematic diagram showing the hardware structure of a computer device according to an embodiment.
[0207] like Fig.11 As shown, the computer device 1100 includes an input device 1101 , an input interface 1102 , a processor 1103 , a memory 1104 , an output interface 1105 , and an output device 1106 .
[0208] The input interface 1102, the processor 1103, the memory 1104, and the output interface 1105 are connected to each other through the bus 1110, and the input device 1101 and the output device 1106 are connected to the bus 1110 through the input interface 1102 and the output interface 1105, respectively, and then connected to other components of the computer device 1100. Specifically, the input device 1101 receives input information from the outside, and transmits the input information to the processor 1103 through the input interface 1102; the processor 1103 processes the input information based on the computer executable instructions stored in the memory 1104 to generate output information, temporarily or permanently stores the output information in the memory 1104, and then transmits the output information to the output device 1106 through the output interface 1105; the output device 1106 outputs the output information to the outside of the computer device 1100 for the user to use.
[0209] In one embodiment, Fig.11 The computer device 1100 shown can be implemented as a matching model training device or an object matching device, which may include: a memory configured to store a program; a processor configured to run the program stored in the memory to execute the matching model training method described in the above embodiment; the object matching device may include: a memory configured to store a program; a processor configured to run the program stored in the memory to execute the object matching method described in the above embodiment.
[0210] According to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer-readable storage medium. For example, an embodiment of the present application includes a computer-readable storage medium, which includes storing a program or instruction on the computer-readable storage medium, and when the program or instruction is executed by a computer device, the computer device performs the steps of the above-mentioned matching model training method or object matching device method.
[0211] According to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network, and / or installed from a removable storage medium.
[0212] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions, and when it is run on a computer, the computer executes the method described in each of the above embodiments. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrations. The available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid-state drives), etc.
[0213] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0214] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application 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 replace some or all of the technical features therein with equivalents. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A matching model training method, comprising: Obtain government industry information; Performing mask processing on the first object to obtain a first training data set, wherein the first object includes at least one of the following: the government affairs industry information and knowledge triplet information corresponding to the government affairs industry information; The initial matching task model is trained using the first training data set to obtain a target matching task model.
2. The method according to claim 1, wherein: The first training data set includes a first concatenated sample, and the knowledge triple information includes a head entity word, a relation word, and a tail entity word; The step of performing mask processing on the first object to obtain a first training data set includes: Performing mask processing on at least one of the head entity word, the relation word, and the tail entity word to obtain masked triplet information; The information obtained by splicing the mask triplet information and the government affairs industry information is determined as the first splicing sample.
3. The method according to claim 1 or 2, wherein: The first training data set includes the second spliced sample; the masking process is performed on the first object to obtain the first training data set, including: Performing masking processing on at least one entity word in the government affairs industry information to obtain masked entity information; The information obtained by splicing the masked entity information and the knowledge triple information is determined as the second spliced sample.
4. The method according to claim 1, wherein: The first training data set includes a first mask sample, and the government industry information includes at least one of the following: a keyword, an entity word; the masking process is performed on the first object to obtain the first training data set, including: Masking the keywords in the government affairs industry information and at least one of the entity words to obtain first masked government affairs information; The first masked government affairs information is determined as the first masked sample.
5. The method according to claim 4, wherein: The first training data set also includes a second mask sample; and the method further includes: When the proportion of the masked portion in the first masked government affairs information to the first masked government affairs information is less than or equal to a first threshold, masking a first word in the first masked government affairs information to obtain second masked government affairs word information, wherein the first word is determined by a random algorithm; The second masked government affairs information is determined as the second masked sample.
6. The method according to claim 1, wherein: Before training the initial matching task model by using the first training data set to obtain the target matching task model, the method further includes: Classifying and labeling the sentences in the government affairs industry information at the sentence level to obtain a second training data set; The step of training the initial matching task model using the first training data set to obtain a target matching task model includes: The initial matching task model is trained using the first training data set and the second training data set to obtain a target matching task model.
7. The method according to claim 6, wherein: The second training data set includes the first classification identification samples; the sentences in the government industry information are classified and labeled according to the sentence level to obtain the second training data set, including: Divide the government affairs industry information according to the sentence level to obtain M sentences, where M is a positive integer; Obtaining the distance between any two sentences in the M sentences; When the distance characterizes that the arbitrary two sentences are adjacent sentences, the arbitrary two sentences are classified and marked by a first classification mark to obtain the first classification mark sample.
8. The method according to claim 7, wherein: The government affairs industry information includes N government affairs industry event texts, where N is a positive integer; The second training data set also includes a second classification identification sample; the method also includes: Performing semantic analysis on each of the M sentences to obtain a sentence relationship between at least two of the M sentences, wherein the sentence relationship includes a first sentence relationship, and the first sentence relationship indicates that the at least two sentences belong to the same government affairs industry event text among the N government affairs industry event texts; The sentences in the M sentences that meet the first sentence relationship are classified and marked by the second classification mark to obtain the second classification mark samples.
9. The method according to claim 8, wherein: The second training data set further includes a third classification identification sample; the sentence relationship further includes a second sentence relationship, and the second sentence relationship represents that the at least two sentences belong to different government affairs industry event texts among the N government affairs industry event texts; The method further comprises: The sentences in the M sentences that meet the second sentence relationship are classified and marked by the third classification mark to obtain the third classification mark sample.
10. The method according to claim 6, wherein: The initial matching task model includes k initial matching task models; the initial matching task model is trained by the first training data set and the second training data set to obtain a target matching task model, including: According to the matching scenario, obtaining a target initial matching task model corresponding to the matching scenario from the k initial matching task models; The target initial matching task model is trained using the first training data set, the second training data set and a manually annotated supervised text data set to obtain a target matching task model.
11. The method according to claim 9, wherein: The matching scenario is a task recall matching scenario, and the target initial matching task model is a dual-tower matching model; The matching scenario is a task ranking matching scenario, and the target initial matching task model is an interactive matching model.
12. An object matching method, comprising: Receiving a matching request sent by a user terminal, wherein the matching request includes first government affairs industry information; Inputting the first government affairs industry information into a target matching task model to obtain target matching information matching the first government affairs industry information; Among them, the target matching task model is trained by a first training data set, a second training data set and a manually annotated supervised text data set, the first training data set is determined by a first object, the first object includes at least one of the following: the government affairs industry information, the knowledge triple information corresponding to the government affairs industry information, the second training data set is determined by sentences marked with classification identification in the government affairs industry information; the target matching information includes at least one of the following: events similar to the first government affairs industry information, matters to which the first government affairs industry information belongs, and processing departments corresponding to the first government affairs industry information.
13. An object matching method, comprising: Receiving a matching request sent by a user terminal, wherein the matching request includes first government affairs industry information; According to the matching request, a target matching scenario corresponding to the matching request is acquired, wherein the target matching scenario includes a task recall matching scenario and a task sorting matching scenario; According to the target matching scenario, a target matching task model is obtained, wherein the target matching task model is trained by a first training data set, a second training data set, and a manually annotated supervised text data set, the first training data set is determined by a first object, the first object includes at least one of the following: the government industry information, and the knowledge triple information corresponding to the government industry information, the second training data set is determined by sentences in the government industry information that are marked by classification identification, and the target matching task model includes a first sub-target matching task model corresponding to the task recall matching scenario and a second sub-target matching task model corresponding to the task sorting matching scenario; Inputting the first government affairs industry information into the first sub-goal matching task model to obtain candidate matching information corresponding to the first government affairs industry information; Inputting the candidate matching information into the second sub-target matching task model to obtain target matching information corresponding to the first government affairs industry information, wherein the target matching information includes at least one of the following: an event similar to the first government affairs industry information, a matter to which the first government affairs industry information belongs, and a processing department corresponding to the first government affairs industry information; The target matching information is sent to the user terminal.
14. A computer device comprising: Memory and processor, The memory is used to store a computer program; The processor is used to execute a computer program stored in the memory, and when the computer program is run, the processor executes the steps of the matching model training method as described in any one of claims 1 to 11, or the steps of the object matching method as described in claim 12 or 13.