Keyword extraction model training method and device, equipment, medium and program product

CN116663541BActive Publication Date: 2026-08-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210142036.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-16
Publication Date
2026-08-21
Estimated Expiration
2042-02-16

AI Technical Summary

Technical Problem

[0004]然而,视频相关文本信息的概括性较强,会存在很多的概念词,基于文本挖掘的关键词提取模型在进行视频相关文本信息的关键词提取时会有严重的数据噪声问题,会导致最后获取的关键词不全,且获取的关键词与内容的相关率较低

Benefits of technology

[0053]通过优化对比损失和分类损失的联合损失对关键词提取模型进行训练,为训练模型提供了更多的监督信号,其中,通过在样本内容的特征提取过程中引入对比损失,最大化样本内容中每个词汇与整个样本内容的互信息,从而减少了样本内容中数据噪声的影响,最终提高模型提取的关键词和样本内容的相关率,提高模型提取的关键词的可外显率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116663541B_ABST
    Figure CN116663541B_ABST
Patent Text Reader

Abstract

The application discloses a keyword extraction model training method and device, equipment, medium and program product, and relates to the field of machine learning. The method comprises the following steps: obtaining sample content, extracting a sample feature representation of the sample content by using a keyword extraction model, wherein the sample feature representation comprises a text feature representation corresponding to text data; generating a pollution feature representation based on the text feature representation; obtaining a contrast loss; obtaining a classification loss based on the sample feature representation; training the keyword extraction model by combining the contrast loss and the classification loss; and obtaining a target extraction model. The keyword extraction model is trained by optimizing the joint loss of the contrast loss and the classification loss, more supervision signals are provided for the training model, and the correlation rate of the extracted keywords and the sample content is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of machine learning, and in particular to a keyword extraction model training method, apparatus, device, medium, and program product. Background Technology

[0002] With the development of multimedia and network technologies, the types and quantity of content are constantly increasing. To attract users, more content is being presented in video format. To accurately deliver these videos to target users, it is necessary to accurately understand and extract the specific content of the videos to obtain keywords that represent the video's theme.

[0003] In related technologies, keyword extraction models based on text mining are often used to analyze relevant text information of videos (such as video titles and video descriptions) and extract keywords related to the video content from the relevant text information.

[0004] However, video-related text information is highly generalized and contains many conceptual terms. Keyword extraction models based on text mining suffer from severe data noise when extracting keywords from video-related text information, resulting in incomplete keyword acquisition and low relevance between the acquired keywords and the content. Summary of the Invention

[0005] This application provides a keyword extraction model training method, apparatus, device, medium, and program product, which can improve the correlation rate between keywords and sample content. The technical solution is as follows:

[0006] On the one hand, a keyword extraction model training method is provided, the method comprising:

[0007] Obtain sample content, which includes text data, and use the sample content to train the keyword extraction model;

[0008] The keyword extraction model extracts sample feature representations of the sample content, including text feature representations corresponding to the text data.

[0009] Based on the text feature representation, a contamination feature representation is generated, and a contrastive loss is obtained. The contrastive loss is used to characterize the difference between the text feature representation and the contamination feature representation.

[0010] The classification loss is obtained based on the sample feature representation, and the classification loss is used to characterize the accuracy of the keyword classification result corresponding to the sample feature representation;

[0011] The keyword extraction model is trained by combining the contrast loss and the classification loss to obtain the target extraction model, which is used to extract keywords from target content.

[0012] On the other hand, a keyword extraction model training device is provided, the device comprising:

[0013] An acquisition unit is used to acquire sample content, which includes text data, and the sample content is used to train a keyword extraction model.

[0014] An extraction unit is used to extract sample feature representations of the sample content through the keyword extraction model, wherein the sample feature representations include text feature representations corresponding to the text data;

[0015] The first generation unit is used to generate a contaminated feature representation based on the text feature representation and obtain a contrast loss, wherein the contrast loss is used to characterize the difference between the text feature representation and the contaminated feature representation;

[0016] The second generation unit is used to obtain a classification loss based on the sample feature representation, wherein the classification loss is used to characterize the accuracy of the keyword classification result corresponding to the sample feature representation;

[0017] The training unit is used to train the keyword extraction model by combining the contrastive loss and the classification loss to obtain the target extraction model, which is used to extract keywords from the target content.

[0018] In some optional embodiments, the first generation unit is further configured to randomly change the candidate word nodes in the graph structure features to obtain the pollution feature representation;

[0019] or,

[0020] The connection relationships in the graph structure feature are randomly varied to obtain the pollution feature representation.

[0021] In some optional embodiments, the first generating unit further includes:

[0022] The pooling subunit is used to perform pooling processing on the text feature representation to obtain a pooled feature representation.

[0023] The first generation unit is further configured to obtain the contrast loss based on a first difference between the pooled feature representation and the text feature representation, and a second difference between the pooled feature representation and the contamination feature representation.

[0024] In some optional embodiments, the pooling subunit is further configured to perform max pooling on the text feature representation to obtain a pooled feature representation;

[0025] or,

[0026] The average pooling process is used to perform average pooling on the text feature representation to obtain a pooled feature representation.

[0027] In some optional embodiments, the second generating unit further includes:

[0028] The prediction subunit is used to predict keywords based on the sample feature representation to obtain predicted keywords.

[0029] The second generation unit is also used to obtain the classification loss based on the difference between the reference keyword and the predicted keyword.

[0030] In some optional embodiments, the prediction subunit is further configured to perform keyword prediction based on the sample feature representation to obtain a first category of keywords;

[0031] or,

[0032] Used to predict keywords based on the feature representation of the samples, to obtain the second category of keywords.

[0033] In some optional embodiments, the training unit further includes:

[0034] A sub-unit is used to obtain the weighted fusion result of the contrast loss and the classification loss to obtain the target loss;

[0035] The training unit is also used to train the keyword extraction model based on the target loss to obtain the target extraction model.

[0036] In some optional embodiments, the training unit further includes:

[0037] The adjustment subunit is used to adjust the model parameters in the keyword extraction model based on the target loss, so as to obtain the target extraction model.

[0038] In some optional embodiments, the extraction unit is further configured to extract the text feature representation of the text data through the keyword extraction model;

[0039] The extraction unit is also used to extract multimedia feature representations of the multimedia data through the keyword extraction model;

[0040] The extraction unit further includes:

[0041] The fusion subunit is used to fuse the text feature representation and the multimedia feature representation to obtain the sample feature representation.

[0042] In some optional embodiments, the extraction unit is further configured to extract visual feature representations of the video data using the keyword extraction model;

[0043] The extraction unit is also used to extract audio feature representations of the audio data through the keyword extraction model;

[0044] The fusion subunit is further configured to fuse the visual feature representation and the audio feature representation to obtain the multimedia feature representation.

[0045] In some optional embodiments, the extraction unit further includes:

[0046] The word segmentation subunit is used to perform word segmentation processing on the text data to obtain candidate word segments in the text data;

[0047] The extraction unit is further configured to extract the lexical feature representation of the candidate word segmentation words through the keyword extraction model;

[0048] A subunit is constructed to construct a graph structure feature based on the association between the candidate word segments and the word feature representation, wherein the word feature representation is implemented as candidate word nodes in the graph structure feature.

[0049] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the keyword extraction model training method as described in any of the above embodiments.

[0050] On the other hand, a computer-readable storage medium is provided, wherein at least one piece of program code is stored in the computer-readable storage medium, the program code being loaded and executed by a processor to implement the keyword extraction model training method as described in any of the above embodiments.

[0051] On the other hand, a computer program product is provided, including a computer program or instructions, which, when executed by a processor, implement the keyword extraction model training method as described in any of the above embodiments.

[0052] The technical solutions provided in this application have at least the following beneficial effects:

[0053] The keyword extraction model is trained by optimizing the joint loss of contrastive loss and classification loss, which provides more supervision signals for training the model. In particular, by introducing contrastive loss in the feature extraction process of sample content, the mutual information between each word in the sample content and the whole sample content is maximized, thereby reducing the impact of data noise in the sample content. Ultimately, this improves the relevance between the keywords extracted by the model and the sample content, and increases the explicitness of the extracted keywords. Attached Figure Description

[0054] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0055] Figure 1 This is a schematic diagram of an implementation environment provided by an exemplary embodiment of this application;

[0056] Figure 2 This is a flowchart of a keyword extraction model training method provided in an exemplary embodiment of this application;

[0057] Figure 3 This is a schematic diagram of a word node graph structure provided in an exemplary embodiment of this application;

[0058] Figure 4 This is a schematic diagram of a word node graph structure provided in another exemplary embodiment of this application;

[0059] Figure 5 This is a schematic diagram of a graph convolution process provided in an exemplary embodiment of this application;

[0060] Figure 6 This is a flowchart of a keyword extraction model training method provided in another exemplary embodiment of this application;

[0061] Figure 7 This is a flowchart of a keyword extraction model training method provided in another exemplary embodiment of this application;

[0062] Figure 8 This is a schematic diagram of a keyword extraction model submodule provided in an exemplary embodiment of this application;

[0063] Figure 9 This is an application example of the keyword extraction model training method provided in an exemplary embodiment of this application;

[0064] Figure 10 This is another exemplary embodiment of the keyword extraction model training method provided in this application;

[0065] Figure 11 This is a structural block diagram of a keyword extraction model training device provided in an exemplary embodiment of this application;

[0066] Figure 12 This is a structural block diagram of a keyword extraction model training apparatus provided in another exemplary embodiment of this application;

[0067] Figure 13 This is a structural block diagram of a terminal provided in an exemplary embodiment of this application. Detailed Implementation

[0068] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0069] In this application, the terms "first" and "second" are used to distinguish between identical or similar items that have essentially the same function. It should be understood that there is no logical or temporal dependency between "first" and "second", nor is there any limitation on the quantity or execution order.

[0070] First, a brief introduction to the terms used in the embodiments of this application:

[0071] Multimodal: In this application, it refers to the visual content, audio content, and related text content of the video, wherein the related text content refers to the video title and video description text.

[0072] Grammatical dependency: refers to the subordinate relationship between two word components in a sentence. If one word modifies another word, then the modifier is called the subordinate word, and the word being modified is called the dominant word. In the diagram, the arrow points from the dominant word to the subordinate word.

[0073] Taking video content as an example, related technologies often use video classification or text mining to obtain keywords from video content. Firstly, video classification-based keyword extraction models require manual labeling of a large number of video categories, and the classification effectiveness decreases when encountering new video types, thus affecting the keyword extraction results. Secondly, text mining-based keyword extraction models have the following problems when extracting keywords from video content:

[0074] (1) Data noise problem: When applying the keyword extraction model based on text mining, because videos have richer semantic information, there are more conceptual words in the text related to the video than in the plain text, making it difficult for the annotator to find all the keywords. For example, the title and description of the video are: "Car tips: Don't wipe the engine with a towel if it is dusty. Here's a trick to keep your engine clean." The keyword extraction model based on text mining only extracts the keyword "engine" and does not extract the keyword "car tips" which can also summarize the content of the video.

[0075] (2) The problem of insufficient single-modal information: The keyword extraction model based on text mining only focuses on the text modality, and the obtained keywords cannot be guaranteed to be completely relevant to the video. For example, the title and description of the video are: "Title: Peppa Pig, the favorite of children, teaches you how to fold their little houses, simple DIY craft; Description: Peppa Pig, the favorite of children, teaches you how to fold their little houses, simple DIY craft, a complete video tutorial for kindergarten students' origami, the mini Peppa Pig houses made of paper are simple and beautiful, children will definitely like them." The keyword extraction model based on text mining obtains the keywords "children", "Peppa Pig", "origami", and "little houses", but the content of the video is mainly about the origami tutorial for little houses, and children and Peppa Pig do not appear.

[0076] Therefore, this application provides a keyword extraction model training method. By obtaining contrastive loss through text feature representation and contamination feature representation extracted from sample content, and obtaining classification loss through sample feature representation extracted from sample content, the keyword extraction model is trained by combining contrastive loss and classification loss. This can alleviate the problems of data noise and insufficient single-modal information, thereby improving the relevance of keywords obtained from target content to target content and increasing the visibility of keywords.

[0077] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the aforementioned videos and descriptive texts involved in this application were obtained with full authorization.

[0078] Figure 1 This is a schematic diagram of an implementation environment provided by an exemplary embodiment of this application, such as... Figure 1 As shown, the implementation environment includes a terminal 110, a server 120, and a communication network 130, wherein the terminal 110 and the server 120 are connected through the communication network 130.

[0079] In this embodiment, terminal 110 instructs server 120 to train the keyword extraction model. Optionally, terminal 110 can directly upload sample content to server 120, or it can upload the sample content after classification. This embodiment does not limit this. Optionally, the sample content includes at least one of text content, video content, and audio content. Optionally, terminal 110 is equipped with an application that provides keyword display functionality. Illustratively, this application includes instant messaging applications, news applications, comprehensive search engine applications, social applications, game applications, shopping applications, map navigation applications, etc. This embodiment does not limit this.

[0080] Server 120 is used to train a keyword extraction model. Optionally, the keyword extraction model includes at least a contrast submodule and a classification submodule. Server 120 calls the contrast submodule to extract features from the sample content uploaded by terminal 110, obtaining a contrast loss. Server 120 calls the classification submodule to extract features from the sample content uploaded by terminal 110, obtaining a classification loss. The classification loss and contrast loss are combined, and the combined total loss is used to train the keyword extraction model to obtain a target extraction model. Optionally, the keyword extraction model also includes a key phrase construction submodule, which is used to connect keywords according to their connection relationships to obtain key phrases. Optionally, server 120 sends the trained target extraction model to terminal 110, or server 120 stores the target extraction model after training for later use. Optionally, when terminal 110 needs to extract keywords from target content, it sends the target content to server 120. Server 120 calls the target extraction model to analyze the target content and finally obtains a list of keywords related to the target content.

[0081] In some embodiments, terminal 110 may be a smartphone, tablet computer, laptop computer, desktop computer, smart home appliance, smart vehicle terminal, smart speaker, smart voice interaction device, aircraft, etc., but is not limited to these.

[0082] Server 120 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0083] Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Cloud technology is a general term encompassing network technology, information technology, integration technology, management platform technology, and application technology applied to the cloud computing business model. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to a backend system for logical processing. Data at different levels will be processed separately, and various industry data will require robust system support, which can only be achieved through cloud computing. Optionally, server 120 can also function as a node in a blockchain system.

[0084] In some embodiments, the communication network 130 may be a wired network or a wireless network, and no limitation is made herein.

[0085] The keyword extraction model training method provided in this application can be applied to train a target extraction model. Illustratively, the target extraction model is a model trained using the keyword extraction model training method. Taking video content as an example where the target content for keyword extraction is video content, the video content may optionally include visual content, audio content, and video-related text content. The video-related text content includes the video title, description, video-related subtitles, or other text content associated with the video content. The video content is input into the target extraction model, and through its analysis and processing, keywords related to the video content are output.

[0086] This target extraction model can be applied to video viewing and recommendation modules. It can automatically find a list of keywords related to the video topic from a massive amount of videos. The backend can display these keywords on the interface, allowing users to browse videos based on the keywords in the video content for a better user experience. At the same time, the backend can also recommend videos to users more accurately based on these keywords and user preferences, increasing the browsing rate of recommended videos.

[0087] This target extraction model can also be applied to the video tagging module. By using contrastive learning and multimodal fusion, the model improves the visibility of the extracted keywords. The extracted keywords can also be displayed in the user's video tag bar, making it easier for the user to manage the videos recommended on the homepage. For example, if a user is not interested in videos of the "home renovation" type, they can click the "home renovation" tag on the "I am not interested" page, and then videos with the keyword "home renovation" will not appear on the user's homepage recommendation page.

[0088] It is worth noting that the above application scenarios are merely illustrative examples, and the embodiments of this application do not limit other application scenarios of the keyword extraction model training method.

[0089] Based on the above introduction and implementation environment, Figure 2 This is a flowchart of a keyword extraction model training method provided in an embodiment of this application, such as... Figure 2 As shown, the method includes:

[0090] Step 201: Obtain sample content.

[0091] The sample content includes text data, which is used to train the keyword extraction model.

[0092] Indicatively, the sample content includes at least one of video content, audio content, and text content. This embodiment does not limit this. Optionally, text data refers to text associated with the sample content. Indicatively, when the sample content is implemented as video content, the text data refers to text data associated with the video content, such as the title and description of the target video.

[0093] Optionally, after obtaining the sample content, it needs to be input into the keyword extraction model. Illustratively, the input of sample content can include at least the following two methods:

[0094] (i) The sample content is directly input into the keyword extraction model. The keyword extraction model then performs further operations on the sample data in the sample content. These operations include, but are not limited to, classifying and segmenting the sample data. For example, when the sample content is video content, the video content can be directly input when training the keyword extraction model. The keyword extraction model will analyze the video content to obtain content data, and classify the content data into text data, video data, and audio data. The text data is input into the comparison submodule, and the video and audio data are input into the classification submodule. Optionally, before inputting the text data into the comparison submodule, the keyword extraction model can also perform word segmentation on the text data.

[0095] (ii) After processing the sample content, input it into the keyword extraction model. Optionally, the processing includes, but is not limited to, classifying the sample data in the sample content, segmenting the sample data in the sample content, etc. Then, the processed sample data is directly input into the keyword extraction model, or input into different sub-modules of the keyword extraction model.

[0096] It is worth noting that the above-described method of inputting sample content is merely an illustrative example, and the embodiments of this application do not limit it.

[0097] Step 202: Extract sample feature representations of sample content using a keyword extraction model.

[0098] The sample feature representation includes the text feature representation corresponding to the text data.

[0099] In some optional embodiments, the text feature representation is a graph structure feature, which includes candidate word nodes and connections between the candidate word nodes.

[0100] In some optional embodiments, extracting text feature representations of sample content further includes the following steps:

[0101] The text data is segmented to obtain candidate segmented words; the lexical feature representations of the candidate segmented words are extracted using a keyword extraction model; and a graph structure feature is constructed based on the relationships between the candidate segmented words and the lexical feature representations, where the lexical feature representations are implemented as candidate word nodes in the graph structure feature.

[0102] This example illustrates one way to construct graph structure features, using video content as an example. Given a video and related text data, in this embodiment, the text data refers to the video's title and description:

[0103] (1) Construct the original image based on the title and description of the video above. Please refer to... Figure 3 The target video is titled "How to Make Super Delicious Mashed Potatoes"; its description is "Teaching you how to make mashed potatoes at home, simple and delicious, everyone loves it," such as... Figure 3 As shown, firstly, the video title and description are segmented into words, resulting in a series of words. Each word can be considered a word node 301, where each word node 301 includes node features. Optionally, the node features include the word's word vector, part-of-speech tag, and statistical value (indicating how many times the same word appears in the text data). Optionally, different word nodes 301 are connected by edges 302 according to their connection relationships, such as whether they are consecutive in the original text, whether they are synonyms, or whether they are contained within each other.

[0104] Schematic, the connection relationship includes the grammatical dependency relationship between the words corresponding to the two word nodes 301, for example: Figure 4 As shown, word node 401 and word node 402 are connected by edge 403, and the arrow of edge 403 points to word node 401. Edge 403 is labeled "advmod". Figure 4 This indicates that the word "how" modifies the word "do".

[0105] Schematic diagram: The original graph G can be obtained through word nodes and the connections between them. pos = (A, X), let N be the number of unique word nodes (word nodes whose corresponding word content is unique), and F be the node feature length of each word, where A ∈ R. N×N It is the adjacency matrix of word nodes, X∈R N×F It is the feature representation matrix of word nodes.

[0106] (2) The original image G pos The input (A,X) is fed into the first convolutional network for the first convolution operation. The specific process of the first convolution operation can be divided into the following steps:

[0107] Step 1: Process the original image G pos = Any node ei on (A,X) if it is adjacent to its neighbor node e j Connect the edges of category r and calculate e. j to e i The attention score for information delivery is shown in Formula 1 below:

[0108] Formula 1:

[0109] in, It refers to e j to e i Attention score for information delivery, where exp is the exponential function and LeakyReLU is the activation function. It is all edges of category r connected to e. i The set of points, W (r) and a (r) is the trainable parameter, and || is the connection operation.

[0110] Step 2: Based on attention score For e i Calculate all the information passed from edges of type r, as shown in Formula 2 below:

[0111] Formula 2:

[0112] Step 3: Aggregate the information obtained from all types of edges to obtain the updated feature representation of the word node, as shown in Formula 3 below:

[0113] Formula 3:

[0114] Where R is the set of all edges, and σ is the ReLU activation function.

[0115] This is illustrative; please refer to it. Figure 5 The original structure 510 includes six word nodes e1 to e6, with an edge between every two word nodes. In the original structure 510, r1 and r2 are edges of different types. The first convolution operation is performed on node e3 in the original structure 510 using a first convolutional network. In the intermediate result 520, N... 3,1 N represents the set of all edges of class r1 that extend to e3. 3,2 Let α represent the set of all edges of class r2 that extend to e3. 3,1,2 This represents the attention score for information transfer from e2 to e3, where e2 and e3 are connected by an edge of class r1, and α 3,1,5 This represents the attention score for information transfer from e5 to e3, where e5 and e3 are connected by an edge of class r1, and α 3,2,1 This represents the attention score for information transmission from e1 to e3, where e1 and e3 are connected by an edge of category r2, and α 3,2,4 The attention score represents the information transfer from e4 to e3, where e4 and e3 are connected by an edge of category r2; after performing the first convolution operation on word node e3, the convolution result 530 is obtained, where e3 in the convolution result 530 is the word node that has been updated.

[0116] (3) Transform the original image G pos All word nodes on (A,X) undergo the first convolution operation through the first convolutional network to obtain the updated convolutional graph G. pos = (A,X), then the convolutional graph G pos = (A,X) represents the graph structure feature of the text data.

[0117] Step 203: Generate contamination feature representation based on text feature representation to obtain contrast loss.

[0118] Among them, the contrastive loss is used to characterize the difference between the text feature representation and the contamination feature representation.

[0119] Optionally, the pollution feature representation can be generated in the following ways:

[0120] (a) Randomly transforming the candidate word nodes in the graph structure features yields a pollution feature representation. For an illustrative example, please refer to [reference needed]. Figure 3Original image G pos = (A, X), where the number of unique word nodes (word nodes with unique word content) is N, and the node feature length of each word is F, A∈R. N×N It is the adjacency matrix of word nodes, X∈R N×F It is the feature representation matrix of a word node, for the feature representation matrix X∈R N×F Randomly shuffle the rows, for example: assign the features of word node 'a' to word node 'b', assign the features of word node 'b' to word node 'c', and assign the features of word node 'c' to word 'a'. This results in a contaminated graph. It is the feature representation matrix of the shuffled word nodes.

[0121] Formula 4:

[0122] Here, shuffle is a random sorting function.

[0123] Pollution map The second convolutional network is input for a second convolution operation, the convolution process of which is the same as that of the original image, and will not be described in detail here. The final convolutional image is the contaminated image. This refers to the pollution characteristics of text data.

[0124] (ii) Randomly changing the connection relationships in the graph structure features yields a pollution feature representation. Please refer to the illustrative example. Figure 3 Each word node 301 has one or more edges 302, and the edges 302 include the connection relationships between different word nodes 301. Each word node 301 includes node features. By shuffling the word nodes 301 and their corresponding node features, the original image is shuffled into a contaminated image. The contaminated image is then input into the second convolutional network for the second convolution operation. The convolution process is similar to that of the original image and will not be elaborated here. The final convolutional contaminated image is the contaminated feature representation of the text data.

[0125] Step 204: Obtain the classification loss based on the sample feature representation.

[0126] The classification loss is used to characterize the accuracy of the keyword classification results corresponding to the sample feature representation.

[0127] Optionally, keyword classification is performed on the sample feature representation, and classification loss is calculated based on the keyword classification results. For example, all word nodes in the sample feature representation are divided into two categories, and the classification loss is calculated by comparing the differences between the two categories and the real keywords. Here, the real keywords are manually labeled keywords that are highly relevant to the sample content.

[0128] Step 205: Train the keyword extraction model by combining contrastive loss and classification loss to obtain the target extraction model.

[0129] Among them, the target extraction model is used to extract keywords from the target content.

[0130] Optionally, the model parameters in the keyword extraction model can be adjusted based on the target loss to obtain the target extraction model.

[0131] In summary, the method provided in this application provides more supervision signals for training the keyword extraction model by optimizing the joint loss of contrastive loss and classification loss. Specifically, by introducing contrastive loss during the feature extraction process of sample content, the mutual information between each word in the sample content and the entire sample content is maximized, thereby reducing the impact of data noise in the sample content and ultimately improving the relevance between the keywords extracted by the model and the sample content, and increasing the explicitness of the keywords extracted by the model.

[0132] Please refer to Figure 6 This illustrates another exemplary embodiment of the keyword extraction model training method provided in this application, such as... Figure 6 As shown, the method includes:

[0133] Step 601: Obtain sample content.

[0134] The sample content includes text data, which is used to train the keyword extraction model.

[0135] The types of sample content and the method of extracting keywords from sample content have been explained in step 201, and will not be repeated here.

[0136] Step 602: Extract sample feature representations of sample content using a keyword extraction model.

[0137] The sample feature representation includes the text feature representation corresponding to the text data.

[0138] The process of extracting text feature representations has been described in step 602 and will not be repeated here.

[0139] Optionally, the text feature representation is a graph structure feature, schematically using the convolution result graph G after convolution. pos = (A,X) represents the text feature representation, where the unique word nodes e i The number of words is N, and the node feature length of each word is F, where A∈R N×N It is the adjacency matrix of word nodes, X∈R N×F It is the feature representation matrix of word nodes.

[0140] Step 603: Perform pooling processing on the text feature representation to obtain the pooled feature representation.

[0141] Optionally, pooling processing includes at least the following methods:

[0142] (i) Max pooling is performed on the text feature representation to obtain the pooled feature representation.

[0143] This is illustrative; please refer to it. Figure 5 The original structure 510 is input into the first convolutional network to perform the first convolution operation to obtain the convolution result 530. Optionally, after the first convolution operation, the convolution result 530 is input into the first pooling network to perform the max pooling operation. The max pooling operation extracts the feature of the word node with the largest feature value in the convolution result. This largest word node feature is the pooling feature representation of the text data, which is used to represent the entire convolution result.

[0144] (ii) Perform average pooling on the text feature representation to obtain the pooled feature representation.

[0145] This is illustrative; please refer to it. Figure 5 The original structure 510 is input into the first convolutional network to perform the first convolution operation to obtain the convolution result 530. Optionally, after the first convolution operation, the convolution result 530 is input into the second pooling network to perform the average pooling operation. The average pooling operation is to average the feature values ​​of all word nodes in the convolution result image to obtain the average pooling result. This averaged result is the pooling feature representation of the text data, which is used to represent the entire convolution result.

[0146] To illustrate, taking average pooling as an example, step 603 yields the convolution result image G. pos = (A,X), convolution result image G pos = (A,X) is input into the second pooling network for pooling processing, and the average pooling result s is obtained. s is the pooling feature representation of the text data.

[0147] Formula 5:

[0148] Where σ is the ReLU activation function, N is the number of nodes containing all unique words in the text data, and e i This represents the convolution result G after the first convolution operation. pos Word node features in (A,X).

[0149] Step 604: Based on the first difference between the pooled feature representation and the text feature representation, and the second difference between the pooled feature representation and the contaminated feature representation, the contrastive loss is obtained.

[0150] The method for generating pollution feature representations has been explained in step 203 and will not be repeated here.

[0151] In illustrative terms, taking average pooling as an example, the first difference can be used to indicate that the text feature representation is similar to the pooled feature representation, and the second difference can be used to indicate that the contamination feature representation is not similar to the pooled feature representation.

[0152] Optionally, the contamination feature representation, text feature representation, and pooling feature representation are input into the discriminator D to calculate the first difference and the second difference, in order to calculate G. pos The graph represents s and the convolution result graph G. pos Each node e i and G pos The graph represents s and the convolution result graph G. neg Each node similarity (using To indicate pollution characteristics, use e i (This represents the text feature representation, where 's' represents the pooling feature representation.) e i Inputting 's' into the discriminator will yield the first and second difference results.

[0153] Formula Six:

[0154] Formula 7:

[0155] Where M∈R F*F These are trainable parameters, F is the feature length of the word nodes in the text data, and σ is the sigmoid activation function. Indicates the first difference result. This indicates the second difference result.

[0156] Optionally, the contrast loss can be calculated by combining the first and second difference results.

[0157] Formula 8:

[0158] in, This represents the convolution result image G. pos It is a directed graph. This represents the convolution result image G. neg For a directed graph, log represents the logarithmic function, and N represents the number of nodes containing all unique words in the text data.

[0159] Step 605: Obtain the classification loss based on the sample feature representation.

[0160] The classification loss is used to characterize the accuracy of the keyword classification results corresponding to the sample feature representation.

[0161] The possible results of keyword classification have been explained in step 204 and will not be repeated here.

[0162] Step 606: Train the keyword extraction model by combining contrastive loss and classification loss to obtain the target extraction model.

[0163] Among them, the target extraction model is used to extract keywords from the target content.

[0164] In summary, the method provided in this application provides more supervision signals for training the keyword extraction model by optimizing the joint loss of contrastive loss and classification loss. Specifically, by introducing contrastive loss during the feature extraction process of sample content, the mutual information between each word in the sample content and the entire sample content is maximized, thereby reducing the impact of data noise in the sample content and ultimately improving the relevance between the keywords extracted by the model and the sample content, and increasing the explicitness of the keywords extracted by the model.

[0165] The method provided in this embodiment calculates the contrast loss by using the first difference between the pooled feature representation and the text feature representation and the second difference between the pooled feature representation and the contamination feature representation. The pooling process reduces the output of the model and improves the speed of keyword extraction.

[0166] Please refer to Figure 7 This illustrates another exemplary embodiment of the keyword extraction model training method provided in this application, such as... Figure 7 As shown, the method includes:

[0167] Step 701: Obtain sample content.

[0168] The sample content includes text data, which is used to train the keyword extraction model.

[0169] In some optional embodiments, the sample content may also include multimedia data, which may include video data and audio data.

[0170] For illustrative purposes only, the sample content includes at least one of video content, audio content, text content, etc., and the embodiments of this application do not limit this.

[0171] Optionally, the sample content is labeled with reference keywords, which refer to the keywords that best represent and summarize the sample content and are manually extracted from it. Optionally, the number of reference keywords may include one or two or more. The reference keywords may be obtained by directly extracting them from the text content of the sample content, or, illustratively, by indirectly extracting them from the visual frames and audio in the video content when the sample content is implemented as video content.

[0172] The method for extracting keywords from sample content has been explained in step 201 and will not be repeated here.

[0173] Optionally, the keyword extraction model includes at least a contrast submodule and a classification submodule. The contrast submodule is used to calculate the contrast loss, and the classification submodule is used to calculate the classification loss, and the classification loss and contrast loss are combined. Optionally, the keyword extraction model also includes a key phrase construction module, which is used to connect the keywords obtained in the final classification according to their relationships to obtain key phrases. Illustratively, a key phrase can be a word or a sentence; this embodiment does not limit this.

[0174] This is an illustrative example, using sample content implemented as video content as an example. Please refer to [the documentation / reference]. Figure 8 The keyword extraction model has three sub-modules: comparison module 810, fusion classification module 820, and key phrase construction module 830. The keyword extraction model extracts text data 811, audio data 821, and video data 822 from the sample content.

[0175] Step 702: Extract text feature representations of the text data using a keyword extraction model.

[0176] In some optional embodiments, the text feature representation is a graph structure feature, which includes candidate word nodes and connections between the candidate word nodes.

[0177] The specific extraction method of text feature representation has been explained in step 202, and will not be repeated here.

[0178] This is illustrative; please refer to it. Figure 8 The text data 811 is input into the comparison module 810. First, the text data 811 is segmented to obtain candidate words in the text data. The original structure 812 is established based on the relationship between different candidate words. The text feature representation of the text data is extracted through the convolution process to obtain the convolution result 813.

[0179] Step 703: Extract multimedia feature representations of multimedia data using a keyword extraction model.

[0180] In some optional embodiments, the multimedia feature representation extraction step further includes:

[0181] Visual feature representations of video data are extracted using a keyword extraction model; audio feature representations of audio data are extracted using a keyword extraction model; and the visual and audio feature representations are fused to obtain multimedia feature representations.

[0182] Optionally, video data is extracted from the video content using a keyword extraction model, and visual feature representations are extracted from the video data using a third convolutional network. Illustratively, the third convolutional network can be implemented as an EfficientNet model. Optionally, the visual feature representations can be presented in at least two of the following forms:

[0183] (i) Extract K frames from the video content, obtain the representation of these frames through the third convolutional network, and use the features of each frame as the visual features in the video data.

[0184] (ii) Extract K frames from the video content, obtain the representations of these frames through the third convolutional network, and input the feature representations of the i frames into the first fully connected network to obtain the weights β. vi The weighted sum of all frames is used as a visual feature representation in the video data.

[0185] Schematic, when visual feature representation is implemented as a weighted sum of all frames, using h v To represent visual features.

[0186] Formula Nine:

[0187] Formula 10:

[0188] Where K represents the number of frames extracted from the video content, h v Represents the weighted sum of all frames. Represents weight, The feature representation of the i-th frame indicates that MLP1 is the first fully connected network.

[0189] Optionally, audio data is extracted from the audio content using a keyword extraction model, and audio feature representations are extracted from the audio data using a fourth convolutional network. Illustratively, the fourth convolutional network can be implemented as a VGGish model. Optionally, the audio feature representations can be presented in at least the following two forms:

[0190] (i) Extract K frames from the audio content, obtain the representation of these frames through the fourth convolutional network, and use the features of each frame as the audio features in the video data.

[0191] (ii) Extract K frames from the audio content, obtain the representation of these frames through the fourth convolutional network, and use the weighted sum of all frames as the audio feature representation in the audio data.

[0192] As an illustration, when the audio feature representation is implemented as a weighted sum of all frames, the formulas for obtaining and calculating the weights are the same as those for visual feature representation, and will not be elaborated here. For illustration, h is used. a This is used to represent audio features.

[0193] Optionally, audio feature representation and visual features are fused to obtain multimedia feature representation. Schematic, the audio feature representation h... v and visual feature representation h a The input is fed into the second fully connected network to calculate the fused result h. fuse .

[0194] Formula 11: h fuse =MLP2(h v ||h a )

[0195] MLP2 stands for the second fully connected network.

[0196] This is illustrative; please refer to it. Figure 8 The features of video and audio data are extracted using the EfficientNet and VGGish models, respectively. Then, all visual feature representations are summed with weights, and all audio feature representations are summed with weights to obtain audio feature representation 823 and visual feature representation 824. Finally, audio feature representation 823 and visual feature representation 824 are input into a second fully connected network for connection and transformation to obtain multimedia feature representation 825.

[0197] Step 704: Fuse the text feature representation and the multimedia feature representation to obtain the sample feature representation.

[0198] Schematic, computation of multimedia feature representation h fuse and text feature representation G pos Each feature node e i Hadama q i , then q i This refers to the sample feature representation of the sample content.

[0199] Formula 12: q i =e i ⊙h fuse

[0200] Wherein, q i ∈R FLet Q ∈ R be the feature representation of the i-th node. We denote the matrix composed of all node features as Q ∈ R. N×F N represents the number of unique nodes, and F represents the feature length of each node.

[0201] This is illustrative; please refer to it. Figure 8 The convolution result 813 is the text feature representation of the sample content. The convolution result 813 and the multimedia feature representation 825 are input into the interaction module to generate the sample feature representation 826.

[0202] Step 705: Generate contamination feature representation based on text feature representation to obtain contrast loss.

[0203] Among them, the contrastive loss is used to characterize the difference between the text feature representation and the contamination feature representation.

[0204] Optionally, before obtaining the contrastive loss, the text features are further subjected to pooling processing to obtain pooled feature representations.

[0205] The method for obtaining the pollution feature representation was explained in step 203, and the method for obtaining the pooling feature representation was explained in step 603, so it will not be repeated here.

[0206] Indicative, such as Figure 8 As shown, the original structure 812 is contaminated to obtain the contaminated structure 814. The contaminated structure 814 is then convolved to obtain the contaminated convolution result 815, which is the contaminated feature representation. Simultaneously, the convolution result 813 is pooled to obtain the pooled feature representation 816. The contaminated convolution result 815, the convolution result 813, and the pooled feature representation 816 are input into the contrast loss (loss function) 817 to calculate the contrast loss.

[0207] Step 706: Perform keyword prediction on the sample feature representation to obtain predicted keywords.

[0208] Optionally, keyword prediction can be done through classification.

[0209] Indicatively, the sample feature is represented as q. i Let Q be the set of matrices representing the sample features, and let Q be the sample feature matrix as graph G. pos The node feature matrix, denoted as G pos = (A, Q), then graph G pos Input the first convolutional network and classify all nodes.

[0210] Formula Thirteen:

[0211] in This represents the model's classification results for the predicted keywords.

[0212] In some optional embodiments, the classification results of the predicted keywords include at least:

[0213] (i) Predict keywords based on sample feature representations to obtain the first category of keywords;

[0214] (ii) Based on the sample feature representation, keyword prediction is performed to obtain the second category of keywords.

[0215] This is illustrative; please refer to it. Figure 8 The sample feature representation 826 is convolved, and the category of each word node is classified to obtain positive and negative nodes.

[0216] In some optional embodiments, the process of categorizing keywords further includes the following steps:

[0217] Connect all the first-category keywords or second-category keywords according to their connection relationship (e.g., whether these keywords are consecutive in the sample content) to form key phrases.

[0218] This is illustrative; please refer to it. Figure 8 The word nodes that are judged to be positive nodes are input into the key phrase construction module 830. By referring to the connection relationship of word nodes in the text data, they are connected to form key phrases 831.

[0219] Step 707: Obtain the classification loss based on the difference between the reference keywords and the predicted keywords.

[0220] Indicative, reference keywords are denoted as y i Predicted keywords are denoted as Calculate classification loss based on reference keywords and predicted keywords. Formula 14 is shown below:

[0221] Formula Fourteen:

[0222] This is illustrative; please refer to it. Figure 8 All the positive and negative nodes obtained are input into the classification loss (loss function) 827 along with the real keywords to obtain the classification loss.

[0223] Step 708: Obtain the weighted fusion result of the contrast loss and the classification loss to obtain the target loss.

[0224] Optionally, the target loss can be obtained by weighted summation of the contrast loss and the classification loss. Formula 15 is shown below:

[0225] Formula 15:

[0226] Where γ is the balance coefficient.

[0227] Step 709: Train the keyword extraction model based on the target loss to obtain the target extraction model.

[0228] Alternatively, the keyword extraction model can be trained by adjusting the values ​​of the parameters in the target loss. For example, the balance coefficient γ in Formula 15 can be adjusted to adjust the target loss and train the keyword extraction model.

[0229] In summary, the method provided in this application provides more supervision signals for training the keyword extraction model by optimizing the joint loss of contrastive loss and classification loss. Specifically, by introducing contrastive loss during the feature extraction process of sample content, the mutual information between each word in the sample content and the entire sample content is maximized, thereby reducing the impact of data noise in the sample content and ultimately improving the relevance between the keywords extracted by the model and the sample content, and increasing the explicitness of the keywords extracted by the model.

[0230] The method provided in this embodiment alleviates the problems of incomplete keyword extraction and low keyword relevance to sample content by fusing feature representations of multiple modalities in the sample content and enabling interaction and information complementarity among the feature representations of multiple modalities.

[0231] Please refer to Table 1, which shows a set of experimental data comparing the performance of the target extraction model and the baseline model trained by the keyword extraction model training method provided in the embodiments of this application when extracting keywords.

[0232] Table 1

[0233] Baseline Model 1 0.338 0.355 Benchmark Model 2 0.431 0.445 Target extraction model 0.490 0.484

[0234] Among them, the first benchmark model extracts keywords by learning the pairwise relationship between words and their contexts and using sequence labeling; the second benchmark model uses the traditional graph convolution method to extract keywords through node classification.

[0235] Evaluation metric one measures the model's ability to extract keywords from a single sample; evaluation metric two measures the model's ability to extract keywords from a set of samples. Additionally, the sample dataset consists of video samples.

[0236] It is easy to see from Table 1 that the evaluation index 1 and evaluation index 2 of the target extraction model are both greater than those of the benchmark model 1 and benchmark model 2. This indicates that the target extraction model has a stronger keyword extraction ability than the benchmark model, whether it is a single sample or multiple samples. In other words, the target extraction model trained by the keyword extraction model training method provided in this application embodiment can improve the relevance rate between the keywords extracted from the video and the video.

[0237] Please refer to Table 2, which contains the ablation experimental data of the target extraction model.

[0238] Table 2

[0239] First target extraction model 0.443 0.462 Second target extraction model 0.474 0.474 Third target extraction model 0.478 0.482 Target extraction model 0.490 0.484

[0240] Among them, the first target extraction model refers to the process of removing graph contrast learning and multimodal fusion during the keyword extraction model training process; the second target extraction model refers to the process of removing graph contrast learning during the keyword extraction model training process; the third target extraction model refers to the process of removing multimodal fusion during the keyword extraction model training process; and the target extraction model refers to the model trained using the complete keyword extraction model training method.

[0241] Evaluation metric one measures the model's ability to extract keywords from a single sample; evaluation metric two measures the model's ability to extract keywords from a set of samples. Furthermore, the sample dataset consists of video samples.

[0242] It is evident from Table 2 that graph contrastive learning and multimodal fusion processes can significantly improve the keyword extraction model's ability to extract keywords during the training process of the keyword extraction model.

[0243] Please refer to Figure 9 This example illustrates the keywords extracted from real samples by the target extraction model and the baseline model, using only text data. The real keywords were manually labeled. As seen in the example, the real keyword is "it seems like I'm holding your hand," which is included in the target extraction model but not in the baseline model. The target extraction model also includes "square dancing," indicating that, combined with the textual information in the title and description, this keyword is relevant to the text's topic.

[0244] Please refer to Figure 10 The example illustrates the keywords extracted by the target extraction model and the baseline model in a video sample, where the real keywords were manually labeled. As can be seen from the example, the target extraction model perfectly matches the real keywords, while the keywords obtained by the baseline model are related to the video title but not to the actual theme of the video.

[0245] based on Figure 9 and Figure 10The examples shown demonstrate that the target extraction model trained by the keyword extraction model training method provided in this application can improve the relevance of keywords extracted from videos to the videos, thereby increasing the visibility of keywords.

[0246] Please refer to Figure 11 The diagram illustrates a structural block diagram of a keyword extraction model training device provided in an exemplary embodiment of this application. The device includes the following units:

[0247] The acquisition unit 1110 is used to acquire sample content, which includes text data, and the sample content is used to train the keyword extraction model.

[0248] Extraction unit 1120 is used to extract sample feature representation of the sample content through the keyword extraction model, wherein the sample feature representation includes text feature representation corresponding to the text data;

[0249] The first generation unit 1130 is used to generate a contaminated feature representation based on the text feature representation and obtain a contrast loss, wherein the contrast loss is used to characterize the difference between the text feature representation and the contaminated feature representation;

[0250] The second generation unit 1140 is used to obtain a classification loss based on the sample feature representation, wherein the classification loss is used to characterize the accuracy of the keyword classification result corresponding to the sample feature representation;

[0251] Training unit 1150 is used to train the keyword extraction model by combining the contrast loss and the classification loss to obtain a target extraction model, which is used to extract keywords from target content.

[0252] In some optional embodiments, the first generation unit 1130 is further configured to randomly change the candidate word nodes in the graph structure features to obtain the pollution feature representation;

[0253] or,

[0254] The connection relationships in the graph structure feature are randomly varied to obtain the pollution feature representation.

[0255] like Figure 12 As shown, in some optional embodiments, the first generation unit 1130 further includes:

[0256] Pooling subunit 1131 is used to perform pooling processing on the text feature representation to obtain a pooled feature representation;

[0257] The first generation unit 1130 is further configured to obtain the contrast loss based on a first difference between the pooled feature representation and the text feature representation, and a second difference between the pooled feature representation and the contamination feature representation.

[0258] In some optional embodiments, the pooling subunit 1131 is further configured to perform max pooling on the text feature representation to obtain a pooled feature representation;

[0259] or,

[0260] The average pooling process is used to perform average pooling on the text feature representation to obtain a pooled feature representation.

[0261] In some optional embodiments, the second generating unit 1140 further includes:

[0262] Prediction subunit 1141 is used to predict keywords based on the sample feature representation to obtain predicted keywords;

[0263] The second generation unit 1140 is further configured to obtain the classification loss based on the difference between the reference keyword and the predicted keyword.

[0264] In some optional embodiments, the prediction subunit 1141 is further configured to perform keyword prediction based on the sample feature representation to obtain a first category of keywords;

[0265] or,

[0266] Used to predict keywords based on the feature representation of the samples, to obtain the second category of keywords.

[0267] In some optional embodiments, the training unit 1150 further includes:

[0268] The acquisition subunit 1151 is used to acquire the weighted fusion result of the contrast loss and the classification loss to obtain the target loss;

[0269] The training unit 1150 is also used to train the keyword extraction model based on the target loss to obtain the target extraction model.

[0270] In some optional embodiments, the training unit 1150 further includes:

[0271] The adjustment subunit 1152 is used to adjust the model parameters in the keyword extraction model based on the target loss to obtain the target extraction model.

[0272] In some optional embodiments, the extraction unit 1120 is further configured to extract the text feature representation of the text data through the keyword extraction model;

[0273] The extraction unit 1120 is also used to extract multimedia feature representations of the multimedia data through the keyword extraction model;

[0274] The extraction unit 1120 further includes:

[0275] The fusion subunit 1121 is used to fuse the text feature representation and the multimedia feature representation to obtain the sample feature representation.

[0276] In some optional embodiments, the extraction unit 1120 is further configured to extract visual feature representations of the video data through the keyword extraction model;

[0277] The extraction unit 1120 is also used to extract the audio feature representation of the audio data through the keyword extraction model;

[0278] The fusion subunit 1121 is further configured to fuse the visual feature representation and the audio feature representation to obtain the multimedia feature representation.

[0279] In some optional embodiments, the extraction unit 1120 further includes:

[0280] The word segmentation subunit 1122 is used to perform word segmentation processing on the text data to obtain candidate word segments in the text data;

[0281] The extraction unit 1120 is also used to extract the lexical feature representation of the candidate word segmentation words through the keyword extraction model;

[0282] Subunit 1123 is constructed to construct graph structure features based on the association between the candidate word segments and the word feature representation, wherein the word feature representation is implemented as candidate word nodes in the graph structure features.

[0283] In summary, the keyword extraction model training device provided in this application training method trains the keyword extraction model by optimizing the joint loss of contrastive loss and classification loss, providing more supervision signals for the training model. In particular, by introducing contrastive loss in the feature extraction process of sample content, the mutual information between each word in the sample content and the entire sample content is maximized, thereby reducing the impact of data noise in the sample content, and ultimately improving the relevance between the keywords extracted by the model and the sample content, and improving the explicitness of the keywords extracted by the model.

[0284] It should be noted that the keyword extraction model training device provided in the above embodiments is only an example of the division of the above functional units. In practical applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the device can be divided into different functional units to complete all or part of the functions described above. In addition, the keyword extraction model training device and the keyword extraction model training method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0285] Figure 13 A structural block diagram of a computer device 1300 provided in an exemplary embodiment of this application is shown. The computer device 1300 may be a portable mobile terminal, such as a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. The computer device 1300 may also be referred to as a user device, portable terminal, laptop terminal, desktop terminal, or other names.

[0286] Typically, computer device 1300 includes a processor 1301 and a memory 1302.

[0287] Processor 1301 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1301 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1301 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1301 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 1301 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0288] The memory 1302 may include one or more computer-readable storage media, which may be non-transitory. The memory 1302 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1302 is used to store at least one instruction, which is executed by the processor 1301 to implement the keyword extraction model training method provided in the method embodiments of this application.

[0289] In some embodiments, the computer device 1300 may also optionally include other components, as those skilled in the art will understand. Figure 13 The structure shown does not constitute a limitation on the computer device 1300, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0290] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. This program can be stored in a computer-readable storage medium, which may be a computer-readable storage medium included in the memory described in the above embodiments; or it may be a standalone computer-readable storage medium not assembled into the terminal. The computer-readable storage medium stores at least one instruction, at least one program segment, a code set, or an instruction set. The at least one instruction, the at least one program segment, the code set, or the instruction set is loaded and executed by the processor to implement any of the keyword extraction model training methods described in the above embodiments.

[0291] Optionally, the computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), solid-state drives (SSDs), or optical discs, etc. The random access memory may include resistive random access memory (ReRAM) and dynamic random access memory (DRAM). The sequence numbers of the embodiments in this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0292] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0293] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A keyword extraction model training method, characterized in that, The method includes: Obtain sample content, which includes text data, and use the sample content to train the keyword extraction model; The keyword extraction model extracts sample feature representations of the sample content. The sample feature representations include text feature representations corresponding to the text data. The text feature representations are graph structure features, which include candidate word nodes and connection relationships between the candidate word nodes. Based on the text feature representation, a contaminated feature representation is generated, and a contrastive loss is obtained. The contrastive loss is used to characterize the difference between the text feature representation and the contaminated feature representation. The contaminated feature representation is obtained by randomly changing the candidate word nodes in the graph structure feature, or by randomly changing the connection relationship in the graph structure feature. The classification loss is obtained based on the sample feature representation, and the classification loss is used to characterize the accuracy of the keyword classification result corresponding to the sample feature representation; The keyword extraction model is trained by combining the contrast loss and the classification loss to obtain the target extraction model, which is used to extract keywords from target content.

2. The method according to claim 1, characterized in that, The step of generating a contamination feature representation based on the text feature representation and obtaining a contrast loss includes: The text feature representation is subjected to pooling processing to obtain pooled feature representation; The contrast loss is obtained based on the first difference between the pooled feature representation and the text feature representation, and the second difference between the pooled feature representation and the contamination feature representation.

3. The method according to claim 2, characterized in that, The process of pooling the text feature representation to obtain a pooled feature representation includes: Max pooling is applied to the text feature representation to obtain a pooled feature representation; or, The text feature representation is subjected to average pooling to obtain pooled feature representation.

4. The method according to any one of claims 1 to 3, characterized in that, The sample content is marked with reference keywords; The classification loss derived from the sample feature representation includes: Keyword prediction is performed on the sample feature representation to obtain predicted keywords; The classification loss is obtained based on the difference between the reference keywords and the predicted keywords.

5. The method according to claim 4, characterized in that, The predicted keywords include first-category keywords and second-category keywords; The step of predicting keywords from the sample feature representation to obtain predicted keywords includes: Based on the sample feature representation, keyword prediction is performed to obtain the first category of keywords; or, Based on the sample feature representation, keyword prediction is performed to obtain the second category of keywords.

6. The method according to any one of claims 1 to 3, characterized in that, The process of training the keyword extraction model by combining the contrast loss and the classification loss to obtain the target extraction model includes: Obtain the weighted fusion result of the contrast loss and the classification loss to get the target loss; The keyword extraction model is trained based on the target loss to obtain the target extraction model.

7. The method according to claim 6, characterized in that, The step of training the keyword extraction model based on the target loss to obtain the target extraction model includes: The target extraction model is obtained by adjusting the model parameters in the keyword extraction model based on the target loss.

8. The method according to any one of claims 1 to 3, characterized in that, The sample content also includes multimedia data; The extraction of sample feature representations of the sample content through the keyword extraction model includes: The keyword extraction model is used to extract the text feature representation of the text data; The multimedia feature representation of the multimedia data is extracted using the keyword extraction model. The text feature representation and the multimedia feature representation are fused to obtain the sample feature representation.

9. The method according to claim 8, characterized in that, The multimedia data includes video data and audio data; The extraction of multimedia feature representations from the multimedia data using the keyword extraction model includes: The visual feature representation of the video data is extracted using the keyword extraction model. The keyword extraction model is used to extract audio feature representations of the audio data. The visual feature representation and the audio feature representation are fused to obtain the multimedia feature representation.

10. The method according to claim 8, characterized in that, The step of extracting the text feature representation of the text data through the keyword extraction model includes: The text data is segmented to obtain candidate words in the text data; The keyword extraction model is used to extract the lexical feature representations of the candidate word segmentation words; Based on the relationships between the candidate word segments and the word feature representation, a graph structure feature is constructed, wherein the word feature representation is implemented as candidate word nodes in the graph structure feature.

11. A keyword extraction model training device, characterized in that, The device includes: An acquisition unit is used to acquire sample content, which includes text data, and the sample content is used to train a keyword extraction model. The extraction unit is used to extract sample feature representations of the sample content through the keyword extraction model. The sample feature representations include text feature representations corresponding to the text data. The text feature representations are graph structure features, which include candidate word nodes and connection relationships between the candidate word nodes. The first generation unit is configured to generate a contaminated feature representation based on the text feature representation and obtain a contrast loss, wherein the contrast loss is used to characterize the difference between the text feature representation and the contaminated feature representation; wherein the contaminated feature representation is obtained by randomly changing the candidate word nodes in the graph structure feature, or the contaminated feature representation is obtained by randomly changing the connection relationship in the graph structure feature; The second generation unit is used to obtain a classification loss based on the sample feature representation, wherein the classification loss is used to characterize the accuracy of the keyword classification result corresponding to the sample feature representation; The training unit is used to train the keyword extraction model by combining the contrastive loss and the classification loss to obtain the target extraction model, which is used to extract keywords from the target content.

12. A computer device, characterized in that, The computer device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the keyword extraction model training method as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one piece of program code, which is loaded and executed by a processor to implement the keyword extraction model training method as described in any one of claims 1 to 10.

14. A computer program product, characterized in that, It includes a computer program or instructions that, when executed by a processor, implement the keyword extraction model training method as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Adversarial sample attack method for voice keyword classification network

    CN112216273A