Broad program name detection method and device
By converting the name of the mini program and the name of the operating entity into word vector encoding and using the classifier to judge, the user experience problem caused by the broad name of the mini program is solved, the detection accuracy is improved, and the rationality of the mini program name is ensured.
Patent Information
- Application Number
- CN202011061564.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-30
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-09-30
AI Technical Summary
With the increase in the number of mini programs on the mini program service platform, the problem of broad mini program names has become more and more prominent, making it difficult for users to search for the desired mini program among a large number of mini programs, affecting the user experience.
By obtaining the name of the mini program and the name of the operating entity, parsing and converting them into word vector encoding, using a pre-trained classifier to determine whether the name is too broad, and introducing the entity name as reference information to improve detection accuracy.
Improved the accuracy of detection of broad mini program names to ensure that mini programs that include company names or personal names will not be judged as broad, thereby improving user experience.
Smart Images

Figure CN112199947B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of machine learning technology, and more particularly, to a method and apparatus for performing broad program name detection using machine learning. Background Art
[0002] Mini Programs are applications that can be used without downloading and installing. Compared with traditional applications, Mini Programs can save developers development and promotion costs, and can also reduce users' usage time costs and mobile phone memory space usage. Since Mini Programs have a low development threshold, are easy to use, and are suitable for the conversion of offline stores of life services and non-rigid low-frequency applications, all major traffic platforms provide Mini Program services.
[0003] As the number of mini programs on the mini program service platform continues to increase, the problem of broad mini program names has become more prominent. Broad mini program names refer to the use of overly broad general nouns, industry terms, product names, activity names, function terms, etc. as mini program names. The use of broad mini program names makes it difficult for users to search for the required mini program from a large number of mini programs, affecting the user experience. For this reason, it is hoped that there will be an improved solution that can accurately detect whether the mini program name is too broad when the mini program is settled on the mini program service platform, so as to prevent mini programs with overly broad names from settling on the mini program service platform. Summary of the invention
[0004] One or more embodiments of the present specification describe a method and apparatus for detecting broad program names, which uses the name of a program body as reference information to detect whether the program name is too broad, thereby improving the accuracy of detecting broad program names.
[0005] In a first aspect, this specification provides a method for detecting a broad program name, comprising:
[0006] Obtain a program name and a subject name of a program, wherein the subject name is the name of the operating subject of the program;
[0007] Parsing at least one first word segment from the program name, and mapping each of the first word segments into a corresponding first word vector according to a pre-trained word segmentation-vector mapping dictionary;
[0008] Parsing at least one second word segment from the subject name, and mapping each of the second word segments into a corresponding second word vector according to the word segmentation-vector mapping dictionary;
[0009] Generate a program name code according to each of the first word vectors, wherein the program name code is used to represent content features of the program name;
[0010] Generate a subject name code according to the program name code and each of the second word vectors, wherein the subject name code is used to characterize the content features of the subject name and the similarity between the first participle and the second participle;
[0011] Input the program name code and the subject name code into a pre-trained classifier, and obtain the name breadth coefficient output by the classifier;
[0012] If the name broadness system is greater than a preset name broadness threshold, it is determined that the program name is broad.
[0013] In a possible implementation, the step of generating a program name code according to each of the first word vectors includes:
[0014] Encode each of the first word vectors using a pre-trained encoding neural network to obtain a word segmentation code corresponding to each of the first word vectors;
[0015] The program name code is obtained by performing code fusion using the word segmentation codes.
[0016] Furthermore, in one embodiment, encoding each of the first word vectors using a pre-trained encoding neural network to obtain a word segmentation code corresponding to each of the first word vectors includes:
[0017] Input each of the first word vectors into the encoding neural network to obtain the word segmentation code output by the encoding neural network for each of the first word vectors.
[0018] Further, in another embodiment, after parsing at least one first word segment from the program name, the part of speech of each first word segment can be determined respectively, and the part of speech of each first word segment can be mapped to a corresponding part of speech vector according to a pre-trained part of speech-vector mapping dictionary. In this case, the pre-trained encoding neural network is used to encode each first word vector to obtain a corresponding word segment encoding, including:
[0019] For each of the first participles, concatenate the first word vector and the part-of-speech vector corresponding to the first participle to obtain an input vector corresponding to the first participle;
[0020] The input vector corresponding to each of the first word segmentations is input into the encoding neural network for encoding, and the word segmentation code output by the encoding neural network for each of the first word segmentations is obtained respectively.
[0021] In a possible implementation manner, the step of using the word segmentation codes to perform code fusion to obtain the program name code includes:
[0022] The pre-trained self-attention model is used to perform encoding fusion on the word segmentation codes to obtain the program name code.
[0023] In another possible implementation, the encoding neural network includes a bidirectional long short-term memory network BiLSTM. In this case, in one embodiment, the program name encoding is obtained by encoding fusion using each word segmentation encoding, including:
[0024] For each first word vector, concatenate the forward code and the backward code output by BiLSTM for the first word vector to obtain the concatenated code corresponding to the first word vector;
[0025] The concatenated codes corresponding to the first word vectors are summed and the average value is taken as the program name code.
[0026] In another possible implementation, the encoding neural network includes a bidirectional long short-term memory network BiLSTM. In this case, in one embodiment, the program name encoding is obtained by encoding fusion using each word segmentation encoding, including:
[0027] Obtaining a backward encoding of a head word vector output by the BiLSTM, wherein the head word vector is the first word vector corresponding to the first word at the head of the program name;
[0028] Obtain a forward encoding of a tail word vector output by the BiLSTM, wherein the tail word vector is the first word vector corresponding to the first word at the tail of the program name;
[0029] The backward encoding output by the BiLSTM for the head word vector and the forward encoding output by the BiLSTM for the tail word vector are concatenated as the program name encoding.
[0030] In a possible implementation manner, the encoding neural network includes one of the following: a bidirectional long short-term memory network BiLSTM, a convolutional neural network CNN, and a Transformer network.
[0031] In a possible implementation manner, generating a subject name code according to the program name code and each of the second word vectors includes:
[0032] Input the program name encoding and each of the second word vectors into a pre-trained attention model;
[0033] The attention model encodes each of the second word vectors according to the program name code to obtain the subject name code.
[0034] In a possible implementation, parsing out the segmented words from the name includes: parsing each character in the name into a segmented word, or segmenting the name using a pre-created segmentation model to obtain at least one segmented word.
[0035] In a second aspect, this specification also provides a device for detecting a broad program name, including:
[0036] a name acquisition unit, configured to acquire a program name and a subject name of a program, wherein the subject name is a name of an operating subject of the program;
[0037] a program mapping unit configured to parse at least one first word segment from the program name acquired by the name acquisition unit, and map each of the first word segments into a corresponding first word vector according to a pre-trained word segmentation-vector mapping dictionary;
[0038] a subject mapping unit configured to parse at least one second word segment from the subject name acquired by the name acquisition unit, and map each of the second word segments into a corresponding second word vector according to the word segmentation-vector mapping dictionary;
[0039] a program encoding unit, configured to generate a program name code according to each of the first word vectors obtained by the program mapping unit, wherein the program name code is used to represent content features of the program name;
[0040] a subject encoding unit, configured to generate a subject name encoding according to the program name encoding obtained by the program encoding unit and each of the second word vectors obtained by the subject mapping unit, wherein the subject name encoding is used to characterize the content feature of the subject name and the similarity between the first participle and the second participle;
[0041] A classification unit is configured to input the program name code obtained by the program encoding unit and the subject name code obtained by the subject encoding unit into a pre-trained classifier, obtain a name breadth coefficient output by the classifier, and determine that the program name is broad when the name breadth coefficient is greater than a preset name breadth threshold.
[0042] Furthermore, in one embodiment, the program coding unit includes:
[0043] an encoding subunit, configured to encode each of the first word vectors using a pre-trained encoding neural network to obtain a word segmentation code corresponding to each of the first word vectors;
[0044] A fusion subunit is configured to perform encoding fusion using the word segmentation codes obtained by the encoding subunit to obtain the program name code.
[0045] Further, in one embodiment, the encoding subunit is configured as follows:
[0046] Input each of the first word vectors into the encoding neural network to obtain the word segmentation code output by the encoding neural network for each of the first word vectors.
[0047] In a possible implementation manner, the program name broadness detection device further comprises: a part-of-speech mapping unit;
[0048] The part-of-speech mapping unit is configured to respectively determine the part-of-speech of each of the first participials determined by the program mapping unit, and map the part-of-speech of each of the first participials to a corresponding part-of-speech vector according to a pre-trained part-of-speech-vector mapping dictionary;
[0049] The encoding subunit is configured as follows:
[0050] For each of the first participles, concatenate the first word vector corresponding to the first participle and the part-of-speech vector determined by the part-of-speech mapping unit to obtain an input vector corresponding to the first participle;
[0051] The input vector corresponding to each first word segmentation is input into the encoding neural network for encoding, and the word segmentation code output by the encoding neural network for each first word segmentation is obtained respectively.
[0052] In a possible implementation manner, the fusion subunit is configured as follows:
[0053] The pre-trained self-attention model is used to perform encoding fusion on the word segmentation codes to obtain the program name code.
[0054] In a possible implementation manner, the encoding neural network includes a bidirectional long short-term memory network BiLSTM;
[0055] The fusion subunit is configured as follows:
[0056] For each of the first word vectors, concatenate the forward code and the backward code output by the BiLSTM for the first word vector to obtain a concatenated code corresponding to the first word vector;
[0057] The concatenated codes corresponding to the first word vectors are summed and the average value is taken as the program name code.
[0058] In a possible implementation manner, the encoding neural network includes a bidirectional long short-term memory network BiLSTM. In this case, the fusion subunit is configured as follows:
[0059] Obtaining a backward encoding of a head word vector output by the BiLSTM, wherein the head word vector is the first word vector corresponding to the first word at the head of the program name;
[0060] Obtain a forward encoding of a tail word vector output by the BiLSTM, wherein the tail word vector is the first word vector corresponding to the first word at the tail of the program name;
[0061] The backward encoding output by the BiLSTM for the head word vector and the forward encoding output by the BiLSTM for the tail word vector are concatenated as the program name encoding.
[0062] In a possible implementation, the encoding neural network includes one of the following: a bidirectional long short-term memory network, a convolutional neural network, and a Transformer network.
[0063] In a possible implementation manner, the main encoding unit is configured as follows:
[0064] Input the program name encoding and each of the second word vectors into a pre-trained attention model;
[0065] The attention model encodes each of the second word vectors according to the program name code to obtain the subject name code.
[0066] In a possible implementation manner, the program mapping unit is configured to parse each character in the program name into one of the first segmented words, or to segment the program name using a pre-created segmentation model to obtain at least one of the first segmented words;
[0067] The subject mapping unit is configured to parse each character in the subject name into a second word segmentation, or to segment the subject name using the word segmentation model to obtain at least one second word segmentation.
[0068] In a third aspect, the present specification provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method provided in the first aspect and any possible implementation of the first aspect.
[0069] In a fourth aspect, the present specification provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method provided by the above-mentioned first aspect and any possible implementation manner of the first aspect is implemented.
[0070] According to the method and device for detecting broadness of program names provided by the embodiments of this specification, after converting the program name into a program name code, the subject name is converted into a subject name code according to the program name code and the subject name, so that the subject name code can characterize the similarity of the segmentation words in the program name and the subject name, and then the program name code and the subject name code are input into the classifier to determine whether the program name is broad. Since the subject name is introduced as reference information in the process of detecting broadness of the name, the program name including the company name or the personal name will not be judged as broad, thereby improving the accuracy of broad detection of the program name. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0072] Figure 1 A schematic diagram showing an implementation scenario of an embodiment disclosed in this specification;
[0073] Figure 2 A flowchart showing a method for detecting a broad program name according to an embodiment;
[0074] Figure 3 A schematic diagram showing an implementation scenario of another embodiment disclosed in this specification;
[0075] Figure 4 A schematic diagram showing a program name broad detection device according to an embodiment;
[0076] Figure 5 A schematic diagram showing a program name broad detection device according to another embodiment;
[0077] Figure 6 A schematic diagram showing a device for detecting broad program names according to yet another embodiment. DETAILED DESCRIPTION
[0078] The solution provided in this specification is described below in conjunction with the accompanying drawings.
[0079] Since there are a large number of mini-programs on the mini-program service platform, if the mini-program has a broad name, it will make it difficult for users to search for the required mini-program from a large number of mini-programs, which will affect the user experience. Therefore, it is necessary to perform a broad detection on the mini-program name before the mini-program is settled on the mini-program service platform to prevent mini-programs with broad names from being settled on the mini-program service platform, thereby ensuring the user experience. If the mini-program name includes the name of the operating entity, the mini-program name is usually not broad, but since there is less information to refer to during broad detection, it often happens that the mini-program name includes the name of the operating entity but the detection result still indicates that the mini-program name is broad, so the accuracy of broad detection of mini-program names is low.
[0080] In order to accurately perform broad detection on the mini program name, according to the concept of the embodiments of this specification, an optimization scheme is proposed to perform broad detection on the mini program name by using the name of the mini program operating entity as reference information. Since the mini program name including the name of the operating entity is usually not broad, the name of the operating entity is integrated into the model of broad detection of the mini program name, so that the broad detection process of the mini program name has more reference information, thereby improving the accuracy of broad detection of the mini program name.
[0081] It should be noted that in the description of the subsequent embodiments of this specification, the program may be a mini-program that needs to be run on a mini-program service platform, or it may be an application program that runs on computers, mobile phones, tablets, and various wearable smart devices.
[0082] Figure 1 This is a schematic diagram of an implementation scenario of an embodiment disclosed in this specification. Figure 1As shown, before a program is settled in the mini program service platform or application market, the program name of the program and the main body name of the operating entity of the program are first obtained, and then the program name code for characterizing the content characteristics of the program name is generated according to each first participle included in the program name, and then the main body name code is generated according to each second participle included in the main body name and the obtained program name code, and then the program name code and the main body name code are input into the pre-trained classifier, and the classifier determines whether the program name of the program is broad according to the program name code and the main body name code. Since the main body name code is generated according to the program name code and each second participle included in the main body name, the main body name code can not only characterize the content characteristics of the main body name, but also characterize the similarity between the first participle in the program name and the second participle in the main body name. When making a broad judgment, the classifier will determine whether the program name is broad based on the similarity and the content characteristics of the program name and the main body name, so that the program name including the participle with identification function in the main body name has a broad detection result of not broad, thereby improving the accuracy of broad detection of program names.
[0083] The following describes the specific implementation process of program name broad detection.
[0084] Figure 2 The following is a method for detecting a program name that is too broad according to an embodiment. It is understood that the method can be executed by any device, equipment, platform, or device cluster that has computing and processing capabilities. Figure 2 As shown, the method for detecting broad program names may include the following steps:
[0085] Step 202: Obtain a program name and a subject name of a program, wherein the subject name is the name of the operating subject of the program;
[0086] Step 204: parse out a missing first word from the program name, and map each first word into a corresponding first word vector according to a pre-trained word-vector mapping dictionary;
[0087] Step 206: parse at least one second word segment from the subject name, and map each second word segment into a corresponding second word vector according to the word segmentation-vector mapping dictionary;
[0088] Step 208: Generate a program name code according to each first word vector, wherein the program name code is used to represent content features of the program name;
[0089] Step 210: Generate a subject name code according to the program name code and each second word vector, wherein the subject name code is used to characterize the content feature of the subject name and the similarity between the first participle and the second participle;
[0090] Step 212: input the program name code and the subject name code into a pre-trained classifier, and obtain the name breadth coefficient output by the classifier;
[0091] Step 214: If the name broadness system is greater than a preset name broadness threshold, it is determined that the program name is broad.
[0092] The following describes how to execute each of the above steps.
[0093] In step 202, the program name and subject name of a program are obtained. It can be understood that the program is a mini program that needs to be stationed in the mini program service platform or an application program that needs to be stationed in the application market. The program name is the name of the program, which is a name that users can directly view and is used to distinguish different programs. The subject name is the name of the operating entity of the program. When the operating entity of the program is a company, the subject name is the company name. When the operating entity of the program is an individual, the subject name is the individual name.
[0094] Then, in step 204 and step 206, one or more first participles are parsed from the program name, one or more second participles are parsed from the subject name, and the first participles are mapped into first word vectors according to the pre-trained word segmentation-vector mapping dictionary, and the second participles are mapped into second word vectors. It should be understood that the first participle here is the participle parsed from the program name, the second participle is the participle parsed from the subject name, the first word vector is mapped from the first participle, and the second word vector is mapped from the second participle, where "first" and "second" are only used for distinction and have no other limiting effect.
[0095] It can be understood that the program name and the subject name usually include multiple characters. In order to verify whether the program name is a broad common noun, industry term, product name, activity name or function word, and to verify whether the program name includes the identifying participle in the subject name, the first participle is parsed from the program name and the second participle is parsed from the subject name, and then the program name can be verified whether it is broad by comparing the participles.
[0096] In order to convert word segmentation into an encoding that can be recognized and processed by the classifier, the word segmentation must first be mapped to a word vector, and then the word vector must be converted to an encoding. For this purpose, the word segmentation-vector mapping dictionary must be pre-trained. The word segmentation-vector mapping dictionary records the mapping relationship between commonly used word segmentation and word vectors. Each commonly used word segmentation mapping has a word vector, and different commonly used word segmentation mappings have the same or different word vectors. The value of the word vector is generated during the training of the word segmentation-vector mapping dictionary, and the word segmentation-vector mapping dictionary is obtained by training together with the classifier, ensuring that after the word segmentation is mapped to a word vector according to the word segmentation-vector mapping dictionary, the name encoding generated according to the word vector can be recognized and processed by the classifier.
[0097] When mapping a segmentation (first segmentation / second segmentation) to a word vector (first word vector / second word vector) according to the segmentation-vector mapping dictionary, first query whether the segmentation is included in the segmentation-vector mapping dictionary. If the segmentation is included in the segmentation-vector mapping dictionary, the segmentation is mapped to the corresponding word vector according to the mapping relationship between the segmentation and the word vector in the segmentation-vector mapping dictionary. If the segmentation is not included in the segmentation-vector mapping dictionary, the segmentation is mapped as an unregistered word to a determined general word vector. In the process of training the segmentation-vector mapping dictionary, segments with low frequency of occurrence or that have never appeared are determined as unregistered words, and a general word vector is generated and saved in the segmentation-vector mapping dictionary as a word vector mapped to each unregistered word. This can ensure that all parsed word segments can be mapped to corresponding word vectors according to the word segmentation-vector mapping dictionary, and that program name codes and subject name codes can be generated according to the word vectors to perform broad detection of program names. It can also ensure that the word segmentation-vector mapping dictionary records fewer word segmentation-vector mapping relationships, thereby improving the efficiency of mapping word segments to vectors.
[0098] Then in step 208, a program name code is generated based on each first word vector. It can be understood that the classifier cannot process the vector, so it is necessary to generate a program name code based on each first word vector so that the program name code can characterize the content characteristics of the program name, and then the classifier can identify and process the program name code to achieve a broad detection of the program name. The program name code is used to characterize the content characteristics of the program name, and specifically can characterize the content of each first participle in the program name and the part of speech of each first participle, so that the classifier can perform a broad detection based on the content and part of speech of each first participle in the program name, thereby ensuring the accuracy of the detection result obtained.
[0099] Then, in step 210, a subject name code is generated according to the program name code and each second word vector. It can be understood that when generating the subject name code according to the program name code and each second word vector, each second word vector can be encoded according to the program name code, so that the generated subject name code can not only represent the content characteristics of the subject name, but also represent the similarity between the first participle in the program name and the second participle in the subject name. When the program name and the subject name include the same participle, the first participle in the program name and the second participle in the subject name have a high similarity.
[0100] It should be noted that, in the subject name code generated according to the program name code and each second word vector, different second word vectors correspond to different code segments in the subject name code, and the code segments corresponding to different second word vectors may have different weights. Usually, if there is a first word vector that is identical to a second word vector, the code segment corresponding to the second word vector has a higher weight, but not all code segments corresponding to second word vectors that have the same first word vector have a higher weight. Instead, only the code segment corresponding to the second word vector that identifies the subject name and has the same first word vector has a higher weight.
[0101] In one example, there is a first participle and a second participle, both of which are "Limited Liability Company". The first word vector corresponding to the first participle is the same as the second word vector corresponding to the second participle. However, since "Limited Liability Company" does not serve as an identifier for the entity name, the encoding segment corresponding to the second participle does not have a higher weight in the generated entity name encoding.
[0102] In another example, there is a first participle and a second participle, both of which are "Ant Financial". The first word vector corresponding to the first participle is the same as the second word vector corresponding to the second participle. Since "Ant Financial" serves as an identifier for the subject name, the encoding segment corresponding to the second participle has a higher weight in the generated subject name encoding.
[0103] The subject name code is generated according to the program name code and each second word vector. Since the program name code can represent the content characteristics of the program name, the generated subject name code integrates the content characteristics of the program name, so that the subject name code can represent the similarity between the first participle and the second participle, that is, the subject name code can represent whether the program name includes a company name or personal name that serves as an identifier in the subject name, so that the subject name is used as reference information for broad detection of program names, which helps to improve the accuracy of broad detection of program names.
[0104] Next, at step 212, the program name code and the subject name code are input into a pre-trained classifier, and the classifier calculates a name breadth coefficient for the program to characterize the breadth of the program name.
[0105] It can be understood that the classifier is obtained in advance through sample training. The classifier can detect the breadth of the program name according to the input program name code and the subject name code, and then input the name breadth coefficient for characterizing the breadth of the program name. After that, it can be determined whether the program name is broad according to the name breadth coefficient, thereby realizing automatic breadth detection of the program name to solve the efficiency and cost problems of manually reviewing whether the program name is broad, thereby shortening the program development and settlement cycle and improving the user experience of program developers and operators.
[0106] When the program name code and the subject name code are input into the classifier, the program name code and the subject name code can be concatenated and input into the classifier, or the program name code and the subject name code can be added and input into the classifier. The specific way of inputting the code can be determined according to the way of inputting the code into the classifier when training the classifier, ensuring that the way of inputting the code into the classifier during the name broad detection is consistent with the way of inputting the code into the classifier during the classifier training. In addition, the classifier can be a classifier composed of a fully connected neural network.
[0107] Then, in step 214, the name breadth coefficient output by the classifier is compared with a preset name breadth threshold. If the name breadth coefficient is greater than the name breadth threshold, the program name is determined to be broad, otherwise the program name is determined to be not broad. Accordingly, if it is determined that the program name of a program is broad, the program is prohibited from entering the mini program service platform or application market, and if it is determined that the program name of a program is not broad, the program is allowed to enter the mini program service platform or application market.
[0108] The name breadth threshold is determined based on the calculation logic of the classifier, the total number of programs in the mini-program service platform / application market, and the user's tolerance for broad program names. The higher the total number of programs in the mini-program service platform / application market, the smaller the name breadth threshold should be; the higher the user's tolerance for broad program names, the larger the name breadth threshold should be.
[0109] In one embodiment, when step 208 generates a program name code based on each first word vector, a pre-trained encoding neural network can be used to encode each first word vector to obtain a word segmentation code corresponding to each first word vector, and then each word segmentation code is used to perform encoding fusion to obtain the program name code.
[0110] By pre-training the encoding neural network, the encoding neural network is used to encode each first word vector to obtain the word segmentation code corresponding to each first word vector, and the program name code is obtained by fusing the word segmentation codes, which realizes the conversion of vectors that cannot be recognized by the classifier into codes that can be recognized and processed by the classifier, ensuring that the classifier can be used to automatically perform broad detection of the program name. In addition, when the encoding neural network is used to encode each first word vector to obtain the corresponding word segmentation code, each first word vector is not encoded independently, but the relationship between different first word segmentation vectors is combined to comprehensively encode each first word vector, so the obtained word segmentation code also represents the relationship between each word segmentation in the program name.
[0111] Furthermore, the encoding neural network can use various types of neural network algorithms to convert vectors into codes. For example, the encoding neural network can be a bidirectional long short-term memory network (Bi-directional LongShort-Term Memory, BiLSTM), a convolutional neural network (Convolutional Neural Networks, CNN), a Transformer network, etc.
[0112] When training the encoding neural network, the corresponding neural network algorithm can be flexibly selected according to the specific application scenario to train the encoding neural network, so as to meet the personalized needs of different mini-program service platforms or application markets, which helps to improve the applicability of the broad program name detection solution provided in this manual.
[0113] Furthermore, when the first word vectors are encoded using the pre-trained encoding neural network to obtain the word segmentation code corresponding to each first word vector, the word segmentation code can be obtained in at least the following two ways according to the different processing objects of the encoding neural network:
[0114] Method 1: directly input each first word vector into the encoding neural network, and then obtain the word segmentation code output by the encoding neural network for each first word vector;
[0115] Method 2: First, determine the part of speech of each first word segment respectively, and map the part of speech of each first word segment into a corresponding part of speech vector according to a pre-trained part-of-speech-vector mapping dictionary, and then obtain the input vector corresponding to each first word segment respectively for the first word vector and the part-of-speech vector, and then input each input vector into the encoding neural network for encoding, and then obtain the word segmentation code output by the encoding neural network for each first word segment respectively.
[0116] For the above method 1, since the first word vector is mapped from the corresponding first word segmentation, the first word vector represents the content characteristics of the corresponding first word segmentation, and each first word vector is directly input into the encoding neural network to obtain the word segmentation code corresponding to each first word vector, so that the word segmentation code can also represent the content characteristics of the corresponding first word segmentation, and then by fusing each word segmentation code, the program name code that can reflect the content characteristics of the program name can be obtained.
[0117] Since the word segmentation codes corresponding to each first word vector can be obtained by only inputting the first word vector into the encoding neural network, the process of encoding the first word vector is simpler and faster, thereby ensuring that broad detection of program names is more efficient.
[0118] For the above-mentioned method 2, first determine the part of speech of each first word segment, and map the part of speech of each first word segment to a corresponding part of speech vector through a pre-trained part-of-speech-vector mapping dictionary, then concatenate the first word vector with the corresponding part-of-speech vector to obtain an input vector, and input each input vector into the encoding neural network to obtain the word segmentation code corresponding to each first word vector.
[0119] The first word vector represents the content features of the corresponding first word segmentation, and the part-of-speech vector represents the part-of-speech features of the corresponding first word segmentation. The first word vector and the part-of-speech vector are concatenated and input into the encoding neural network to obtain the word segmentation code, so that the word segmentation code can represent the content features and part-of-speech features of the corresponding first word segmentation. Then, the program name code obtained by fusing the word segmentation codes can not only reflect the content features of the word segmentations included in the program name, but also represent the part-of-speech features of the word segmentations included in the program name, that is, the content features and part-of-speech features of the program name are used as reference information to perform broad detection of the program name, and the part-of-speech of the word segmentations included in the program name can also be used as a reference factor for judging whether the program name is broad. Since the reference information in the detection process is increased, the accuracy of broad detection of the program name can be further improved.
[0120] In order to convert the word segmentation part-of-speech features into codes that can be recognized and processed by the classifier, it is first necessary to map the word segmentation part-of-speech to the part-of-speech vector, and then convert the part-of-speech vector into a code. For this purpose, it is necessary to pre-train the part-of-speech-vector mapping dictionary. The part-of-speech-vector mapping dictionary records the mapping relationship between various parts of speech and part-of-speech vectors. Each part-of-speech mapping has a part-of-speech vector, and each part-of-speech mapping has a different part-of-speech vector. The value of the part-of-speech vector is generated during the training process of the part-of-speech-vector mapping dictionary, and the part-of-speech-vector mapping dictionary is obtained by training together with the word segmentation-vector mapping dictionary, the encoding neural network and the classifier, to ensure that after the part-of-speech is mapped to the part-of-speech vector according to the part-of-speech-vector mapping dictionary, the program name code generated according to the first word vector and the part-of-speech vector can be recognized and processed by the classifier.
[0121] In one embodiment, when each word segmentation code is used to perform code fusion to obtain the program name code, a pre-trained self-attention model can be used to perform code fusion on each word segmentation code to obtain the program name code.
[0122] When the trained self-attention model is used to fuse the word segment codes, the trained self-attention model can fuse the word segment codes according to the content features represented by the word segment codes to obtain the program name code, so that the code segments corresponding to different first word segments in the program name code have corresponding weights. Generally, the stronger the identification effect of a first word on the program name, the greater the weight of the code segment corresponding to the first word in the program name code.
[0123] In an example, the program name is "ABC Clothing Mall", "ABC", "clothing" and "mall" are three first participles respectively, and the identification effect of these three first participles on the program name is "ABC" > "clothing" > "mall", so in the generated program name code, the weight of the code segment corresponding to "ABC" is greater than the weight of the code segment corresponding to "clothing", and the weight of the code segment corresponding to "clothing" is greater than the weight of the code segment corresponding to "mall".
[0124] The trained self-attention model is used to fuse the word segment codes to obtain the program name code. Not only can the word segment codes be fused into a program name code that can be recognized and processed by the classifier, but also weights can be assigned to the code segments corresponding to each first word in the program name code, so that the code segment corresponding to the first word that has a strong identification effect on the program name has a higher weight. Therefore, when the classifier judges whether the program name is broad, the code segment with a higher weight has a greater impact on the judgment result, further improving the accuracy of broad detection of program names.
[0125] It can be understood that the weight of each coding segment in the program name encoding is determined by the self-attention model. The trained self-attention model has the function of assigning weights to the corresponding coding segments in the program name encoding according to the word content and word part of speech represented by the word segmentation encoding.
[0126] In another embodiment, when BiLSTM is used to encode each first word vector to obtain the word segmentation code corresponding to each first word vector, the word segmentation codes may not be fused using a model structure or model algorithm such as a self-attention model, but may be fused by directly performing mathematical operations on the word segmentation codes output by BiLSTM. Fusion of word segmentation codes by mathematical operations includes at least the following two fusion methods:
[0127] Fusion method 1: First, for each first word vector, concatenate the forward code and backward code output by BiLSTM for the first word vector to obtain the concatenated code corresponding to the first word vector, then sum the concatenated codes corresponding to each first word vector and take the average value as the program name code.
[0128] Fusion method 2: First, obtain the backward encoding of the BiLSTM output for the head word vector, and obtain the forward encoding of the BiLSTM output for the tail word vector, and then concatenate the above backward encoding and forward encoding as the program name encoding, where the head word vector is the first word vector corresponding to the first word at the head of the program name, and the tail word vector is the first word vector corresponding to the first word at the tail of the program name.
[0129] For the above-mentioned fusion method one, since BiLSTM includes a forward network and a backward network, for each first word vector input into BiLSTM, the forward network will output a forward code for the first word vector, and the backward network will output a backward code for the first word vector. The forward code and the backward code output for the first word vector are concatenated as the concatenated code corresponding to the first word vector, and then the concatenated codes are summed and the average is taken as the program name code. At this time, the program name code integrates the characteristics of each concatenated code, which can reflect the content characteristics of each word in the program name as a whole, and ensure that the program name can be accurately and broadly detected according to the program name code.
[0130] For the above-mentioned fusion method 2, when the backward network of BiLSTM encodes the head word vector, it will refer to the encoding results of the backward network for other first word vectors to encode the head word vector. Similarly, when the forward network of BiLSTM encodes the tail word vector, it will also refer to the encoding results of the forward network for other first word vectors to encode the tail word vector. Therefore, the backward code generated by the backward network encoding the head word vector and the forward code generated by the forward network encoding the tail word vector both integrate the characteristics of each first word vector. Therefore, the program name code generated by splicing the backward code corresponding to the head word vector and the forward code corresponding to the tail word vector can also reflect the content characteristics of each word in the program name as a whole, ensuring that the program name can be accurately and broadly detected according to the program name code.
[0131] The mathematical operation method of the above-mentioned fusion method one or two is used to fuse the word segmentation codes to generate the program name code. Since there is no need to use various model structures and model algorithms, the time for training the corresponding model can be saved, and the mathematical operation method is more efficient, which helps to improve the efficiency of broad recognition of program names.
[0132] In addition, since BiLSTM includes a forward network and a backward network, each input word vector will be encoded by the forward network and the backward network. The obtained word segmentation encoding can better reflect the relationship between the word vectors, and then the program name encoding can better reflect the content characteristics of the program name, ensuring that the program name can be accurately and broadly detected based on the program name encoding.
[0133] In one embodiment, when step 210 generates the subject name code based on the program name code and each second word vector, the program name code and each second word vector can be input into a pre-trained attention model, and the attention model encodes the program name code and each second word vector to obtain the subject name code.
[0134] When the trained attention model encodes each second word vector according to the program name code to generate the subject name code, the attention model can focus on the second word vectors that identify the subject name and have the same first word vector as it, so that the coding segments corresponding to these second word vectors in the generated subject name code have higher weights, that is, effective information for broad classification of program names is extracted, such as company names, personal names, etc. When the classifier performs broad detection of program names based on the program name code and the subject name code, these coding segments with higher weights in the subject name code will have a significant impact on the broad detection results, thereby determining that program names including company names and personal names are not broad names, thereby ensuring the accuracy of broad detection of program names.
[0135] It can be understood that the weight of each coding segment in the main name encoding is determined by the attention model, and the trained attention model has the function of assigning weights to the corresponding coding segments in the main name according to the word segmentation content represented by the second vector. In addition, in order to ensure that each network algorithm, model, dictionary and classifier can work together to complete the broad detection of program names, the word segmentation-vector mapping dictionary, part of speech-vector mapping dictionary, encoding neural network, self-attention model, attention model and classifier can be modeled as an overall model.
[0136] In one embodiment, in steps 204 and 206, when parsing the segmented words (first segmented word / second segmented word) from the name (program name / subject name), each character in the name can be parsed as a segmented word, or the name can be segmented using a pre-created segmentation model to obtain at least one segmented word.
[0137] When parsing each character in the name into a word segment, each word segment only includes one character. By comparing each character in the program name and the subject name, it is determined whether the program name includes a company name or a personal name, which is used as reference information for broad detection of the program name. At this time, since there is no need to train a word segmentation model, it is only necessary to split the program name and the subject name by character. On the one hand, it can save the workload and time of the previous model training, and on the other hand, it can improve the speed of obtaining the first word segment and the second word segment, thereby improving the efficiency of broad detection of the program name.
[0138] When the word segmentation model is used to segment the name to obtain the word segments, each word segmentation may include one or more characters, so that most of the word segments are phrases or words. Based on the phrases or words, it can be more accurately determined whether the program name includes a company name or a personal name, thereby further improving the accuracy of broad detection of program names.
[0139] In one embodiment, in combination with the description of the foregoing embodiments, this specification discloses an implementation scenario of another embodiment. Figure 3 Schematic diagram of the implementation scenario of this embodiment. Figure 3 As shown, after obtaining a program that needs to be tested for broad program name, first obtain the program name and the main body name of the program; then use the word segmentation model to segment the program name to obtain the first word segmentation, and use the word segmentation model to segment the main body name to obtain the second word segmentation; then map the first word segmentation to a first word vector, map the part of speech of the first word segmentation to a part of speech vector, concatenate the first word vector and the part of speech vector corresponding to each word segmentation to obtain an input vector, and map the second word segmentation to a second word vector; then input each input vector into BiLSTM for encoding to obtain a word segmentation code corresponding to each input vector; then input each word segmentation code into the self-attention model for fusion to obtain a program name code; then input the program name code and each second word vector into the attention model for encoding to obtain a main body name code; then concatenate the program name code and the main body name code and input them into the classifier to obtain a name broadness coefficient output by the classifier; then determine whether the program name of the program is broad based on the relationship between the name broadness coefficient and the preset name broadness threshold.
[0140] Looking back at the above process of detecting the broadness of program names, after converting the program name into a program name code, the subject name is converted into a subject name code according to the program name code and the subject name, so that the subject name code can characterize the similarity of the segmentation words in the program name and the subject name, and then the program name code and the subject name code are input into the classifier to determine whether the program name is broad. Since the subject name is introduced as reference information in the process of detecting the broadness of the name, the program name including the company name or personal name will not be judged as broad, thereby improving the accuracy of the broad detection of the program name.
[0141] Another embodiment of the present invention further provides a device for detecting broad program names. Figure 4 FIG. 1 shows a program name broad detection device of an embodiment. It is understood that the device can be implemented by any device, equipment, platform and device cluster with computing and processing capabilities. Figure 4 As shown, the device 40 includes:
[0142] A name acquisition unit 41, configured to acquire a program name and a subject name of a program, wherein the subject name is the name of the operating subject of the program;
[0143] a program mapping unit 42 configured to parse at least one first word segment from the program name obtained by the name obtaining unit 41, and map each first word segment into a corresponding first word vector according to a pre-trained word segment-vector mapping dictionary;
[0144] a subject mapping unit 43 configured to parse at least one second word segment from the subject name obtained by the name obtaining unit 41, and map each second word segment into a corresponding second word vector according to the word segmentation-vector mapping dictionary;
[0145] a program encoding unit 44, configured to generate a program name code according to each first word vector obtained by the program mapping unit 42, wherein the program name code is used to represent content features of the program name;
[0146] a subject encoding unit 45 configured to generate a subject name encoding according to the program name encoding obtained by the program encoding unit 44 and each second word vector obtained by the subject mapping unit 43, wherein the subject name encoding is used to represent the content feature of the subject name and the similarity between the first participle and the second participle;
[0147] A classification unit 46 is configured to input the program name code obtained by the program encoding unit 44 and the subject name code obtained by the subject encoding unit 45 into a pre-trained classifier, obtain the name breadth coefficient output by the classifier, and determine that the program name is broad when the name breadth coefficient is greater than a preset name breadth threshold.
[0148] In a possible implementation, the program encoding unit 44 may generate the program name encoding according to each first word vector using an encoding neural network. Figure 5 As shown, the program coding unit 44 includes:
[0149] an encoding subunit 441, configured to encode each first word vector using a pre-trained encoding neural network to obtain a word segmentation code corresponding to each first word vector;
[0150] A fusion subunit 442 is configured to perform code fusion using the word segmentation codes obtained by the encoding subunit 441 to obtain the program name code.
[0151] Furthermore, in one embodiment, the encoding subunit 441 is configured to input each first word vector into the encoding neural network, and obtain the word segmentation code output by the encoding neural network for each first word vector.
[0152] Furthermore, in one embodiment, Figure 5 The program name is broadly based on the detection device 40, such as Figure 6 As shown, the program name broad detection device 40 further includes: a part-of-speech mapping unit 47;
[0153] A part-of-speech mapping unit 47 is configured to respectively determine the part-of-speech of each first word segment determined by the program mapping unit 42, and map the part-of-speech of each first word segment to a corresponding part-of-speech vector according to a pre-trained part-of-speech-vector mapping dictionary;
[0154] The encoding subunit 441 is configured as follows:
[0155] For each first participle, concatenate the first word vector corresponding to the first participle and the part-of-speech vector determined by the part-of-speech mapping unit 47 to obtain an input vector corresponding to the first participle;
[0156] The input vector corresponding to each first word segmentation is input into the encoding neural network for encoding, and the word segmentation code output by the encoding neural network for each first word segmentation is obtained respectively.
[0157] Furthermore, in one embodiment, the fusion subunit configuration 442 is configured to utilize a pre-trained self-attention model to perform encoding fusion on each word segmentation encoding to obtain a program name encoding.
[0158] Further, in one embodiment, the encoding subunit 441 may use BiLSTM to encode each first word vector to obtain a word segmentation code. In this case, the fusion subunit 442 is configured as follows:
[0159] For each first word vector, concatenate the forward code and the backward code output by BiLSTM for the first word vector to obtain the concatenated code corresponding to the first word vector;
[0160] The concatenated codes corresponding to the first word vectors are summed and the average value is taken as the program name code.
[0161] Furthermore, in one embodiment, the encoding subunit 441 may use BiLSTM to encode each first word vector to obtain a word segmentation code. In this case, the fusion subunit 442 may also be configured as follows:
[0162] Get the backward encoding of the BiLSTM output for the head word vector, where the head word vector is the first word vector corresponding to the first word at the head of the program name;
[0163] Get the forward encoding of the tail word vector output by BiLSTM, where the tail word vector is the first word vector corresponding to the first word at the end of the program name;
[0164] The backward encoding of the BiLSTM output for the head word vector and the forward encoding of the BiLSTM output for the tail word vector are concatenated as the program name encoding.
[0165] Further, in one embodiment, the encoding neural network includes one of the following: a bidirectional long short-term memory network, a convolutional neural network, and a Transformer network.
[0166] In one possible case, the subject encoding unit 45 can generate the subject name encoding using the attention model. In this case, the subject encoding unit 45 is configured as follows:
[0167] Input the program name encoding and each of the second word vectors into a pre-trained attention model;
[0168] The attention model encodes each of the second word vectors according to the program name code to obtain the subject name code.
[0169] In a possible implementation mode, in combination with the program name broad detection device 40 in each of the above embodiments, the program mapping unit 42 and the subject mapping unit 43 can obtain word segments through a word segmentation model, or directly use each character as a word segmentation. In this case, the program mapping unit 42 is configured to parse each character in the program name into a first word segmentation, or use a pre-created word segmentation model to segment the program name to obtain at least one first word segmentation; the subject mapping unit 43 is configured to parse each character in the subject name into a second word segmentation, or use a word segmentation model to segment the subject name to obtain at least one second word segmentation.
[0170] In this way, through the above-mentioned program name broad detection device 40, the main name of the program is used as reference information for broad detection of the program name, and the main name is encoded using the attention mechanism to extract information that is effective for broad classification of the program name, so that the small program name broad detection process has more reference information, thereby improving the accuracy of broad detection of the small program name. It should be understood that the information interaction, execution process, etc. between the units in the above-mentioned device embodiment are based on the same concept as the above-mentioned method embodiment. The specific content can be referred to the description in the above-mentioned method embodiment, and will not be repeated here.
[0171] In another aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method for detecting broad program names described in the above embodiments.
[0172] In another aspect, an embodiment further provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method for detecting broad program names described in the above embodiments is implemented.
[0173] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, firmware or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0174] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for detecting broad program names, comprising: Obtain a program name and a subject name of a program, wherein the subject name is the name of the operating subject of the program; Parsing at least one first word segment from the program name, and mapping each of the first word segments into a corresponding first word vector according to a pre-trained word segmentation-vector mapping dictionary; Parsing at least one second word segment from the subject name, and mapping each of the second word segments into a corresponding second word vector according to the word segmentation-vector mapping dictionary; Generate a program name code according to each of the first word vectors, wherein the program name code is used to represent content features of the program name; Generate a subject name code according to the program name code and each of the second word vectors, wherein the subject name code is used to characterize the content features of the subject name and the similarity between the first participle and the second participle; Input the program name code and the subject name code into a pre-trained classifier, and obtain the name breadth coefficient output by the classifier; If the name broadness coefficient is greater than a preset name broadness threshold, determining that the program name is broad; The step of generating a program name code according to each of the first word vectors includes: Encode each of the first word vectors using a pre-trained encoding neural network to obtain a word segmentation code corresponding to each of the first word vectors; Using each of the word segmentation codes to perform code fusion, obtaining the program name code; The step of generating a subject name code according to the program name code and each of the second word vectors includes: Input the program name encoding and each of the second word vectors into a pre-trained attention model; The attention model encodes each of the second word vectors according to the program name code to obtain the subject name code.
2. The method according to claim 1, wherein: The using a pre-trained encoding neural network to encode each of the first word vectors to obtain a word segmentation code corresponding to each of the first word vectors includes: Input each of the first word vectors into the encoding neural network to obtain the word segmentation code output by the encoding neural network for each of the first word vectors.
3. The method according to claim 1, wherein: After parsing out at least one first word from the program name, the method further includes: Determine the part of speech of each of the first participles respectively, and map the part of speech of each of the first participles into a corresponding part of speech vector according to a pre-trained part of speech-vector mapping dictionary; The using of the pre-trained encoding neural network to encode each of the first word vectors to obtain corresponding word segmentation codes includes: For each of the first participles, concatenate the first word vector and the part-of-speech vector corresponding to the first participle to obtain an input vector corresponding to the first participle; The input vector corresponding to each of the first word segmentations is input into the encoding neural network for encoding, and the word segmentation code output by the encoding neural network for each of the first word segmentations is obtained respectively.
4. The method according to claim 1, wherein the step of using each of the word segmentation codes to perform code fusion to obtain the program name code comprises: The pre-trained self-attention model is used to perform encoding fusion on the word segmentation codes to obtain the program name code.
5. The method according to claim 1, wherein the encoding neural network comprises a bidirectional long short-term memory network BiLSTM; The step of using each of the word segmentation codes to perform code fusion to obtain the program name code includes: For each of the first word vectors, concatenate the forward code and the backward code output by the BiLSTM for the first word vector to obtain a concatenated code corresponding to the first word vector; The concatenated codes corresponding to the first word vectors are summed and the average value is taken as the program name code.
6. The method according to claim 1, wherein the encoding neural network comprises a bidirectional long short-term memory network BiLSTM; The step of using each of the word segmentation codes to perform code fusion to obtain the program name code includes: Obtaining a backward encoding of a head word vector output by the BiLSTM, wherein the head word vector is the first word vector corresponding to the first word at the head of the program name; Obtain a forward encoding of a tail word vector output by the BiLSTM, wherein the tail word vector is the first word vector corresponding to the first word at the tail of the program name; The backward encoding output by the BiLSTM for the head word vector and the forward encoding output by the BiLSTM for the tail word vector are concatenated as the program name encoding.
7. The method according to claim 1, wherein the encoding neural network comprises one of the following: a bidirectional long short-term memory network BiLSTM, a convolutional neural network CNN and a Transformer network.
8. The method according to any one of claims 1 to 7, wherein parsing out word segments from the name comprises: Parse each character in the name as a token; or, The name is segmented using a pre-created segmentation model to obtain at least one segmentation.
9. A device for detecting broad program names, comprising: a name acquisition unit, configured to acquire a program name and a subject name of a program, wherein the subject name is a name of an operating subject of the program; a program mapping unit configured to parse at least one first word segment from the program name acquired by the name acquisition unit, and map each of the first word segments into a corresponding first word vector according to a pre-trained word segmentation-vector mapping dictionary; a subject mapping unit configured to parse at least one second word segment from the subject name acquired by the name acquisition unit, and map each of the second word segments into a corresponding second word vector according to the word segmentation-vector mapping dictionary; a program encoding unit, configured to generate a program name code according to each of the first word vectors obtained by the program mapping unit, wherein the program name code is used to represent content features of the program name; a subject encoding unit, configured to generate a subject name encoding according to the program name encoding obtained by the program encoding unit and each of the second word vectors obtained by the subject mapping unit, wherein the subject name encoding is used to characterize the content feature of the subject name and the similarity between the first participle and the second participle; a classification unit configured to input the program name code obtained by the program encoding unit and the subject name code obtained by the subject encoding unit into a pre-trained classifier, obtain a name breadth coefficient output by the classifier, and determine that the program name is broad when the name breadth coefficient is greater than a preset name breadth threshold; Wherein, the program coding unit includes: an encoding subunit, configured to encode each of the first word vectors using a pre-trained encoding neural network to obtain a word segmentation code corresponding to each of the first word vectors; a fusion subunit configured to perform code fusion using the word segmentation codes obtained by the encoding subunit to obtain the program name code; Wherein, the main encoding unit is configured as follows: Input the program name encoding and each of the second word vectors into a pre-trained attention model; The attention model encodes each of the second word vectors according to the program name code to obtain the subject name code.
10. The apparatus according to claim 9, wherein the encoding subunit is configured as: Input each of the first word vectors into the encoding neural network to obtain the word segmentation code output by the encoding neural network for each of the first word vectors.
11. The apparatus according to claim 9, further comprising: A part-of-speech mapping unit; The part-of-speech mapping unit is configured to respectively determine the part-of-speech of each of the first participials determined by the program mapping unit, and map the part-of-speech of each of the first participials to a corresponding part-of-speech vector according to a pre-trained part-of-speech-vector mapping dictionary; The encoding subunit is configured as follows: For each of the first participles, concatenate the first word vector corresponding to the first participle and the part-of-speech vector determined by the part-of-speech mapping unit to obtain an input vector corresponding to the first participle; The input vector corresponding to each first word segmentation is input into the encoding neural network for encoding, and the word segmentation code output by the encoding neural network for each first word segmentation is obtained respectively.
12. The device according to claim 9, wherein the fusion subunit is configured as: The pre-trained self-attention model is used to perform encoding fusion on the word segmentation codes to obtain the program name code.
13. The apparatus according to claim 9, wherein the encoding neural network comprises a bidirectional long short-term memory network (BiLSTM); The fusion subunit is configured as follows: For each of the first word vectors, concatenate the forward code and the backward code output by the BiLSTM for the first word vector to obtain a concatenated code corresponding to the first word vector; The concatenated codes corresponding to the first word vectors are summed and the average value is taken as the program name code.
14. The apparatus according to claim 9, wherein the encoding neural network comprises a bidirectional long short-term memory network (BiLSTM); The fusion subunit is configured as follows: Get the backward encoding of the BiLSTM output for the head word vector, where: The head word vector is the first word vector corresponding to the first word at the head of the program name; Obtain a forward encoding of a tail word vector output by the BiLSTM, wherein the tail word vector is the first word vector corresponding to the first word at the tail of the program name; The backward encoding output by the BiLSTM for the head word vector and the forward encoding output by the BiLSTM for the tail word vector are concatenated as the program name encoding.
15. The apparatus of claim 9, wherein the encoding neural network comprises one of the following: a bidirectional long short-term memory network, a convolutional neural network, and a Transformer network.
16. The device according to any one of claims 9 to 15, wherein: The program mapping unit is configured to parse each character in the program name into one of the first segmented words, or to segment the program name using a pre-created segmentation model to obtain at least one of the first segmented words; The subject mapping unit is configured to parse each character in the subject name into a second word segmentation, or to segment the subject name using the word segmentation model to obtain at least one second word segmentation.
17. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 8.
18. A computing device comprising a memory and a processor, characterized in that: The memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Medical record file coding method, server, and computer readable storage medium
CN109493931A
Answer determination method and device
CN110309282A
