A method, device, equipment and medium for determining APP type
By receiving the initial description text, name and package name of the APP, text standardization is performed and specified description text is generated. Combined with the training of the Bert model and TextCNN model, the subjectivity and data quality problems in the traditional APP classification method are solved, and the APP classification is improved Accuracy and accuracy of text feature extraction.
Patent Information
- Application Number
- CN202411120100.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-08-15
AI Technical Summary
Traditional APP classification methods rely on manual annotation and rules-based classification algorithms, which have strong subjectivity and low efficiency, and insufficient APP information data in the database, resulting in inaccurate classification, especially the problems of garbled or missing content.
By receiving the initial description text, name and package name of the APP, text standardization is performed, specified description text is generated, and key text is generated according to the context semantics for filling. Combining the Bert model and TextCNN model training, the target APP classification model is built to improve text characteristics. Extraction and classification accuracy.
It improves the accuracy of text feature extraction and the accuracy of APP classification, reduces the adverse impact of fill text on feature extraction, and ensures the logical integrity and accuracy of classification results.
Smart Images

Figure CN118643377B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of text classification, and in particular to a method, device, equipment and medium for determining an APP type. Background Art
[0002] At present, the number and types of APPs are showing explosive growth. In order to facilitate users to use and developers to understand market trends, APP classification technology has come into being. However, traditional APP classification methods mainly rely on manual labeling and rule-based classification algorithms. These methods have problems such as strong subjectivity, low efficiency, and difficulty in formulating rules, resulting in inaccurate classification. In addition, the APP information in the existing database still faces problems such as insufficient data volume and low data quality in actual applications. There are even many APP information that are garbled or missing content, which will also affect the accuracy of APP classification. Summary of the invention
[0003] The purpose of the present invention is to provide a method, device, equipment and medium for determining the type of APP, which can effectively reduce the adverse effect of filler text on the accuracy of text feature extraction, thereby ensuring the accuracy of text feature extraction and the accuracy of APP classification.
[0004] According to a first aspect of the present invention, there is provided a method for determining an APP type, comprising the following steps:
[0005] Receive the initial description text of the APP to be classified, the name of the APP to be classified and the package name of the APP to be classified; the initial description text refers to the application introduction text corresponding to the APP to be classified.
[0006] The initial description text of the APP to be classified is subjected to text standardization processing to generate the specified description text of the APP to be classified.
[0007] When the specified character quantity ratio is less than the preset first character ratio threshold, the key text is inserted as the content to be filled in the sentence without characters in the specified description text of the APP to be classified to generate the target description text; the specified character quantity ratio refers to the ratio of the number of characters in the key text to the number of characters in the initial description text of the APP to be classified; the key text refers to the text generated by the target natural language processing model according to the contextual semantics corresponding to the character-free position in the specified description text of the APP to be classified.
[0008] When the specified character quantity ratio is not less than the preset first character ratio threshold, the first character quantity difference and the second character quantity difference are obtained; the first character quantity difference refers to the difference between the number of characters in the name of the APP to be classified and the number of characters in the key text, and the second character quantity difference refers to the difference between the number of characters in the APP package name to be classified and the number of characters in the key text.
[0009] When the first character quantity difference is greater than the second character quantity difference, the package name of the APP to be classified is inserted as the content to be filled into the sentence without characters in the designated description text of the APP to be classified to generate the target description text.
[0010] When the first character quantity difference is not greater than the second character quantity difference, the name of the APP to be classified is inserted as the content to be filled into the sentence without characters in the designated description text of the APP to be classified to generate the target description text.
[0011] The target description text is input into the target APP classification model to determine the APP type of the APP to be classified.
[0012] Furthermore, the specified description text of the APP to be classified is generated through the following steps:
[0013] The initial description text of the APP to be classified is compared with a preset stop word library, the stop words in the initial description text of the APP to be classified are found and deleted, and a first description text of the APP to be classified is generated.
[0014] The target words in the first description text of the APP to be classified are converted into words according to a preset natural language processing model to generate a designated description text of the APP to be classified.
[0015] Furthermore, the target APP classification model is obtained through the following steps:
[0016] Obtain a preset description text, a preset APP name and a preset APP package name of each preset APP in a given APP database; the preset description text refers to an application introduction text corresponding to the preset APP.
[0017] According to the preset description text corresponding to each preset APP, a final description text corresponding to each preset APP is generated; the method for obtaining the final description text is consistent with the method for obtaining the target description text.
[0018] When the ratio of the number of characters in the final description text corresponding to any preset APP to the number of characters in the preset description text corresponding to the preset APP is less than the first ratio threshold corresponding to the preset APP, the preset description text, preset APP name, and preset APP package name of the preset APP itself will be filtered out, so as to take the preset description texts, preset APP names, and preset APP package names of the remaining several preset APPs as the target sample set.
[0019] The target sample set is input into the preset Bert model to extract text features, and the text feature vector corresponding to each preset APP is output through the output layer of the preset Bert model.
[0020] According to the text feature vector corresponding to each preset APP and the classification label corresponding to each preset APP, the given initial TextCNN model is trained and adjusted to obtain the target APP classification model; the output layer of the initial TextCNN model is constructed according to the given classification label system.
[0021] Furthermore, the target APP classification model is obtained through the following steps:
[0022] The number of classification labels in the classification label system and the number of preset APPs corresponding to each classification label are obtained to determine the loss function of the initial TextCNN model.
[0023] The text feature vectors corresponding to several preset APPs are divided into a training set and a validation set.
[0024] Based on the loss function of the initial TextCNN model, the text feature vectors corresponding to several preset APPs in the training set and the classification labels corresponding to each preset APP are input into the given initial TextCNN model, and the intermediate TextCNN model is obtained after training.
[0025] The text feature vectors corresponding to several preset APPs in the validation set and the classification labels corresponding to each preset APP are input into the intermediate TextCNN model to obtain the loss value of the intermediate TextCNN model.
[0026] The loss function is adjusted according to the loss value of the intermediate TextCNN model until the error meets the preset requirements to obtain the target APP classification model.
[0027] Furthermore, the first ratio threshold corresponding to the preset APP refers to a ratio threshold corresponding to a character number range in which the number of characters of the preset description text corresponding to the preset APP is found from a preset character ratio relationship table.
[0028] According to a second aspect of the present invention, a device for determining an APP type is provided, the device comprising:
[0029] The receiving module is used to receive the initial description text of the APP to be classified, the name of the APP to be classified and the package name of the APP to be classified; the initial description text refers to the application introduction text corresponding to the APP to be classified.
[0030] The first processing module is used to perform text standardization processing on the initial description text of the APP to be classified to generate a specified description text of the APP to be classified.
[0031] The first generation module is used to insert the key text as the content to be filled into the sentence without characters in the specified description text of the APP to be classified when the specified character number ratio is less than the preset first character ratio threshold, so as to generate the target description text; the specified character number ratio refers to the ratio of the number of characters in the key text to the number of characters in the initial description text of the APP to be classified; the key text refers to the text generated by the target natural language processing model according to the contextual semantics corresponding to the character-free position in the specified description text of the APP to be classified.
[0032] The first acquisition module is used to obtain the first character quantity difference and the second character quantity difference when the specified character quantity ratio is not less than the preset first character ratio threshold; the first character quantity difference refers to the difference between the number of characters in the name of the APP to be classified and the number of characters in the key text, and the second character quantity difference refers to the difference between the number of characters in the APP package name to be classified and the number of characters in the key text.
[0033] The second generating module is used to insert the package name of the APP to be classified as the content to be filled into the sentence without characters in the designated description text of the APP to be classified when the first character quantity difference is greater than the second character quantity difference, so as to generate a target description text.
[0034] The third generating module is used to insert the name of the APP to be classified as the content to be filled into the sentence without characters in the designated description text of the APP to be classified when the first character quantity difference is not greater than the second character quantity difference, so as to generate the target description text.
[0035] The first determination module is used to input the target description text into a target APP classification model to determine the APP type of the APP to be classified.
[0036] Furthermore, the first processing module includes:
[0037] The deletion module is used to compare the initial description text of the APP to be classified with a preset stop word library, find and delete the stop words in the initial description text of the APP to be classified, and generate a first description text of the APP to be classified.
[0038] The vocabulary conversion module is used to perform vocabulary conversion on the target vocabulary in the first description text of the APP to be classified according to a preset natural language processing model to generate a specified description text of the APP to be classified.
[0039] Furthermore, it also includes a first training module, wherein the first training module includes:
[0040] The second acquisition module is used to obtain a preset description text, a preset APP name and a preset APP package name of each preset APP in a given APP database; the preset description text refers to an application introduction text corresponding to the preset APP.
[0041] The fourth generation module is used to generate a final description text corresponding to each preset APP according to the preset description text corresponding to each preset APP; the method for obtaining the final description text is consistent with the method for obtaining the target description text.
[0042] The third acquisition module is used to filter out the preset description text, preset APP name, and preset APP package name of the preset APP itself when the ratio of the number of characters of the final description text corresponding to any preset APP to the number of characters of the preset description text corresponding to the preset APP is less than the first ratio threshold corresponding to the preset APP, so as to take the preset description texts, preset APP names, and preset APP package names of the remaining several preset APPs as the target sample set.
[0043] The output module is used to input the target sample set into the preset Bert model to extract text features, and output the text feature vector corresponding to each preset APP through the output layer of the preset Bert model.
[0044] The second training module is used to train and adjust the given initial TextCNN model according to the text feature vector corresponding to each preset APP and the classification label corresponding to each preset APP to obtain the target APP classification model; the output layer of the initial TextCNN model is constructed according to the given classification label system.
[0045] Furthermore, the second training module includes:
[0046] The second determination module is used to obtain the number of classification labels in the classification label system and the number of preset APPs corresponding to each classification label to determine the loss function of the initial TextCNN model.
[0047] The division module is used to divide the text feature vectors corresponding to several preset APPs into a training set and a verification set.
[0048] The third training module is used to input the text feature vectors corresponding to several preset APPs in the training set and the classification labels corresponding to each preset APP into the given initial TextCNN model based on the loss function of the initial TextCNN model, and obtain the intermediate TextCNN model after training.
[0049] The fourth acquisition module is used to input the text feature vectors corresponding to several preset APPs in the verification set and the classification label corresponding to each preset APP into the intermediate TextCNN model to obtain the loss value of the intermediate TextCNN model.
[0050] The parameter adjustment module is used to adjust the loss function according to the loss value of the intermediate TextCNN model until the error meets the preset requirements to obtain the target APP classification model.
[0051] According to a third aspect of the present invention, there is provided an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for determining an APP type when executing the computer program.
[0052] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for determining the type of an APP is implemented.
[0053] Compared with the prior art, the present invention has at least the following beneficial effects:
[0054] The method for determining the APP type described in the present invention first receives the initial description text of the APP to be classified, the APP name to be classified and the APP package name to be classified, and generates the designated description text of the APP to be classified through standardization processing, and generates the key text according to the contextual semantics of the missing content in the designated description text. When the ratio of the number of characters in the key text to the number of characters in the initial description text is small, the key text is used to fill the missing content, thereby improving the logical integrity of the text. However, when the key text has many characters, it is likely to affect the logical rationality of the text or change the original meaning of the designated description text, resulting in low accuracy in text feature extraction. Therefore, when the key text has many characters, the APP name to be classified or the APP package name to be classified that can reflect a certain APP meaning is used to fill in the missing content, so that the filled text is more reasonable and complete, thereby ensuring the accuracy of text feature extraction and the accuracy of APP classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0056] Figure 1 A flowchart of a method for determining an APP type provided in Embodiment 1 of the present invention;
[0057] Figure 2 A flowchart of step S200 provided in the first embodiment of the present invention;
[0058] Figure 3 A flowchart of the steps of obtaining a target APP classification model provided in the first embodiment of the present invention;
[0059] Figure 4 Another flowchart of the steps of obtaining the target APP classification model provided in the first embodiment of the present invention;
[0060] Figure 5 A schematic diagram of an apparatus for determining an APP type provided in Embodiment 2 of the present invention;
[0061] Figure 6 A schematic diagram of a first processing module 200 provided in Embodiment 2 of the present invention;
[0062] Figure 7 A schematic diagram of a first training module provided in Embodiment 2 of the present invention;
[0063] Figure 8 This is a schematic diagram of a second training module 50 provided in Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0064] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0065] Embodiment 1
[0066] like Figure 1 As shown, this embodiment provides a method for determining an APP type, including the following steps:
[0067] S100, receiving an initial description text of the APP to be classified, a name of the APP to be classified, and a package name of the APP to be classified; the initial description text refers to an application introduction text corresponding to the APP to be classified.
[0068] S200, performing text standardization processing on the initial description text of the APP to be classified to generate a specified description text of the APP to be classified.
[0069] In a specific embodiment, Figure 2 As shown, in step S200, the specified description text of the APP to be classified is generated through the following steps:
[0070] S201, comparing the initial description text of the APP to be classified with a preset stop word library, searching and deleting stop words in the initial description text of the APP to be classified, and generating a first description text of the APP to be classified.
[0071] S202, performing vocabulary conversion on the target vocabulary in the first description text of the APP to be classified according to the preset natural language processing model to generate a specified description text of the APP to be classified; it can be understood as: converting the target vocabulary into its corresponding basic form to restore the word form; the target vocabulary refers to a number of words that need to be restored as determined by the preset natural language processing model.
[0072] As mentioned above, deleting stop words can make the content of the text more refined, thereby improving the accuracy of text feature extraction. Word form restoration helps to reduce the diversity of vocabulary and improve generalization ability, thus helping to improve the accuracy of APP classification.
[0073] S300, when the specified character quantity ratio is less than the preset first character ratio threshold, the key text is inserted as the content to be filled into the sentence without characters in the specified description text of the APP to be classified to generate the target description text; the specified character quantity ratio refers to the ratio of the number of characters in the key text to the number of characters in the initial description text of the APP to be classified.
[0074] Specifically, the key text refers to the text generated by the target natural language processing model according to the contextual semantics corresponding to the character-free position in the specified description text of the APP to be classified; those skilled in the art know that the processing method of using any natural language processing model in the prior art to generate text according to the contextual semantics corresponding to the missing content falls within the protection scope of the present invention and will not be repeated here.
[0075] As mentioned above, when the number of words in the generated key text is smaller than the ratio of the specified description text, the filled text will be closer to the true meaning of the specified description text, that is, there will not be much error between the text obtained after filling and the original meaning of the specified description text. Therefore, using it as the content to be filled can guarantee the original meaning of the text to a certain extent while also improving the logical rationality of the text.
[0076] S400, when the specified character quantity ratio is not less than the preset first character ratio threshold, obtain the first character quantity difference and the second character quantity difference; the first character quantity difference refers to the difference between the number of characters in the APP name to be classified and the number of characters in the key text, and the second character quantity difference refers to the difference between the number of characters in the APP package name to be classified and the number of characters in the key text; technical personnel in this field set the first character ratio threshold according to actual needs.
[0077] S500, when the first character quantity difference is greater than the second character quantity difference, inserting the package name of the APP to be classified as content to be filled into a sentence without characters in the designated description text of the APP to be classified to generate a target description text.
[0078] S600, when the first character quantity difference is not greater than the second character quantity difference, inserting the name of the APP to be classified as content to be filled into a sentence without characters in the designated description text of the APP to be classified to generate a target description text.
[0079] As mentioned above, when the number of characters in the generated key text is larger than the ratio of the specified description text, the error between the text obtained after filling and the original meaning of the specified description text will become larger. Considering that the name of the APP to be classified and the package name of the APP to be classified can reflect the meaning of the APP to be classified to a certain extent, for example, XX video is video software, and XX music is music software, using the name of the APP to be classified or the package name of the APP to be classified whose number of characters is closer to the number of characters in the key text as the content to be filled can improve the completeness and accuracy of the text, thereby improving the accuracy of text feature extraction, which is conducive to the correct classification of the APP.
[0080] S700, input the target description text into the target APP classification model to determine the APP type of the APP to be classified; it can be understood as: inputting the text feature vector corresponding to the target description text into the target APP classification model, extracting the feature vector from the text feature vector through the convolution kernel of the target APP classification model, performing dimensionality transformation on the feature vector by the pooling layer, inputting the transformation result into the fully connected layer, and outputting the classification result of the APP to be classified through nonlinear transformation; wherein, the number of neurons in the fully connected layer is set according to the number of classification labels.
[0081] As mentioned above, the logical integrity of the text is improved by using key text to fill in sentences without characters. However, when there are many key text characters, stop words and other words whose meanings do not meet the requirements will appear, which will affect the logical accuracy and refinement of the text and thus reduce the accuracy of text feature extraction. Therefore, when the proportion of key text characters is relatively large, the name of the APP to be classified or the package name of the APP to be classified is used to fill in the missing content, thereby ensuring the accuracy of text feature extraction.
[0082] In a specific embodiment, Figure 3 As shown, the method obtains the target APP classification model through the following steps:
[0083] S10, obtaining a preset description text, a preset APP name and a preset APP package name of each preset APP in a given APP database; the preset description text refers to an application introduction text corresponding to the preset APP.
[0084] S20, generating a final description text corresponding to each preset APP according to the preset description text corresponding to each preset APP; the method for obtaining the final description text is consistent with the method for obtaining the target description text.
[0085] S30, when the ratio of the number of characters in the final description text corresponding to any preset APP to the number of characters in the preset description text corresponding to the preset APP is less than the first ratio threshold corresponding to the preset APP, the preset description text, preset APP name, and preset APP package name of the preset APP itself are filtered out, so as to take the preset description texts, preset APP names, and preset APP package names of the remaining several preset APPs as the target sample set.
[0086] Specifically, the first proportion threshold corresponding to the preset APP refers to the proportion threshold corresponding to the character number range of the preset description text corresponding to the preset APP found from the preset character proportion relationship table; it can be understood that: the character proportion relationship table is a table in which several preset character number ranges and several proportion thresholds correspond one to one; among which, technical personnel in this field set the character number range according to actual needs.
[0087] For a better understanding, an example is given: when the number of characters in the preset description text corresponding to the preset APP is 200 words, the character number range is 170-230, and the first proportion threshold corresponding to the preset APP is 0.5; when the number of characters in the preset description text corresponding to the preset APP is 100 words, the character number range is 80-120, and the first proportion threshold corresponding to the preset APP is 0.7; when the number of characters in the preset description text corresponding to the preset APP is 40 words, the character number range is 30-50, and the first proportion threshold corresponding to the preset APP is 0.9.
[0088] As mentioned above, since the preset description text with a large number of characters can fully reflect the type of the corresponding preset APP, and the preset description text with a small number of characters reflects a limited text meaning, when setting the character ratio relationship table, when the number of characters is large, the set ratio threshold is small, and when the number of characters is small, since the content reflecting the APP type itself is limited, the set ratio threshold is large, that is, when the target description text accounts for a large proportion, it is considered to be able to reflect the content type. By deleting the text information with a corresponding proportion less than the corresponding ratio threshold, the sample screening is achieved, thereby making the trained target TextCNN model more effective.
[0089] S40, input the target sample set into the preset Bert model to extract text features, and output the text feature vector corresponding to each preset APP through the output layer of the preset Bert model; it can be understood as: merging the preset description text, preset APP name and preset APP package name corresponding to the same preset APP into one text and inputting it into the preset Bert model to extract text features.
[0090] S50, training and adjusting the parameters of a given initial TextCNN model according to the text feature vector corresponding to each preset APP and the classification label corresponding to each preset APP to obtain a target APP classification model; the output layer of the initial TextCNN model is constructed according to the given classification label system.
[0091] Specifically, the classification label system refers to a pre-configured label system consisting of a number of classification labels; for example, the classification labels may be games, tools, social networking, etc.
[0092] As mentioned above, the preliminary processing of the target sample set by the preset Bert model and the further feature extraction of the output results of the preset Bert model combined with the initial TextCNN model can enhance the classification ability of the model, and the output layer is constructed according to the classification label to ensure the output of accurate classification results.
[0093] In a specific embodiment, Figure 4 As shown, step S50 also includes the following steps:
[0094] S51, obtaining the number of classification labels in the classification label system and the number of preset APPs corresponding to each classification label to determine the loss function of the initial TextCNN model.
[0095] Specifically, the loss function L of the initial TextCNN model meets the following conditions:
[0096] L=-∑ M i=1 (((lgN i ) / ∑ M i=1 N i )lgG+(1-(lgN i ) / ∑ M i=1 N i )lg(1-G)), where M is the number of classification labels in the classification label system, N i is the number of preset APPs corresponding to the i-th classification label, and G is the activation function.
[0097] Preferably, G meets the following conditions:
[0098] G=1 / (1+exp -w(c1+c2+……+cf) ), where w is the preset weight threshold and cf is the feature value corresponding to the fth dimension in the text feature vector.
[0099] S52, dividing the text feature vectors corresponding to several preset APPs into a training set and a verification set; technicians in this field make the division according to actual needs, for example, the proportion of the training set is 80%, and the proportion of the verification set is 20%.
[0100] S53, based on the loss function of the initial TextCNN model, the text feature vectors corresponding to several preset APPs in the training set and the classification labels corresponding to each preset APP are input into the given initial TextCNN model, and the intermediate TextCNN model is obtained after training.
[0101] S54, input the text feature vectors corresponding to several preset APPs in the verification set and the classification label corresponding to each preset APP into the intermediate TextCNN model to obtain the loss value of the intermediate TextCNN model.
[0102] S55, adjusting the loss function according to the loss value of the intermediate TextCNN model until the error meets the preset requirements, and obtaining the target APP classification model.
[0103] As mentioned above, the loss function is set according to the number of classification labels and the number of APPs corresponding to each classification label, and the initial TextCNN model is trained and adjusted through the training set and the validation set to make the model have higher classification ability. Through the combination of the Bert model and the TextCNN model, the semantics of the APP description text can be more comprehensively understood, thereby improving the accuracy of APP classification.
[0104] Embodiment 2
[0105] like Figure 5 As shown, this embodiment 2 provides a device for determining an APP type, including:
[0106] The receiving module 100 is used to receive the initial description text of the APP to be classified, the name of the APP to be classified and the package name of the APP to be classified; the initial description text refers to the application introduction text corresponding to the APP to be classified.
[0107] The first processing module 200 is used to perform text standardization processing on the initial description text of the APP to be classified to generate a specified description text of the APP to be classified.
[0108] In a specific embodiment, Figure 6 As shown, the first processing module 200 includes:
[0109] The deletion module 201 is used to compare the initial description text of the APP to be classified with a preset stop word library, find and delete the stop words in the initial description text of the APP to be classified, and generate a first description text of the APP to be classified.
[0110] The vocabulary conversion module 202 is used to perform vocabulary conversion on the target vocabulary in the first description text of the APP to be classified according to the preset natural language processing model to generate a specified description text of the APP to be classified; it can be understood as: converting the target vocabulary into its corresponding basic form to restore the word form; the target vocabulary refers to a number of words that need to be restored as determined by the preset natural language processing model.
[0111] As mentioned above, deleting stop words can make the content of the text more refined, thereby improving the accuracy of text feature extraction. Word form restoration helps to reduce the diversity of vocabulary and improve generalization ability, thus helping to improve the accuracy of APP classification.
[0112] The first generation module 300 is used to insert the key text as the content to be filled into the sentence without characters in the specified description text of the APP to be classified to generate the target description text when the specified character number ratio is less than the preset first character ratio threshold; the specified character number ratio refers to the ratio of the number of characters in the key text to the number of characters in the initial description text of the APP to be classified.
[0113] Specifically, the key text refers to the text generated by the target natural language processing model according to the contextual semantics corresponding to the character-free position in the specified description text of the APP to be classified; those skilled in the art know that the processing method of using any natural language processing model in the prior art to generate text according to the contextual semantics corresponding to the missing content falls within the protection scope of the present invention and will not be repeated here.
[0114] As mentioned above, when the number of words in the generated key text is smaller than the ratio of the specified description text, the filled text will be closer to the true meaning of the specified description text, that is, there will not be much error between the text obtained after filling and the original meaning of the specified description text. Therefore, using it as the content to be filled can guarantee the original meaning of the text to a certain extent while also improving the logical rationality of the text.
[0115] The first acquisition module 400 is used to obtain a first character quantity difference and a second character quantity difference when a specified character quantity ratio is not less than a preset first character ratio threshold; the first character quantity difference refers to the difference between the number of characters in the name of the APP to be classified and the number of characters in the key text, and the second character quantity difference refers to the difference between the number of characters in the APP package name to be classified and the number of characters in the key text; technicians in this field set the first character ratio threshold according to actual needs.
[0116] The second generating module 500 is used to insert the package name of the APP to be classified as the content to be filled into the sentence without characters in the designated description text of the APP to be classified to generate the target description text when the first character quantity difference is greater than the second character quantity difference.
[0117] The third generating module 600 is used to insert the name of the APP to be classified as the content to be filled into the sentence without characters in the designated description text of the APP to be classified to generate the target description text when the first character quantity difference is not greater than the second character quantity difference.
[0118] As mentioned above, when the number of characters in the generated key text is larger than the ratio of the specified description text, the error between the text obtained after filling and the original meaning of the specified description text will become larger. Considering that the name of the APP to be classified and the package name of the APP to be classified can reflect the meaning of the APP to be classified to a certain extent, for example, XX video is video software, and XX music is music software, using the name of the APP to be classified or the package name of the APP to be classified whose number of characters is closer to the number of characters in the key text as the content to be filled can improve the completeness and accuracy of the text, thereby improving the accuracy of text feature extraction, which is conducive to the correct classification of the APP.
[0119] The first determination module 700 is used to input the target description text into the target APP classification model to determine the APP type of the APP to be classified; it can be understood as: inputting the text feature vector corresponding to the target description text into the target APP classification model, extracting the feature vector from the text feature vector through the convolution kernel of the target APP classification model, performing dimensionality transformation on the feature vector by the pooling layer, inputting the transformation result into the fully connected layer, and outputting the classification result of the APP to be classified through nonlinear transformation; wherein the number of neurons in the fully connected layer is set according to the number of classification labels.
[0120] As mentioned above, the logical integrity of the text is improved by using key text to fill in sentences without characters. However, when there are many key text characters, stop words and other words whose meanings do not meet the requirements will appear, which will affect the logical accuracy and refinement of the text and thus reduce the accuracy of text feature extraction. Therefore, when the proportion of key text characters is relatively large, the name of the APP to be classified or the package name of the APP to be classified is used to fill in the missing content, thereby ensuring the accuracy of text feature extraction.
[0121] In a specific embodiment, Figure 7 As shown, the device further includes a first training module, and the first training module includes:
[0122] The second acquisition module 10 is used to obtain a preset description text, a preset APP name and a preset APP package name of each preset APP in a given APP database; the preset description text refers to an application introduction text corresponding to the preset APP.
[0123] The fourth generating module 20 is used to generate a final description text corresponding to each preset APP according to the preset description text corresponding to each preset APP; the method for obtaining the final description text is consistent with the method for obtaining the target description text.
[0124] The third acquisition module 30 is used to filter out the preset description text, preset APP name, and preset APP package name of the preset APP itself when the ratio of the number of characters of the final description text corresponding to any preset APP to the number of characters of the preset description text corresponding to the preset APP is less than the first ratio threshold corresponding to the preset APP, so as to use the preset description texts, preset APP names, and preset APP package names of the remaining several preset APPs as the target sample set.
[0125] Specifically, the first proportion threshold corresponding to the preset APP refers to the proportion threshold corresponding to the character number range of the preset description text corresponding to the preset APP found from the preset character proportion relationship table; it can be understood that: the character proportion relationship table is a table in which several preset character number ranges and several proportion thresholds correspond one to one; among which, technical personnel in this field set the character number range according to actual needs.
[0126] For a better understanding, an example is given: when the number of characters in the preset description text corresponding to the preset APP is 200 words, the character number range is 170-230, and the first proportion threshold corresponding to the preset APP is 0.5; when the number of characters in the preset description text corresponding to the preset APP is 100 words, the character number range is 80-120, and the first proportion threshold corresponding to the preset APP is 0.7; when the number of characters in the preset description text corresponding to the preset APP is 40 words, the character number range is 30-50, and the first proportion threshold corresponding to the preset APP is 0.9.
[0127] As mentioned above, since the preset description text with a large number of characters can fully reflect the type of the corresponding preset APP, and the preset description text with a small number of characters reflects a limited text meaning, when setting the character ratio relationship table, when the number of characters is large, the set ratio threshold is small, and when the number of characters is small, since the content reflecting the APP type itself is limited, the set ratio threshold is large, that is, when the target description text accounts for a large proportion, it is considered to be able to reflect the content type. By deleting the text information with a corresponding proportion less than the corresponding ratio threshold, the sample screening is achieved, thereby making the trained target TextCNN model more effective.
[0128] The output module 40 is used to input the target sample set into the preset Bert model to extract text features, and output the text feature vector corresponding to each preset APP through the output layer of the preset Bert model; it can be understood as: the preset description text, preset APP name and preset APP package name corresponding to the same preset APP are merged into one text and input into the preset Bert model to extract text features.
[0129] The second training module 50 is used to train and adjust the parameters of a given initial TextCNN model according to the text feature vector corresponding to each preset APP and the classification label corresponding to each preset APP to obtain a target APP classification model; the output layer of the initial TextCNN model is constructed according to the given classification label system.
[0130] Specifically, the classification label system refers to a pre-configured label system consisting of a number of classification labels; for example, the classification labels may be games, tools, social networking, etc.
[0131] As mentioned above, the preliminary processing of the target sample set by the preset Bert model and the further feature extraction of the output results of the preset Bert model combined with the initial TextCNN model can enhance the classification ability of the model, and the output layer is constructed according to the classification label to ensure the output of accurate classification results.
[0132] In a specific embodiment, Figure 8As shown, the second training module 50 includes:
[0133] The second determination module 51 is used to obtain the number of classification labels in the classification label system and the number of preset APPs corresponding to each classification label to determine the loss function of the initial TextCNN model.
[0134] Specifically, the loss function L of the initial TextCNN model meets the following conditions:
[0135] L=-∑ M i=1 (((lgN i ) / ∑ M i=1 N i )lgG+(1-(lgN i ) / ∑ M i=1 N i )lg(1-G)), where M is the number of classification labels in the classification label system, N i is the number of preset APPs corresponding to the i-th classification label, and G is the activation function.
[0136] Preferably, G meets the following conditions:
[0137] G=1 / (1+exp -w(c1+c2+……+cf) ), where w is the preset weight threshold and cf is the feature value corresponding to the fth dimension in the text feature vector.
[0138] The division module 52 is used to divide the text feature vectors corresponding to several preset APPs into a training set and a verification set; those skilled in the art make the division according to actual needs, for example, the proportion of the training set is 80% and the proportion of the verification set is 20%.
[0139] The third training module 53 is used to input the text feature vectors corresponding to several preset APPs in the training set and the classification labels corresponding to each preset APP into a given initial TextCNN model based on the loss function of the initial TextCNN model, and obtain an intermediate TextCNN model after training.
[0140] The fourth acquisition module 54 is used to input the text feature vectors corresponding to several preset APPs in the verification set and the classification label corresponding to each preset APP into the intermediate TextCNN model to obtain the loss value of the intermediate TextCNN model.
[0141] The parameter adjustment module 55 is used to adjust the loss function according to the loss value of the intermediate TextCNN model until the error meets the preset requirements, thereby obtaining the target APP classification model.
[0142] As mentioned above, the loss function is set according to the number of classification labels and the number of APPs corresponding to each classification label, and the initial TextCNN model is trained and adjusted through the training set and the validation set to make the model have higher classification ability. Through the combination of the Bert model and the TextCNN model, the semantics of the APP description text can be more comprehensively understood, thereby improving the accuracy of APP classification.
[0143] Embodiment 3
[0144] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:
[0145] Receive the initial description text of the APP to be classified, the name of the APP to be classified and the package name of the APP to be classified; the initial description text refers to the application introduction text corresponding to the APP to be classified.
[0146] The initial description text of the APP to be classified is subjected to text standardization processing to generate the specified description text of the APP to be classified.
[0147] When the specified character quantity ratio is less than the preset first character ratio threshold, the key text is inserted as the content to be filled in the sentence without characters in the specified description text of the APP to be classified to generate the target description text; the specified character quantity ratio refers to the ratio of the number of characters in the key text to the number of characters in the initial description text of the APP to be classified; the key text refers to the text generated by the target natural language processing model according to the contextual semantics corresponding to the character-free position in the specified description text of the APP to be classified.
[0148] When the specified character quantity ratio is not less than the preset first character ratio threshold, the first character quantity difference and the second character quantity difference are obtained; the first character quantity difference refers to the difference between the number of characters in the name of the APP to be classified and the number of characters in the key text, and the second character quantity difference refers to the difference between the number of characters in the APP package name to be classified and the number of characters in the key text.
[0149] When the first character quantity difference is greater than the second character quantity difference, the package name of the APP to be classified is inserted as the content to be filled into the sentence without characters in the designated description text of the APP to be classified to generate the target description text.
[0150] When the first character quantity difference is not greater than the second character quantity difference, the name of the APP to be classified is inserted as the content to be filled into the sentence without characters in the designated description text of the APP to be classified to generate the target description text.
[0151] The target description text is input into the target APP classification model to determine the APP type of the APP to be classified.
[0152] Embodiment 4
[0153] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0154] Receive the initial description text of the APP to be classified, the name of the APP to be classified and the package name of the APP to be classified; the initial description text refers to the application introduction text corresponding to the APP to be classified.
[0155] The initial description text of the APP to be classified is subjected to text standardization processing to generate the specified description text of the APP to be classified.
[0156] When the specified character quantity ratio is less than the preset first character ratio threshold, the key text is inserted as the content to be filled in the sentence without characters in the specified description text of the APP to be classified to generate the target description text; the specified character quantity ratio refers to the ratio of the number of characters in the key text to the number of characters in the initial description text of the APP to be classified; the key text refers to the text generated by the target natural language processing model according to the contextual semantics corresponding to the character-free position in the specified description text of the APP to be classified.
[0157] When the specified character quantity ratio is not less than the preset first character ratio threshold, the first character quantity difference and the second character quantity difference are obtained; the first character quantity difference refers to the difference between the number of characters in the name of the APP to be classified and the number of characters in the key text, and the second character quantity difference refers to the difference between the number of characters in the APP package name to be classified and the number of characters in the key text.
[0158] When the first character quantity difference is greater than the second character quantity difference, the package name of the APP to be classified is inserted as the content to be filled into the sentence without characters in the designated description text of the APP to be classified to generate the target description text.
[0159] When the first character quantity difference is not greater than the second character quantity difference, the name of the APP to be classified is inserted as the content to be filled into the sentence without characters in the designated description text of the APP to be classified to generate the target description text.
[0160] The target description text is input into the target APP classification model to determine the APP type of the APP to be classified.
[0161] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0162] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0163] Although some specific embodiments of the present invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will also be appreciated by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.
Claims
1. A method for determining an APP type, characterized in that: The following steps are involved: Receive the initial description text, the name of the APP to be classified and the package name of the APP to be classified; the initial description text refers to the application introduction text corresponding to the APP to be classified; Perform text standardization on the initial description text of the APP to be classified to generate the specified description text of the APP to be classified; When the specified character quantity ratio is less than a preset first character ratio threshold, the key text is inserted as content to be filled into the sentence without characters in the specified description text of the APP to be classified to generate a target description text; the specified character quantity ratio refers to the ratio of the number of characters in the key text to the number of characters in the initial description text of the APP to be classified; the key text refers to the text generated by the target natural language processing model according to the contextual semantics corresponding to the character-free position in the specified description text of the APP to be classified; When the specified character quantity ratio is not less than the preset first character ratio threshold, the first character quantity difference and the second character quantity difference are obtained; the first character quantity difference refers to the difference between the number of characters in the APP name to be classified and the number of characters in the key text, and the second character quantity difference refers to the difference between the number of characters in the APP package name to be classified and the number of characters in the key text; When the first character quantity difference is greater than the second character quantity difference, inserting the package name of the APP to be classified as the content to be filled into the sentence without characters in the designated description text of the APP to be classified to generate the target description text; When the first character quantity difference is not greater than the second character quantity difference, inserting the name of the APP to be classified as the content to be filled into the sentence without characters in the designated description text of the APP to be classified to generate the target description text; The target description text is input into the target APP classification model to determine the APP type of the APP to be classified.
2. The method for determining the APP type according to claim 1, characterized in that: Generate the specified description text of the APP to be classified through the following steps: Compare the initial description text of the APP to be classified with a preset stop word library, find and delete the stop words in the initial description text of the APP to be classified, and generate a first description text of the APP to be classified; The target words in the first description text of the APP to be classified are converted into words according to a preset natural language processing model to generate a designated description text of the APP to be classified.
3. The method for determining the APP type according to claim 1, characterized in that: Obtain the target APP classification model through the following steps: Obtain a preset description text, a preset APP name and a preset APP package name of each preset APP in a given APP database; the preset description text refers to an application introduction text corresponding to the preset APP; Generate a final description text corresponding to each preset APP according to the preset description text corresponding to each preset APP; The method for obtaining the final description text is consistent with the method for obtaining the target description text; When the ratio of the number of characters of the final description text corresponding to any preset APP to the number of characters of the preset description text corresponding to the preset APP is less than the first ratio threshold corresponding to the preset APP, the preset description text, preset APP name, and preset APP package name of the preset APP itself are filtered out, so as to use the preset description texts, preset APP names, and preset APP package names of the remaining preset APPs as the target sample set; Input the target sample set into the preset Bert model to extract text features, and output the text feature vector corresponding to each preset APP through the output layer of the preset Bert model; According to the text feature vector corresponding to each preset APP and the classification label corresponding to each preset APP, the given initial TextCNN model is trained and adjusted to obtain the target APP classification model; the output layer of the initial TextCNN model is constructed according to the given classification label system.
4. The method for determining the APP type according to claim 3, characterized in that: The target APP classification model is also obtained through the following steps: Obtain the number of classification labels in the classification label system and the number of preset APPs corresponding to each classification label to determine the loss function of the initial TextCNN model; Divide the text feature vectors corresponding to several preset APPs into a training set and a validation set; Based on the loss function of the initial TextCNN model, the text feature vectors corresponding to several preset apps in the training set and the classification labels corresponding to each preset app are input into the given initial TextCNN model, and the intermediate TextCNN model is obtained after training; Input the text feature vectors corresponding to several preset apps in the validation set and the classification labels corresponding to each preset app into the intermediate TextCNN model to obtain the loss value of the intermediate TextCNN model; The loss function is adjusted according to the loss value of the intermediate TextCNN model until the error meets the preset requirements to obtain the target APP classification model.
5. The method for determining the APP type according to claim 3, characterized in that: The first ratio threshold corresponding to the preset APP refers to a ratio threshold corresponding to a character number range within which the number of characters of the preset description text corresponding to the preset APP falls, which is found from a preset character ratio relationship table.
6. A device for determining an APP type, characterized in that: The device comprises: A receiving module, used to receive an initial description text of the APP to be classified, a name of the APP to be classified, and a package name of the APP to be classified; the initial description text refers to an application introduction text corresponding to the APP to be classified; The first processing module is used to perform text standardization processing on the initial description text of the APP to be classified to generate a specified description text of the APP to be classified; The first generating module is used for inserting the key text as the content to be filled into the sentence without characters in the specified description text of the APP to be classified to generate the target description text when the specified character number ratio is less than the preset first character ratio threshold value; the specified character number ratio refers to the ratio of the number of characters in the key text to the number of characters in the initial description text of the APP to be classified; the key text refers to the text generated by the target natural language processing model according to the context semantics corresponding to the character-free position in the specified description text of the APP to be classified; A first acquisition module is used to acquire a first character quantity difference and a second character quantity difference when the specified character quantity ratio is not less than a preset first character ratio threshold; the first character quantity difference refers to the difference between the number of characters in the name of the APP to be classified and the number of characters in the key text, and the second character quantity difference refers to the difference between the number of characters in the name of the APP to be classified and the number of characters in the key text; A second generating module is used for inserting the package name of the APP to be classified as the content to be filled into the sentence without characters in the designated description text of the APP to be classified to generate a target description text when the first character quantity difference is greater than the second character quantity difference; A third generating module is used for inserting the name of the APP to be classified as the content to be filled into the sentence without characters in the designated description text of the APP to be classified to generate a target description text when the first character quantity difference is not greater than the second character quantity difference; The first determination module is used to input the target description text into a target APP classification model to determine the APP type of the APP to be classified.
7. The device for determining the type of APP according to claim 6, characterized in that: The first processing module comprises: A deletion module, used to compare the initial description text of the APP to be classified with a preset stop word library, find and delete the stop words in the initial description text of the APP to be classified, and generate a first description text of the APP to be classified; The vocabulary conversion module is used to perform vocabulary conversion on the target vocabulary in the first description text of the APP to be classified according to a preset natural language processing model to generate a specified description text of the APP to be classified.
8. The device for determining APP type according to claim 6, characterized in that: Also included is a first training module, wherein the first training module includes: The second acquisition module is used to obtain a preset description text, a preset APP name and a preset APP package name of each preset APP in a plurality of preset APPs in a given APP database; the preset description text refers to an application introduction text corresponding to the preset APP; A fourth generating module is used to generate a final description text corresponding to each preset APP according to the preset description text corresponding to each preset APP; the method for obtaining the final description text is consistent with the method for obtaining the target description text; The third acquisition module is used to filter out the preset description text, preset APP name, and preset APP package name of the preset APP itself when the ratio of the number of characters of the final description text corresponding to any preset APP to the number of characters of the preset description text corresponding to the preset APP is less than the first ratio threshold corresponding to the preset APP, so as to use the preset description texts, preset APP names, and preset APP package names of the remaining preset APPs as the target sample set; An output module is used to input the target sample set into a preset Bert model to extract text features, and output a text feature vector corresponding to each preset APP through the output layer of the preset Bert model; The second training module is used to train and adjust the given initial TextCNN model according to the text feature vector corresponding to each preset APP and the classification label corresponding to each preset APP to obtain the target APP classification model; the output layer of the initial TextCNN model is constructed according to the given classification label system.
9. The device for determining the type of APP according to claim 8, characterized in that: The second training module includes: The second determination module is used to obtain the number of classification labels in the classification label system and the number of preset APPs corresponding to each classification label to determine the loss function of the initial TextCNN model; A division module is used to divide the text feature vectors corresponding to several preset APPs into a training set and a verification set; The third training module is used to input the text feature vectors corresponding to several preset apps in the training set and the classification labels corresponding to each preset app into the given initial TextCNN model based on the loss function of the initial TextCNN model, and obtain the intermediate TextCNN model after training; The fourth acquisition module is used to input the text feature vectors corresponding to several preset APPs in the verification set and the classification label corresponding to each preset APP into the intermediate TextCNN model to obtain the loss value of the intermediate TextCNN model; The parameter adjustment module is used to adjust the loss function according to the loss value of the intermediate TextCNN model until the error meets the preset requirements to obtain the target APP classification model.
10. The device for determining APP type according to claim 8, characterized in that: The first ratio threshold corresponding to the preset APP refers to a ratio threshold corresponding to a character number range within which the number of characters of the preset description text corresponding to the preset APP falls, which is found from a preset character ratio relationship table.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for determining the APP type as described in any one of claims 1 to 5 is implemented.
12. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for determining the type of an APP as claimed in any one of claims 1 to 5 is implemented.
