A method and device for determining text labels

By constructing a label network relationship diagram and using a text classifier to combine label description features and network relationship feature vectors, the problem of inaccurate text label determination in the prior art is solved and more accurate text classification is achieved.

CN112541055BActive Publication Date: 2024-09-06CHINA UNIONPAY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011494762.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-17
Publication Date
2024-09-06
Estimated Expiration
2040-12-17

AI Technical Summary

Technical Problem

The existing technology is not accurate enough when determining tags for text, mainly due to the lack of consideration of the logical relationship and descriptive characteristics between tags.

Method used

By constructing a network relationship diagram between tags, the network relationship feature vector of the tag is obtained, and combined with the text feature vector, a text classifier is used to determine which tag the text to be classified belongs to, taking into account the label's descriptive features and network relationship feature vector.

Benefits of technology

The accuracy of text classification is improved, the label of the text to be classified can be determined more accurately, and the classification effect is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112541055B
    Figure CN112541055B
Patent Text Reader

Abstract

The present application discloses a method and device for determining text labels, which include determining a text feature vector of a text to be classified; determining a label feature vector of a label for any label in a preset label set; determining the probability that the text to be classified belongs to a label based on the text feature vector and the label feature vector; the label feature vector includes a description feature vector of the label and a network relationship feature vector of the label in the preset label set; and determining a label whose probability meets a preset condition as the label of the text to be classified. When determining labels for the text to be classified, in addition to using the text feature vector of the text to be classified as a basis for determining labels, the label feature vector of any label in the preset label set is also used as a basis for determining labels. This process increases the logical relationship between the labels in the preset label set and the description feature vector of each label itself, so that this method has a more accurate classification effect when classifying the text to be classified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular, to a method and device for determining a text label. Background Art

[0002] With the development of big data and artificial intelligence technology, a huge amount of text data has been generated on the Internet. By classifying and labeling these text data, we can better recommend content of interest to users, search for areas of interest, and discover hot events. For example, we can recommend products based on user comments and hot events based on Weibo.

[0003] For any specific application field, such as the system in the customer service field, the customer consultation content is accurately classified, that is, an accurate label is determined for each text-based customer consultation content, so that when customer consultation content corresponding to the label enters the customer service system in the future, the customer consultation content can be quickly replied or recommended with relevant content.

[0004] Currently, text classification is usually based on the information of the text itself, building a text classifier, and using the text classifier to determine the label of the text to be classified.

[0005] However, the above-mentioned method of labeling text does not work well.

[0006] Application Contents

[0007] The present application provides a method and device for determining text labels, which are used to solve the problem that the prior art is not accurate enough when determining labels for texts.

[0008] In a first aspect, an embodiment of the present application provides a method for determining a text label, the method comprising: determining a text feature vector of a text to be classified; for any label in a preset label set, determining a label feature vector of the label; based on the text feature vector and the label feature vector, determining the probability that the text to be classified belongs to the label; the label feature vector comprises a description feature vector of the label and a network relationship feature vector of the label in the preset label set; and determining a label whose probability meets a preset condition as the label of the text to be classified.

[0009] Based on this scheme, when determining the label of the text to be classified, in addition to using the text feature vector of the text to be classified as the basis for determining the label, the label feature vector of any label in the preset label set is also used as the basis for determining the label. In this process, the logical relationship between the labels in the preset label set and the descriptive feature vector of each label itself are added, so that this method has a more accurate classification effect when classifying the text to be classified.

[0010] In one possible implementation method, the network relationship feature vector of the label in the preset label set is determined in the following manner, including: constructing a network relationship graph for each label in the preset label set; in the network relationship graph, each label is a node, and the logical relationship between labels is an edge; through the network relationship graph, each label is mapped to an N-dimensional space to obtain an N-dimensional network relationship feature vector of each label; wherein, in the N-dimensional space, the closer the distance between labels, the higher the similarity.

[0011] Based on this scheme, when determining the labels for the classified text, the existing labels are formed into a label set, and a network relationship graph of each label in the label set is constructed, and the constructed network relationship graph is mapped, so as to obtain the network relationship feature vector between the existing labels. When the network relationship feature vector formed in this way is used to classify the text, the logical relationship between labels can be integrated to a large extent, which is of great reference significance for improving the accuracy of text classification.

[0012] In one possible implementation method, determining the probability that the text to be classified belongs to the label based on the text feature vector and the label feature vector includes: inputting the text feature vector and the label feature vector into a text classifier, and determining the probability that the text to be classified belongs to the label through the text classifier.

[0013] Based on this scheme, the text feature vector of the text to be classified is combined one by one with the label feature vector of any label in the preset label set, and the combination results are input into the text classifier one by one. Since the text classifier is trained based on historical texts and labels in the preset label set, it can better classify the text to be classified accurately, that is, determine a more accurate label for the text to be classified.

[0014] In a possible implementation method, the text classifier is trained in the following manner, including: constructing a sample, wherein the sample includes a positive sample and a negative sample; for any sample, determining a second text feature vector of the text in the sample and a second label feature vector of the label in the sample; inputting the second text feature vector and the second label vector into an initial model, and performing reverse training based on the output of the initial model and the sample identifier of the sample until the text classifier is obtained; the sample identifier is used to indicate whether the text sample is a positive sample or a negative sample.

[0015] Based on this scheme, in the process of training a text classifier, by constructing positive samples and negative samples, wherein any sample includes text and labels, the text feature vector of the text and the label feature vector of the label are determined, and the determined text feature vector and label feature vector are used to train the initial classifier until a classifier that meets the requirements is obtained through training, i.e., a text classifier. In this method, since the possible influence of labels on the classification of texts is fully considered in the process of training the text classifier, when the text classifier formed by introducing labels is used to determine the labels of the text to be classified, the determined labels will be able to more accurately reflect the text to be classified.

[0016] In one possible implementation method, a similar negative sample in a negative sample is obtained in the following manner, including: determining a second label that is similar to a first label of a positive sample; wherein a distance between a network relationship feature vector of the first label and a network relationship feature vector of the second label is less than a set distance; and constructing the text of the positive sample and the second label as a negative sample.

[0017] Based on this scheme, in the process of training a text classifier, regarding negative samples of positive samples, the negative samples included can be similar negative samples generated based on the labels of positive samples, wherein the distance between the labels of similar negative samples and the labels of positive samples is less than the set distance. In this way, in the process of training a text classifier, by accurately distinguishing between positive samples and positive samples, the accuracy of the classifier in classifying text can be improved.

[0018] In one possible implementation method, a random negative sample in a negative sample is obtained by: randomly determining a third label from the preset label set, wherein the third label is different from the first label of the positive sample; and constructing the text of the positive sample and the third label as a negative sample.

[0019] Based on this scheme, in the process of training a text classifier, regarding negative samples of positive samples, the negative samples included may be random negative samples with labels different from those of positive samples. By training some random negative samples, in the process of training the text classifier, by accurately distinguishing between positive samples and positive samples, the accuracy of the classifier in classifying text can be improved.

[0020] In a possible implementation method, the descriptive feature vector of the tag is obtained by crawling the descriptive information of the tag from the network.

[0021] Based on this scheme, since the descriptive information corresponding to the label (expressed in text form) can express a certain meaning, the descriptive feature vector of the label is obtained by performing work such as text feature vector extraction on the descriptive information corresponding to the label, and the descriptive feature vector of the label is included in the training scope of the text classifier. Therefore, the text classifier obtained based on this method can improve the classification effect of the text to be classified.

[0022] In a second aspect, an embodiment of the present application provides a device for determining a text label, the device comprising: a text feature vector determination unit, used to determine a text feature vector of a text to be classified; a text label probability determination unit, used to determine a label feature vector of any label in a preset label set; based on the text feature vector and the label feature vector, determining the probability that the text to be classified belongs to the label; the label feature vector comprises a description feature vector of the label and a network relationship feature vector of the label in the preset label set; a text label determination unit, used to determine a label whose probability meets a preset condition as a label of the text to be classified.

[0023] Based on this scheme, when determining the label of the text to be classified, in addition to using the text feature vector of the text to be classified as the basis for determining the label, the label feature vector of any label in the preset label set is also used as the basis for determining the label. In this process, the logical relationship between the labels in the preset label set and the descriptive feature vector of each label itself are added, so that this method has a more accurate classification effect when classifying the text to be classified.

[0024] In one possible implementation method, the device also includes a network relationship feature vector determination unit; the network relationship feature vector determination unit is used to construct a network relationship graph for each label in the preset label set; in the network relationship graph, each label is a node, and the logical relationship between labels is an edge; through the network relationship graph, each label is mapped to an N-dimensional space to obtain an N-dimensional network relationship feature vector for each label; wherein, in the N-dimensional space, the closer the distance between labels, the higher the similarity.

[0025] Based on this scheme, when determining the labels for the classified text, the existing labels are formed into a label set, and a network relationship graph of each label in the label set is constructed, and the constructed network relationship graph is mapped, so as to obtain the network relationship feature vector between the existing labels. When the network relationship feature vector formed in this way is used to classify the text, the logical relationship between labels can be integrated to a large extent, which is of great reference significance for improving the accuracy of text classification.

[0026] In a possible implementation method, the text label probability determination unit is specifically configured to input the text feature vector and the label feature vector into a text classifier, and determine the probability that the text to be classified belongs to the label through the text classifier.

[0027] Based on this scheme, the text feature vector of the text to be classified is combined one by one with the label feature vector of any label in the preset label set, and the combination results are input into the text classifier one by one. Since the text classifier is trained based on historical texts and labels in the preset label set, it can better classify the text to be classified accurately, that is, determine a more accurate label for the text to be classified.

[0028] In a possible implementation method, the device also includes a text classifier obtaining unit; the text classifier obtaining unit is used to construct a sample, and the sample includes a positive sample and a negative sample; for any sample, a second text feature vector of the text in the sample and a second label feature vector of the label in the sample are determined; the second text feature vector and the second label vector are input into an initial model, and reverse training is performed according to the output of the initial model and the sample identifier of the sample until the text classifier is obtained; the sample identifier is used to indicate whether the text sample is a positive sample or a negative sample.

[0029] Based on this scheme, in the process of training a text classifier, by constructing positive samples and negative samples, wherein any sample includes text and labels, the text feature vector of the text and the label feature vector of the label are determined, and the determined text feature vector and label feature vector are used to train the initial classifier until a classifier that meets the requirements is obtained through training, i.e., a text classifier. In this method, since the possible influence of labels on the classification of texts is fully considered in the process of training the text classifier, when the text classifier formed by introducing labels is used to determine the labels of the text to be classified, the determined labels will be able to more accurately reflect the text to be classified.

[0030] In one possible implementation method, the text classifier obtains a unit, and is also used to determine a second label that is similar to the first label of a positive sample; wherein the distance between the network relationship feature vector of the first label and the network relationship feature vector of the second label is less than a set distance; and the text of the positive sample and the second label are constructed as a negative sample.

[0031] Based on this scheme, in the process of training a text classifier, regarding negative samples of positive samples, the negative samples included can be similar negative samples generated based on the labels of positive samples, wherein the distance between the labels of similar negative samples and the labels of positive samples is less than the set distance. In this way, in the process of training a text classifier, by accurately distinguishing between positive samples and positive samples, the accuracy of the classifier in classifying text can be improved.

[0032] In a possible implementation method, the text classifier obtaining unit is further used to randomly determine a third label from the preset label set, where the third label is different from the first label of the positive sample; and construct the text of the positive sample and the third label as a negative sample.

[0033] Based on this scheme, in the process of training a text classifier, regarding negative samples of positive samples, the negative samples included may be random negative samples with labels different from those of positive samples. By training some random negative samples, in the process of training the text classifier, by accurately distinguishing between positive samples and positive samples, the accuracy of the classifier in classifying text can be improved.

[0034] In a possible implementation method, the descriptive feature vector of the tag is obtained by crawling the descriptive information of the tag from the network.

[0035] Based on this scheme, since the descriptive information corresponding to the label (expressed in text form) can express a certain meaning, the descriptive feature vector of the label is obtained by performing work such as text feature vector extraction on the descriptive information corresponding to the label, and the descriptive feature vector of the label is included in the training scope of the text classifier. Therefore, the text classifier obtained based on this method can improve the classification effect of the text to be classified.

[0036] In a third aspect, an embodiment of the present application provides a computing device, including:

[0037] Memory for storing computer programs;

[0038] The processor is used to call the computer program stored in the memory and execute any method as described in the first aspect according to the obtained program.

[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is used to enable a computer to execute any method as described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0041] Figure 1 A method for determining a text label provided in an embodiment of the present application;

[0042] Figure 2 A network relationship diagram between tags provided in an embodiment of the present application;

[0043] Figure 3 A schematic diagram of a network relationship feature vector in a two-dimensional space provided in an embodiment of the present application;

[0044] Figure 4 A device for determining a text label provided in an embodiment of the present application;

[0045] Figure 5 A schematic diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0047] At present, with the development of big data and artificial intelligence technology, the Internet has generated a huge amount of text data. By classifying and labeling these text data, users can be better recommended content of interest, search for areas of interest, and discover hot events. The text classifiers commonly used to classify text data are obtained through training only based on the information in the text itself. However, the effect of the text classifiers obtained in this way is not good.

[0048] Based on the above technical problems, the present application embodiment provides a method for determining a text label, such as Figure 1 As shown, the method comprises the following steps:

[0049] Step 101, determining a text feature vector of a text to be classified.

[0050] In this step, the process of determining the text feature vector of the text to be classified is the process of converting a piece of text into an N-dimensional vector.

[0051] For example, for a text to be classified, such as the text "Using QuickPass to scan the code on the bus in Taiyuan only costs one cent", first, accurate Chinese word segmentation can be performed. For example, through Chinese word segmentation, it can be segmented into "QuickPass / in / Taiyuan / take / the bus / scan the code / one cent / just / do".

[0052] Next, stop word processing is performed on the already segmented text. For example, by using a stop word dictionary, some common stop words such as "in", "of", etc. are removed to obtain the characteristics of the text.

[0053] Immediately afterwards, some misspelled words in the text are corrected. For example, by using a misspelling correction dictionary, "Taiyuan" can be corrected from "Taiyuan".

[0054] Finally, the word vectors of each word can be calculated by using pre-trained models such as FastText / BERT, and then the word vectors are filled in a set M*N matrix to generate a text feature vector.

[0055] Step 102: For any label in the preset label set, determine the label feature vector of the label; based on the text feature vector and the label feature vector, determine the probability that the text to be classified belongs to the label; the label feature vector includes the description feature vector of the label and the network relationship feature vector of the label in the preset label set.

[0056] In this step, the labels generated after classifying historical texts are summarized to form a preset label set. Different technical fields correspond to a preset label set respectively. For any label in the preset label set, determining the label feature vector of the label specifically includes the description feature vector of the label and the network relationship feature vector of the label in the preset label set; thus, based on the text feature vector of the text to be classified and the label feature vector of the label, the probability of the text to be classified under each label can be determined.

[0057] Step 103: Determine the label of the text to be classified as the label that satisfies the preset condition.

[0058] In this step, since the probabilities of the text to be classified under each label in the preset label set can be obtained through Step 102, the label that satisfies the probability can be determined as the label of the text to be classified based on certain preset conditions.

[0059] Based on this scheme, when determining the label of the text to be classified, in addition to using the text feature vector of the text to be classified as the basis for determining the label, the label feature vector of any label in the preset label set is also used as the basis for determining the label. In this process, the logical relationship between the labels in the preset label set and the descriptive feature vector of each label itself are added, so that this method has a more accurate classification effect when classifying the text to be classified.

[0060] The following will explain the above steps in detail with examples.

[0061] In one implementation of the above step 101, the network relationship feature vector of the label in the preset label set is determined in the following manner, including: constructing a network relationship graph for each label in the preset label set; in the network relationship graph, each label is a node, and the logical relationship between labels is an edge; through the network relationship graph, each label is mapped to an N-dimensional space to obtain an N-dimensional network relationship feature vector of each label; wherein, in the N-dimensional space, the closer the distance between labels, the higher the similarity.

[0062] For example, in the payment field, there may be various payment methods such as bank cards, Alipay, WeChat, UnionPay mobile QuickPass, Cloud QuickPass, etc. Then, for each payment method, it may include payment details at a lower level. For example, the lower level of bank cards may include subcategories such as bank card binding, the lower level of Cloud QuickPass may include subcategories such as urban transportation and transaction inquiries, and the lower level of UnionPay mobile QuickPass may include subcategories such as Apple Pay and HUAWEI Pay. Each subcategory may also include payment details at a lower level, and examples will not be given one by one. Among them, various payment methods and payment details under the payment methods can be defined as tags, so that a network relationship diagram of each tag in the payment field can be obtained, such as Figure 2 As shown, it is a network relationship diagram between tags provided by an embodiment of the present application. Figure 2 It includes nodes formed by labels such as bank card, Alipay, WeChat, UnionPay mobile QuickPass, Cloud QuickPass, bank card binding, city transportation, transaction query, Apple Pay, HUAWEI Pay, etc., as well as the logical relationship between each label. For example, the next level of UnionPay card includes bank card binding. Bank card, Alipay, WeChat, UnionPay mobile QuickPass and Cloud QuickPass are the more mainstream payment methods in society. Any two of them are in a competitive relationship. Then, for Figure 2The network relationship diagram shown in the figure can map each label in the diagram to an N-dimensional space, so as to obtain the N-dimensional network relationship feature vector of each label. For example, based on a network such as GNN, the logical relationship of the label can be converted into a vector representation of the label in the N-dimensional space. This method can not only obtain the logical relationship between each label and other labels, but also obtain the N-dimensional vector of each label, thereby converting the label of the historical text into the network relationship feature vector of the label. For simple illustration, Figure 3 A schematic diagram of a network relationship feature vector in a two-dimensional space provided in an embodiment of the present application, Figure 3 is based on Figure 2 Schematic diagram of the network relationship feature vector formed by some of the tags shown in , where tags of the same topic can be mapped to similar two-dimensional vector spaces, and tags of different topics can be mapped to two-dimensional vector spaces with a longer distance, such as mapping "bus and subway" to vector (1.3, 9.8), mapping "public payment" to vector (1.4, 8.7), mapping "Apple Pay" to vector (1.2, 2.1), mapping "HUAWEI Pay" to vector (1.11, 1.98), mapping "bank card password" to vector (5.3, 4.4), and mapping "bank card binding" to vector (5.6, 3.7).

[0063] In some implementations of the present application, the descriptive feature vector of the tag is obtained by crawling the descriptive information of the tag from the network.

[0064] For example, for any tag in the preset tag set, the definition of the tag can be obtained through the Internet, such as through the entry of Baidu Encyclopedia, to obtain the descriptive information of the tag. Assuming that "Yunsuanfu" is a tag in the preset tag set, its descriptive information can be captured from the Internet. For example, the descriptive information captured from the Internet can be "Yunsuanfu, the unified APP of the banking industry, brings together the mobile payment functions and preferential benefits of various institutions, and is committed to becoming a mobile payment manager that saves consumers money and worries..." Then, the text corresponding to the descriptive information explaining the tag "Yunsuanfu" can be obtained by performing steps such as extracting text feature vectors on it, including Chinese word segmentation, stop word processing, typo correction, etc.

[0065] Based on the same principle, by constructing a descriptive feature vector for any label in the preset label set, it is convenient to obtain the descriptive feature vector corresponding to the label from the descriptive feature vector of the constructed label in the process of training the text classifier and in the process of classifying the text to be classified.

[0066] In one implementation of the above step 102, determining the probability that the text to be classified belongs to the label based on the text feature vector and the label feature vector includes: inputting the text feature vector and the label feature vector into a text classifier, and determining the probability that the text to be classified belongs to the label through the text classifier.

[0067] In the embodiment of the present application, the classifier can be used to calculate the text feature vector and label feature vector input therein to determine the probability of the text to be classified under the corresponding label.

[0068] In certain implementations of the present application, the text classifier is trained in the following manner, including: constructing a sample, the sample including a positive sample and a negative sample; for any sample, determining a second text feature vector of the text in the sample and a second label feature vector of the label in the sample; inputting the second text feature vector and the second label vector into an initial model, and performing reverse training based on the output of the initial model and the sample identifier of the sample until the text classifier is obtained; the sample identifier is used to indicate whether the text sample is a positive sample or a negative sample.

[0069] For example, for any text in the historical text, the text has been labeled. For this sample, its positive sample includes the text, the label corresponding to the text, and the sample identifier of the text (positive sample); its negative sample includes the text, the label that has / does not have a certain logical relationship with the label corresponding to the text, and the sample identifier of the text (negative sample). Then, the positive sample and negative sample corresponding to the text are respectively input into the initial model. By adjusting the parameters of the initial model, the final classifier can accurately identify the positive sample as a positive sample and the negative sample as a negative sample, so that the classifier at this time can be called a text classifier.

[0070] In certain implementations of the present application, similar negative samples in negative samples are obtained in the following manner, including: determining a second label that is similar to a first label of a positive sample; wherein a distance between a network relationship feature vector of the first label and a network relationship feature vector of the second label is less than a set distance; and constructing the text of the positive sample and the second label as a negative sample.

[0071] In some implementations of the present application, a random negative sample in a negative sample is obtained by: randomly determining a third label from the preset label set, wherein the third label is different from the first label of the positive sample; and constructing the text of the positive sample and the third label into a negative sample.

[0072] For example, with respect to a historical text, the negative samples corresponding to its positive samples may include similar negative samples and random negative samples. Among them, the formation of similar negative samples is based on the labels corresponding to the samples in the positive samples. Specifically, in the aforementioned network relationship feature vector, the labels corresponding to the samples in the positive samples are used as a benchmark, and one or more labels that meet the preset conditions with respect to the labels are determined as labels in similar negative samples, such as determining the first 3-5 labels that are closest to the label as labels in similar negative samples; the formation of random negative samples is not based on the labels corresponding to the samples in the positive samples. Specifically, one or more labels corresponding to the samples in non-positive samples are randomly selected from the aforementioned preset label set, such as randomly determining 3-5 labels, and these labels are respectively determined as labels in random negative samples. Thus, for any text in the historical text, its positive sample can be expressed as (doc i ,tag ij ,1), negative samples can be expressed as (doc i ,tag ik ,-1), where doc represents text, tag represents tag, and the subscript i is used to represent any text in the historical text. ij The label used to represent the positive sample of the text, tag ik The label used to represent the negative sample of the text, 1 is used to represent the positive sample and -1 is used to represent the negative sample.

[0073] For any text in the historical text, we can form positive and negative samples of the text, and then, based on the positive and negative samples (doc i ,tag i ,±1), extract doc in each sample i 、tag i The corresponding text feature vector V doc and label feature vector V tag , and concatenate the text feature vector and the label feature vector to obtain the concatenated vector concat[V doc ,V tag ].

[0074] Based on the generated concatenated vector, a classification model can be trained by constructing a logistic regression algorithm. The logistic regression algorithm uses stochastic gradient descent training to learn the parameters w and b, and finally generates a text classifier.

[0075]

[0076] Among them, for generating text classifiers, in addition to selecting the logistic regression algorithm, other machine learning algorithms, such as SVM, GBDT, DNN, etc., can also be used for text classification; in addition, in addition to using classification algorithms, it can also be based on ranking algorithms, such as Learning to rank, rankNet and other algorithms.

[0077] Therefore, when the trained text classifier is used to determine the label of the text to be classified "Only one cent is required to scan the QR code to ride the bus at Taiyuan via UnionPay", its text feature vector is first obtained, and then the text feature vector is concatenated with the description feature vector of any label in the preset label set, and the concatenated vectors are input into the trained text classifier one by one, so that the probability of the text under any label in the preset label set can be obtained. For example, for the text to be classified, i , you can get the prediction results (doc i , Cloud QuickPass, 0.85), (doc i , bank card, 0.155), ..., (doc i ,Alipay,-0.65).

[0078] Take out the labels of the top N texts with the highest scores. Recommend the labels of the texts as candidate labels to get the predicted results. For example, take the top 3 as the doc i , you can get the tags for the text: Cloud QuickPass, bank card, bank account.

[0079] The experiment is based on UnionPay customer service conversation data and conversation data labels, with a total of 95,933 training data and 23,984 test data, including conversation text and its labels, and uses the FastText classification algorithm as a classifier. In the traditional classification algorithm that does not use label features, the TOP-5 accuracy of the model prediction is 81.2%. In the text classification algorithm combined with label features, the TOP-5 accuracy of the model prediction is 87.5%, which is significantly improved (P>0.05) compared with the prediction accuracy of the traditional method model.

[0080] Based on the same concept, the present application also provides a device for determining a text label, such as Figure 4 As shown, the device comprises:

[0081] A text feature vector determining unit 401, used to determine a text feature vector of a text to be classified;

[0082] The text label probability determination unit 402 is used to determine the label feature vector of any label in the preset label set; based on the text feature vector and the label feature vector, determine the probability that the text to be classified belongs to the label; the label feature vector includes the description feature vector of the label and the network relationship feature vector of the label in the preset label set;

[0083] The text label determination unit 403 is used to determine a label whose probability meets a preset condition as the label of the text to be classified.

[0084] Furthermore, the device also includes a network relationship feature vector determination unit 404; the network relationship feature vector determination unit 404 is used to construct a network relationship graph of each label in the preset label set; in the network relationship graph, each label is a node, and the logical relationship between labels is an edge; through the network relationship graph, each label is mapped to an N-dimensional space to obtain an N-dimensional network relationship feature vector of each label; wherein, the closer the distance in the N-dimensional space, the higher the similarity of labels.

[0085] Furthermore, for the device, the text label probability determination unit 402 is specifically used to input the text feature vector and the label feature vector into a text classifier, and determine the probability that the text to be classified belongs to the label through the text classifier.

[0086] Furthermore, the device also includes a text classifier obtaining unit 405; the text classifier obtaining unit 405 is used to construct a sample, wherein the sample includes a positive sample and a negative sample; for any sample, a second text feature vector of the text in the sample and a second label feature vector of the label in the sample are determined; the second text feature vector and the second label vector are input into an initial model, and reverse training is performed according to the output of the initial model and the sample identifier of the sample until the text classifier is obtained; the sample identifier is used to indicate whether the text sample is a positive sample or a negative sample.

[0087] Further, for the device, the text classifier obtains unit 405, which is also used to determine a second label similar to the first label of the positive sample; wherein the distance between the network relationship feature vector of the first label and the network relationship feature vector of the second label is less than a set distance; and the text of the positive sample and the second label are constructed as a negative sample.

[0088] Furthermore, for the device, the text classifier obtaining unit 405 is also used to randomly determine a third label from the preset label set, where the third label is different from the first label of the positive sample; and construct the text of the positive sample and the third label as a negative sample.

[0089] Furthermore, for the device, the descriptive feature vector of the tag is obtained by crawling the descriptive information of the tag from the network.

[0090] The embodiment of the present application provides a computing device, which may be a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (PDA), etc. The computing device may include a central processing unit (CPU), a memory, an input / output device, etc. The input device may include a keyboard, a mouse, a touch screen, etc. The output device may include a display device, such as a liquid crystal display (LCD), a cathode ray tube (CRT), etc.

[0091] The memory may include a read-only memory (ROM) and a random access memory (RAM), and provides the processor with program instructions and data stored in the memory. In an embodiment of the present application, the memory may be used to store program instructions for a method of determining a text label;

[0092] The processor is used to call the program instructions stored in the memory and execute the method for determining the text label according to the obtained program.

[0093] like Figure 5 FIG. 1 is a schematic diagram of a computing device provided in an embodiment of the present application, wherein the computing device includes:

[0094] Processor 501, memory 502, transceiver 503, bus interface 504; wherein the processor 501, memory 502 and transceiver 503 are connected via a bus 505;

[0095] The processor 501 is configured to read the program in the memory 502 and execute the above method for determining the text label;

[0096] The processor 501 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and a NP. It may also be a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0097] The memory 502 is used to store one or more executable programs and can store data used by the processor 501 when performing operations.

[0098] Specifically, the program may include program code, and the program code includes computer operation instructions. The memory 502 may include volatile memory, such as random-access memory (RAM); the memory 502 may also include non-volatile memory, such as flash memory, hard disk drive (HDD) or solid-state drive (SSD); the memory 502 may also include a combination of the above-mentioned types of memory.

[0099] The memory 502 stores the following elements, executable modules or data structures, or a subset thereof, or an extended set thereof:

[0100] Operation instructions: include various operation instructions, used to implement various operations.

[0101] Operating system: includes various system programs used to implement various basic businesses and handle hardware-based tasks.

[0102] The bus 505 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0103] The bus interface 504 may be a wired communication access port, a wireless bus interface or a combination thereof, wherein the wired bus interface may be, for example, an Ethernet interface. The Ethernet interface may be an optical interface, an electrical interface or a combination thereof. The wireless bus interface may be a WLAN interface.

[0104] An embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute a method for determining a text label.

[0105] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0106] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0107] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0108] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0109] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0110] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for determining a text label, characterized in that: include: Determine the text feature vector of the text to be classified; For any label in the preset label set, determine the label feature vector of the label; input the text feature vector and the label feature vector into a text classifier, and determine the probability that the text to be classified belongs to the label through the text classifier; the label feature vector includes a description feature vector of the label and a network relationship feature vector of the label in the preset label set; Determine the label whose probability meets the preset condition as the label of the text to be classified; The text classifier is trained in the following way: Constructing a sample, wherein the sample includes a positive sample and a negative sample; For any sample, determine a second text feature vector of the text in the sample and a second label feature vector of the label in the sample; input the second text feature vector and the second label vector into an initial model, and perform reverse training according to the output of the initial model and the sample identifier of the sample until the text classifier is obtained; the sample identifier is used to indicate whether the text sample is a positive sample or a negative sample; The network relationship feature vector of the tag in the preset tag set is determined in the following manner, including: Constructing a network relationship diagram of each tag in the preset tag set; in the network relationship diagram, each tag is a node, and the logical relationship between tags is an edge; the logical relationship is that the current node has a node at the next level; Through the network relationship graph, each label is mapped to an N-dimensional space to obtain an N-dimensional network relationship feature vector of each label; wherein, in the N-dimensional space, labels with closer distances have higher similarities.

2. The method according to claim 1, characterized in that Similar negative samples in negative samples are obtained by the following methods, including: Determine a second label that is similar to the first label of the positive sample; wherein the distance between the network relationship feature vector of the first label and the network relationship feature vector of the second label is less than a set distance; The text of the positive sample and the second label are constructed as a negative sample.

3. The method according to claim 1, characterized in that The random negative samples in the negative samples are obtained by the following methods, including: Randomly determine a third label from the preset label set, where the third label is different from the first label of the positive sample; The text of the positive sample and the third label are constructed as a negative sample.

4. The method according to any one of claims 1 to 3, characterized in that: The descriptive feature vector of the tag is obtained by crawling the descriptive information of the tag from the network.

5. A device for determining a text label, characterized in that: include: A text feature vector determination unit, used to determine the text feature vector of the text to be classified; The text label probability determination unit is used to determine the label feature vector of any label in the preset label set; input the text feature vector and the label feature vector into a text classifier, and determine the probability that the text to be classified belongs to the label through the text classifier; the label feature vector includes a description feature vector of the label and a network relationship feature vector of the label in the preset label set; The text classifier is trained in the following way: Constructing a sample, wherein the sample includes a positive sample and a negative sample; For any sample, determine a second text feature vector of the text in the sample and a second label feature vector of the label in the sample; input the second text feature vector and the second label vector into an initial model, and perform reverse training according to the output of the initial model and the sample identifier of the sample until the text classifier is obtained; the sample identifier is used to indicate whether the text sample is a positive sample or a negative sample; A text label determination unit, used to determine a label whose probability meets a preset condition as a label of the text to be classified; The label probability determination unit of the text is also used to construct a network relationship diagram of each label in the preset label set; in the network relationship diagram, each label is a node, and the logical relationship between labels is an edge; the logical relationship is that the current node has a node at the next level; through the network relationship diagram, each label is mapped to an N-dimensional space to obtain an N-dimensional network relationship feature vector of each label; wherein, the closer the distance in the N-dimensional space, the higher the similarity of labels.

6. The device according to claim 5, characterized in that Similar negative samples in negative samples are obtained by the following methods, including: Determine a second label that is similar to the first label of the positive sample; wherein the distance between the network relationship feature vector of the first label and the network relationship feature vector of the second label is less than a set distance; The text of the positive sample and the second label are constructed as a negative sample.

7. A computer device, characterized in that: include: Memory for storing computer programs; A processor, configured to call a computer program stored in the memory, and execute the method according to any one of claims 1 to 4 according to the obtained program.

8. A computer-readable storage medium, characterized in that: The storage medium stores a program, and when the program is run on a computer, the computer is enabled to implement the method according to any one of claims 1 to 4.