Sample data generation, model training, and domain word recognition method and device

By employing a dual screening method of part-of-speech combination distribution and word vector similarity matching in the sample text dataset, efficient and accurate domain word sample data is generated, solving the problems of low generation efficiency and insufficient accuracy in existing technologies and improving the training effect of the domain word recognition model.

CN116127071BActive Publication Date: 2026-03-24MASHANG CONSUMER FINANCE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-31
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing technologies suffer from low efficiency and insufficient accuracy when generating domain-specific word sample data, especially during neural network model training, where a large amount of high-quality sample data is required to ensure the accuracy of model parameters.

Method used

By using a sample text dataset based on the target business domain, a first domain word set that meets the target part-of-speech combination screening criteria is first selected, and then a second domain word set is selected based on the word vector similarity screening criteria to generate domain word sample data. By using the dual screening dimensions of part-of-speech combination distribution matching and word vector similarity matching, the reliance on manual annotation and preset rules is avoided.

Benefits of technology

This improved the efficiency and accuracy of sample data generation, ensured the training effect of the domain word recognition model, and enhanced the accuracy of model parameters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116127071B_ABST
    Figure CN116127071B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a sample data generation, model training, field word identification method and device, first, based on the sample text data set of the target business field, select the first field word set meeting the target word combination screening condition; the target word combination screening condition includes at least one field word part of speech combination determined based on the historical field word library; then, based on the target word vector of each initial field word in the first field word set, select the second field word set meeting the preset word vector screening condition from the first field word set; the preset word vector screening condition includes the constraint condition of word vector similarity; then, based on the plurality of candidate field words in the second field word set, generate field word sample data; that is, a large number of candidate field words are obtained by performing part of speech combination screening and word vector similarity matching on the sample text data set, and then the field word sample data is generated based on the candidate field words, which can improve the generation efficiency and accuracy of the sample data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and in particular to a sample data generation method, a model training method, and a domain word recognition method and device. BACKGROUND

[0002] At present, with the continuous development of artificial intelligence technology, neural network models have also been born, and at the same time, domain word mining has been widely applied in many scenarios such as search application and knowledge graph entity warehousing. In order to improve the efficiency and accuracy of domain word mining, domain word mining can be combined with neural network models, that is, domain word mining is performed using a neural network model, so as to construct the required domain vocabulary for a target business domain.

[0003] However, in the training process of the neural network model, a large amount of model training sample data is required, and therefore, domain word sample data for training a domain word recognition model needs to be generated. The quality of the domain word sample data will affect the parameter accuracy of the trained domain word recognition model. Therefore, a technical solution is needed to generate domain word sample data with high efficiency and high accuracy. SUMMARY

[0004] The purpose of the embodiments of the present application is to provide a sample data generation method, a model training method, and a domain word recognition method and device. A large number of candidate domain words are obtained by performing part-of-speech combination screening and word vector similarity matching on a sample text data set, and then domain word sample data is generated based on the candidate domain words, which can improve the generation efficiency and accuracy of the sample data.

[0005] In order to achieve the above technical solutions, the embodiments of the present application are implemented as follows:

[0006] In a first aspect, the embodiments of the present application provide a domain word sample data generation method, which comprises:

[0007] obtaining a sample text data set of a target business domain; the sample text data set comprises a plurality of sample texts;

[0008] selecting a first domain word set satisfying a target part-of-speech combination screening condition based on the plurality of sample texts; the first domain word set comprises a plurality of initial domain words, and the target part-of-speech combination screening condition comprises at least one domain word part-of-speech combination determined based on a historical domain word library corresponding to the target business domain;

[0009] selecting a second domain word set satisfying a preset word vector screening condition from the first domain word set based on a target word vector of each initial domain word; the second domain word set comprises a plurality of candidate domain words, and the preset word vector screening condition comprises a constraint condition of word vector similarity.

[0010] generating field word sample data based on the plurality of candidate field words.

[0011] In a second aspect, an embodiment of the present application provides a field word recognition model training method, which comprises:

[0012] obtaining field word sample data; the field word sample data is obtained based on the generating method in the first aspect, and the field word sample data comprises M field word samples, each of the field word samples comprising a candidate field word, a positive example sample corresponding to the candidate field word, and a negative example sample;

[0013] inputting each of the field word samples into a field word recognition model to be trained to obtain a target word vector of the candidate field word, a target word vector of the positive example sample, and a target word vector of the negative example sample in the field word sample;

[0014] determining a first word vector distance based on the target word vector of the candidate field word and the target word vector of the positive example sample, and determining a second word vector distance based on the target word vector of the candidate field word and the target word vector of the negative example sample;

[0015] determining a model loss value based on the first word vector distance and the second word vector distance corresponding to each of the field word samples;

[0016] performing model parameter iterative updating on the field word recognition model to be trained based on the model loss value to obtain a trained field word recognition model.

[0017] In a third aspect, an embodiment of the present application provides a field word recognition method, which comprises:

[0018] obtaining a text data set to be recognized in a target business field; the text data set to be recognized comprises a plurality of texts to be recognized;

[0019] selecting a plurality of target words to be recognized from the plurality of texts to be recognized;

[0020] inputting the target words to be recognized, positive example samples corresponding to the target words to be recognized, and negative example samples into the trained field word recognition model to obtain field words in the target business field; the positive example samples are randomly selected from a field word dictionary, and the negative example samples are randomly selected from a non-field word dictionary.

[0021] In a fourth aspect, an embodiment of the present application provides a field word sample data generation device, which comprises:

[0022] a sample data obtaining module, configured to obtain a sample text data set in a target business field; the sample text data set comprises a plurality of sample texts;

[0023] The first selecting module is configured to select a first domain word set meeting a target word combination screening condition based on the plurality of sample texts; the first domain word set includes a plurality of initial domain words, and the target word combination screening condition includes at least one domain word combination determined based on a historical domain word library corresponding to the target business domain;

[0024] The second selecting module is configured to select a second domain word set meeting a preset word vector screening condition from the first domain word set based on a target word vector of each initial domain word; the second domain word set includes a plurality of candidate domain words, and the preset word vector screening condition includes a constraint condition of word vector similarity;

[0025] The domain word sample generation module is configured to generate domain word sample data based on the plurality of candidate domain words.

[0026] In a fifth aspect, an embodiment of the present application provides a domain word recognition model training device, and the device includes:

[0027] The domain word sample acquisition module is configured to acquire domain word sample data; the domain word sample data is obtained based on the generation method in the first aspect, and the domain word sample data includes M domain word samples, each of which includes a candidate domain word, a positive example sample and a negative example sample corresponding to the candidate domain word;

[0028] The target word vector determination model is configured to input each domain word sample into a domain word recognition model to be trained, to obtain a target word vector of a candidate domain word, a target word vector of a positive example sample and a target word vector of a negative example sample in the domain word sample;

[0029] The word vector distance determination model is configured to determine a first word vector distance based on the target word vector of the candidate domain word and the target word vector of the positive example sample, and determine a second word vector distance based on the target word vector of the candidate domain word and the target word vector of the negative example sample;

[0030] The model loss value determination module is configured to determine a model loss value based on the first word vector distance and the second word vector distance corresponding to each domain word sample;

[0031] The recognition model training module is configured to perform model parameter iterative updating on the domain word recognition model to be trained based on the model loss value, to obtain a trained domain word recognition model.

[0032] In a sixth aspect, an embodiment of the present application provides a domain word recognition device, and the device includes:

[0033] The data to be identified is obtained by a data to be identified acquisition module, and the data to be identified includes a plurality of texts to be identified.

[0034] The words to be identified are selected by a word to be identified selection module from the plurality of texts to be identified.

[0035] The domain words are identified by a domain word identification module by inputting the words to be identified, positive samples and negative samples corresponding to the words to be identified into a trained domain word identification model, and the domain words in the target business domain are obtained. The positive samples are randomly selected from a domain word dictionary, and the negative samples are randomly selected from a non-domain word dictionary.

[0036] In a seventh aspect, a computer device is provided, and the device includes:

[0037] A processor and a memory arranged to store computer executable instructions configured to be executed by the processor, and the executable instructions include steps for performing the method as described in the first aspect, the second aspect or the third aspect.

[0038] In an eighth aspect, a storage medium is provided, and the storage medium is used to store computer executable instructions, and the executable instructions make a computer perform steps in the method as described in the first aspect, the second aspect or the third aspect.

[0039] It can be seen that, in the embodiments of the present application, first domain word set satisfying target word combination screening condition is selected based on sample text data set of target business domain; the target word combination screening condition includes at least one domain word part-of-speech combination determined based on historical domain word library; second domain word set satisfying preset word vector screening condition is selected from the first domain word set based on target word vector of each initial domain word in the first domain word set; the preset word vector screening condition includes constraint condition of word vector similarity; and domain word sample data is generated based on a plurality of candidate domain words in the second domain word set; that is, the present application preliminarily screens the sample text data set from the part-of-speech combination distribution matching dimension, obtains the first domain word set, and secondarily screens the first domain word set from the word vector similarity matching dimension, to obtain the second domain word set. In this way, without marking the sample text or formulating various screening rules, a large number of candidate domain words satisfying target part-of-speech combination distribution and preset word vector similarity requirement can be obtained by means of the two screening dimensions of part-of-speech combination distribution matching and word vector similarity matching, and domain word sample data is generated based on the candidate domain words, so that the generation efficiency and accuracy of sample data can be improved. BRIEF DESCRIPTION OF DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description only aim to some embodiments of one or more of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0041] Figure 1 The first flowchart of the field word sample data generation method provided by the embodiments of the present application;

[0042] Figure 2 The first implementation principle diagram of the field word sample data generation method provided by the embodiments of the present application;

[0043] Figure 3 The second implementation principle diagram of the field word sample data generation method provided by the embodiments of the present application;

[0044] Figure 4 The third implementation principle diagram of the field word sample data generation method provided by the embodiments of the present application;

[0045] Figure 5 The second flowchart of the field word sample data generation method provided by the embodiments of the present application;

[0046] Figure 6 The flowchart of the field word recognition model training method provided by the embodiments of the present application;

[0047] Figure 7 The implementation principle diagram of the field word recognition model training method provided by the embodiments of the present application;

[0048] Figure 8 The flowchart of the field word recognition method provided by the embodiments of the present application;

[0049] Figure 9 The first implementation principle diagram of the field word recognition method provided by the embodiments of the present application;

[0050] Figure 10 The second implementation principle diagram of the field word recognition method provided by the embodiments of the present application;

[0051] Figure 11 The module composition diagram of the field word sample data generation device provided by the embodiments of the present application;

[0052] Figure 12 The module composition diagram of the field word recognition model training device provided by the embodiments of the present application;

[0053] Figure 13 A schematic diagram of the module composition of the domain term recognition device provided in the embodiments of this application;

[0054] Figure 14 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0055] To enable those skilled in the art to better understand the technical solutions in one or more of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of one or more of this application, and not all embodiments. Based on the embodiments of one or more of this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of this application.

[0056] It should be noted that, unless otherwise specified, one or more embodiments and features described in this application can be combined with each other. The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0057] This application provides one or more embodiments of a method and apparatus for generating sample data, training models, and identifying domain terms. Considering that manually labeling domain and non-domain terms in a sample text dataset inevitably leads to low labeling efficiency, and that automatically extracting domain and non-domain terms from a sample text dataset using pre-defined filtering rules inevitably results in low domain term extraction accuracy due to inaccurate and incomplete filtering rules, this technical solution first selects a first set of domain terms that meets the target part-of-speech combination filtering conditions based on a sample text dataset of the target business domain. The target part-of-speech combination filtering conditions include at least one domain term combination determined based on a historical domain term lexicon. Then, based on the target word vectors of each initial domain term in the first set of domain terms, the domain term is extracted from the first set of domain terms. The first domain word set is obtained by first screening the sample text dataset from the part-of-speech combination distribution matching dimension to obtain the first domain word set, and then screening the first domain word set from the word vector similarity matching dimension to obtain the second domain word set. In this way, there is no need to label the sample text or formulate various screening rules. Instead, by using the two screening dimensions of part-of-speech combination distribution matching and word vector similarity matching, a large number of candidate domain words that meet the target part-of-speech combination distribution and preset word vector similarity requirements can be obtained. Then, domain word sample data can be generated based on the candidate domain words, which can improve the efficiency and accuracy of sample data generation.

[0058] in, Figure 1 This is a schematic diagram of a first process for a domain term sample data generation method provided in one or more embodiments of this application. Figure 1 The method described above can be executed by an electronic device equipped with a domain term sample data generation device. This electronic device can be a terminal device or a designated server. The hardware device for generating domain term sample data (i.e., the electronic device equipped with the domain term sample data generation device), the hardware device for training the domain term recognition model (i.e., the electronic device equipped with the domain term recognition model training device), and the hardware device for domain term recognition (i.e., the electronic device equipped with the domain term device) can be identical or different from each other. Figure 1 As shown, the method includes at least the following steps:

[0059] S102, Obtain a sample text dataset for the target business domain; the sample text dataset includes multiple sample texts;

[0060] Specifically, the aforementioned target business area can be any business area, such as the financial field, the education field, or the financial lending field, the financial management field, etc.; the target business area can be a broad category or a specific sub-category within a broad category. This application does not limit the division of business areas.

[0061] Specifically, taking the financial lending sector as an example, the sample text can be the dialogue text between the agent and the target user within a preset historical time period. For example, it could be the online chat content generated when the agent recommends a loan product to the target user, or the call text content obtained from the conversion of call voice.

[0062] S104. Based on the above multiple sample texts, select a first domain word set that meets the target part-of-speech combination screening conditions; wherein, the first domain word set includes multiple initial domain words, and the target part-of-speech combination screening conditions include at least one domain word part-of-speech combination determined based on the historical domain word thesaurus corresponding to the target business domain;

[0063] Specifically, the aforementioned historical domain terminology library may include historical domain terms aggregated within a preset historical time period. For example, the historical domain terminology library may include a small number of domain terms under the target business domain that are manually extracted. The historical domain terminology library may also include domain terms under the target business domain obtained based on a preset domain terminology mining method. The historical domain terminology library may also include domain terms under the target business domain obtained by mining domain terms based on historical text data using the method provided in this application. By performing part-of-speech combination distribution analysis on multiple historical domain terms in the historical domain terminology library, target part-of-speech combination screening conditions are obtained. Then, based on the part-of-speech combination distribution matching dimension and the target part-of-speech combination screening conditions, multiple sample texts are initially screened to obtain the first domain terminology set.

[0064] Specifically, keyword groups are extracted from multiple sample texts to determine the part-of-speech (POS) combination distribution of each keyword group. It is then determined whether the POS combination distribution of the keyword group is the same as the POS combination of a certain domain word in the target POS combination screening criteria. If they are the same, the keyword group is determined to meet the target POS combination screening criteria. Therefore, if the POS combination distribution of a keyword group is the same as the POS combination of a certain domain word in the target POS combination screening criteria, then that keyword group is taken as an initial domain word. That is, the set of all keyword groups in the multiple sample texts that meet the target POS combination screening criteria is the first domain word set. For example, if the POS combination distribution of multiple domain words included in the target POS combination screening criteria is: “v|n”, “v|v”, “v|n|v”, where v represents a verb, n represents a noun, and v|n represents a phrase consisting of a verb and a noun, then if the POS combination distribution of a certain keyword group is v|n (e.g., cancel an account, [cancel / v, account / n]), then that keyword group is taken as an initial domain word.

[0065] S106, Based on the target word vectors of each initial domain word in the first domain word set, select a second domain word set that meets the preset word vector screening conditions from the first domain word set; wherein, the second domain word set includes multiple candidate domain words, and the preset word vector screening conditions include constraints on word vector similarity;

[0066] The constraint on word vector similarity can be to select a certain number of initial domain words in descending order of word vector similarity. Specifically, after initial screening of domain words from the part-of-speech combination distribution matching dimension to obtain the first domain word set, a second screening of domain words is performed from the word vector similarity matching dimension to obtain the second domain word set. In practice, for each initial domain word, a feature vector transformation is performed to obtain the target word vector; the word vector similarity between the target word vector of the initial domain word and the average word vector corresponding to the first domain word set is calculated; a certain number of initial domain words with the highest word vector similarity in the first domain word set are determined as candidate domain words, and the set of multiple candidate domain words is the second domain word set.

[0067] Specifically, feature vector conversion can be performed using a pre-trained word vector conversion model. For example, the word vector conversion model can be a BERT pre-trained model or other word vector conversion models. This application does not limit the choice of which model to use.

[0068] S108, Based on multiple candidate domain words in the above-mentioned second domain word set, generate domain word sample data.

[0069] Specifically, based on multiple candidate domain words in the aforementioned second domain word set and a preset domain word lexicon, a domain word dictionary and a non-domain word dictionary are determined. That is, based on the preset domain word lexicon, multiple candidate domain words in the second domain word set are divided into two categories: domain words and non-domain words. Candidate domain words that are classified as domain words are added to the domain word dictionary, and candidate domain words that are classified as non-domain words are added to the non-domain word dictionary. In specific implementation, the preset domain word lexicon may be the same as or different from the aforementioned historical domain word lexicon.

[0070] Then, domain words in the domain word dictionary and non-domain words in the non-domain word dictionary can be directly identified as domain word sample data. That is, the real labels of candidate domain words added to the domain word dictionary are domain words, and the real labels of candidate domain words added to the non-domain word dictionary are non-domain words. Alternatively, positive and negative samples can be introduced for comparative learning. That is, for each candidate domain word, positive and negative samples are randomly selected from the domain word dictionary and the non-domain word dictionary. The candidate domain word, as well as the corresponding positive and negative samples, are used to form a triplet information. This triplet information is identified as a domain word sample. That is, based on the triplet information corresponding to M candidate domain words, domain word sample data is obtained.

[0071] In this embodiment, the sample text dataset is first preliminarily screened from the part-of-speech combination distribution matching dimension to obtain a first domain word set. Then, the first domain word set is further screened from the word vector similarity matching dimension to obtain a second domain word set. In this way, there is no need to label the sample text or formulate various screening rules. Instead, by using the two screening dimensions of part-of-speech combination distribution matching and word vector similarity matching, a large number of candidate domain words that meet the target part-of-speech combination distribution and preset word vector similarity requirements can be obtained. Then, domain word sample data can be generated based on the candidate domain words, which can improve the efficiency and accuracy of sample data generation.

[0072] In one specific embodiment, such as Figure 2 As shown, a specific implementation process for generating domain term sample data is presented, mainly including:

[0073] (1) Obtain a sample text dataset for the target business domain; wherein, the sample text dataset includes multiple sample texts;

[0074] (2) Based on the above multiple sample texts, perform part-of-speech combination distribution matching, select the initial domain words that meet any domain word part-of-speech combination screening conditions, and thus obtain the first domain word set containing P initial domain words; P is an integer greater than zero;

[0075] (3) Based on the first domain word set mentioned above, perform word vector similarity matching, select candidate domain words that meet the preset word vector screening conditions (i.e., the initial domain words whose word vector similarity to the average word vector of the first domain word set ranks first), and thus obtain a second domain word set containing M candidate domain words; M is an integer greater than zero and M is less than P;

[0076] (4) Based on the M candidate domain words in the second domain word set mentioned above, generate domain word sample data; the domain word sample data is used to train the domain word recognition model.

[0077] Specifically, regarding the process of initially screening multiple sample texts based on the target part-of-speech combination screening criteria from the part-of-speech combination distribution matching dimension to obtain the first domain word set, S104 above, based on the aforementioned multiple sample texts, selects the first domain word set that meets the target part-of-speech combination screening criteria, specifically including:

[0078] Step A1: Divide the above sample texts into business themes to obtain N text paragraphs under each business theme;

[0079] Specifically, considering that the target business area may involve multiple business types, each business type corresponds to a business theme, that is, the business theme is a subdivision of the business types involved in the target business area. N business themes include multiple business types under the target business area, and the N business themes corresponding to different business areas are also different.

[0080] For example, taking the financial lending sector as the target business area, target users may have multiple business processing needs (i.e., business types), such as applying for extension, early settlement, account cancellation, etc. Therefore, topic modeling can be used to divide the sample text into paragraphs according to different business themes, resulting in different sets of text paragraphs under different business themes. For example, for the business theme of applying for extension, the text paragraphs related to applying for extension in the sample text are classified into the text paragraph set corresponding to applying for extension; for the business theme of early settlement, the text paragraphs related to early settlement in the sample text are classified into the text paragraph set corresponding to early settlement.

[0081] Specifically, a topic paragraph segmentation model can be pre-trained. Multiple sample texts are input into the topic paragraph segmentation model to obtain N sets of text paragraphs under business topics. A set of text paragraphs includes multiple text paragraphs whose text content belongs to the same business topic under the target business domain.

[0082] Step A2: For each business topic, select an initial domain word subset that meets the target part-of-speech combination selection criteria from multiple text paragraphs under that business topic; wherein, the initial domain word subset includes multiple initial domain words under a certain business topic;

[0083] Specifically, based on different business themes, for each business theme, keyword groups are extracted from multiple text paragraphs corresponding to that business theme, and the part-of-speech combination distribution of each keyword group is determined. It is then determined whether the part-of-speech combination distribution of the keyword group is the same as the part-of-speech combination of a certain domain word in the target part-of-speech combination screening criteria. If they are the same, the keyword group is determined to meet the target part-of-speech combination screening criteria. Therefore, if the part-of-speech combination distribution of the keyword group extracted from multiple text paragraphs corresponding to the business theme is the same as the part-of-speech combination of a certain domain word in the target part-of-speech combination screening criteria, then that keyword group is taken as an initial domain word. That is, the set of all keyword groups in the multiple text paragraphs corresponding to the business theme that meet the target part-of-speech combination screening criteria is the initial domain word subset corresponding to that business theme. Similarly, initial domain word subsets corresponding to N business themes are determined respectively.

[0084] In practical implementation, considering that the part-of-speech combinations of domain words under different business themes may have certain differences, since the initial screening process based on the part-of-speech combination distribution matching dimension is carried out separately according to business themes, different part-of-speech combination sub-screening conditions can be used for different business themes. That is, for each business theme, an initial subset of domain words that meet the part-of-speech combination sub-screening conditions corresponding to the business theme in the target part-of-speech combination screening conditions are selected from multiple text paragraphs under that business theme.

[0085] Step A3: Determine the first domain term set based on the initial domain term subsets corresponding to each business theme under the target business domain; since the first domain term set includes initial domain terms under multiple different business themes, it can ensure the diversity of the finally selected candidate domain terms.

[0086] Specifically, the set of initial domain word subsets corresponding to N business topics is defined as the first domain word set, which includes initial domain word subset 1 corresponding to business topic 1, initial domain word subset 2 corresponding to business topic 2, ..., and initial domain word subset N corresponding to business topic N.

[0087] Specifically, the process of performing secondary filtering on the first domain word set based on preset word vector filtering conditions from the word vector similarity matching dimension to obtain the second domain word set includes the initial domain word subsets corresponding to N business themes.

[0088] Correspondingly, in S106 above, based on the target word vectors of each initial domain word in the first domain word set, a second domain word set that meets the preset word vector filtering conditions is selected from the first domain word set, specifically including:

[0089] Step B1: For each business topic, average the target word vectors of each initial domain word in the initial domain word subset corresponding to the business topic to obtain the average word vector corresponding to the business topic.

[0090] Specifically, for each business theme, feature vector transformation is performed on multiple initial domain words corresponding to the business theme to obtain the target word vector of each initial domain word; the target word vectors of multiple initial domain words corresponding to the business theme are averaged to obtain the average word vector corresponding to the business theme; for example, the target word vectors of multiple initial domain words in the initial domain word subset 1 corresponding to business theme 1 are averaged to determine the average word vector 1 corresponding to business theme 1; the target word vectors of multiple initial domain words in the initial domain word subset N corresponding to business theme N are averaged to determine the average word vector N corresponding to business theme N.

[0091] Step B2: Calculate the word vector similarity between the target word vector of each initial domain word under the above business theme and the average word vector corresponding to the business theme;

[0092] Specifically, after determining the average word vectors corresponding to N business themes, for each business theme, the target word vectors of the initial domain words under that business theme are matched with the average word vectors corresponding to that business theme to obtain the word vector similarity for each initial domain word under that business theme. For example, the target word vectors of the initial domain words under business theme 1 are matched with the average word vector 1 of business theme 1 to obtain the word vector similarity for each initial domain word under business theme 1. Similarly, the target word vectors of the initial domain words under business theme N are matched with the average word vector N of business theme N to obtain the word vector similarity for each initial domain word under business theme N. The word vector similarity can be obtained by calculating the cosine of the target word vectors and the average word vectors.

[0093] Step B3: From the initial domain word subset corresponding to the above business topics, select the m initial domain words with the highest word vector similarity ranking to obtain the candidate domain word subset;

[0094] Specifically, for each business theme, multiple initial domain words in the initial domain word subset corresponding to that business theme are sorted in descending order of word vector similarity. Then, based on the sorting results, the top m initial domain words are selected from the initial domain word subset corresponding to that business theme to obtain the candidate domain word subset corresponding to that business theme. For example, based on the word vector similarity of multiple initial domain words in the initial domain word subset 1 corresponding to business theme 1, multiple initial domain words in the initial domain word subset 1 are sorted in descending order of word vector similarity. Then, based on the sorting results, the top m initial domain words are selected from the initial domain word subset 1 to obtain the candidate domain word subset 1 corresponding to business theme 1. Similarly, based on the word vector similarity of multiple initial domain words in the initial domain word subset N corresponding to business theme N, multiple initial domain words in the initial domain word subset N are sorted in descending order of word vector similarity. Then, based on the sorting results, the top m initial domain words are selected from the initial domain word subset N to obtain the candidate domain word subset N corresponding to business theme N.

[0095] Step B4: Determine the second domain term set based on the subset of candidate domain terms corresponding to each business theme under the target business domain.

[0096] Specifically, the set of candidate domain word subsets corresponding to N business themes is defined as the second domain word set. That is, the second domain word set includes candidate domain word subset 1 corresponding to business theme 1, candidate domain word subset 2 corresponding to business theme 2, ..., and candidate domain word subset N corresponding to business theme N.

[0097] It should be noted that, regarding the process of determining the second domain set, the first domain term set includes the initial domain term subsets corresponding to N business topics. The initial domain term subsets corresponding to each business domain can be obtained by using the above steps A1 to A3, or by using other specific implementation methods that can be conceived by those skilled in the art. This application does not limit this.

[0098] In one specific embodiment, in the above Figure 2 On the basis of, such as Figure 3 As shown, for the initial domain term selection and candidate domain term selection processes, a method for selecting domain terms according to different business themes is added to improve the accuracy of domain term selection. An alternative implementation process for generating domain term sample data is also presented, mainly including:

[0099] (1) Obtain a sample text dataset for the target business domain; wherein, the sample text dataset includes multiple sample texts;

[0100] (2) The following specific steps can be taken for the process of obtaining the first domain word set based on part-of-speech combination distribution matching:

[0101] The above sample texts are divided into business themes to obtain text paragraphs under N business themes; for each business theme, an initial domain word subset that meets the target part-of-speech combination screening conditions is selected from the multiple text paragraphs under that business theme; based on the initial domain word subsets corresponding to each business theme under the target business domain, a first domain word set containing P initial domain words is determined.

[0102] (3) The following specific steps can be taken for the process of obtaining the second domain word set based on word vector similarity matching:

[0103] For each business topic, the target word vectors of each initial domain word in the initial domain word subset corresponding to the business topic are averaged to obtain the average word vector corresponding to the business topic; the word vector similarity between the target word vectors of each initial domain word under the above business topic and the average word vector corresponding to the business topic is calculated; from the initial domain word subset corresponding to the above business topic, the m initial domain words with the highest word vector similarity are selected to obtain the candidate domain word subset; based on the candidate domain word subset corresponding to each business topic under the target business domain, a second domain word set containing M candidate domain words is determined.

[0104] (4) Based on the M candidate domain words in the second domain word set mentioned above, generate domain word sample data; the domain word sample data is used to train the domain word recognition model.

[0105] Specifically, regarding the process of obtaining domain word sample data based on multiple selected candidate domain words, S108 above, generating domain word sample data based on multiple candidate domain words in the second domain word set, specifically includes:

[0106] Step C1: Based on the multiple candidate domain words in the second domain word set and the preset domain word lexicon, determine the domain word dictionary and the non-domain word dictionary; wherein, the preset domain word lexicon may be the same as or different from the historical domain word lexicon.

[0107] Specifically, the candidate domain words are semantically matched with multiple real domain words in the preset domain word lexicon. If a candidate domain word matches any real domain word semantically, it is identified as a domain word. If a candidate domain word does not match any real domain word semantically, it is identified as a non-domain word. Thus, the multiple candidate domain words in the second domain word set are divided into two categories: domain words and non-domain words. Then, a domain word dictionary is determined based on the candidate domain words that are classified as domain words, and a non-domain word dictionary is determined based on the candidate domain words that are classified as non-domain words.

[0108] Step C2: For each candidate domain word, randomly select positive and negative sample examples corresponding to the candidate domain word from the domain word dictionary and non-domain word dictionary.

[0109] Specifically, for candidate domain words that are classified as domain words, domain words randomly selected from the domain word dictionary are used as positive examples of the candidate domain words, and non-domain words randomly selected from the non-domain word dictionary are used as negative examples of the candidate domain words; conversely, for candidate domain words that are classified as non-domain words, domain words randomly selected from the domain word dictionary are used as negative examples of the candidate domain words, and non-domain words randomly selected from the non-domain word dictionary are used as positive examples of the candidate domain words.

[0110] Step C3: Based on each candidate domain word in the second domain word set mentioned above, and the positive and negative sample examples corresponding to each candidate domain word, generate domain word sample data; wherein, the domain word sample data includes M domain word samples, and each domain word sample includes a candidate domain word, and the positive and negative sample examples corresponding to that candidate domain word.

[0111] Specifically, in the process of generating domain word sample data based on candidate domain words, the correspondence between candidate domain words and their true labels is not directly used as domain word samples. Instead, positive and negative samples are introduced to encourage comparative learning during model training based on domain word sample data, thereby further improving the accuracy of model parameters. Therefore, for each candidate domain word, positive and negative samples are randomly selected from the domain word dictionary and the non-domain word dictionary. The candidate domain word, along with its corresponding positive and negative samples, are used to form a triplet information. This triplet information is then defined as a domain word sample. In other words, domain word sample data is obtained based on the triplet information corresponding to M candidate domain words.

[0112] Specifically, taking the financial lending sector as an example, if the candidate keyword is "extension application," and the positive example corresponding to this candidate keyword is "settlement processing," and the negative example corresponding to this candidate keyword is "cold symptoms," then the domain word sample obtained based on this candidate keyword can be represented as (extension application, settlement processing, cold symptoms); as another example, if the candidate keyword is "increase loan limit," and the positive example corresponding to this candidate keyword is "early settlement," and the negative example corresponding to this candidate keyword is "check phone bill," then the domain word sample obtained based on this candidate keyword can be represented as (increase loan limit, early settlement, check phone bill); and as yet another example, if the candidate keyword is "apply for a loan," and the positive example corresponding to this candidate keyword is "change loan repayment date," and the negative example corresponding to this candidate keyword is "navigation route," then the domain word sample obtained based on this candidate keyword can be represented as (apply for a loan, change loan repayment date, navigation route).

[0113] In one specific embodiment, in the above Figure 3 On the basis of, such as Figure 4 As shown, regarding the process of constructing domain word sample data based on candidate domain words, positive and negative examples corresponding to the candidate domain words are introduced to facilitate comparative learning during subsequent model training, thereby further improving the accuracy of model parameters. Another specific implementation process for generating domain word sample data is presented, mainly including:

[0114] (1) Obtain a sample text dataset for the target business domain; wherein, the sample text dataset includes multiple sample texts;

[0115] (2) The following specific steps can be taken for the process of obtaining the first domain word set based on part-of-speech combination distribution matching:

[0116] The above sample texts are divided into business themes to obtain text paragraphs under N business themes; for each business theme, an initial domain word subset that meets the target part-of-speech combination screening conditions is selected from the multiple text paragraphs under that business theme; based on the initial domain word subsets corresponding to each business theme under the target business domain, a first domain word set containing P initial domain words is determined.

[0117] (3) The following specific steps can be taken for the process of obtaining the second domain word set based on word vector similarity matching:

[0118] For each business topic, the target word vectors of each initial domain word in the initial domain word subset corresponding to the business topic are averaged to obtain the average word vector corresponding to the business topic; the word vector similarity between the target word vectors of each initial domain word under the above business topic and the average word vector corresponding to the business topic is calculated; from the initial domain word subset corresponding to the above business topic, the m initial domain words with the highest word vector similarity are selected to obtain the candidate domain word subset; based on the candidate domain word subset corresponding to each business topic under the target business domain, a second domain word set containing M candidate domain words is determined.

[0119] (4) The following specific steps can be taken for the process of generating domain word sample data based on M candidate domain words:

[0120] Based on the M candidate domain words in the aforementioned second domain word set and the preset domain word lexicon, a domain word dictionary and a non-domain word dictionary are determined. For each candidate domain word, positive and negative example samples corresponding to the candidate domain word are randomly selected from the aforementioned domain word dictionary and non-domain word dictionary. The candidate domain word, along with its corresponding positive and negative example samples, are used to form a triplet information, which is then defined as a domain word sample. That is, based on the triplet information corresponding to the M candidate domain words, domain word sample data is obtained. Specifically, the domain word sample data includes domain word sample 1, ..., domain word sample i, ..., domain word sample N. Domain word sample 1 includes candidate domain word 1, positive example sample 1, and negative example sample 1. Domain word sample 2 includes candidate domain word i, positive example sample i, and negative example sample i. Domain word sample N includes candidate domain word N, positive example sample N, and negative example sample N.

[0121] Specifically, regarding the process of obtaining a domain term dictionary and a non-domain term dictionary based on multiple candidate domain terms, step C1 above, based on multiple candidate domain terms in the second domain term set and a preset domain term lexicon, determines the domain term dictionary and the non-domain term dictionary, specifically including:

[0122] Step C11: For each candidate domain word, perform semantic matching between the candidate domain word and each domain word in the preset domain word lexicon to obtain the semantic matching result;

[0123] The semantic matching results mentioned above include semantic matching or semantic mismatch. Specifically, the process of semantic matching between candidate domain words and real domain words can be carried out by using an inverted index to search for real domain words in a preset domain word library and calculating the semantic similarity between candidate domain words and real domain words.

[0124] Step C12: Based on the semantic matching results corresponding to each candidate domain word, determine the first type of candidate word set and the second type of candidate word set; wherein, the first type of candidate word set includes multiple candidate domain words that have successfully matched semantically, and the second type of candidate word set includes multiple candidate domain words that have not successfully matched semantically.

[0125] Specifically, if the semantic matching result indicates semantic matching, the corresponding candidate domain word is added to the first type of candidate word set, and the real label of the candidate domain word in the second type of candidate word set is the domain word; if the semantic matching result indicates semantic mismatch, the corresponding candidate domain word is added to the second type of candidate word set, and the real label of the candidate domain word in the second type of candidate word set is the non-domain word.

[0126] Step C13: Based on the first type of candidate word set and the preset domain word lexicon, determine the domain word dictionary; and based on the second type of candidate word set, determine the non-domain word dictionary;

[0127] Specifically, regarding the process of determining the domain-specific terminology dictionary, the first set of candidate words can be directly determined as the domain-specific terminology dictionary, meaning the domain-specific terminology dictionary includes multiple domain-specific words from the first set of candidate words; alternatively, the combination of the first set of candidate words and a preset domain-specific terminology library can be determined as the domain-specific terminology dictionary, meaning the domain-specific terminology dictionary includes multiple domain-specific words from the first set of candidate words and multiple domain-specific words from the preset domain-specific terminology library. Regarding the process of determining the non-domain-specific terminology dictionary, the second set of candidate words can be directly determined as the non-domain-specific terminology dictionary, meaning the non-domain-specific terminology dictionary includes multiple non-domain-specific words from the second set of candidate words; alternatively, the combination of the second set of candidate words and a preset set of interfering words can be determined as the non-domain-specific terminology dictionary, meaning the non-domain-specific terminology dictionary includes multiple non-domain-specific words from the second set of candidate words and multiple interfering words (which can be considered as non-domain-specific words) from the preset set of interfering words.

[0128] In practical implementation, to further improve the accuracy of domain term sample data, and thus further improve the accuracy of model parameters, step C13 above, based on the aforementioned first type of candidate word set and the preset domain term lexicon, determines the domain term dictionary, specifically including:

[0129] The combination of the first type of candidate word set and the preset domain word library is determined as the initial dictionary;

[0130] Multiple domain terms in the initial dictionary are clustered to obtain domain term clusters, and these domain term clusters are determined as the domain term dictionary.

[0131] Correspondingly, step C13 above, which involves determining the non-domain word dictionary based on the second type of candidate word set, specifically includes:

[0132] Clustering is performed on multiple non-domain words in the above second type of candidate word set to obtain non-domain word clusters, and the above non-domain word clusters are determined as non-domain word dictionaries.

[0133] Specifically, the process of determining the domain terminology dictionary does not directly use the first set of candidate words or the combination of the first set of candidate words and the preset domain terminology library as the domain terminology dictionary. Instead, it performs clustering on the first set of candidate words or the combination of the first set of candidate words and the preset domain terminology library, and then determines the domain terminology dictionary by the resulting domain term clusters. This removes domain terms that are far from the center of the domain term clusters, making the domain terminology dictionary more accurate, thereby ensuring that the positive examples selected from the domain terminology dictionary are more accurate. The process of determining the non-domain word dictionary does not directly determine the second-type candidate word set or the combination of the second-type candidate word set and the preset interference word set as the non-domain word dictionary. Instead, it performs clustering processing on the second-type candidate word set or the combination of the second-type candidate word set and the preset interference word set, and then determines the non-domain word clusters obtained from the clustering as the non-domain word dictionary. This can remove non-domain words that are far from the center of the non-domain word clusters, making the accuracy of the non-domain word dictionary higher, thereby ensuring that the accuracy of the negative sample selected from the non-domain word dictionary is higher.

[0134] It should be noted that existing clustering methods can be used to cluster at least one of the first candidate word set, the initial dictionary, and the second candidate word set. Existing clustering methods can be K-Means clustering or other clustering methods. The specific clustering method used can be set according to actual needs, and this application does not limit it in this regard.

[0135] Furthermore, before generating domain-specific word sample data, it is necessary to first construct target part-of-speech combination filtering conditions. The process of determining these conditions includes, for example... Figure 5 As shown, before obtaining the sample text dataset of the target business domain in S102, the following steps are also included:

[0136] S110, Obtain the historical domain terminology library corresponding to the target business domain; wherein, the historical domain terminology library includes multiple historical domain terms;

[0137] S112, For each historical domain word, based on the part of speech of each word in the historical domain word, determine the domain word part of speech combination corresponding to the historical domain word;

[0138] S114. Based on the part-of-speech combinations of the domain words corresponding to the above-mentioned historical domain words, determine the target part-of-speech combination screening conditions corresponding to the target business domain.

[0139] Specifically, the aforementioned historical domain term can be a domain term phrase containing multiple words, each with its own part of speech. The combination of the parts of speech of each word in the historical domain term is determined as the domain term part of speech combination corresponding to the historical domain term. Then, the domain term part of speech combinations corresponding to multiple historical domain terms are deduplicated to obtain the target part of speech combination selection criteria.

[0140] For example, taking the financial lending sector as the target business area, the historical domain terminology database includes terms such as "stop collection," "extend repayment," "cancel account," "increase credit limit," and "issue settlement certificate." If the historical domain term is "stop collection" (where "stop" is a verb and "extend collection" is also a verb), then the corresponding domain term part-of-speech combination can be represented as "v|v." Similarly, if the historical domain term is "extend repayment" (where "extend" is a verb and "cancel account" is also a verb), then the corresponding domain term part-of-speech combination can be represented as "v|v." If the historical domain term is "v|n", then the domain term part-of-speech combination corresponding to the historical domain term can be represented as "v|n"; if the historical domain term is "increase credit limit" (increase is verb v, credit limit is noun n), then the domain term part-of-speech combination corresponding to the historical domain term can be represented as "v|n"; if the historical domain term is "issue settlement certificate" (issue is verb v, settlement is noun n, certificate is verb v), then the domain term part-of-speech combination corresponding to the historical domain term can be represented as "v|n|v"; therefore, at least one domain term part-of-speech combination distribution in the target part-of-speech combination screening conditions can include "v|n", "v|v", and "v|n|v".

[0141] The domain word sample data generation method in this application embodiment first selects a first domain word set that meets the target part-of-speech combination screening conditions based on a sample text dataset of the target business domain; the target part-of-speech combination screening conditions include at least one part-of-speech combination of domain words determined based on a historical domain word lexicon; then, based on the target word vectors of each initial domain word in the first domain word set, a second domain word set that meets preset word vector screening conditions is selected from the first domain word set; the preset word vector screening conditions include constraints on word vector similarity; finally, domain word sample data is generated based on multiple candidate domain words in the second domain word set; that is to say... This application first performs preliminary screening of the sample text dataset from the part-of-speech combination distribution matching dimension to obtain a first domain word set, and then performs secondary screening of the first domain word set from the word vector similarity matching dimension to obtain a second domain word set. In this way, there is no need to label the sample text or formulate various screening rules. Instead, by using the two screening dimensions of part-of-speech combination distribution matching and word vector similarity matching, a large number of candidate domain words that meet the target part-of-speech combination distribution and preset word vector similarity requirements can be obtained. Then, domain word sample data can be generated based on the candidate domain words, which can improve the efficiency and accuracy of sample data generation.

[0142] Corresponding to the above Figures 1 to 5 Based on the same technical concept, the method for generating domain term sample data described in this application also provides a method for training a domain term recognition model. Figure 6 This is a flowchart illustrating the domain term recognition model training method provided in an embodiment of this application. Figure 6 The method described herein can be executed by an electronic device equipped with a domain term recognition model training device. It should be noted that the domain term recognition model trained based on the domain term recognition model training method provided in this application embodiment can be applied to any specific application scenario requiring domain term mining based on text data from a target business domain. For example, in the application scenario of intelligent customer service, domain terms are extracted from the dialogue text between agents and customers within the target business domain, and then the domain terms are annotated with intent to obtain basic data for user intent recognition. Another example is in the application scenario of search applications, where domain terms are extracted from article text within the target business domain, and then the domain terms are used as search keywords to retrieve matching search content based on the search keywords. Yet another example is in the application scenario of knowledge graph entity storage, where domain terms are extracted from text data within the target business domain, and a domain term knowledge graph of the target business domain is constructed based on the domain terms to execute downstream business processing based on the domain term knowledge graph. Figure 6 As shown, the method includes at least the following steps:

[0143] S602, Obtain domain word sample data; wherein, the domain word sample data includes M domain word samples, each domain word sample includes a candidate domain word, a positive example sample and a negative example sample corresponding to the candidate domain word;

[0144] Specifically, the domain word sample data mentioned above can be obtained based on the domain word sample data generation method mentioned above; the process of determining candidate domain words, positive samples and negative samples in each domain word sample is described in the above embodiments and will not be repeated here.

[0145] S604, input the domain word samples into the domain word recognition model to be trained, and obtain the target word vectors of the candidate domain words, the target word vectors of the positive samples, and the target word vectors of the negative samples in the domain word samples;

[0146] S606, determine the first word vector distance based on the target word vectors of candidate domain words in the domain word samples and the target word vectors of positive sample samples; and determine the second word vector distance based on the target word vectors of candidate domain words in the domain word samples and the target word vectors of negative sample samples;

[0147] Specifically, the first word vector distance and the second word vector distance can be Euclidean distance, that is, using Euclidean distance to measure the feature distance between candidate domain words and positive and negative samples.

[0148] S608, based on the distance between the first word vector and the second word vector corresponding to word samples in each domain, determine the model loss value;

[0149] Specifically, since the first word vector distance between candidate domain words and positive samples reflects the similarity between their word vectors, and the second word vector distance between candidate domain words and negative samples reflects the similarity between their word vectors, the model parameters are iteratively updated during the model training phase to make the target word vectors of candidate domain words closer to the target word vectors of positive samples and farther away from the target word vectors of negative samples. This makes the feature vectors of candidate domain words, which are classified as domain words, closer to the feature space of positive samples and farther away from the feature space of negative samples. This means that two word groups belonging to the same domain word are close in distance in the encoding space, while two word groups belonging to the domain word and non-domain word are far apart in the encoding space. In other words, the loss function of the domain word recognition model to be trained constrains the feature distances among candidate domain words, positive samples, and negative samples, reducing the feature distance between candidate domain words classified as domain words and positive samples, and increasing the feature distance between candidate domain words classified as domain words and negative samples.

[0150] Specifically, the model loss value is determined based on the difference between the distance between the first word vector and the distance between the second word vector corresponding to each candidate domain word.

[0151] S610, based on the above model loss value, perform iterative updates of the model parameters of the domain word recognition model to be trained, and obtain the trained domain word recognition model.

[0152] Specifically, after determining the model loss value based on the first and second word vector distances corresponding to each candidate domain word, the gradient descent method is used to adjust the parameters of the domain word recognition model to be trained based on the above model loss value. Here, since the model loss value is determined based on the first word vector distance between the candidate domain word and the positive sample and the second word vector distance between the candidate domain word and the negative sample, the model learns continuously to make the target word vector of the candidate domain word closer to the target word vector of the positive sample and farther away from the target word vector of the negative sample. That is, during the iterative update of the model parameters, the word vector distance between the candidate domain word and the positive and negative samples is considered, thereby improving the accuracy of the model parameter adjustment and making the domain word mining accuracy of the trained domain word recognition model higher.

[0153] It should be noted that the process of iteratively training the model parameters based on the model loss value to obtain the trained domain word recognition model can be found in the existing process of using gradient descent to backpropagate and fine-tune the model parameters, which will not be repeated here.

[0154] In this embodiment, on the one hand, since the candidate domain words in the domain word sample data are obtained by combining the part-of-speech combination distribution matching dimension and the word vector similarity matching dimension, there is no need to label the sample text or formulate various screening rules. A large number of candidate domain words that meet the target part-of-speech combination distribution and preset word vector similarity requirements can be obtained. Then, domain word sample data can be generated based on the candidate domain words, which can improve the generation efficiency and accuracy of sample data. On the other hand, since each domain word sample includes not only candidate domain words, but also positive and negative sample samples selected for the candidate domain words, during the model training stage, the model loss value is determined based on the first word vector distance between the candidate domain words and the positive sample, and the second word vector distance between the candidate domain words and the negative sample in the above-mentioned domain word sample. Then, the model parameters are iteratively updated based on the model loss value. This adds the limiting conditions of the word vector distance between the candidate domain words and the positive sample, and the word vector distance between the candidate domain words and the negative sample, which enables the model to learn the distance relationship between the original sample and the positive and negative samples, achieve the effect of comparative learning, and thus improve the update accuracy of the model parameters.

[0155] Specifically, in the process of determining the model loss value for each round of model training, S608 above determines the model loss value based on the first word vector distance and the second word vector distance corresponding to each domain word sample, including:

[0156] Step D1: For each domain word sample, determine the positive and negative example distance difference based on the first word vector distance and the second word vector distance corresponding to the domain word sample.

[0157] Specifically, the domain word recognition model to be trained can include three neural network layers. Taking a domain word sample as an analysis object, the candidate domain word, positive sample, and negative sample in the domain word sample are respectively input into a corresponding neural network layer to obtain the target word vector of the candidate domain word, the word vector of the positive sample, and the word vector of the negative sample. Based on the target word vector of the candidate domain word and the target word vector of the positive sample, the first word vector distance between the candidate domain word and the positive sample is calculated, and based on the target word vector of the candidate domain word and the target word vector of the negative sample, the second word vector distance between the candidate domain word and the negative sample is calculated. Then, the difference between the first word vector distance and the second word vector distance is determined as the positive and negative distance difference corresponding to the candidate domain word. The larger the positive and negative distance difference, the further the candidate domain word is from the negative sample and the closer it is to the negative sample, and therefore, the larger the model loss value.

[0158] Step D2: Based on the above positive and negative example distance differences, determine the model sub-loss value corresponding to the above domain word samples;

[0159] Specifically, the difference between positive and negative examples can be directly determined as the sub-loss value of the model corresponding to the domain word sample. In practice, in order to improve the flexibility of adjusting the training accuracy of the model parameters, a preset distance interval parameter value can also be introduced. Based on the difference between positive and negative examples and the preset distance interval parameter value, the sub-loss value of the model corresponding to the domain word sample can be determined.

[0160] Step D3: Determine the model loss value based on the model sub-loss values ​​corresponding to the M domain word samples mentioned above.

[0161] Specifically, after calculating the model sub-loss value corresponding to each candidate domain word, the average of the model sub-loss values ​​of the M candidate domain words can be used to obtain the model loss value, or the model sub-loss values ​​of the M candidate domain words can be weighted and summed to obtain the model parameter loss value.

[0162] Furthermore, in the process of determining the model sub-loss value corresponding to the domain word sample, if a preset distance interval parameter value is introduced, step D2 above, based on the distance difference between the positive and negative examples, determines the model sub-loss value corresponding to the domain word sample, specifically including:

[0163] Step D21: Determine the initial sub-loss value based on the above positive and negative example distance difference and the preset distance interval parameter value;

[0164] Specifically, the aforementioned preset distance interval parameter value can be set according to actual needs. This sets a requirement for the distance between the feature space formed by non-domain words outside the target business domain and the feature space formed by domain words within the target business domain. The distance between the two feature spaces must be greater than the preset distance interval parameter value. The magnitude of the preset distance interval parameter value affects the training accuracy of the model parameters. A larger preset distance interval parameter value results in higher training accuracy, while a smaller value results in lower accuracy. Therefore, if a higher accuracy of the trained domain word recognition model is desired, the preset distance interval parameter value can be increased; conversely, if a lower accuracy is desired, the preset distance interval parameter value can be decreased.

[0165] Step D22: If the initial sub-loss value is greater than zero, then the initial sub-loss value is determined as the model sub-loss value corresponding to the domain word sample.

[0166] Step D23: If the initial sub-loss value is less than or equal to zero, then set the model sub-loss value corresponding to the domain word sample to zero.

[0167] Specifically, if the initial sub-loss value is greater than zero, it means that the sum of the word vector distance between the candidate domain word and the positive sample and the preset distance interval parameter value is greater than the word vector distance between the candidate domain word and the negative sample. In other words, the word vector distance between the candidate domain word and the positive sample is relatively large, so the initial sub-loss value is used as the model sub-loss value corresponding to the domain word sample. If the initial sub-loss value is less than or equal to zero, it means that the sum of the word vector distance between the candidate domain word and the positive sample and the preset distance interval parameter value is less than or equal to the word vector distance between the candidate domain word and the negative sample. In other words, the word vector distance between the candidate domain word and the positive sample is relatively small, so the model sub-loss value corresponding to the domain word sample can be set to zero, that is, the model sub-loss value corresponding to this part of the candidate domain word is ignored.

[0168] Specifically, when the word vector distance (i.e., the fourth word vector distance) between candidate domain words and negative samples is the same, if the preset distance interval parameter value is set relatively large, the corresponding model sub-loss value will be set to zero only when the word vector distance (i.e., the third word vector distance) between candidate domain words and positive samples is relatively small. That is, only when the word vector distance between candidate domain words and positive samples is relatively small will the model sub-loss value brought by the candidate domain word be excluded. This can make the accuracy of the trained domain word recognition model higher (i.e., improve the training accuracy of model parameters); conversely, it will reduce the training accuracy of model parameters.

[0169] In practical implementation, the loss value of the above model can be calculated in the following way:

[0170]

[0171] in, This represents the model loss value, where M represents the number of domain word samples, and i represents the index of the domain word sample. This represents the target word vector of the candidate domain word with index i. This represents the target word vector of the positive example sample corresponding to the candidate domain word with index i. This represents the target word vector of the negative example sample corresponding to the candidate domain word with index i. This represents the word vector distance (i.e., the third word vector distance) between candidate domain words and positive samples. This represents the word vector distance (i.e., the fourth word vector distance) between candidate domain words and negative sample words. This indicates the preset distance interval parameter value; in specific implementation, It can represent Euclidean distance.

[0172] In one specific embodiment, such as Figure 7 As shown, a specific implementation process for training a domain-specific word recognition model is presented, mainly including:

[0173] (1) Obtain domain word sample data; wherein, the domain word sample data includes M domain word samples, each domain word sample includes a candidate domain word, a positive sample corresponding to the candidate domain word and a negative sample;

[0174] (2) Input the candidate domain words, positive samples and negative samples in each domain word sample into the corresponding neural network layer in the domain word recognition model to be trained, and obtain the target word vectors of the candidate domain words, the target word vectors of the positive samples and the target word vectors of the negative samples in the domain word sample; Specifically, the domain word recognition model includes neural network layer 1, neural network layer 2 and neural network layer 3. For example, neural network layer 1 is used to perform feature vector transformation on the positive samples of the candidate domain words, neural network layer 2 is used to perform feature vector transformation on the candidate domain words, and neural network layer 3 is used to perform feature vector transformation on the negative samples of the candidate domain words;

[0175] (3) Determine the first word vector distance based on the target word vectors of candidate domain words in the domain word samples and the target word vectors of positive sample samples; and determine the second word vector distance based on the target word vectors of candidate domain words in the domain word samples and the target word vectors of negative sample samples;

[0176] (4) For each domain word sample, determine the model sub-loss value of the domain word sample based on the first word vector distance and the second word vector distance corresponding to the domain word sample;

[0177] (5) Determine the model loss value based on the model sub-loss values ​​of word samples in each domain;

[0178] (6) Based on the above model loss value, the domain word recognition model to be trained is iteratively updated to obtain the trained domain word recognition model. That is, the model parameters of neural network layer 1, neural network layer 2 and neural network layer 3 are iteratively updated until the current model training result meets the preset model training termination condition to obtain the trained domain word recognition model. The preset model training termination condition may include either the current model training round number equals the total training round number or the model loss function converges.

[0179] It should be noted that, for the sake of simplicity, the above... Figure 7 The diagram illustrates the specific implementation process of determining the model sub-loss value for the domain word sample with index i. The process of determining the model sub-loss value for other domain word samples is similar.

[0180] The domain word recognition model training method in this application has two advantages. First, since the candidate domain words in the domain word sample data are obtained by combining the part-of-speech combination distribution matching dimension and the word vector similarity matching dimension, there is no need to label the sample text or formulate various screening rules. This allows for the generation of a large number of candidate domain words that meet the target part-of-speech combination distribution and preset word vector similarity requirements. This improves the efficiency and accuracy of sample data generation. Second, since each domain word sample includes not only candidate domain words but also positive and negative sample words selected for the candidate domain words, during the model training phase, the model loss value is determined based on the first word vector distance between the candidate domain words and the positive sample words, and the second word vector distance between the candidate domain words and the negative sample words in the above-mentioned domain word samples. The model parameters are then iteratively updated based on this model loss value. This adds the constraints of the word vector distance between the candidate domain words and the positive sample words, and the word vector distance between the candidate domain words and the negative sample words, enabling the model to learn the distance relationship between the original sample and the positive and negative samples, achieving the effect of comparative learning, thereby improving the accuracy of model parameter updates.

[0181] It should be noted that this embodiment in this application is based on the same inventive concept as the previous embodiment in this application. Therefore, the specific implementation of this embodiment can be referred to the implementation of the aforementioned domain term sample data generation method, and the repeated parts will not be described again.

[0182] Corresponding to the above Figures 1 to 5 The described domain term sample data generation method or the above Figures 6 to 7 Based on the same technical concept, the domain term recognition model training method described in this application also provides a domain term recognition method. Figure 8This is a flowchart illustrating the domain term recognition method provided in an embodiment of this application. Figure 8 The method described herein can be executed by an electronic device equipped with a domain term recognition device. It should be noted that the domain term recognition method provided in this application embodiment can be applied to any specific application scenario that requires domain term mining using a pre-trained domain term recognition model. For example, in the application scenario of intelligent customer service, a pre-trained domain term recognition model is used to extract domain terms from the dialogue text between agents and customers within the target business domain; then, the domain terms are annotated with intent to obtain basic data for user intent recognition. Another example is in the application scenario of search applications, where a pre-trained domain term recognition model is used to extract domain terms from article text within the target business domain; then, the domain terms are used as search keywords to retrieve matching search content based on the search keywords. Yet another example is in the application scenario of knowledge graph entity storage, where a pre-trained domain term recognition model is used to extract domain terms from text data within the target business domain, and a domain term knowledge graph of the target business domain is constructed based on the domain terms to execute downstream business processing based on the domain term knowledge graph. Figure 8 As shown, the method includes at least the following steps:

[0183] S802, Obtain the target business domain's text dataset; the text dataset includes multiple texts to be identified;

[0184] Specifically, the aforementioned target business area can be any business area, such as the financial field, the education field, or the financial lending field, the financial management field, etc.; the target business area can be a broad category or a specific sub-category within a broad category. This application does not limit the division of business areas.

[0185] Specifically, taking the financial lending sector as an example, the text to be identified can be the dialogue text between agents and target users generated based on online business traffic. For example, it could be the online chat content generated when agents recommend a loan product to target users, or the text content of a call obtained by converting voice into voice.

[0186] S804, Select multiple target words to be identified from the above multiple texts to be identified;

[0187] Specifically, multiple keyword groups to be identified can be extracted from multiple texts to be identified. These keyword groups can be directly used as target words to be identified. Alternatively, the process of determining the second domain word set can be referenced above. First, multiple keyword groups to be identified can be preliminarily screened from the part-of-speech combination distribution matching dimension to obtain the third domain word set. Then, the third domain word set can be screened a second time from the word vector similarity matching dimension to obtain the fourth domain word set containing multiple target words to be identified.

[0188] S806, the target word to be identified, the corresponding positive sample and negative sample are input into the trained domain word recognition model to obtain the domain words in the target business domain; wherein, the positive sample is randomly selected from the domain word dictionary, and the negative sample is randomly selected from the non-domain word dictionary.

[0189] Specifically, the domain word recognition model mentioned above can be obtained based on the domain word recognition model training method mentioned above. The training process of the domain word recognition model is described in the above embodiments and will not be repeated here. In addition, the process of determining the domain word dictionary and the non-domain word dictionary mentioned above is described in the domain word sample generation method regarding the construction process of the domain word dictionary and the non-domain word dictionary, and will not be repeated here.

[0190] In this embodiment, on the one hand, since each domain word sample in the domain word sample data used to train the domain word recognition model includes not only candidate domain words, but also positive and negative sample samples selected for the candidate domain words, the model loss value is determined based on the first word vector distance between the candidate domain words and the positive sample, and the second word vector distance between the candidate domain words and the negative sample in the aforementioned domain word sample; then, the model parameters are iteratively updated based on this model loss value. This adds the constraints of the word vector distance between the candidate domain words and the positive sample, and the word vector distance between the candidate domain words and the negative sample, enabling the model to learn the original sample and the positive and negative samples. Distance relationships are used to achieve the effect of comparative learning, thereby improving the accuracy of model parameter updates. Consequently, in the domain word mining stage, the accuracy of domain word recognition can be improved. On the other hand, in the domain word mining stage, the input data of the domain word recognition model includes not only the target word to be identified, but also positive and negative sample examples selected for the target word to be identified. This allows for the identification of whether the target word to be identified is a domain word based on the third word vector distance between the target word to be identified and the positive sample examples, and the fourth word vector distance between the target word to be identified and the negative sample examples. This constrains the word vector distance between the target word to be identified and the positive and negative sample examples, thereby further improving the accuracy of domain word recognition.

[0191] To improve the efficiency of domain term mining, the extraction process for target words to be identified can refer to the above-mentioned candidate domain term extraction process. This involves extracting multiple target words from the text to be identified based on two dimensions: part-of-speech combination distribution matching and word vector similarity matching. In other words, the keyword groups extracted from the text to be identified are not directly used as target words; instead, multiple target words are obtained through two rounds of filtering. Specifically, in S804 above, multiple target words are selected from the multiple texts to be identified, including:

[0192] Step 1: Based on the above multiple texts to be identified, select a third domain word set that meets the target part-of-speech combination screening criteria; wherein, the third domain word set includes multiple initial words to be identified; the target part-of-speech combination screening criteria include at least one domain word part-of-speech combination determined based on the historical domain word thesaurus corresponding to the target business domain;

[0193] Specifically, the selection process for the third domain term set is the same as the selection process for the first domain term set, and will not be repeated here.

[0194] Step 2: Based on the target word vectors of each initial word to be identified in the third domain word set, select a fourth domain word set that meets the preset word vector screening conditions from the third domain word set; wherein, the fourth domain word set includes multiple target words to be identified, and the preset word vector screening conditions include constraints on word vector similarity.

[0195] Specifically, the selection process for the fourth domain term set is the same as the selection process for the second domain term set, and will not be repeated here.

[0196] Specifically, regarding the process of domain word recognition based on the information of the triplet to be identified, in step S806 above, the target word to be identified, the corresponding positive sample and negative sample are input into the trained domain word recognition model to obtain the domain words under the target business domain, which specifically includes:

[0197] Step 1: Input the target word to be identified, the corresponding positive sample and negative sample into the trained domain word recognition model for feature vector transformation processing to obtain the target word vector of the target word to be identified, the target word vector of the positive sample and the target word vector of the negative sample;

[0198] Step 2: Based on the target word vector of the target word to be identified and the target word vector of the positive sample, determine the third word vector distance; and based on the target word vector of the target word to be identified and the target word vector of the negative sample, determine the fourth word vector distance.

[0199] Specifically, the third word vector distance is the word vector distance between the target word to be identified and the corresponding positive sample, and the fourth word vector distance is the word vector distance between the target word to be identified and the corresponding negative sample. The calculation process of the third and fourth word vector distances can refer to the first and second word vector distances mentioned above, and will not be repeated here.

[0200] Step 3: Based on the third and fourth word vector distances mentioned above, determine the domain word recognition result of the target word to be identified;

[0201] Specifically, after determining the distances of the third and fourth word vectors, the word vector distance difference between the fourth and third word vector distances is calculated. If this word vector distance difference is greater than a preset distance difference threshold, the target word to be identified is determined to be a domain word. Correspondingly, the domain word identification result of the target word to be identified indicates that the target word to be identified is a domain word. The preset distance difference threshold can be an integer greater than zero. That is, the third word vector distance is less than the fourth word vector distance, and the word vector distance difference is greater than a positive number. In other words, the distance between the target word to be identified and the positive sample feature space is relatively small, and the distance between the target word to be identified and the negative sample feature space is relatively large. The distance difference between the target word to be identified and the two feature spaces meets a certain preset distance difference threshold requirement. Otherwise, the target word to be identified is determined to be a non-domain word. Correspondingly, the domain word identification result of the target word to be identified indicates that the target word to be identified is a non-domain word.

[0202] It should be noted that the preset distance difference threshold may be the same as or different from the preset distance interval parameter value. The preset distance difference threshold can be set according to actual needs, and this application does not limit it.

[0203] Step 4: Based on the domain word recognition results of each target word to be identified, determine the domain words under the target business domain.

[0204] In one specific embodiment, such as Figure 9 As shown, a specific implementation process for domain word recognition is presented, which mainly includes:

[0205] (1) Obtain the target business domain's text dataset; wherein, the text dataset includes multiple texts to be identified;

[0206] (2) Based on the above multiple texts to be identified, perform part-of-speech combination distribution matching, select the initial words to be identified that meet any part-of-speech combination of the target part-of-speech combination screening conditions, and thus obtain a third domain word set containing X initial words to be identified; X is an integer greater than zero;

[0207] (3) Based on the above third domain word set, perform word vector similarity matching, select target words that meet the preset word vector screening conditions (i.e., the initial target words that are ranked first in word vector similarity with the average word vector of the third domain word set), and thus obtain a fourth domain word set containing Y target target words; Y is an integer greater than zero and Y is less than X;

[0208] (4) Input the word group data to be identified into the trained domain word recognition model for feature vector transformation to obtain the target word vector of the target word to be identified, the target word vector of the positive sample and the target word vector of the negative sample; Specifically, the word group data to be identified includes Y triplet information to be identified, and each triplet information to be identified includes a target word to be identified, the positive sample and the negative sample corresponding to the target word to be identified;

[0209] (5) Based on the target word vector of the target word to be identified and the target word vector of the positive sample, determine the third word vector distance; and based on the target word vector of the target word to be identified and the target word vector of the negative sample, determine the fourth word vector distance;

[0210] (6) Based on the third word vector distance and the fourth word vector distance mentioned above, determine the domain word recognition result of the target word to be identified;

[0211] (7) Based on the domain word recognition results of each target word to be identified, determine the domain words under the target business domain.

[0212] It should be noted that, for the sake of simplicity, the above... Figure 9 The diagram illustrates the specific implementation process for determining whether a target word with index j is a domain word. The process for identifying whether other target words are domain words is similar.

[0213] In a specific embodiment, the specific implementation process based on the above-described domain word sample data generation method and domain word recognition model training method is as follows: Figure 10 As shown, a specific implementation process for domain word recognition is given, which mainly includes: the generation stage of domain word sample data, the training stage of the domain word recognition model, and the domain word recognition stage;

[0214] Specifically, regarding the generation stage of domain term sample data, please refer to the above. Figures 2 to 4 The diagram shown illustrates the specific implementation principle; for the training phase of the domain word recognition model, please refer to the above. Figure 7 The diagram shown illustrates the specific implementation principle; for the domain word recognition stage, please refer to the above. Figure 9 The diagram shown illustrates the specific implementation principle; the detailed implementation process will not be elaborated here.

[0215] The domain word recognition method in this application embodiment, on the one hand, since each domain word sample in the domain word sample data used to train the domain word recognition model includes not only candidate domain words, but also positive and negative sample samples selected for the candidate domain words, the model loss value is determined based on the first word vector distance between the candidate domain words and the positive sample, and the second word vector distance between the candidate domain words and the negative sample in the aforementioned domain word sample; then, the model parameters are iteratively updated based on the model loss value; this adds the limiting conditions of the word vector distance between the candidate domain words and the positive sample, and the word vector distance between the candidate domain words and the negative sample, prompting the model to learn the original sample and the positive sample. The distance relationship between negative samples achieves the effect of contrastive learning, thereby improving the accuracy of model parameter updates. Consequently, in the domain word mining stage, it can improve the accuracy of domain word recognition. On the other hand, in the domain word mining stage, the input data of the domain word recognition model includes not only the target word to be identified, but also the positive and negative samples selected for the target word to be identified. This allows for the identification of whether the target word to be identified is a domain word based on the third word vector distance between the target word to be identified and the positive sample, and the fourth word vector distance between the target word to be identified and the negative sample. This constrains the word vector distance between the target word to be identified and the positive and negative samples, thereby further improving the accuracy of domain word recognition.

[0216] It should be noted that this embodiment in this application is based on the same inventive concept as the previous embodiment in this application. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned domain word sample data generation method and domain word recognition model training method. The repeated parts will not be described again.

[0217] Corresponding to the above Figures 1 to 5 Based on the same technical concept, the method for generating domain term sample data described in this application also provides a domain term sample data generation apparatus. Figure 11 This is a schematic diagram of the module composition of the domain term sample data generation device provided in the embodiments of this application. The device is used to perform... Figures 1 to 5 The method for generating domain term sample data described, such as Figure 11 As shown, the device includes:

[0218] The sample data acquisition module 1102 is used to acquire a sample text dataset of the target business domain; the sample text dataset includes multiple sample texts;

[0219] The first selection module 1104 is used to select a first domain word set that meets the target part-of-speech combination screening conditions based on the plurality of sample texts; the first domain word set includes a plurality of initial domain words, and the target part-of-speech combination screening conditions include at least one domain word part-of-speech combination determined based on the historical domain word thesaurus corresponding to the target business domain;

[0220] The second selection module 1106 is used to select a second set of domain words that meets preset word vector screening conditions from the first set of domain words based on the target word vectors of each of the initial domain words; the second set of domain words includes multiple candidate domain words, and the preset word vector screening conditions include constraints on word vector similarity.

[0221] Domain word sample generation module 1108 is used to generate domain word sample data based on the multiple candidate domain words.

[0222] The domain word sample data generation device in this application embodiment first selects a first domain word set that meets the target part-of-speech combination screening conditions based on a sample text dataset of the target business domain; the target part-of-speech combination screening conditions include at least one part-of-speech combination of domain words determined based on a historical domain word lexicon; then, based on the target word vectors of each initial domain word in the first domain word set, a second domain word set that meets preset word vector screening conditions is selected from the first domain word set; the preset word vector screening conditions include constraints on word vector similarity; and then, based on multiple candidate domain words in the second domain word set, domain word sample data is generated; that is to say... This application first performs preliminary screening of the sample text dataset from the part-of-speech combination distribution matching dimension to obtain a first domain word set, and then performs secondary screening of the first domain word set from the word vector similarity matching dimension to obtain a second domain word set. In this way, there is no need to label the sample text or formulate various screening rules. Instead, by using the two screening dimensions of part-of-speech combination distribution matching and word vector similarity matching, a large number of candidate domain words that meet the target part-of-speech combination distribution and preset word vector similarity requirements can be obtained. Then, domain word sample data can be generated based on the candidate domain words, which can improve the efficiency and accuracy of sample data generation.

[0223] It should be noted that the embodiments of the domain term sample data generation device in this application and the embodiments of the domain term sample data generation method in this application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can be referred to the implementation of the corresponding domain term sample data generation method mentioned above, and the repeated parts will not be described again.

[0224] Corresponding to the above Figures 6 to 7 Based on the same technical concept, the domain term recognition model training method described in this application also provides a domain term recognition model training device. Figure 12 This is a schematic diagram of the module composition of the domain word recognition model training device provided in the embodiments of this application. The device is used to perform... Figures 6 to 7 The training method for the domain word recognition model is described, such as Figure 12 As shown, the device includes:

[0225] The domain word sample acquisition module 1202 is used to acquire domain word sample data; the domain word sample data is obtained based on the above-mentioned domain word sample data generation method, and the domain word sample data includes M domain word samples, each of the domain word samples including a candidate domain word, a positive example sample and a negative example sample corresponding to the candidate domain word;

[0226] The target word vector determination model 1204 is used to input each of the domain word samples into the domain word recognition model to be trained, and obtain the target word vectors of the candidate domain words, the target word vectors of the positive samples, and the target word vectors of the negative samples in the domain word samples;

[0227] The word vector distance determination model 1206 is used to determine a first word vector distance based on the target word vector of the candidate domain word and the target word vector of the positive example sample; and to determine a second word vector distance based on the target word vector of the candidate domain word and the target word vector of the negative example sample.

[0228] The model loss value determination module 1208 is used to determine the model loss value based on the first word vector distance and the second word vector distance corresponding to each domain word sample;

[0229] The recognition model training module 1210 is used to iteratively update the model parameters of the domain word recognition model to be trained based on the model loss value, so as to obtain the trained domain word recognition model.

[0230] The domain word recognition model training device in this application embodiment, on the one hand, since the candidate domain words in the domain word sample data are obtained by combining the part-of-speech combination distribution matching dimension and the word vector similarity matching dimension, there is no need to label the sample text or formulate various screening rules. A large number of candidate domain words that meet the target part-of-speech combination distribution and preset word vector similarity requirements can be obtained. Then, domain word sample data can be generated based on the candidate domain words, which can improve the generation efficiency and accuracy of sample data. On the other hand, since each domain word sample includes not only candidate domain words, but also positive and negative sample samples selected for the candidate domain words, during the model training stage, the model loss value is determined based on the first word vector distance between the candidate domain words and the positive sample, and the second word vector distance between the candidate domain words and the negative sample in the above-mentioned domain word sample. Then, the model parameters are iteratively updated based on the model loss value. This adds the limiting conditions of the word vector distance between the candidate domain words and the positive sample, and the word vector distance between the candidate domain words and the negative sample, which enables the model to learn the distance relationship between the original sample and the positive and negative samples, achieve the effect of comparative learning, and thus improve the update accuracy of the model parameters.

[0231] It should be noted that the embodiments of the domain word recognition model training device in this application and the embodiments of the domain word recognition model training method in this application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can be referred to the implementation of the corresponding domain word recognition model training method mentioned above, and the repeated parts will not be described again.

[0232] Corresponding to the above Figures 8 to 10 Based on the same technical concept, this application also provides a domain term recognition device in its embodiments, which is also described in the domain term recognition method. Figure 13 This is a schematic diagram of the module composition of the domain term recognition device provided in the embodiments of this application. The device is used to perform... Figures 8 to 10 The domain-specific word recognition method described, such as Figure 13 As shown, the device includes:

[0233] The data acquisition module 1302 is used to acquire a dataset of texts to be identified in a target business domain; the dataset of texts to be identified includes multiple texts to be identified.

[0234] The word selection module 1304 is used to select multiple target words to be identified from the multiple texts to be identified;

[0235] The domain word recognition module 1306 is used to input the target word to be recognized, the positive sample and the negative sample corresponding to the target word to be recognized into the trained domain word recognition model to obtain the domain words under the target business domain; the domain word recognition model is obtained based on the above-mentioned domain word recognition model training method, the positive sample is randomly selected from the domain word dictionary, and the negative sample is randomly selected from the non-domain word dictionary.

[0236] The domain word recognition device in this embodiment, on the one hand, since each domain word sample in the domain word sample data used to train the domain word recognition model includes not only candidate domain words, but also positive and negative sample samples selected for the candidate domain words, the model loss value is determined based on the first word vector distance between the candidate domain words and the positive sample samples, and the second word vector distance between the candidate domain words and the negative sample samples in the aforementioned domain word samples; then, the model parameters are iteratively updated based on the model loss value; this adds the limiting conditions of the word vector distance between the candidate domain words and the positive sample samples, and the word vector distance between the candidate domain words and the negative sample samples, enabling the model to learn the original sample and the positive sample. The distance relationship between negative samples achieves the effect of contrastive learning, thereby improving the accuracy of model parameter updates. Consequently, in the domain word mining stage, it can improve the accuracy of domain word recognition. On the other hand, in the domain word mining stage, the input data of the domain word recognition model includes not only the target word to be identified, but also the positive and negative samples selected for the target word to be identified. This allows for the identification of whether the target word to be identified is a domain word based on the third word vector distance between the target word to be identified and the positive sample, and the fourth word vector distance between the target word to be identified and the negative sample. This constrains the word vector distance between the target word to be identified and the positive and negative samples, thereby further improving the accuracy of domain word recognition.

[0237] It should be noted that the embodiments of the domain word recognition device in this application and the embodiments of the domain word recognition method in this application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can be referred to the implementation of the corresponding domain word recognition method mentioned above, and the repeated parts will not be described again.

[0238] Furthermore, corresponding to the above Figures 1 to 10 Based on the same technical concept, this application also provides a computer device for executing the above-described domain term sample data generation method, such as... Figure 14 As shown.

[0239] Computer devices can vary significantly due to differences in configuration or performance. They may include one or more processors 1401 and memory 1402, with memory 1402 storing one or more application programs or data. Memory 1402 can be temporary or persistent storage. The application programs stored in memory 1402 may include one or more modules (not shown), each module including a series of computer-executable instructions for the computer device. Furthermore, processor 1401 may be configured to communicate with memory 1402 and execute the series of computer-executable instructions stored in memory 1402 on the computer device. The computer device may also include one or more power supplies 1403, one or more wired or wireless network interfaces 1404, one or more input / output interfaces 1405, one or more keyboards 1406, etc.

[0240] In one specific embodiment, the computer device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for use in the computer device, and is configured to be executed by one or more processors. The one or more programs include computer-executable instructions for performing the following:

[0241] Obtain a sample text dataset from the target business domain; the sample text dataset includes multiple sample texts.

[0242] Based on the multiple sample texts, a first domain word set that meets the target part-of-speech combination screening conditions is selected; the first domain word set includes multiple initial domain words, and the target part-of-speech combination screening conditions include at least one domain word part-of-speech combination determined based on the historical domain word thesaurus corresponding to the target business domain;

[0243] Based on the target word vectors of each of the initial domain words, a second domain word set that meets the preset word vector screening conditions is selected from the first domain word set; the second domain word set includes multiple candidate domain words, and the preset word vector screening conditions include constraints on word vector similarity.

[0244] Based on the multiple candidate domain terms, domain term sample data is generated.

[0245] The computer device in this embodiment first selects a first domain word set that meets the target part-of-speech combination screening conditions based on a sample text dataset of the target business domain. The target part-of-speech combination screening conditions include at least one part-of-speech combination of domain words determined based on a historical domain word lexicon. Then, based on the target word vectors of each initial domain word in the first domain word set, a second domain word set that meets the preset word vector screening conditions is selected from the first domain word set. The preset word vector screening conditions include constraints on word vector similarity. Then, domain word sample data is generated based on multiple candidate domain words in the second domain word set. In other words, this application first performs preliminary screening of the sample text dataset from the part-of-speech combination distribution matching dimension to obtain the first domain word set, and then performs secondary screening of the first domain word set from the word vector similarity matching dimension to obtain the second domain word set. This eliminates the need to label the sample text or formulate various screening rules. Instead, by using the two screening dimensions of part-of-speech combination distribution matching and word vector similarity matching, a large number of candidate domain words that meet the target part-of-speech combination distribution and preset word vector similarity requirements can be obtained. Then, domain word sample data is generated based on the candidate domain words, which can improve the efficiency and accuracy of sample data generation.

[0246] In another specific embodiment, the computer device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for use in the computer device, and is configured to be executed by one or more processors. The one or more programs include computer-executable instructions for performing the following:

[0247] Obtain domain term sample data; the domain term sample data is obtained based on the domain term sample data generation method described above, and the domain term sample data includes M domain term samples, each of the domain term samples including a candidate domain term, a positive example sample and a negative example sample corresponding to the candidate domain term;

[0248] Each domain word sample is input into the domain word recognition model to be trained to obtain the target word vector of the candidate domain word, the target word vector of the positive sample, and the target word vector of the negative sample in the domain word sample.

[0249] Based on the target word vectors of the candidate domain words and the target word vectors of the positive examples, a first word vector distance is determined; and based on the target word vectors of the candidate domain words and the target word vectors of the negative examples, a second word vector distance is determined.

[0250] The model loss value is determined based on the first word vector distance and the second word vector distance corresponding to each domain word sample;

[0251] Based on the model loss value, the domain word recognition model to be trained is iteratively updated to obtain the trained domain word recognition model.

[0252] The computer device in this embodiment, on the one hand, since the candidate domain words in the domain word sample data are obtained by combining the part-of-speech combination distribution matching dimension and the word vector similarity matching dimension, there is no need to label the sample text or formulate various screening rules. A large number of candidate domain words that meet the target part-of-speech combination distribution and preset word vector similarity requirements can be obtained. Then, domain word sample data can be generated based on the candidate domain words, which can improve the generation efficiency and accuracy of sample data. On the other hand, since each domain word sample includes not only candidate domain words, but also positive and negative sample samples selected for the candidate domain words, during the model training stage, the model loss value is determined based on the first word vector distance between the candidate domain words and the positive sample, and the second word vector distance between the candidate domain words and the negative sample in the above-mentioned domain word sample. Then, the model parameters are iteratively updated based on the model loss value. This adds the limiting conditions of the word vector distance between the candidate domain words and the positive sample, and the word vector distance between the candidate domain words and the negative sample, which enables the model to learn the distance relationship between the original sample and the positive and negative samples, achieve the effect of comparative learning, and thus improve the update accuracy of the model parameters.

[0253] In yet another specific embodiment, the computer device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for use in the computer device, and is configured to be executed by one or more processors. The one or more programs include computer-executable instructions for performing the following:

[0254] Obtain a dataset of texts to be identified within the target business domain; the dataset includes multiple texts to be identified.

[0255] Select multiple target words to be identified from the multiple texts to be identified;

[0256] The target word to be identified, the corresponding positive sample and negative sample are input into the trained domain word recognition model to obtain the domain words under the target business domain; the positive sample is randomly selected from the domain word dictionary, and the negative sample is randomly selected from the non-domain word dictionary.

[0257] The computer device in this embodiment, on the one hand, since each domain word sample in the domain word sample data used to train the domain word recognition model includes not only candidate domain words, but also positive and negative sample samples selected for the candidate domain words, determines the model loss value based on the first word vector distance between the candidate domain words and the positive sample, and the second word vector distance between the candidate domain words and the negative sample in the aforementioned domain word sample; then, iteratively updates the model parameters based on the model loss value; this adds the limiting conditions of the word vector distance between the candidate domain words and the positive sample, and the word vector distance between the candidate domain words and the negative sample, enabling the model to learn the original sample and the positive and negative samples. By establishing distance relationships between samples, a comparative learning effect is achieved, thereby improving the accuracy of model parameter updates. Consequently, in the domain word mining stage, the accuracy of domain word recognition can be improved. On the other hand, in the domain word mining stage, the input data of the domain word recognition model includes not only the target word to be identified, but also positive and negative sample examples selected for the target word to be identified. This allows for the identification of whether the target word to be identified is a domain word based on the third word vector distance between the target word to be identified and the positive sample examples, and the fourth word vector distance between the target word to be identified and the negative sample examples. This constrains the word vector distance between the target word to be identified and the positive and negative sample examples, thereby further improving the accuracy of domain word recognition.

[0258] It should be noted that the embodiments concerning computer devices in this application and the embodiments concerning domain term sample data generation methods in this application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can be referred to the implementation of the corresponding domain term sample data generation methods described above, and the repeated parts will not be described again.

[0259] Furthermore, corresponding to the above Figures 1 to 10 Based on the same technical concept, this application also provides a storage medium for storing computer-executable instructions. In one specific embodiment, the storage medium can be a USB flash drive, optical disc, hard disk, etc. When the computer-executable instructions stored in the storage medium are executed by a processor, they can achieve the following process:

[0260] Obtain a sample text dataset from the target business domain; the sample text dataset includes multiple sample texts.

[0261] Based on the multiple sample texts, a first domain word set that meets the target part-of-speech combination screening conditions is selected; the first domain word set includes multiple initial domain words, and the target part-of-speech combination screening conditions include at least one domain word part-of-speech combination determined based on the historical domain word thesaurus corresponding to the target business domain;

[0262] Based on the target word vectors of each of the initial domain words, a second domain word set that meets the preset word vector screening conditions is selected from the first domain word set; the second domain word set includes multiple candidate domain words, and the preset word vector screening conditions include constraints on word vector similarity.

[0263] Based on the multiple candidate domain terms, domain term sample data is generated.

[0264] When the computer-executable instructions stored in the storage medium in this embodiment are executed by the processor, firstly, based on the sample text dataset of the target business domain, a first domain word set that meets the target part-of-speech combination screening conditions is selected; the target part-of-speech combination screening conditions include at least one part-of-speech combination of domain words determined based on the historical domain word lexicon; then, based on the target word vectors of each initial domain word in the first domain word set, a second domain word set that meets the preset word vector screening conditions is selected from the first domain word set; the preset word vector screening conditions include constraints on word vector similarity; finally, based on multiple candidate domain words in the second domain word set, a domain word sample number is generated. According to this application, the sample text dataset is initially screened based on part-of-speech combination distribution matching to obtain a first domain word set. Then, the first domain word set is screened again based on word vector similarity matching to obtain a second domain word set. This eliminates the need for any labeling of the sample text or the formulation of various screening rules. Instead, by using the two screening dimensions of part-of-speech combination distribution matching and word vector similarity matching, a large number of candidate domain words that meet the target part-of-speech combination distribution and preset word vector similarity requirements can be obtained. Based on the candidate domain words, domain word sample data can be generated, which can improve the efficiency and accuracy of sample data generation.

[0265] In another specific embodiment, the storage medium can be a USB flash drive, optical disc, hard disk, etc., and the computer-executable instructions stored on the storage medium can achieve the following process when executed by the processor:

[0266] Obtain domain term sample data; the domain term sample data is obtained based on the domain term sample data generation method, and the domain term sample data includes M domain term samples, each of the domain term samples including a candidate domain term, a positive example sample and a negative example sample corresponding to the candidate domain term;

[0267] Each domain word sample is input into the domain word recognition model to be trained to obtain the target word vector of the candidate domain word, the target word vector of the positive sample, and the target word vector of the negative sample in the domain word sample.

[0268] Based on the target word vectors of the candidate domain words and the target word vectors of the positive examples, a first word vector distance is determined; and based on the target word vectors of the candidate domain words and the target word vectors of the negative examples, a second word vector distance is determined.

[0269] The model loss value is determined based on the first word vector distance and the second word vector distance corresponding to each domain word sample;

[0270] Based on the model loss value, the domain word recognition model to be trained is iteratively updated to obtain the trained domain word recognition model.

[0271] In the embodiments of this application, when the computer-executable instructions stored in the storage medium are executed by the processor, on the one hand, since the candidate domain words in the domain word sample data are obtained by combining the part-of-speech combination distribution matching dimension and the word vector similarity matching dimension, there is no need to mark the sample text or formulate various filtering rules. A large number of candidate domain words that meet the target part-of-speech combination distribution and preset word vector similarity requirements can be obtained. Therefore, domain word sample data can be generated based on the candidate domain words, which can improve the efficiency and accuracy of sample data generation. On the other hand, since each domain word sample includes not only candidate domain words but also... For the positive and negative samples selected from the candidate domain words, during the model training phase, the model loss value is determined based on the first word vector distance between the candidate domain words and the positive samples, and the second word vector distance between the candidate domain words and the negative samples in the aforementioned domain word samples. Then, the model parameters are iteratively updated based on this model loss value. This adds the constraints of the word vector distance between the candidate domain words and the positive samples, as well as the word vector distance between the candidate domain words and the negative samples, enabling the model to learn the distance relationship between the original samples and the positive and negative samples, achieving the effect of comparative learning, thereby improving the accuracy of the model parameter update.

[0272] In another specific embodiment, the storage medium can be a USB flash drive, optical disc, hard disk, etc., and the computer-executable instructions stored on the storage medium, when executed by a processor, can achieve the following process:

[0273] Obtain a dataset of texts to be identified within the target business domain; the dataset includes multiple texts to be identified.

[0274] Select multiple target words to be identified from the multiple texts to be identified;

[0275] The target word to be identified, the corresponding positive sample and negative sample are input into the trained domain word recognition model to obtain the domain words under the target business domain; the positive sample is randomly selected from the domain word dictionary, and the negative sample is randomly selected from the non-domain word dictionary.

[0276] When the computer-executable instructions stored in the storage medium in this embodiment are executed by the processor, on the one hand, since each domain word sample in the domain word sample data used to train the domain word recognition model includes not only candidate domain words, but also positive and negative sample samples selected for the candidate domain words, the model loss value is determined based on the first word vector distance between the candidate domain words and the positive sample, and the second word vector distance between the candidate domain words and the negative sample in the aforementioned domain word samples; then, the model parameters are iteratively updated based on the model loss value; this adds the limiting conditions of the word vector distance between the candidate domain words and the positive sample, and the word vector distance between the candidate domain words and the negative sample, prompting the model to be able to By learning the distance relationship between the original sample and the positive and negative samples, the model achieves a comparative learning effect, thereby improving the accuracy of model parameter updates. Consequently, in the domain word mining stage, it can improve the accuracy of domain word recognition. On the other hand, in the domain word mining stage, the input data of the domain word recognition model includes not only the target word to be identified, but also the positive and negative sample examples selected for the target word to be identified. This allows the model to identify whether the target word to be identified is a domain word based on the third word vector distance between the target word to be identified and the positive sample examples, and the fourth word vector distance between the target word to be identified and the negative sample examples. This constrains the word vector distance between the target word to be identified and the positive and negative sample examples, thereby further improving the accuracy of domain word recognition.

[0277] It should be noted that the embodiments concerning storage media in this application and the embodiments concerning domain term sample data generation method in this application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can be referred to the implementation of the corresponding domain term sample data generation method described above, and the repeated parts will not be described again.

[0278] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

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

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

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

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

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

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

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

[0286] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0287] The embodiments of this application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. One or more embodiments of this application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can reside in local and remote computer storage media, including storage devices.

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

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

Claims

1. A method for generating domain term sample data, characterized in that, The method includes: Obtain a sample text dataset from the target business domain; the sample text dataset includes multiple sample texts. Based on the multiple sample texts, a first domain word set that meets the target part-of-speech combination screening conditions is selected; the first domain word set includes multiple initial domain words, and the target part-of-speech combination screening conditions include at least one domain word part-of-speech combination determined based on the historical domain word thesaurus corresponding to the target business domain; Based on the word vector similarity between the target word vectors of each initial domain word and the average word vectors corresponding to the first domain word set, a second domain word set that meets the preset word vector screening conditions is selected from the first domain word set; the second domain word set includes multiple candidate domain words, and the preset word vector screening conditions include constraints based on word vector similarity; Based on the multiple candidate domain terms, domain term sample data is generated.

2. The method according to claim 1, characterized in that, The first domain word set selected based on the multiple sample texts that meets the target part-of-speech combination filtering conditions includes: The multiple sample texts are divided into business themes to obtain N text paragraphs under each business theme; For each business topic, an initial subset of domain words that meets the target part-of-speech combination filtering conditions is selected from multiple text paragraphs under the business topic; the initial subset of domain words includes multiple initial domain words under the business topic; Based on the initial domain term subset corresponding to each of the aforementioned business themes, a first domain term set is determined.

3. The method according to claim 1, characterized in that, The first domain term set includes initial domain term subsets corresponding to N business topics; The step of selecting a second set of domain words that meets preset word vector screening conditions from the first set of domain words based on the word vector similarity between the target word vectors of each initial domain word and the average word vectors corresponding to the first set of domain words includes: For each business topic, the target word vectors of each initial domain word in the initial domain word subset corresponding to the business topic are averaged to obtain the average word vector corresponding to the business topic. Calculate the word vector similarity between the target word vector of each initial domain word under the business theme and the average word vector corresponding to the business theme; From the initial domain word subset corresponding to the business topic, select the m initial domain words with the highest word vector similarity ranking to obtain the candidate domain word subset; A second set of domain terms is determined based on the subset of candidate domain terms corresponding to each of the aforementioned business themes.

4. The method according to claim 1, characterized in that, The process of generating domain term sample data based on the multiple candidate domain terms includes: Based on the multiple candidate domain words and the preset domain word lexicon, a domain word dictionary and a non-domain word dictionary are determined; For each candidate domain word, positive and negative sample examples corresponding to the candidate domain word are randomly selected from the domain word dictionary and the non-domain word dictionary; Based on the candidate domain words, the positive examples, and the negative examples, domain word sample data is generated; the domain word sample data includes M domain word samples, and each domain word sample includes a candidate domain word, a corresponding positive example, and a negative example.

5. The method according to claim 4, characterized in that, The process of determining a domain-specific dictionary and a non-domain-specific dictionary based on the multiple candidate domain terms and a preset domain-specific dictionary includes: For each candidate domain word, semantic matching is performed between the candidate domain word and each domain word in the preset domain word lexicon to obtain a semantic matching result; Based on the semantic matching results corresponding to each of the candidate domain words, a first set of candidate words and a second set of candidate words are determined; the first set of candidate words includes multiple candidate domain words that are semantically matched successfully, and the second set of candidate words includes multiple candidate domain words that are semantically unmatched. Based on the first set of candidate words and the preset domain word library, a domain word dictionary is determined; and based on the second set of candidate words, a non-domain word dictionary is determined.

6. A method for training a domain-specific word recognition model, characterized in that, The method includes: Obtain domain term sample data; the domain term sample data is obtained based on the generation method according to any one of claims 1 to 5, the domain term sample data includes M domain term samples, each domain term sample includes a candidate domain term, a positive example sample and a negative example sample corresponding to the candidate domain term; Each domain word sample is input into the domain word recognition model to be trained to obtain the target word vector of the candidate domain word, the target word vector of the positive sample, and the target word vector of the negative sample in the domain word sample. Based on the target word vectors of the candidate domain words and the target word vectors of the positive examples, a first word vector distance is determined; and based on the target word vectors of the candidate domain words and the target word vectors of the negative examples, a second word vector distance is determined. The model loss value is determined based on the first word vector distance and the second word vector distance corresponding to each domain word sample; Based on the model loss value, the domain word recognition model to be trained is iteratively updated to obtain the trained domain word recognition model.

7. The method according to claim 6, characterized in that, The step of determining the model loss value based on the first word vector distance and the second word vector distance corresponding to each of the candidate domain words includes: For each domain word sample, the positive and negative example distance difference is determined based on the first word vector distance and the second word vector distance corresponding to the domain word sample; Based on the distance difference between the positive and negative examples, determine the model sub-loss value corresponding to the domain word sample; The model loss value is determined based on the model sub-loss values ​​corresponding to the M domain word samples.

8. A domain term recognition method, characterized in that, The method includes: Obtain a dataset of texts to be identified within the target business domain; the dataset includes multiple texts to be identified. Select multiple target words to be identified from the multiple texts to be identified; The target word to be identified, the corresponding positive sample and negative sample are input into the trained domain word recognition model to obtain the domain words under the target business domain; the positive sample is randomly selected from the domain word dictionary, the negative sample is randomly selected from the non-domain word dictionary, and the domain word recognition model is obtained based on the domain word recognition model training method as described in claim 6 or 7.

9. The method according to claim 8, characterized in that, The step of selecting multiple target words to be identified from the multiple texts to be identified includes: Based on the multiple texts to be identified, a third domain word set that meets the target part-of-speech combination screening criteria is selected; the third domain word set includes multiple initial words to be identified; the target part-of-speech combination screening criteria include at least one domain word part-of-speech combination determined based on the historical domain word thesaurus corresponding to the target business domain; Based on the target word vectors of each of the initial words to be identified, a fourth domain word set that meets the preset word vector filtering conditions is selected from the third domain word set; the fourth domain word set includes multiple target words to be identified, and the preset word vector filtering conditions include constraints on word vector similarity.

10. A domain term sample data generation device, characterized in that, The device includes: The sample data acquisition module is used to acquire a sample text dataset of the target business domain; the sample text dataset includes multiple sample texts. The first selection module is used to select a first domain word set that meets the target part-of-speech combination screening conditions based on the plurality of sample texts; the first domain word set includes a plurality of initial domain words, and the target part-of-speech combination screening conditions include at least one domain word part-of-speech combination determined based on the historical domain word thesaurus corresponding to the target business domain; The second selection module is used to select a second domain word set that meets preset word vector screening conditions from the first domain word set based on the word vector similarity between the target word vectors of each initial domain word and the average word vectors corresponding to the first domain word set; the second domain word set includes multiple candidate domain words, and the preset word vector screening conditions include constraints on word vector similarity; The domain term sample generation module is used to generate domain term sample data based on the multiple candidate domain terms.

11. A domain term recognition device, characterized in that, The device includes: The data acquisition module is used to acquire a dataset of texts to be identified in the target business domain; the dataset of texts to be identified includes multiple texts to be identified. The word selection module is used to select multiple target words to be identified from the multiple texts to be identified; The domain word recognition module is used to input the target word to be recognized, the positive sample and the negative sample corresponding to the target word to be recognized into the trained domain word recognition model to obtain the domain words under the target business domain; the positive sample is randomly selected from the domain word dictionary, and the negative sample is randomly selected from the non-domain word dictionary; the domain word recognition model is obtained based on the domain word recognition model training method as described in claim 6 or 7.

12. A computer device, characterized in that, The device includes: Processor; and A memory configured to store computer-executable instructions configured to be executed by the processor, the executable instructions including steps for performing the method as described in any one of claims 1 to 5, any one of claims 6 to 7, or any one of claims 8 to 9.

13. A storage medium, characterized in that, The storage medium is used to store computer-executable instructions that cause the computer to perform the method as described in any one of claims 1 to 5, any one of claims 6 to 7, or any one of claims 8 to 9.

Citation Information

Patent Citations

  • Word segmentation and part-of-speech recognition method and device and electronic medical record analysis method and device

    CN111274806A

  • Comment phrase extraction method and equipment

    CN111597791A

  • Knowledge graph reasoning method and device

    CN115222050A