Video clustering method, device, storage medium and electronic device

By obtaining the semantic feature vectors of video titles for clustering processing, the problem of large computational complexity and low accuracy of video clustering methods in the existing technology is solved, and efficient and accurate video clustering results are achieved.

CN112131430BActive Publication Date: 2024-09-06TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing video clustering methods require large amounts of calculations, complex processing, and low efficiency when processing massive video resources, and the accuracy of clustering results is affected by incorrect determination of key image frames.

Method used

By obtaining the semantic feature vector of the video title, the trained semantic feature extraction model is used to cluster the video, which reduces the processing of multiple image frames of the video and improves computing efficiency and clustering accuracy.

Benefits of technology

It improves the efficiency and accuracy of video clustering, with small computational workload and fast processing speed. The feature vector of the video title accurately expresses the video content characteristics, which improves the accuracy of the clustering results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112131430B
    Figure CN112131430B
Patent Text Reader

Abstract

The present application provides a video clustering method, device, storage medium and electronic device, which belongs to the field of computer technology and relates to artificial intelligence and natural language processing technology. Among them, the video clustering method includes: obtaining the video title of each video in the video data set to be clustered, clustering the video according to the feature vector corresponding to the semantic feature of each video title, and obtaining multiple video sets. Compared with the processing of multiple image frames in the video in the related art, this method processes the video title of the video, with small amount of calculation, fast processing speed and high efficiency. Moreover, since the video title can represent the content information of the video, the feature vector of the video title can accurately express the content characteristics of the video. Based on the feature vector of the video title, clustering the video can improve the accuracy of the clustering result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a video clustering method, device, storage medium and electronic device. Background Art

[0002] As people's spiritual and cultural needs continue to increase, various video resources are constantly enriched. For example, creators publish hundreds of thousands of short videos through Internet platforms every day. When users watch videos, they need to search for videos of interest in a huge amount of video resources, which takes a lot of time.

[0003] In order to facilitate the management of massive amounts of videos and reduce the time users spend searching for videos of interest, videos can be clustered and the same category labels can be set for videos in the same category. For example, a "food" label can be set for some food videos, and a "military" label can be set for some military videos.

[0004] At present, when clustering videos, key image frames are usually extracted from the video first, and then the video is clustered according to the image features in the key image frames to obtain clustering results. This method processes multiple image frames in the video, with large amount of calculation, complex processing and low efficiency. In addition, it is easy to make wrong judgments when determining the key image frames and the image features in the key image frames, which affects the accuracy of the clustering results. Summary of the invention

[0005] In order to solve the existing technical problems, the embodiments of the present application provide a video clustering method, device, storage medium and electronic device, which can improve the efficiency and accuracy of video clustering.

[0006] To achieve the above purpose, the technical solution of the embodiment of the present application is implemented as follows:

[0007] In a first aspect, an embodiment of the present application provides a video clustering method, the method comprising:

[0008] Get the video title of each video in the video dataset to be clustered;

[0009] Extract semantic features from each video title to obtain a feature vector for each video title;

[0010] According to the obtained feature vector of each video title, each video in the video data set is clustered to obtain multiple video sets; the videos in each video set belong to the same category.

[0011] In a second aspect, an embodiment of the present application further provides a video clustering device, the device comprising:

[0012] A title acquisition unit, used to acquire a video title of each video in the video data set to be clustered;

[0013] A feature extraction unit, used to extract semantic features from each video title to obtain a feature vector for each video title;

[0014] The video clustering unit is used to perform clustering processing on each video in the video data set according to the obtained feature vector of each video title to obtain multiple video sets; the videos in each video set belong to the same category.

[0015] In an optional embodiment, the feature extraction unit is specifically used to:

[0016] Each video title is input into a trained semantic feature extraction model to obtain a feature vector of each video title; the semantic feature extraction model is trained using video title samples with annotated category labels as training data.

[0017] In an optional embodiment, the device further includes a model training unit, which is used to:

[0018] Acquire a training data set, wherein the training data set includes a plurality of video title samples, each of which has a corresponding category label, and the category label is used to identify the category to which the video corresponding to the video title sample belongs;

[0019] Extract video caption samples from the training dataset;

[0020] Input the extracted video title samples into the semantic feature extraction model to be trained to obtain the feature vector of the video title samples;

[0021] Inputting the feature vector of the video title sample into the classification network to obtain the category prediction result of the video title sample output by the classification network;

[0022] Determine the loss value according to the category prediction result of the video title sample and the category label of the video title sample;

[0023] The network parameters of the semantic feature extraction model to be trained and the classification network are adjusted according to the determined loss value until the loss value converges, and the semantic feature extraction model after the network parameters are adjusted is used as the trained semantic feature extraction model.

[0024] In an optional embodiment, the semantic feature extraction model to be trained is a pre-trained BERT model or a Word2vec model.

[0025] In an optional embodiment, each video title sample has multiple category labels, and the classification network is a multi-classification network; the model training unit is specifically used to:

[0026] Input the feature vector of the video title sample into the multi-classification network to obtain the predicted probability of the video title sample corresponding to each preset category;

[0027] The prediction probability greater than or equal to the set threshold and the corresponding preset category are used as the category prediction result of the video title sample.

[0028] In an optional embodiment, each video title sample has a category label, the classification network is a binary classification network; and the model training unit is specifically used to:

[0029] Input the feature vector of the video title sample into the binary classification network to obtain the predicted probability of the video title sample corresponding to each preset category;

[0030] The maximum value of the predicted probability and the corresponding preset category are taken as the category prediction result of the video title sample.

[0031] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the video clustering method of the first aspect is implemented.

[0032] In a fourth aspect, an embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the computer program is executed by the processor, the processor implements the video clustering method of the first aspect.

[0033] The video clustering method, device, storage medium and electronic device provided in the embodiment of the present application obtain the video title of each video in the video data set to be clustered, and cluster the video according to the feature vector corresponding to the semantic feature of each video title to obtain multiple video sets. Compared with the processing of multiple image frames in the video in the related art, the method provided in the embodiment of the present application processes the video title of the video, with small amount of calculation, fast processing speed and high efficiency. Moreover, since the video title can represent the content information of the video, the feature vector of the video title can accurately express the content characteristics of the video. Based on the feature vector of the video title, the video is clustered, which can improve the accuracy of the clustering result. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0035] Figure 1 A schematic diagram of an application scenario of a video clustering method provided in an embodiment of the present application;

[0036] Figure 2 A flowchart of a video clustering method provided in an embodiment of the present application;

[0037] Figure 3 A flowchart of a method for training a semantic feature extraction model provided in an embodiment of the present application;

[0038] Figure 4 A schematic diagram of the structure of a semantic feature extraction model provided in an embodiment of the present application;

[0039] Figure 5 A schematic diagram of the internal structure of a semantic feature extraction model provided in an embodiment of the present application;

[0040] Figure 6 A schematic diagram of a semantic feature extraction process provided in an embodiment of the present application;

[0041] Figure 7 A schematic diagram of a video recommendation interface provided in an embodiment of the present application;

[0042] Figure 8 A schematic diagram of the structure of a video clustering device provided in an embodiment of the present application;

[0043] Fig. 9 A schematic diagram of the structure of another video clustering device provided in an embodiment of the present application;

[0044] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0046] It should be noted that the terms "including" and "having" and their variations involved in the documents of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0047] Some of the terms used in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.

[0048] (1) Short videos: A form of Internet content dissemination, short videos refer to high-frequency video content that can be played through a client, suitable for viewing on the move or in a short leisure state. Due to the short content, it can be a single video or a series of columns. Generally, anchors who use new media platforms for live video broadcasts will also send their own recorded short videos to the server of the new media platform to share with users.

[0049] (2) BERT (Bidirectional Encoder Representations from Transformers) model: A natural language processing model based on a multi-layer Transformer model with an encoder-decoder architecture that can be used for a variety of natural language processing tasks such as text generation, named entity recognition, natural language reasoning, and text classification.

[0050] (3) Word2vec model: A natural language processing model that learns semantic knowledge from a large amount of text corpus in an unsupervised manner. It uses word vectors to represent the semantic information of words by learning text, that is, through an embedding space, semantically similar words are very close in the space.

[0051] (4) K-means clustering: A clustering algorithm that can cluster feature vectors with high similarity and small differences into one cluster based on the distance, similarity or closeness between feature vectors, and obtain multiple clusters formed by different feature vectors. The feature vectors within the same cluster are highly similar, and the feature vectors of different clusters are highly different. The cluster center of each cluster is the mean vector obtained by averaging the feature vectors belonging to the cluster. Therefore, the K-means clustering algorithm is also called the K-means clustering algorithm or the K-means clustering algorithm.

[0052] The word “exemplary” is used hereinafter to mean “serving as an example, example, or illustration.” Any embodiment described as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0053] The terms "first" and "second" in this document are used for descriptive purposes only and should not be understood as explicitly or implicitly indicating relative importance or implicitly indicating the number of technical features indicated. Therefore, features defined as "first" and "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.

[0054] The embodiments of the present application relate to artificial intelligence (AI) and machine learning technology, and are designed based on natural language processing technology and machine learning (ML) in artificial intelligence.

[0055] Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology mainly includes computer vision technology, natural language processing technology, and machine learning / deep learning.

[0056] With the research and advancement of artificial intelligence technology, artificial intelligence has been studied and applied in many fields, such as common smart homes, smart customer service, virtual assistants, smart speakers, smart marketing, unmanned driving, autonomous driving, robots, smart medical care, etc. I believe that with the development of technology, artificial intelligence will be applied in more fields and play an increasingly important role.

[0057] Machine learning is a multi-disciplinary interdisciplinary subject, involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills, and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning generally include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning and other technologies. In the process of semantic feature extraction of video titles, the embodiment of the present application adopts a semantic feature extraction model based on machine learning or deep learning to learn video title samples with category labels, so that the feature vector of the semantic features of the input video title can be extracted.

[0058] Natural language processing technology is an important direction in the fields of computer science and artificial intelligence. Its research can realize various theories and methods for effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language used by people in daily life, so it is closely related to the study of linguistics. Natural language processing technology generally includes technologies such as text generation, text processing, semantic understanding, machine translation, robot question and answer, knowledge graph, etc. The embodiment of the present application adopts the semantic understanding technology in natural language processing technology to perform semantic understanding on the video titles of each video, and based on the obtained feature vector that can characterize the semantic features of the video title, cluster processing is performed on each video in the video data set to obtain multiple video sets.

[0059] In order to better understand the technical solutions provided in the embodiments of the present application, the following briefly introduces the application scenarios to which the technical solutions provided in the embodiments of the present application are applicable. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not intended to limit the application. In specific implementation, the technical solutions provided in the embodiments of the present application can be flexibly applied according to actual needs.

[0060] The video clustering method provided in the embodiment of the present application can be applied to Figure 1 In an application scenario shown in FIG. Figure 1 As shown, the server 100 is connected to the terminal device 300 through the network 200 for communication, wherein the network 200 may be but is not limited to a local area network, a metropolitan area network or a wide area network, and the number of the terminal devices 300 connected to the server 100 may be multiple. The terminal device 300 may transmit communication data and messages to each other through the network 200 and the server 100. The terminal device 300 may be a portable device (e.g., a mobile phone, a tablet computer, a laptop computer, etc.), or a computer, a smart screen or a personal computer (PC, Personal Computer), etc. The server 100 may be a server or a server cluster or a cloud computing center composed of several servers, or a virtualization platform, or a personal computer, a large or medium-sized computer or a computer cluster, etc. According to the implementation needs, the application scenario in the embodiment of the present application may have any number of terminal devices and servers. This application does not make any special restrictions on this.

[0061] The terminal device 300 shoots a video through a camera, or obtains the video through other means such as network downloading. For example, a video publishing client is installed on the terminal device 300, and the video publishing platform corresponding to the video publishing client is located on the server 100. After the user uses the terminal device 300 to shoot a video, the terminal device 300 sends the shot video to the server 100 through the video publishing client, and the server 100 can publish the received videos sent by each terminal device on the video publishing platform, so that other users can watch the published videos by logging into the video publishing platform. The server 100 can also perform clustering processing on the videos to be published or the videos that have been published to the video publishing platform, and set category tags for each video.

[0062] Since video is a highly unstructured data, the quantity is huge and the growth rate is very fast, it is difficult to set category labels for it manually.

[0063] In the related art, when clustering a video, the content features of the video are usually used to first extract the key image frames in the video, and then use the network model obtained by unsupervised training to extract the image features of the key image frames, and cluster the video according to the image features in the key image frames to obtain the clustering results. This method processes multiple image frames in the video, with a large amount of calculation, a complex processing process, and low efficiency. Moreover, since the network model obtained by unsupervised training is used to extract the image features of the key image frames, the image features output by the network model are too abstract, and the final clustering results are often inaccurate and cannot achieve the expected video classification effect.

[0064] In order to improve the efficiency and accuracy of video clustering, an embodiment of the present application provides a video clustering method, which extracts semantic features from the video title of each video to obtain a feature vector of each video title, and clusters multiple videos based on the feature vector of each video title to obtain multiple video sets. Compared with the related art of processing multiple image frames in a video, the method provided in the embodiment of the present application processes the video title of the video, with a small amount of calculation, fast processing speed and high efficiency. Moreover, since the video title can represent the content information of the video, the feature vector of the video title can accurately express the content characteristics of the video. Based on the feature vector of the video title, clustering the video can improve the accuracy of the clustering result.

[0065] It should be noted that the video clustering method provided in the embodiment of the present application can be executed by the server 100, or can be executed collaboratively by the terminal device 300 and the server 100.

[0066] The video clustering method provided by the embodiment of the present application is described in detail below in conjunction with the accompanying drawings and specific implementation methods. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.

[0067] Figure 2 A flowchart of a video clustering method provided by an embodiment of the present application is shown. The method can be performed by Figure 1 The server 100 in the embodiment may also be executed by a terminal device or other electronic device. By way of example, the specific implementation process of the video clustering method of the embodiment of the present application is described below using a server for video clustering as the execution subject. The specific implementation process executed by other devices is similar to the process executed by the server alone, and will not be repeated herein.

[0068] like Figure 2 As shown, the video clustering method includes the following steps:

[0069] Step S201, obtaining the video title of each video in the video data set to be clustered.

[0070] The video data set to be clustered may include videos that are about to be published on the video publishing platform, or videos that have been published on the video publishing platform. The videos in the video data set may be sent from the terminal device to the server, or obtained by the server from the server of other platforms. Each video in the video data set has a video title.

[0071] For example, a user can shoot a short video with a camera in a terminal device and then upload the short video to a server. The user can set a video title for the short video before uploading it to the server. Alternatively, a staff member can set a video title for the short video after the short video is uploaded to the server.

[0072] Optionally, the server can periodically cluster videos published to the video publishing platform. These videos can be short videos uploaded by users through terminal devices, or series of videos published by other video publishers, such as TV series or other videos. The server groups the videos to be clustered into a video dataset and obtains the video title of each video in the video dataset.

[0073] Step S202: extract semantic features from each video title to obtain a feature vector for each video title.

[0074] For example, each acquired video title can be input into a trained semantic feature extraction model to obtain a feature vector for each video title. Figure 4As shown, the network structure of the semantic feature extraction model may include an input layer, a hidden layer, and an output layer. For any video title, after the video title is segmented, each segmented word E1~En is input into the input layer of the semantic feature extraction model, and each segmented word is processed through the hidden layer to obtain the word vectors T1~Tn corresponding to each segmented word. The output layer obtains the sentence vector corresponding to the video title according to the word vectors corresponding to each segmented word, and the sentence vector can be used as the feature vector of the video title.

[0075] The semantic feature extraction model is trained by using video title samples with category labels as training data. The training process of the semantic feature extraction model will be described in detail below.

[0076] In some embodiments, the server may use the BERT model as a semantic feature extraction model to extract semantic features of the video title and obtain a feature vector of the video title.

[0077] The hidden layer of the BERT model can include one or more Transformer model structures. The Transformer model structure can be as follows: Figure 5 As shown in the figure, it includes a mask multi-head attention layer (Mask Multi-Head Attention) and a feed forward network layer (Feed Forward). The Transformer model can use the segmentation in the previous context of a segmentation to predict the segmentation. The mask multi-head attention layer is used to mask the segmentation in the context of the segmentation to prevent the leakage of information in the context. The mask multi-head attention layer and the feed forward network layer are connected to a data normalization layer to normalize the data before inputting it into the next network layer. Normalizing the data output by each network layer is conducive to speeding up the training speed of the model and improving the training effect of the model.

[0078] For example, in one embodiment, the BERT model is composed of a 12-layer Transformer Encoder (or Transformer model). First, the [CLS] identifier is inserted at the head position of the video title, and then the video title after the identifier is inserted is input into the BERT model with a 12-layer Transformer encoder to obtain a feature vector of the video title.

[0079] In other embodiments, the server may use the Word2vec model as a semantic feature extraction model to extract semantic features of the video title and obtain a feature vector of the video title. Specifically, the Word2Vec model may determine the vector representation of the word segmentation based on the context in which the word segmentation is located. The Word2Vec model may be used to determine the word vectors of each word segmentation in the video title, and the feature vector of the video title may be determined based on the word vectors of each word segmentation.

[0080] Step S203, clustering each video in the video data set according to the obtained feature vector of each video title to obtain multiple video sets.

[0081] After obtaining the feature vector of each video title, each video in the video data set can be clustered to obtain a clustering result, that is, multiple video sets. The videos in each video set belong to the same category.

[0082] The video clustering method provided in the embodiment of the present application obtains the video title of each video in the video data set to be clustered, and performs clustering processing on the video according to the feature vector corresponding to the semantic feature of each video title to obtain multiple video sets. Compared with the related art of processing multiple image frames in the video, the method provided in the embodiment of the present application processes the video title of the video, with small amount of calculation, fast processing speed and high efficiency.

[0083] In the above embodiment, only the video title is input into the semantic feature extraction model, and the feature vector of the video title is used to represent the content information of the video. Compared with inputting both the video title and the existing category label of the video into the semantic feature extraction model, and using the feature vector jointly determined by the video title and the existing category label of the video to represent the content information of the video, the video is clustered based on the feature vector of the video title. According to the clustering result, the repetition rate of the category label set for the video and the existing category label of the video is low, which is conducive to discovering many valuable new categories.

[0084] For example, suppose that the original classification of the video already includes categories such as "current affairs", "food", "sports", and "travel", that is, the existing category labels of the video already include the above categories. If the video title and the existing category labels of each video are input into the semantic feature extraction model, and the videos are clustered based on the obtained feature vectors jointly determined by the video title and the existing category labels of the video, the multiple video sets obtained are likely to still include several categories such as "current affairs", "food", "sports", and "travel", resulting in a large area of ​​duplication between the generated clustering results and the existing category labels of the video. The repetition rate of the category labels set for the video based on the clustering results and the existing category labels of the video will be high, and the clustering results may be unusable.

[0085] By adopting the video clustering method provided in the embodiment of the present application, only the video title of each video is input into the semantic feature extraction model, and the videos are clustered based on the feature vectors of the obtained video titles. The obtained multiple video sets will contain more new categories, and the repetition rate between the category labels set for the videos based on the clustering results and the existing category labels of the videos will be lower, and the clustering results will be richer.

[0086] In some embodiments, in the above step S203, a K-means clustering algorithm may be used to cluster the feature vectors of the video titles, and the videos may be clustered according to the clustering results of the feature vectors.

[0087] Exemplarily, after obtaining the feature vector of each video title, a preset number of feature vectors can be selected from the feature vectors of each video title as initial cluster centers, and the feature vector of each video title and the initial cluster center with the closest distance can be divided into the same cluster, and the steps of determining the cluster center of each cluster according to the feature vector in each cluster, and dividing the feature vector of each video title and the cluster center with the closest distance into the same cluster are repeated until the variation range of each cluster center is within the expected range, and multiple clusters are obtained, and then the videos corresponding to the feature vectors of the video titles in each cluster are divided into the same video set, thereby obtaining multiple video sets.

[0088] Specifically, the number of video sets obtained after the video data set is clustered can be determined first. For example, the number of video sets obtained can be preset to K. K feature vectors are selected from the feature vectors of all the obtained video titles as initial cluster centers, and the distance between the feature vector of each video title and each initial cluster center is calculated respectively. The feature vector of each video title and the initial cluster center with the closest distance are divided into the same cluster to obtain K clusters. For each of the K clusters, the mean vector of all feature vectors in the cluster is calculated, and the obtained mean vector is used as the new cluster center of the cluster. If the distance between the obtained new cluster center and the original cluster center is less than or equal to the set distance value, the clustering process is terminated to obtain multiple clusters. The videos corresponding to the feature vectors of the video titles in each cluster are divided into the same video set to obtain multiple video sets.

[0089] In some embodiments, after obtaining multiple video sets, a category label can be set for each video based on the obtained video sets. Specifically, the same category label can be marked for each video in the specified video set according to the received category information input for the specified video set in the multiple video sets.

[0090] For example, the clustering results of the videos can be displayed to the user. After watching some or all videos in a certain video collection, the user can determine the video category corresponding to the video collection and input the category information for the video collection. For example, if all the videos in a certain video collection are related to the military, the user can determine that the video category corresponding to the video collection is "military" and fill in "military" in the category information collection of the video collection. The server marks each video in the video collection with the category label "military" according to the received category information "military" input for the video collection.

[0091] In some embodiments, after the video is labeled with a category label, the video can be recommended to the user based on the labeled category label.

[0092] Specifically, feature information of the target user may be obtained, and a target category label may be determined according to the feature information of the target user, and a video labeled with the target category label may be selected as a target video recommended to the target user.

[0093] In one embodiment, the characteristic information of the target user may be information related to the videos watched by the target user, and the information related to the videos watched by the target user may reflect the types of videos that the target user is interested in. For example, the information of the current video being watched by the target user may be obtained, the category label of the current video may be determined, and a video with the same category label as the current video may be selected from the videos to be selected, and the selected video may be recommended to the target user. Alternatively, the information of the historical videos recorded in the historical playback records of the target user may be obtained, and the corresponding video may be selected from the videos to be selected based on the category label that appears the most times in the historical videos or the category label that has appeared before, and the selected video may be recommended to the target user.

[0094] In one embodiment, the characteristic information of the target user may be the age, gender and other information of the target user. The user group to which the target user belongs may be determined based on the age, gender and other information of the target user. The target category label may be determined based on the recorded hobbies of the user group, and videos marked with the target category label may be selected and recommended to the target user.

[0095] For example, Figure 7As shown, a video playback client is installed on the terminal device. When a user watches a video on a video publishing platform through the video playback client, the server can recommend videos to the user based on the user's feature information and the category label corresponding to the video, and send the recommended video to the user's terminal device. The terminal device can display the video recommended to the user below the video playback area in the display interface. When the user is interested in the recommended video, he can directly click on the recommended video to watch it. In some embodiments, when the user opens the video playback client, the video recommended to the user based on the user's feature information can also be displayed on the homepage.

[0096] Through the above method, similar videos can be pushed to the same or similar users, and even a user interest map can be constructed, and the user's interests can be mined and explored based on the interest map. Videos that the user is interested in can be recommended to the user based on the user's interests, which is conducive to improving the user's video viewing experience and increasing the user's video viewing time.

[0097] The training process of the semantic feature extraction model used in the above embodiment can be as follows: Figure 3 As shown, the training method of the semantic feature extraction model can be executed by a server or by a terminal device. This embodiment is described by taking the server executing the training method as an example.

[0098] like Figure 3 As shown, the training method of the semantic feature extraction model may include the following steps:

[0099] Step S301, obtaining a training data set.

[0100] The acquired training data set may include multiple video title samples, each of which is annotated with a corresponding category label, which is used to identify the category to which the video corresponding to the video title sample belongs. The video title samples may come from published videos. Since the published videos already have category labels, the category labels of the video title samples can be determined according to the category labels of the corresponding videos, so each video title sample is annotated with a corresponding category label. For example, some video title samples are annotated with the category label "food", and some video title samples are annotated with the category label "sports", etc.

[0101] Step S302: extract video title samples from the training data set.

[0102] A training data set may be obtained in advance, and when training the model, video title samples are extracted from the training data set as training sample data.

[0103] Step S303: input the extracted video title sample into the semantic feature extraction model to be trained to obtain the feature vector of the video title sample.

[0104] In some embodiments, the semantic feature extraction model to be trained can be a pre-trained Word2vec model or BERT model. For example, a large-scale (large amount of sample data) Chinese data set can be used to pre-train the Word2vec model or BERT model to obtain a pre-trained Word2vec model or BERT model. The pre-trained Word2vec model or BERT model has a strong ability to extract sentence semantic information. On this basis, it is only necessary to fine-tune the network parameters of the pre-trained Word2vec model or BERT model using a training data set composed of video sample data, so that it can be applied to the video clustering scenario of the embodiment of the present application to accurately extract the semantic features of the video title.

[0105] The video title sample is input into the semantic feature extraction model to be trained, and a feature vector of the video title sample output by the semantic feature extraction model to be trained is obtained.

[0106] Step S304: input the feature vector of the video title sample into the classification network to obtain the predicted category of the video title sample output by the classification network.

[0107] In an embodiment of the present application, a classification network is used as an auxiliary to train a semantic feature extraction model. In practical applications, only the trained semantic feature extraction model is used to extract semantic features from the input video title, and the classification network is no longer used. Optionally, the structure of the classification network may include a pooling layer and a fully connected layer. The feature vector of the video title sample is input to the pooling layer, and the pooling layer is used to reduce the dimension of the input feature vector, and the feature vector after dimension reduction is input to the fully connected layer. The fully connected layer is used to splice the input feature vector, and output the predicted category of the video title sample according to the spliced ​​feature vector.

[0108] In some embodiments, each video title sample may have a category label, and the classification network may adopt a binary classification network, such as an SVM classifier or a Softmax classifier. The feature vector of the video title sample is input into the binary classification network to obtain the prediction probability of the video title sample corresponding to each preset category, and the maximum value of the prediction probability and the corresponding preset category are used as the category prediction result of the video title sample.

[0109] Considering that the same video may belong to multiple different categories and have multiple category labels. In other embodiments, each video title sample may have multiple category labels, and the classification network may adopt a multi-classification network, such as a Softmax classifier. Among them, the Softmax classifier can be used for both binary classification and multi-classification. The feature vector of the video title sample is input into the multi-classification network to obtain the prediction probability of the video title sample corresponding to each preset category, and the prediction probability greater than or equal to the set threshold and the corresponding preset category are used as the category prediction result of the video title sample.

[0110] Take the BERT model as an example, the semantic feature extraction model to be trained is: Figure 6 As shown in the figure, first insert the [CLS] identifier at the head position of the extracted video title sample, such as inserting the [CLS] identifier at the head position of the video title "Food Tour Came to XXXX, Authentic XXXX is Really Delicious", and then perform word segmentation on the video title sample after inserting the identifier and input it into the BERT model with a 12-layer Transformer decoder. The top layer of the BERT model (the 12th layer Transformer) outputs the feature vector of the video title sample. The feature vector of the video title sample is classified into multiple labels through the classification network, and classification labels such as "Food Exploration", "Food Culture", and "XXXX" are obtained as category prediction results.

[0111] Step S305, determining a loss value according to the predicted category of the video title sample and the category label of the video title sample.

[0112] When calculating the loss value, a preset loss function can be used to calculate the loss value. The loss function can use a cross entropy loss function, such as a Sigmoid function. The loss function used can also be, but not limited to, a multi-classification cross entropy loss function, a contrastive loss function related to metric learning, or a triplet loss function. Generally, the loss value is used to determine how close the actual output is to the expected output. The smaller the loss value, the closer the actual output is to the expected output.

[0113] Step S306, determine whether the loss value converges to a preset target value; if not, execute step S307; if yes, execute step S308.

[0114] Determine whether the loss value converges to the preset target value. If the loss value is less than or equal to the preset target value, or the change in the loss value obtained after N consecutive trainings is less than or equal to the preset target value, it is considered that the loss value has converged to the preset target value, indicating that the loss value has converged; otherwise, it means that the loss value has not yet converged.

[0115] Step S307: adjusting the parameters of the semantic feature extraction model to be trained according to the determined loss value.

[0116] If the loss value has not converged, the model parameters are adjusted. After the model parameters are adjusted, the process returns to step S302 to continue the next round of training.

[0117] Step S308, ending the training to obtain a trained semantic feature extraction model.

[0118] If the loss value converges, the currently obtained semantic feature extraction model is used as the trained semantic feature extraction model.

[0119] In one embodiment, in the above step S307, when adjusting the model parameters, the parameters of the semantic feature extraction model and the classification network can be adjusted at the same time, that is, the parameters of the semantic feature extraction model and the classification network to be trained are adjusted according to the loss value until the loss value converges to a preset target value, and the obtained semantic feature extraction model is used as the trained semantic feature extraction model.

[0120] When using the classification network as an auxiliary training model to train the semantic feature extraction model, the classification network can also be trained in advance. In the above step S307, when adjusting the model parameters, only the parameters of the semantic feature extraction model can be adjusted until the loss value converges to the preset target value. The obtained semantic feature extraction model is used as the trained semantic feature extraction model.

[0121] Since only a small part of the existing category labels of the video are manually annotated by the staff according to the video content, and most of them are automatically annotated by the video understanding model, the existing category labels of the video can represent the content information of the video to a large extent. In the above training process, using the existing category labels of the video as the training target of the semantic feature extraction model can enable the semantic feature extraction model to learn more video content features when learning video title samples. The semantic feature extraction model obtained through the above training process can better express the video content features, and the results of vectorizing the video according to the video title are richer. Its richness can be better utilized in the clustering process, so that the clustering results obtained can be more in line with expectations.

[0122] At the same time, the embodiment of the present application avoids directly using the existing category labels of the video in practical applications, and only uses the existing category labels of the video to supervise the training effect of the model when training the semantic feature extraction model. In practical applications, the semantic feature extraction model obtained by training is used to extract the feature vector of the video title, and the feature vector of the video title is used to characterize the video, that is, the video information is extracted from both the title dimension and the content dimension. Since the existing label information of the video is not explicitly used in the video clustering process, the clustering results are significantly different from the clustering results that explicitly use the video label information. The clustered categories are more inclined to clustering based on the original title information, so the clustering results have a good difference from the existing label system (the existing category labels of the video). The clustering results obtained based on the video clustering method provided in the embodiment of the present application can dig out more video interest points, hot topics or new categories, and promote the construction of video classification and labeling system of the information flow platform.

[0123] For example, in a specific embodiment, the video data set to be clustered obtained by the server includes 30,000 short videos and their video titles, of which 6 short videos are P1, P2, P3, P4, P5, and P6. The video title of short video P1 is "Today we came to XX store, the XXXX here is particularly delicious", the video title of short video P2 is "In the XX event, XXX won the first place in the track and field event", the video title of short video P3 is "I took a break on the weekend and came to XXXX. The scenery of XXXX is really beautiful", the video title of short video P4 is "XXX in XXXXX store is very famous, let's try it today", the video title of short video P5 is "I ran XX kilometers today and consumed XX calories", and the video title of short video P6 is "Here in XXX, you can blow the sea breeze and sunbathe". The server inputs the video title of each short video into the semantic feature extraction model respectively to obtain the feature vector of each video title, and a total of 30,000 feature vectors are obtained. According to the distance between the 30,000 feature vectors, the 30,000 feature vectors are clustered. The number of clusters can be pre-set to 10. Through the clustering method described above, the 30,000 feature vectors can be divided into 10 clusters. According to the clustering results of the feature vectors, the videos corresponding to the feature vectors in each cluster are divided into the same video set, and a total of 10 video sets are obtained. After clustering, it can be obtained that the short video P1 and the short video P4 are divided into the same video set, and the category label of the video set to which they belong can be set to "food", the short video P2 and the short video P5 are divided into the same video set, and the category label of the video set to which they belong can be set to "sports", and the short video P3 and the short video P6 are divided into the same video set, and the category label of the video set to which they belong can be set to "travel".

[0124] and Figure 2 The video clustering method shown is based on the same inventive concept, and a video clustering device is also provided in the embodiment of the present application, which can be deployed in a server or a terminal device. Since the device is a device corresponding to the video clustering method of the present application, and the principle of solving the problem by the device is similar to that of the method, the implementation of the device can refer to the implementation of the above method, and the repeated parts will not be repeated.

[0125] Figure 8 A schematic diagram of the structure of a video clustering device provided in an embodiment of the present application is shown. Figure 8 As shown, the video clustering device includes a title acquisition unit 801, a feature extraction unit 802 and a video clustering unit 803.

[0126] The title acquisition unit 801 is used to acquire the video title of each video in the video data set to be clustered;

[0127] A feature extraction unit 802 is used to extract semantic features from each video title to obtain a feature vector for each video title;

[0128] The video clustering unit 803 is used to perform clustering processing on each video in the video data set according to the obtained feature vector of each video title to obtain multiple video sets; the videos in each video set belong to the same category.

[0129] In an optional embodiment, the feature extraction unit 802 is specifically configured to:

[0130] Each video title is input into the trained semantic feature extraction model to obtain the feature vector of each video title.

[0131] In an optional embodiment, the video clustering unit 803 is specifically configured to:

[0132] From the feature vectors of each video title, a preset number of feature vectors are selected as initial cluster centers, and the feature vector of each video title and the initial cluster center closest to it are divided into the same cluster;

[0133] Repeat the steps of determining the cluster center of each cluster according to the feature vector in each cluster, and classifying the feature vector of each video title and the cluster center with the closest distance into the same cluster, until the variation range of each cluster center is within the expected range, and a plurality of clusters are obtained;

[0134] The videos corresponding to the feature vectors of the video titles in each cluster are divided into the same video set to obtain multiple video sets.

[0135] In an optional embodiment, if Fig. 9 As shown, the above-mentioned video clustering device may further include a model training unit 901 , a label marking unit 902 and a video recommendation unit 903 .

[0136] Among them, the model training unit 901 is used to obtain a training data set, which includes multiple video title samples, each of which has a corresponding category label, and the category label is used to identify the category of the video corresponding to the video title sample; extract the video title sample from the training data set; input the extracted video title sample into the semantic feature extraction model to be trained to obtain the feature vector of the video title sample; input the feature vector of the video title sample into the classification network to obtain the category prediction result of the video title sample output by the classification network; determine the loss value according to the category prediction result of the video title sample and the category label of the video title sample; adjust the network parameters of the semantic feature extraction model to be trained and the classification network according to the determined loss value until the loss value converges, and use the semantic feature extraction model after adjusting the network parameters as the trained semantic feature extraction model;

[0137] The label labeling unit 902 is used to label each video in the specified video set with the same category label according to the received category information input for the specified video set in the multiple video sets;

[0138] The video recommendation unit 903 is used to obtain feature information of a target user, determine a target category label according to the feature information of the target user, and select a video marked with the target category label as a target video recommended to the target user.

[0139] In an optional embodiment, each video title sample has multiple category labels, and the classification network is a multi-classification network; the model training unit 901 is specifically used to:

[0140] Input the feature vector of the video title sample into the multi-classification network to obtain the predicted probability of the video title sample corresponding to each preset category;

[0141] The prediction probability greater than or equal to the set threshold and the corresponding preset category are used as the category prediction result of the video title sample.

[0142] In an optional embodiment, each video title sample has a category label, and the classification network is a binary classification network; the model training unit 901 is specifically used for:

[0143] Input the feature vector of the video title sample into the binary classification network to obtain the predicted probability of the video title sample corresponding to each preset category;

[0144] The maximum value of the predicted probability and the corresponding preset category are taken as the category prediction result of the video title sample.

[0145] In an optional embodiment, the semantic feature extraction model to be trained is a pre-trained BERT model or a Word2vec model.

[0146] Based on the same inventive concept as the above method embodiment, an electronic device is also provided in the embodiment of the present application. The electronic device can be used for video clustering. In one embodiment, the electronic device can be a server, or a terminal device or other electronic device. In this embodiment, the structure of the electronic device can be as follows: Fig.10 As shown, it includes a memory 101 , a communication module 103 and one or more processors 102 .

[0147] The memory 101 is used to store computer programs executed by the processor 102. The memory 101 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0148] The memory 101 may be a volatile memory, such as a random-access memory (RAM); the memory 101 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), or the memory 101 is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 101 may be a combination of the above memories.

[0149] The processor 102 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 102 is configured to implement the above-mentioned video clustering method when calling the computer program stored in the memory 101 .

[0150] The communication module 103 is used to communicate with the terminal device and other electronic devices. If the electronic device is a server, the server can receive the video sent by the terminal device through the communication module 103, or pull the video from other servers through the communication module 103.

[0151] The specific connection medium between the memory 101, the communication module 103 and the processor 102 is not limited in the embodiments of the present application. Fig.10In the embodiment, the memory 101 and the processor 102 are connected via a bus 104. The bus 104 is Fig.10 The connections between other components are shown in bold lines, which are only for illustration and are not intended to be limiting. The bus 104 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0152] According to one aspect of the present application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. The processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the test case generation method in the above embodiment. The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0153] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A video clustering method, characterized in that: include: Get the video title of each video in the video dataset to be clustered; Input each video title into the trained semantic feature extraction model to obtain the feature vector of each video title; According to the obtained feature vector of each video title, clustering processing is performed on each video in the video data set to obtain multiple video sets; The videos in each video collection belong to the same category; The training process of the semantic feature extraction model includes: Acquire a training data set, wherein the training data set includes a plurality of video title samples, each of which has a corresponding category label, and the category label is a category label carried by the video corresponding to the video title sample; wherein the category label is used to characterize the content information of the video corresponding to the video title sample, and during the training process, the category label is used as a training target of the semantic feature extraction model to be trained, so that the semantic feature extraction model to be trained can learn the content information of the video corresponding to the video title sample; Extract video caption samples from the training dataset; Inputting the extracted video title samples into the semantic feature extraction model to be trained to obtain feature vectors of the video title samples; wherein the semantic feature extraction model to be trained is a pre-trained model obtained by pre-training based on a Chinese data set; Inputting the feature vector of the video title sample into the trained classification network to obtain the category prediction result of the video title sample output by the classification network; wherein the trained classification network includes a pooling layer and a fully connected layer, the pooling layer is used to perform dimensionality reduction processing on the feature vector of the video title sample, and the fully connected layer is used to splice the feature vector after the dimensionality reduction processing, and output the category prediction result of the video title sample according to the spliced ​​feature vector; Determine the loss value according to the category prediction result of the video title sample and the category label of the video title sample; The network parameters of the semantic feature extraction model to be trained are adjusted according to the determined loss value until the loss value converges, and the semantic feature extraction model after the network parameters are adjusted is used as the trained semantic feature extraction model. The trained semantic feature extraction model is used to extract the feature vector of the video title from the title dimension and the content dimension, and the feature vector includes the title information of the video title and the content information of the video corresponding to the video title.

2. The method according to claim 1, characterized in that After clustering each video in the video data set according to the obtained feature vector of each video title to obtain multiple video sets, the method further includes: According to the received category information input for a designated video set among the multiple video sets, each video in the designated video set is labeled with the same category label.

3. The method according to claim 2, characterized in that After labeling each video in the specified video set with the same category label according to the received category information input for the specified video set in the multiple video sets, the method further includes: Acquire characteristic information of a target user, and determine a target category label according to the characteristic information of the target user; A video marked with the target category label is selected as a target video recommended to the target user.

4. The method according to claim 1, characterized in that: The semantic feature extraction model to be trained is a pre-trained BERT model or a Word2vec model.

5. The method according to claim 1, characterized in that Each video title sample has multiple category labels, and the classification network is a multi-classification network; the feature vector of the video title sample is input into the classification network to obtain the category prediction result of the video title sample output by the classification network, including: Input the feature vector of the video title sample into the multi-classification network to obtain the predicted probability of the video title sample corresponding to each preset category; The prediction probability greater than or equal to the set threshold and the corresponding preset category are used as the category prediction result of the video title sample.

6. The method according to claim 1, characterized in that Each video title sample has a category label, and the classification network is a binary classification network; the feature vector of the video title sample is input into the classification network to obtain the category prediction result of the video title sample output by the classification network, including: Input the feature vector of the video title sample into the binary classification network to obtain the predicted probability of the video title sample corresponding to each preset category; The maximum value of the predicted probability and the corresponding preset category are taken as the category prediction result of the video title sample.

7. The method according to claim 1, characterized in that According to the obtained feature vector of each video title, each video in the video data set is clustered to obtain multiple video sets, including: From the feature vectors of each video title, a preset number of feature vectors are selected as initial cluster centers, and the feature vector of each video title and the initial cluster center closest to it are divided into the same cluster; Repeat the steps of determining the cluster center of each cluster according to the feature vector in each cluster, and classifying the feature vector of each video title and the cluster center with the closest distance into the same cluster, until the variation range of each cluster center is within the expected range, and a plurality of clusters are obtained; The videos corresponding to the feature vectors of the video titles in each cluster are divided into the same video set to obtain multiple video sets.

8. A video clustering device, characterized in that: include: A title acquisition unit, used to acquire a video title of each video in the video data set to be clustered; A feature extraction unit, used for inputting each video title into a trained semantic feature extraction model to obtain a feature vector of each video title; A video clustering unit, used for performing clustering processing on each video in the video data set according to the obtained feature vector of each video title, to obtain multiple video sets; the videos in each video set belong to the same category; The device also includes a model training unit, which is used to: Acquire a training data set, wherein the training data set includes a plurality of video title samples, each of which has a corresponding category label, and the category label is a category label carried by the video corresponding to the video title sample; wherein the category label is used to characterize the content information of the video corresponding to the video title sample, and during the training process, the category label is used as a training target of the semantic feature extraction model to be trained, so that the semantic feature extraction model to be trained can learn the content information of the video corresponding to the video title sample; Extract video caption samples from the training dataset; Inputting the extracted video title samples into the semantic feature extraction model to be trained to obtain feature vectors of the video title samples; wherein the semantic feature extraction model to be trained is a pre-trained model obtained by pre-training based on a Chinese data set; Inputting the feature vector of the video title sample into the trained classification network to obtain the category prediction result of the video title sample output by the classification network; wherein the trained classification network includes a pooling layer and a fully connected layer, the pooling layer is used to perform dimensionality reduction processing on the feature vector of the video title sample, and the fully connected layer is used to splice the feature vector after the dimensionality reduction processing, and output the category prediction result of the video title sample according to the spliced ​​feature vector; Determine the loss value according to the category prediction result of the video title sample and the category label of the video title sample; The network parameters of the semantic feature extraction model to be trained are adjusted according to the determined loss value until the loss value converges, and the semantic feature extraction model after the network parameters are adjusted is used as the trained semantic feature extraction model. The trained semantic feature extraction model is used to extract the feature vector of the video title from the title dimension and the content dimension, and the feature vector includes the title information of the video title and the content information of the video corresponding to the video title.

9. The device according to claim 8, characterized in that The device also includes: The label labeling unit is used to label each video in the specified video set with the same category label according to the received category information input for the specified video set in the multiple video sets.

10. The device according to claim 9, characterized in that The device also includes: The video recommendation unit is used to obtain feature information of a target user, determine a target category label according to the feature information of the target user, and select a video marked with the target category label as a target video recommended to the target user.

11. The device according to claim 8, characterized in that The feature extraction unit is specifically used for: Each video title is input into a trained semantic feature extraction model to obtain a feature vector of each video title; the semantic feature extraction model is trained using video title samples with annotated category labels as training data.

12. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

13. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program executable on the processor, and when the computer program is executed by the processor, the method according to any one of claims 1 to 7 is implemented.