Element text processing method and device, electronic equipment and storage medium
By combining a joint summarization model and deep learning technology, the problem of weak readability in existing technologies is solved, and text summaries that match the target element type are generated with high controllability and accuracy.
Patent Information
- Application Number
- CN202110476637.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-29
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2041-04-29
AI Technical Summary
Existing technologies cannot generate highly readable text summaries based on a given element type.
A joint summarization model is adopted, which extracts vector features of feature type and descriptive information, and uses a deep learning model to train and generate text summaries that match the target feature type. This includes combined training of the first and second models, using a vocabulary mapping table and embedding matrix to enhance feature extraction, and combining an RNN encoder and decoder to improve the accuracy of relevance calculation.
The generated text summaries are highly readable, conform to human language habits, and match the target element types, exhibiting high controllability and accuracy.
Smart Images

Figure CN115269768B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, in particular to a factor text processing method and device, an electronic device and a storage medium. BACKGROUND
[0002] Text summarization technology can summarize multiple or single documents given, and generate concise text summaries as much as possible while ensuring that important content of the original document can be reflected. This technology is an important research topic in the fields of information retrieval and natural language processing.
[0003] In related technologies, it is not possible to generate a text summary with strong readability according to a given factor type. SUMMARY
[0004] The present application provides a method, device, equipment, storage medium and computer program product for factor text processing.
[0005] According to an aspect of the present application, a factor text processing method is provided, comprising:
[0006] obtaining multiple description information of a sample object and a sample summary marked with a factor type;
[0007] extracting factor vector features of the factor type and description vector features of each of the description information;
[0008] using the factor vector features and the description vector features as inputs of a joint summary model to be trained, using the sample summary as an output of the joint summary model, wherein the joint summary model comprises a first model and a second model, and a correlation degree between each of the description information output by the first model and the factor type is an input of the second model, and then training the joint summary model according to a classification loss value of the first model and a decoding loss value of the second model to process commodity description information of a target object and generate a commodity summary matching a target factor type.
[0009] According to another aspect of the present application, a factor text processing device is provided, comprising:
[0010] a first obtaining module configured to obtain multiple description information of a sample object and a sample summary marked with a factor type;
[0011] an extracting module configured to extract factor vector features of the factor type and description vector features of each of the description information;
[0012] The first processing module is configured to take the element vector feature and the description vector feature as inputs of a joint summary model to be trained, and take the sample summary as an output of the joint summary model, wherein the joint summary model comprises a first model and a second model, the correlation degree between each description information output by the first model and the element type is an input of the second model, and the joint summary model is trained according to a classification loss value of the first model and a decoding loss value of the second model, so as to process the product description information of the target object to generate a product summary matching the target element type.
[0013] According to a third aspect of the present application, an electronic device is provided, comprising:
[0014] at least one processor; and
[0015] a memory in communication with the at least one processor; wherein
[0016] the memory has instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the element text processing method according to the first aspect of the present application.
[0017] According to a fourth aspect of the present application, a non-transitory computer readable storage medium storing computer instructions is provided, wherein the computer instructions are used to make the computer execute the element text processing method according to the first aspect of the present application.
[0018] According to a fifth aspect of the present application, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the element text processing method according to the first aspect.
[0019] The above-mentioned technical solutions have at least the following beneficial technical effects:
[0020] The element text processing method generates text with strong readability, and can generate corresponding text summaries according to different element types.
[0021] It should be understood that the contents described in this part are not intended to identify the key or important features of the embodiments of the present application, nor to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0022] The accompanying drawings are used to better understand the present application, and do not limit the present application. Among them:
[0023] Figure 1 is a flowchart of the element text processing method according to the first embodiment of the present application;
[0024] Figure 2 is a flowchart of an element text processing method according to a second embodiment of the present application;
[0025] Figure 3 is a flowchart of an element text processing method according to a third embodiment of the present application;
[0026] Figure 4 is a comparison diagram of word overlap rate according to an embodiment of the present application;
[0027] Figure 5 is a structure diagram of a joint abstract model according to a fourth embodiment of the present application;
[0028] Figure 6 is a flowchart of an element text processing method according to a fourth embodiment of the present application;
[0029] Figure 7 is a structure block diagram of an element text processing apparatus according to an embodiment of the present application;
[0030] Figure 8 is a structure block diagram of an element text processing apparatus according to another embodiment of the present application;
[0031] Figure 9 is a structure block diagram of an element text processing apparatus according to yet another embodiment of the present application;
[0032] Figure 10 is a structure block diagram of an element text processing apparatus according to yet another embodiment of the present application;
[0033] Figure 11 is a block diagram of an electronic device for implementing an element text processing method according to an embodiment of the present application. DETAILED DESCRIPTION
[0034] Exemplary embodiments of the present application are described herein with reference to the accompanying drawings, which are meant to be exemplary and not limiting. Therefore, it should be recognized that many modifications and variations of the exemplary embodiments described herein can be made without departing from the scope and spirit of the application. Also, for the purpose of clarity and a concise description, descriptions of well-known functions and constructions can be omitted.
[0035] Figure 1 is a flowchart of an element text processing method according to a first embodiment of the present application.
[0036] As shown in Figure 1 , the element text processing method can include:
[0037] In step 101, a plurality of description information of a sample object is obtained, and a sample summary marked with an element type is obtained.
[0038] In some embodiments of the present application, when training the joint summary model, a plurality of description information of a sample object is obtained, and a sample summary marked with an element type is obtained. The sample object can be selected according to different application scenarios, which is not limited in the present application, for example, a commodity, a news event.
[0039] Generally, one sample object can correspond to at least one description information, and each description information can be composed of one or more sentences. The description information can describe the sample object from different element types, so that one description information has different relevance degrees with different element types. It can be understood that the language style of the description information is often descriptive rather than summary.
[0040] The method for obtaining the description information can be selected according to the specific application scenario, including but not limited to the following two methods:
[0041] Method one: the information related to the sample object is obtained from the webpage by using the crawler technology as the description information.
[0042] Method two: the information related to the sample object is manually extracted as the description information.
[0043] Unlike the description information, the sample summary corresponding to the sample object is often summary, and it can be understood that one sample object can correspond to multiple element types, and there can be different sample summaries for different element types. For example, when the sample object is an A mobile phone and the element type is appearance, the corresponding sample summary can be: adopting an integrated metal body, the touch is delicate, and the grip is comfortable; when the sample object is an A mobile phone and the element type is performance, the corresponding sample summary can be: adopting a chip, running smoothly without lag, and the performance is more powerful.
[0044] The method for marking the sample summary with the element type can be selected according to the specific application scenario, including but not limited to the following two methods:
[0045] Method one: the sample summary is marked into the corresponding element type by using the artificial marking method.
[0046] Method two: a plurality of sample summaries are clustered to mark the sample summary set belonging to different element types. It can be understood that after clustering, a plurality of sample summary sets can be obtained, and the sample summaries in each sample summary set can be understood as belonging to the same element type, and the sample summaries in the same set can be marked as the same element type. The clustering method used includes but is not limited to any one of the K-means method and the density-based clustering method.
[0047] In step 102, the element vector features of the element type and the description vector features of each description information are extracted.
[0048] It can be understood that the current element type and the description information are text information, and in some embodiments of the present application, the text information needs to be extracted. That is, the element vector features corresponding to the element type are extracted, and the description vector features corresponding to each description information are extracted. The extraction methods of the above two vector features can be the same or different.
[0049] Generally speaking, there can be various extraction methods of vector features, which can be selected according to specific application scenarios, including but not limited to any one of Bags of words, TF-IDF (term frequency–inverse document frequency).
[0050] In step 103, the element vector features and the description vector features are taken as inputs of a joint summary model to be trained, and the sample summary is taken as the output of the joint summary model, wherein the joint summary model includes a first model and a second model, and the relevance between each description information output by the first model and the element type is the input of the second model, and then the joint summary model is trained according to the classification loss value of the first model and the decoding loss value of the second model, so as to process the description information of the target object to generate a product summary matching the target element type.
[0051] It can be understood that the trained joint summary model can output a sample summary according to the input element vector features and the object description vector features. Wherein the element type corresponding to the input element vector can be referred to as the target element type; the object can be referred to as the target object; the output sample summary can be referred to as the product summary.
[0052] The joint abstract model can include a first model and a second model. In some embodiments of the present application, the first model can be a deep learning model, which can be composed of at least one neural network model. Different structures of deep learning models can be selected as the first model according to different application scenarios, which are not limited in the present application, for example, a recurrent neural network model, a convolutional neural network model. There are many training methods for the first model, for example, the description vector feature and the element vector feature can be taken as input, the correlation between the description information corresponding to the description vector feature and the element vector feature corresponding to the element vector feature can be taken as output, and a corresponding classification loss function can be set to train the first model, which includes but is not limited to any one of a negative log-likelihood loss function, a binary cross-entropy loss function. The trained first model can output the correlation between each description information and the element type.
[0053] The second model can be a deep learning model, which can be composed of at least one neural network model. Different structures of deep learning models can be selected as the second model according to different application scenarios, which are not limited in the present application, for example, a sequence-to-sequence model, a convolutional neural network model. The input of the second model includes the correlation between each description information and the element type output by the first model. The input of the second model can also include the vector generated by the element vector and the description vector. There are many training methods for the second model, for example, the vector generated by the element vector and the description vector can be taken as input, and the text abstract matching the target element type can be taken as output, and a corresponding decoding loss function can be set to train the second model, which includes but is not limited to any one of a mean square error loss function, a mean absolute error loss function. The trained second model can output the text abstract matching the target element type.
[0054] As described above, the joint abstract model includes a first model and a second model. Therefore, the input, output and training process of the first model and the second model are the input, output and training process of the joint abstract model. It can be understood that the element vector feature and the description vector feature can be taken as the input of the joint abstract model to be trained, and the sample abstract can be taken as the output of the joint abstract model, and the joint abstract model can be trained according to the classification loss value corresponding to the classification loss function of the first model and the decoding loss value corresponding to the decoding loss function of the second model.
[0055] According to the element text processing method in the embodiment of the present application, the element type and the corresponding element vector feature are obtained, and the description information and the corresponding description vector feature are obtained. The two kinds of vector features are taken as the input of the joint summary model, the sample summary is taken as the output of the joint summary model, and the joint summary model is trained. The trained joint summary model can process the description information to generate a text summary.
[0056] The method has strong controllability, can set different levels of target element types according to different application scenarios, control the model to generate different text summaries according to different target element types, and generate text summaries that match the target element types. Moreover, since the method is based on a generative summary technology rather than an extractive summary technology, the generated text summaries have strong readability and conform to human language habits.
[0057] In the second embodiment of the present application, based on the above-mentioned embodiment, in order to obtain more accurate vector features, a vocabulary mapping table and an embedding matrix can be used. Optionally, step 102 can be steps 201-202.
[0058] The vocabulary mapping table and the embedding matrix can be obtained by Figure 2 More specifically, Figure 2 is a flowchart of an element text processing method according to the second embodiment of the present application, comprising:
[0059] In step 201, the element type and the string of each description information are converted according to a preset vocabulary mapping table to obtain the corresponding element type digital number and description information digital number.
[0060] In some embodiments of the present application, there can be a vocabulary mapping table that can convert words into corresponding digital numbers.
[0061] Generally, a description information is composed of a string, and the description information can be processed by word segmentation to obtain a plurality of words corresponding to each description information. According to the vocabulary mapping table, each word in each description information can be converted into a corresponding description information digital number; similarly, according to the vocabulary mapping table, the element type can be converted into a corresponding element type digital number.
[0062] In step 202, the element type digital number and the description information digital number are processed according to a preset embedding matrix to generate element vector features and description vector features of each description information.
[0063] In some embodiments of the present application, a preset embedding matrix can be provided, and corresponding elements can be selected from the embedding matrix according to the element type digital number and the description information digital number, so as to generate corresponding vector features. It can be understood that the vector features generated according to the element type digital number are element vector features, and the vector features generated according to the description information digital number are description vector features.
[0064] It can be understood that the preset matrix can also be multiple, and an element embedding matrix and a description embedding matrix can be preset. Corresponding element vector features can be generated from the element embedding matrix according to the element type digital number, and corresponding description vector features can be generated from the description embedding matrix according to the description information digital number.
[0065] According to the element text processing method of the embodiments of the present application, more accurate and reliable feature vectors are obtained by using the vocabulary mapping table and the embedding matrix, which can make the correlation calculation between the description information and the element type more accurate. The finally generated text summary is more closely related to the target element type and has stronger controllability.
[0066] In the third embodiment of the present application, based on the above-mentioned embodiments, in order to make the correlation between the description information and the element type more accurate, RNN (Recurrent Neural Network, recurrent neural network) word-level encoders, RNN sentence-level encoders and classifiers are designed in the first model; in order to make the text summary more accurate, RNN encoders and RNN decoders are designed in the second model. Optionally, the data processing process of the first model is steps 301-303, and the data processing process of the second model is step 304.
[0067] The above-mentioned steps can be implemented by Figure 3 More specifically, Figure 3 is a flowchart of the element text processing method according to the third embodiment of the present application, which includes:
[0068] In step 301, the description vector features of each description information are input into the RNN word-level encoder for encoding processing, and the average of the hidden vectors of each word encoding is taken as the vector representation of each description information.
[0069] It can be understood that one description information can correspond to multiple words after being processed by word segmentation. Each word can have corresponding description vector features. In some embodiments of the present application, the description vector features of each description information can be input into the RNN word-level encoder, wherein the structure of the RNN word-level encoder can be designed according to the application scenario, and the present embodiment does not make any limitation, for example, it can be a unit including one or more recurrent neurons.
[0070] After the RNN word-level encoder, the hidden vector corresponding to the vector feature of the description information is obtained. The hidden vector is: the hidden vector obtained after processing the words corresponding to the description information. The hidden vectors belonging to the same description information are averaged to obtain the vector representation corresponding to the current description information. Similarly, the vector representation corresponding to each description information can be obtained.
[0071] In step 302, the vector representation of each description information is input into the RNN sentence-level encoder for encoding processing to compress the sentence-level feature numerical vector of each description information.
[0072] In some embodiments of the present application, the vector representation corresponding to each description information can be input into the RNN sentence-level encoder, and the RNN sentence-level encoder can compress the vector representation to obtain a numerical vector with a fixed dimension, which is the sentence-level feature numerical vector. It can be understood that each description information corresponds to a sentence-level feature numerical vector.
[0073] The structure of the RNN sentence-level encoder can be designed according to the application scenario, and the present embodiment does not limit it, for example: it can be a unit including one or more recurrent neurons.
[0074] In step 303, the sentence-level feature numerical vector and the element vector feature are input into the classifier to obtain the relevance between each description information and the element type through the classification matrix.
[0075] In some embodiments of the present application, there can be a classifier, and the input of the classifier is the sentence-level feature numerical vector and the element vector feature. In the classification model, there can also be a classification matrix, and the element vector feature and each sentence-level feature numerical vector can be combined respectively and through the same classification matrix. The elements of the classification matrix can be some preset parameters.
[0076] The output of the classification matrix can be obtained through the Sigmoid function to obtain the relevance, and the relevance value range is 0-1. The size of the relevance represents the relevance degree of each description information and the current element type. The more relevant the description information and the element type are, the closer the relevance is to 1, and vice versa, the relevance is close to 0.
[0077] In some embodiments of the present application, based on the above embodiments, the calculation of the classification loss can also be performed. The above embodiments can also include steps 1-3:
[0078] In step 1, the word overlap rate between each description information and the sample summary is calculated.
[0079] In some embodiments of the present application, the number of overlapping words between each description information and the sample summary can be calculated, and the number of overlapping words is divided by the total number of words in the description information, that is, the word overlap rate between the description information and the sample information can be obtained.
[0080] As Figure 4 shown, Figure 4 is a word overlap rate comparison diagram according to an embodiment of the present application.
[0081] The sample object is a mobile phone A, and the sample abstract and the plurality of description information are as shown in Figure 4 From the figure, it can be seen that the element type of the sample abstract is performance; the element types of the plurality of description information include photographing and performance. The word overlap rates of sentences 1-5 are 0.4, 0, 0, 0.4, and 0.125, respectively.
[0082] Step two, compare the word overlap rate with the preset overlap rate threshold to generate a label matrix representing the relevance between the description information and the abstract.
[0083] In some embodiments of the present application, the overlap rate threshold can be preset, which can be compared with the word overlap rate. The description information greater than or equal to the overlap rate threshold can be assigned a classification label "1", and the description information less than the threshold can be assigned a classification label "0". The classification label represents the relevance between the description information and the abstract, which can be used in the classification matrix in step 303. The classification label can be referred to as a label matrix.
[0084] As Figure 4 shown, when the overlap rate threshold is 0.35, the classification labels assigned to sentences 1-5 are 1, 0, 0, 1, and 0, respectively.
[0085] Step three, generate a classification loss value of the first model according to the label matrix.
[0086] It can be understood that the classification loss value of the first model can be generated according to the label matrix, and model learning can be performed through gradient back propagation.
[0087] Through steps one to three, the relevance between the description information and the abstract can be accurately and quickly obtained, and a label matrix can be generated. The classification loss value of the first model generated through the label matrix can make the relevance generated by the first model more accurate.
[0088] Step 304, add the element vector feature and the description vector feature to obtain a merged vector feature, input the merged vector feature to an RNN encoder for processing, and input the processing result to an RNN decoder, wherein the relevance between each description information output by the first model and the element type is the input of the RNN decoder.
[0089] In some embodiments of the present application, the element vector feature and the description vector feature can be added to obtain a merged vector feature, and the merged vector feature can be input to an RNN encoder for processing. The RNN encoder encodes to obtain a vector feature corresponding to the description information.
[0090] The processing result of the RNN encoder is input to an RNN decoder, which inputs three parameters at each decoding time step, namely, the hidden state of the previous time step, the corresponding embedding vector of the decoding output, and the context vector. The RNN decoder generates the hidden state feature of the current time step at each decoding time step, which is used to calculate the word-level attention weight with each output of the RNN encoder.
[0091] The input of the RNN decoder further includes the relevance between each description information output by the first model and the element type, which is used as the sentence-level weight of the description information, multiplied by the word-level attention weight of each word corresponding to the description information and then normalized, i.e., the sentence-level attention is distributed to the corresponding word-level attention to generate updated word-level attention. Thus, the weight of the word in the sentence with high relevance to the element type is increased, and the weight of the word in the sentence with low relevance to the element type is decreased.
[0092] The updated word-level attention and the encoding output of the RNN encoder are weighted and summed to obtain a context vector with a fixed dimension, which is used as one of the inputs of the RNN decoder to make the RNN decoder generate a product description output consistent with the current element type.
[0093] The structure of the RNN encoder and the RNN decoder can be designed according to the application scenario, and the present embodiment is not limited, for example, one or more recurrent neurons can be included.
[0094] In some embodiments of the present application, the structure of the joint summary model can be as shown in Figure 5 is a structure diagram of a joint summary model according to the fourth embodiment of the present application. Figure 5 In the present embodiment, the description information and the element information are processed by the embedding matrix to obtain corresponding description vector features and element vector features, respectively. The joint summary model includes a first model and a second model.
[0095] In the first model, the description vector features are processed by the RNN word-level encoder to obtain the hidden vector of each word encoding, and the average value of the hidden vector corresponding to each word in each description information is obtained to obtain the vector representation of each description information. The vector representation is input to the RNN sentence-level encoder for encoding processing to compress the sentence-level feature numerical vector of each description information. The sentence-level feature numerical vector, the element vector feature, and the label matrix are input to the classifier to obtain the relevance between each description information and the element type.
[0096]
[0097] In the second model, the element vector features and the description vector features are added to obtain a combined vector feature, which is input to an RNN encoder for processing. The processing result and the relevance degree obtained by the first model are input to an RNN decoder to obtain a sample summary.
[0098] According to the element text processing method, in the first model, the RNN word-level encoder further enriches the semantic representation of each word on the basis of the description vector features. The RNN sentence-level encoder strengthens the information interaction and feature modeling between words and sentences, so that the model learns rich feature representations.
[0099] In the second model, the element vector features and the description vector features are added to enhance the relevance of the words in each description information and the element features. By inputting the relevance degree generated by the first model, the weight of the words in the sentence with high relevance to the element category is increased, and the weight of the words in the sentence with low relevance to the element category is reduced. At the same time, the controllability of the model is also increased.
[0100] In the fourth embodiment of the present application, based on the above embodiments, the joint summary model can be used to process the description information of a commodity, so as to obtain a corresponding commodity summary. Optionally, the specific implementation manner of processing the description information of a target object to generate a commodity summary matching a target element type can include steps 601-603.
[0101] The joint summary model can be trained by Figure 6 The above is a more detailed description of the present application. Figure 6 is a flowchart of an element text processing method according to the fourth embodiment of the present application, which includes:
[0102] Step 601: receiving the description information of a target object.
[0103] It can be understood that after the joint summary model is trained, according to the element text processing method of the present application, the corresponding commodity summary can be output for the input commodity description information and the target element type.
[0104] In some embodiments of the present application, the target object includes but is not limited to a mobile phone, a computer, and the like. The commodity has relatively detailed description information, which usually includes descriptions of multiple element types.
[0105] Step 602: obtaining at least one target element type.
[0106] In some embodiments of the present application, a target element type can be preset, and the target element type is the element type corresponding to the commodity summary.
[0107] In step 603, the commodity description information and the at least one target element type are input into the trained joint summary model to obtain a commodity summary corresponding to each target element type.
[0108] In some embodiments of the present application, the commodity description information and the at least one target element type are input into the trained joint summary model, and the joint summary model can output a commodity summary corresponding to each target element type.
[0109] According to the element text processing method, the commodity summary related to the target element type and having strong readability can be quickly and efficiently generated according to the obtained commodity description information and target element type of the target object.
[0110] According to the embodiments of the present application, the present application further provides an element text processing device.
[0111] Figure 7 is a structural block diagram of an element text processing device according to an embodiment of the present application. As shown in Figure 7 The element text processing device 700 can include a first acquisition module 710, an extraction module 720, and a first processing module 730.
[0112] The first acquisition module 710 is configured to acquire a plurality of description information of a sample object and a sample summary marked with an element type.
[0113] The extraction module 720 is configured to extract an element vector feature of the element type and a description vector feature of each description information.
[0114] The first processing module 730 is configured to use the element vector feature and the description vector feature as input of a joint summary model to be trained, and use the sample summary as output of the joint summary model, wherein the joint summary model includes a first model and a second model, and a correlation between each description information output by the first model and the element type is input of the second model, and the joint summary model is further trained according to a classification loss value of the first model and a decoding loss value of the second model to process commodity description information of a target object to generate a commodity summary matching a target element type.
[0115] In some embodiments of the present application, as shown in Figure 8 Figure 8 is a structural block diagram of an element text processing device according to another embodiment of the present application. In the element text processing device 800, the first processing module 830 includes an RNN word-level encoder 831, an RNN sentence-level encoder 832, and a classifier 833.
[0116] The description vector features of each description information are input into the RNN word-level encoder for encoding processing. The hidden vector of each word is obtained and averaged to serve as the vector representation of each description information.
[0117] The vector representation of each descriptive information is input into the RNN sentence-level encoder for encoding processing, and the sentence-level feature value vector of each descriptive information is obtained by compression.
[0118] The sentence-level feature numerical vector and feature vector feature are input into the classifier, and the correlation between each descriptive information and the feature type is obtained through the classification matrix.
[0119] in, Figure 8 810, 820 and Figure 7 The 710 and 720 have the same function and structure.
[0120] In some embodiments of this application, such as Figure 9 As shown, Figure 9 This is a structural block diagram of an element text processing apparatus according to another embodiment of this application. In this element text processing apparatus 900, the first processing module 930 further includes: an RNN encoder 934 and an RNN decoder 935, wherein:
[0121] The feature vector features and description vector features are added together to obtain the merged vector features. The merged vector features are then input into the RNN encoder for processing, and the processing result is input into the RNN decoder. The correlation between each description information output by the classifier and the feature type is the input of the RNN decoder.
[0122] in, Figure 9 910, 920 and Figure 8 810, 820 Figure 9 931-933 and Figure 8 The 831-833 series have the same function and structure.
[0123] In some embodiments of this application, such as Figure 10 As shown, Figure 10 This is a structural block diagram of an element text processing apparatus 1000 according to another embodiment of the present application. The element text processing apparatus 1000 further includes: a calculation module 1040, a first generation module 1050, and a second generation module 1060, wherein:
[0124] Calculation module 1040 is used to calculate the word overlap rate between each descriptive information and the sample summary;
[0125] The first generation module 1050 is used to compare the word overlap rate with a preset overlap rate threshold to generate a tag matrix representing the relevance between the descriptive information and the summary.
[0126] The second generation module 1060 is used to generate the classification loss value of the first model based on the label matrix.
[0127] in, Figure 10 Medium 1010-1030 and Figure 9 The Chinese 910-930 have the same function and structure.
[0128] In some embodiments of this application, the specific implementation process of the first processing module 730 in generating a product summary matching the target element type by processing the product description information of the target object can be as follows: receiving the product description information of the target object; obtaining at least one preset target element type; inputting the product description information and at least one target element type into the trained joint summary model to obtain a product summary corresponding to each target element type.
[0129] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0130] According to embodiments of this application, this application also provides an electronic device, a readable storage medium, and a computer program product.
[0131] Figure 11 A schematic block diagram of an example electronic device 1100 that can be used to implement embodiments of this application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein.
[0132] like Figure 11 As shown, device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1102 or a computer program loaded from storage unit 1108 into random access memory (RAM) 1103. The RAM 1103 may also store various programs and data required for the operation of device 1100. The computing unit 1101, ROM 1102, and RAM 1103 are interconnected via bus 1104. Input / output (I / O) interface 1105 is also connected to bus 1104.
[0133] A plurality of components in the device 1100 are connected to the I / O interface 1105, including: an input unit 1106, such as a keyboard, a mouse, etc.; an output unit 1107, such as various types of displays, speakers, etc.; a storage unit 1108, such as a magnetic disk, an optical disk, etc.; and a communication unit 1109, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1109 allows the device 1100 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0134] The computing unit 1101 can be various general and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 1101 performs various methods and processes described above, such as the element text processing method. For example, in some embodiments, the element text processing method can be implemented as a computer software program, which is tangibly embodied in a machine-readable medium, such as the storage unit 1108. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 1100 via the ROM 1102 and / or the communication unit 1109. When the computer program is loaded onto the RAM 1103 and executed by the computing unit 1101, one or more steps of the element text processing method described above can be performed. Alternatively, in other embodiments, the computing unit 1101 can be configured to perform the element text processing method by any other appropriate means, such as by means of firmware.
[0135] Various implementations of the systems and techniques described above herein can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0136] Program code for carrying out methods of the present application can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces a means for implementing the functions / acts specified in the flowcharts and / or block diagrams. The program code can be retrieved from a machine-readable medium or device and executed by a processor to produce a machine for implementing the functions / acts specified in the flowcharts and / or block diagrams. The program code can be executed as a stand-alone program, or in combination with other program codes, on the machine to produce a machine that implements the functions / acts specified in the flowcharts and / or block diagrams.
[0137] In the context of the present application, a machine-readable medium can be a tangible medium that can contain or store program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable storage media can include, without limitation, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media can include, but are not limited to, an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0138] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0139] The systems and techniques described herein can be implemented in a computing system that includes a back end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front end component, e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described herein, or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0140] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service ("Virtual Private Server", or simply "VPS"). The server can also be a server of a distributed system, or a server combined with a blockchain.
[0141] According to the element text processing method provided in the embodiments of the present application, the element type and the corresponding element vector feature are obtained, and the description information and the corresponding description vector feature are obtained. The above two kinds of vector features are taken as the input of the joint summary model, the sample summary is taken as the output of the joint summary model, and the joint summary model is trained. The trained joint summary model can process the description information to generate a text summary.
[0142] The method has strong controllability, and different levels of target element types can be set according to different application scenarios. Different text summaries can be generated by controlling the model according to different target element types, and the generated text summaries match the target element types. Moreover, since the method is based on generative summary technology rather than extractive summary technology, the generated text summaries have strong readability and conform to human language habits.
[0143] The use of the vocabulary mapping table and the embedding matrix obtains more accurate and reliable feature vectors, which can make the correlation calculation of the description information and the element type more accurate. The relationship between the finally generated text summary and the target element type is closer, and the controllability is stronger.
[0144] In the first model, the semantic representation of each word is further enriched on the basis of the description vector features through the RNN word-level encoding layer. Through the RNN sentence-level encoding layer, the information interaction and feature modeling of words, sentences and between sentences are strengthened, so that the model learns rich feature representation.
[0145] In the second model, the relevance of the words in each description information and the element features is enhanced by adding the element vector features and the description vector features. Through the relevance generated by the first model, the weight of the words in the sentence with high relevance to the element category is increased; the weight of the words in the sentence with low relevance to the element category is reduced. At the same time, the controllability of the model is also increased.
[0146] According to the element text processing method, the product abstract related to the target element type and with strong readability can be quickly and efficiently generated according to the obtained product description information of the target object and the target element type.
[0147] It should be understood that the steps can be reordered, added or deleted using various forms of the flow shown above. For example, the steps described in the present disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, which is not limited herein.
[0148] The specific embodiments described above do not constitute a limitation on the scope of protection of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. An element text processing method characterized by comprising: The method comprises: obtaining a plurality of description information of a sample object, and a sample abstract marked with an element type; extracting element vector features of the element type and description vector features of each of the description information; using the element vector features and the description vector features as inputs of a joint abstract model to be trained, and using the sample abstract as an output of the joint abstract model, wherein the joint abstract model comprises a first model and a second model, and a correlation degree between each of the description information output by the first model and the element type is an input of the second model, and the joint abstract model is further trained according to a classification loss value of the first model and a decoding loss value of the second model to process commodity description information of a target object to generate a commodity abstract matching a target element type; wherein the first model comprises an RNN word-level encoder, an RNN sentence-level encoder and a classifier, wherein the description vector features of each of the description information are input into the RNN word-level encoder for encoding processing to obtain an average of hidden vectors of each word encoding as a vector representation of each description information; the vector representation of each of the description information is input into the RNN sentence-level encoder for encoding processing to compress a sentence-level feature numerical vector of each of the description information; the sentence-level feature numerical vector and the element vector features are input into the classifier to obtain the correlation degree between each of the description information and the element type through a classification matrix.
2. The method of claim 1, wherein, The sample abstract marked with the element type comprises: performing clustering processing on a plurality of sample abstracts to mark sample abstract sets belonging to different element types.
3. The method of claim 1, wherein, The extraction of the element vector features of the element type and the description vector features of each of the description information comprises: converting strings of the element type and each of the description information according to a preset vocabulary mapping table to obtain corresponding element type digital numbers and description information digital numbers; processing the element type digital numbers and the description information digital numbers according to a preset embedding matrix to generate the element vector features and the description vector features of each of the description information.
4. The method of claim 3, wherein, The second model comprises an RNN encoder and an RNN decoder, wherein the element vector features and the description vector features are added to obtain a merged vector feature, the merged vector feature is input into the RNN encoder for processing, and the processing result is input into the RNN decoder, wherein the correlation degree between each of the description information output by the first model and the element type is an input of the RNN decoder.
5. The method of claim 1, wherein, Further comprising: calculating a word overlap rate between each of the description information and the sample abstract; comparing the word overlap rate with a preset overlap rate threshold to generate a label matrix representing a correlation between the description information and the abstract; generating a classification loss value of the first model according to the label matrix.
6. The method of any one of claims 1-5, wherein, The processing of the commodity description information of the target object to generate the commodity abstract matching the target element type comprises: receiving commodity description information of a target object; obtaining at least one target element type; Input the commodity description information and the at least one target element type into a trained joint summary model to obtain a commodity summary corresponding to each target element type.
7. An element text processing apparatus characterized by comprising: The device comprises: A first obtaining module is configured to obtain a plurality of description information of a sample object and a sample summary marked with an element type; An extraction module is configured to extract an element vector feature of the element type and a description vector feature of each description information; A first processing module is configured to use the element vector feature and the description vector feature as input of a trained joint summary model and use the sample summary as output of the joint summary model, wherein the joint summary model comprises a first model and a second model, and a relevance between each description information output by the first model and the element type is input of the second model, and the joint summary model is further trained according to a classification loss value of the first model and a decoding loss value of the second model to process commodity description information of a target object to generate a commodity summary matching a target element type; The first processing module comprises an RNN word-level encoder, an RNN sentence-level encoder and a classifier, wherein The description vector feature of each description information is input into the RNN word-level encoder for encoding processing to obtain an average of hidden vectors of each word coding as a vector representation of each description information; The vector representation of each description information is input into the RNN sentence-level encoder for encoding processing to compress a sentence-level feature numerical vector of each description information; The sentence-level feature numerical vector and the element vector feature are input into the classifier to obtain a relevance between each description information and the element type through a classification matrix.
8. The apparatus of claim 7, wherein, The first obtaining module is configured to: Cluster a plurality of sample summaries to mark a sample summary set belonging to different element types.
9. The apparatus of claim 7, wherein, The extraction module is configured to: Convert a string of the element type and each description information according to a preset vocabulary mapping table to obtain a corresponding element type digital number and a description information digital number; Process the element type digital number and the description information digital number according to a preset embedding matrix to generate an element vector feature and a description vector feature of each description information.
10. The apparatus of claim 7, wherein, The first processing module further comprises an RNN encoder and an RNN decoder, wherein The element vector feature and the description vector feature are added to obtain a merged vector feature, the merged vector feature is input into the RNN encoder for processing, and a processing result is input into the RNN decoder, wherein a relevance between each description information output by the classifier and the element type is input of the RNN decoder.
11. The apparatus of claim 7, wherein, Further comprising: A calculation module is configured to calculate a word overlap rate between each description information and the sample summary; A first generation module is configured to compare the word overlap rate with a preset overlap rate threshold to generate a label matrix representing a relevance between description information and a summary; A second generation module is configured to generate a classification loss value of the first model according to the label matrix.
12. The apparatus of any one of claims 7-11, wherein, The first processing module is specifically configured to: receive commodity description information of a target object; obtain at least one target element type of a preset; input the commodity description information and the at least one target element type into a trained joint summary model to obtain a commodity summary corresponding to each target element type. 13.An electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
14. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method of any one of claims 1-6. 15.A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1-6.
Citation Information
Patent Citations
Method and system for automatically abstracting pictures and texts from commodity-related network article
CN106294425A
Abstraction generation method and device, electronic equipment and storage medium
CN111400454A