Disclosure of Invention
In view of the foregoing analysis, embodiments of the present invention are directed to a method, apparatus, device, and medium for generating an electronic program guide, which solve one or more of the above-mentioned problems occurring in the prior art.
The purpose of the invention is realized in the following way:
An embodiment of a first aspect of the present invention provides a method for generating an electronic program guide, including:
acquiring a history watching program record, real-time playing program data and a program database;
Analyzing the historical watching program records to obtain watching preference characteristics, analyzing the real-time broadcasting program data to obtain real-time program characteristics, and analyzing the program database to obtain program characteristics of each program in the program database;
Calculating first similarity between the viewing preference characteristics and the real-time program characteristics, and generating a reference score according to the first similarity; calculating a second similarity between the viewing preference feature and program features of each program in the program database, and generating a comparison score according to the second similarity;
Screening programs with the comparison scores larger than the reference scores in a program database, and setting the programs as programs to be played;
And sorting the comparison scores of the programs to be played, and generating an electronic program guide according to the sorting result.
Further, the history viewing program record includes a history viewing program type, a viewing duration, a number of times of viewing, a viewing period.
Further, analyzing the historical viewing program records to obtain viewing preference characteristics, wherein the step of analyzing the historical viewing program records comprises the steps of converting the historical viewing program records into feature vectors by using a Word2vec model, calculating weights of program types, viewing time lengths, viewing times and viewing time periods, and adjusting the feature vectors through a weighting strategy to obtain the viewing preference characteristics.
Further, the analyzing the real-time playing program data to obtain real-time program features comprises the steps of collecting image frames from video streams of the real-time playing program and extracting image features, carrying out frequency spectrum analysis on audio streams of the real-time playing program to extract audio features, extracting text features in program subtitles or conversations, and carrying out multi-mode fusion on the image features, the audio features and the text features to obtain program feature vectors.
Further, the analyzing the program database to obtain the program characteristics of each program in the program database comprises the steps of extracting metadata of each program in the program database, including information such as program types, duration, actors, directors, labels, introduction and the like, and using a text analysis model based on keywords to conduct characteristic extraction and classification on the metadata of the program to generate the program characteristics.
Further, the calculating a first similarity between the viewing preference feature and the real-time program feature, generating a reference score according to the first similarity includes calculating a cosine similarity between the viewing preference feature and the real-time program feature as a first similarity expressed as: vu denotes the viewing preference feature, vr denotes the real-time program feature, and the benchmark score is expressed as scores=α×sim1 +β, α, β e [0,1] denotes the parameter used to adjust the benchmark score.
Further, the calculating a second similarity between the viewing preference feature and the program features of the respective programs in the program database, generating a comparison score according to the second similarity, includes calculating a cosine similarity between the viewing preference feature and the program features of the respective programs in the program database as a second similarity expressed as: vpi denotes the program characteristics of the ith program in the program database, and the comparison score is expressed as scorec=γ×sim2 +delta, gamma, delta e 0,1 denotes the parameters used to adjust the comparison score.
An embodiment of a second aspect of the present invention provides an electronic program guide generating apparatus, including:
the acquisition module is used for acquiring historical watching program records, real-time playing program data and a program database;
The analysis module is used for analyzing the historical watching program records to obtain watching preference characteristics, analyzing the real-time broadcasting program data to obtain real-time program characteristics, and analyzing the program database to obtain the program characteristics of each program in the program database;
The computing module is used for computing a first similarity between the watching preference feature and the real-time program feature, generating a reference score according to the first similarity, computing a second similarity between the watching preference feature and the program feature of each program in the program database, and generating a comparison score according to the second similarity;
The screening module is used for screening programs with the comparison score larger than the reference score in the program database and setting the programs to be played;
And the generation module is used for sorting the comparison scores of the programs to be played and generating an electronic program guide according to the sorting result.
An embodiment of a third aspect of the present invention provides an electronic device, including a memory and a processor, where the memory stores a computer program that, when executed by the processor, implements the electronic program guide generating method according to any of the embodiments.
An embodiment of a fourth aspect of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the electronic program guide generating method according to any of the embodiments.
Compared with the prior art, the invention has at least one of the following beneficial effects:
according to the electronic program guide generation method, the historical watching program records of the user, the real-time playing program data and the program database are analyzed to obtain watching preference characteristics reflecting the long-term interests of the user and real-time program characteristics reflecting the short-term interests of the user, the reference score is calculated according to the watching preference characteristics and the real-time program characteristics, standards are set for the electronic program guide, the comparison score is calculated according to the watching preference characteristics and the program characteristics, the comparison score is compared with the reference score, so that programs conforming to the long-term interests and the short-term interests of the user are mined from the program database, the electronic program guide is generated, the long-term interests of the user can be guaranteed to be met by the guide, the accuracy is high, the short-term interests of the user can be guaranteed to be met, and the dynamic performance is good.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. It should be noted that embodiments and features of embodiments in the present disclosure may be combined, separated, interchanged, and/or rearranged with one another without conflict. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1
In one embodiment of the present invention, as shown in fig. 1, an electronic program guide generating method is disclosed, comprising the steps of:
s1, acquiring a history watching program record, real-time playing program data and a program database.
Illustratively, the history viewing program record includes a history viewing program type, a viewing duration, a number of times of viewing, a viewing period.
In some embodiments, the historical viewing program records also include user interaction data such as search queries, program ratings, favorites, and the like.
The real-time broadcast program data includes video streams, audio streams, text data, metadata, and the like.
The program database includes programs to be played and metadata thereof.
In some embodiments, the historical viewing program records may need to be pre-processed, such as data cleansing, formatting, time slicing, etc.
S2, analyzing the historical watching program records to obtain watching preference characteristics, analyzing the real-time broadcasting program data to obtain real-time program characteristics, and analyzing the program database to obtain program characteristics of all programs in the program database.
In this embodiment, step S2 specifically includes:
s201, converting the historical watching program record into a feature vector by using a Word2vec model;
For example, a pre-trained Skip-gram model is used to extract keywords in a historical viewing program record, and then a serialization technique is used to map a keyword list to a vector space to obtain feature vectors, including a program type vectortype(pi, a viewing duration vectorduration(pi), a viewing times vectorfrequency(pi, and a viewing period vectortime(pi.
S202, calculating weights of program types, watching time lengths, watching times and watching time periods, and adjusting feature vectors through a weighting strategy to obtain watching preference features;
specifically, the weights of the program types are expressed as: Weights representing the genre of program pi, and the weights for the viewing durations are expressed as: duration (pi) represents the time length of the user watching program pi, N represents the total program number of historical watching records, and the weight of watching times is expressed as follows: count (pi) represents the number of times the user views program pi, and the weight of the viewing period is represented as: Represents the time since viewing program pi, λ represents the decay factor;
the viewing preference characteristics are expressed as follows:
in some embodiments, the method further comprises the step of introducing a real-time update mechanism, wherein the steps are as follows:
(I) Adding program data newly watched by a user into a history watching program record at regular intervals;
(II) progressively reducing the weight of the old viewing record by an attenuation mechanism.
S203, collecting image frames from a video stream of a real-time playing program, and extracting image features;
In particular, real-time program content feature extraction is a very important ring, comprising image features, audio features and text features, and aims to identify and extract the features of the currently played program by analyzing the content of the currently played program so as to match the viewing preference of the user when the user views the program, wherein the image features are extracted by the following steps:
(I) Image frame sampling, namely extracting static image frames from a video stream according to a certain frequency, sampling one frame every second so as to acquire visual characteristics of the video, then identifying and extracting key frames in the video, and determining which frames are key frames by detecting scene changes or calculating inter-frame differences;
(II) image feature representation, namely, utilizing a pre-trained CNN model to perform feature representation on the extracted image frame and converting the image into feature vectors, utilizing a target detection algorithm to identify specific objects or scenes in the image, thereby extracting features with finer granularity and identifying characters, objects, backgrounds and the like in programs;
And (III) video content aggregation, namely aggregating continuous image frame characteristics into video segment characteristics to capture dynamic changes of the video, and identifying types of different scenes in the video and marking the types of the scenes, such as indoor, outdoor, action scenes and the like.
S204, performing spectrum analysis on the audio stream of the real-time playing program, and extracting audio characteristics;
the audio features are extracted as follows:
(I) Audio signal processing, namely analyzing frequency characteristics of an audio signal through short-time Fourier transform, extracting characteristics such as MFCC (Mel frequency cepstrum coefficient), chroma characteristics, tone, rhythm and the like, and describing acoustic properties of the audio;
(II) Audio event detection, namely converting voice in the audio into text by utilizing a voice recognition model such as DEEPSPEECH, extracting dialogue and voice content in a program, detecting and identifying specific sound effects such as laughter, applause and music in the audio, identifying the occurrence frequency and the position of the sound effects in the program, and identifying emotion types such as joy, sadness and tension of the program by analyzing intonation and emotion clues in the audio.
S205, extracting text features in program subtitles or conversations;
the text feature extraction steps are as follows:
(I) Caption and dialogue processing, namely extracting caption information from video, identifying characters from image frames by using OCR technology, and acquiring the characters from caption files such as SRT of programs;
The topic and keyword extraction, namely identifying the topic in the text by using a topic modeling algorithm such as LDA and the like, and extracting the core topic of the program discussion; extracting keywords from the text through algorithms such as TextRank and the like, and identifying important concepts in the program;
and (III) text emotion analysis, namely performing emotion classification on the text by using an emotion analysis model, identifying emotion attitudes expressed in the text, such as positive, negative and neutral, calculating emotion intensity in the text, evaluating emotion intensity, and providing finer analysis for emotion identification.
S206, carrying out multi-mode fusion on the image features, the audio features and the text features to obtain program feature vectors;
specifically, the multimodal fusion of image features, audio features, and text features includes the steps of:
(I) Feature alignment
Feature alignment-synchronizing features of different modalities, ensuring that they correspond to the same time period on the time axis, which typically involves processing time stamps between audio, video frames and subtitles;
Spatial alignment, namely mapping the features of different modes to the same or similar dimensions in a feature space so as to facilitate fusion;
(II) feature fusion strategy
Feature splicing, namely simply splicing the multi-mode features together to form a high-dimensional feature vector;
And (3) feature weighted fusion, namely, assigning weights to the features of different modes, and carrying out weighted summation or weighted average according to the importance of the features, wherein the weights can be determined through an experiment or a learning mechanism.
Deep fusion, namely, feature fusion is carried out by using a deep neural network, and complex relations among modes are automatically learned, which can be realized through a multi-layer perceptron, a self-attention mechanism and the like.
(III) representation and storage of fusion features
Feature normalization, namely normalizing the fused feature vectors to ensure the consistent numerical ranges of different feature dimensions.
Feature storage and indexing, namely storing the fused program feature vectors into a database, and establishing an index so as to facilitate quick retrieval and matching of user preferences.
S207, extracting metadata of each program in a program database, wherein the metadata comprises information such as program types, duration, actors, directors, labels, introduction and the like;
And S208, extracting and classifying the characteristics of the metadata of the program by using a text analysis model based on keywords, and generating the program characteristics.
Specifically, keywords which can be most representative of programs are identified and extracted from metadata by using text analysis models based on keywords, such as TF-IDF, textRank and the like, the extracted keywords and the metadata are classified, the programs are classified into proper types or topics, and the models are used for generating program characteristics by combining the extracted keywords and classification information, wherein the characteristics comprise the structured metadata and the characteristics obtained from text analysis, so that the generated program characteristics can accurately reflect main information of the programs and potential interests of users.
S3, calculating first similarity between the watching preference feature and the real-time program feature, generating a reference score according to the first similarity, calculating second similarity between the watching preference feature and the program feature of each program in the program database, and generating a comparison score according to the second similarity.
In this embodiment, step S3 specifically includes:
S301, calculating cosine similarity between the watching preference feature and the real-time program feature, wherein the cosine similarity is expressed as a first similarity: vu denotes a viewing preference feature, vr denotes a real-time program feature;
S302, the reference score is expressed as scores=α×sim1 +beta, alpha, beta E [0,1] represents a parameter for adjusting the reference score;
S303, calculating cosine similarity between the viewing preference feature and the program feature of each program in the program database, where the cosine similarity is expressed as a second similarity: vpi denotes the program characteristics of the ith program in the program database;
S304, the comparison score is expressed as scorec=γ×sim2 +delta, gamma, delta E [0,1] and represents a parameter for adjusting the comparison score.
In some embodiments, α, β and γ, δ may be optimized using a neural network so that the benchmark score and the comparison score are more accurate.
S4, screening programs with the comparison score larger than the reference score in a program database, and setting the programs as programs to be played;
specifically, step S4 includes the steps of:
S401, traversing all programs in a program database, and calculating the comparison score of each program one by one according to the steps S303 and S304;
s402, comparing the comparison score with the reference score obtained in the step S302 for each program, if the comparison score is larger than the reference score, the program is matched with the watching preference of the user and is set as the program to be played, and if the comparison score is smaller than the reference score, the program is not matched with the watching preference of the user and needs to be excluded when the electronic program guide is generated.
S5, sorting the comparison scores of the programs to be played, and generating an electronic program guide according to the sorting result.
Specifically, after all the programs to be played are obtained in step S4, in order to further consider the viewing preference of the user, the comparison scores of all the programs to be played are ranked by a ranking algorithm, and all the programs to be played are manufactured into an electronic program guide according to the order from high to low of the comparison scores.
Compared with the prior art, the electronic program guide generating method provided by the embodiment obtains the watching preference feature reflecting the long-term interest of the user and the real-time program feature reflecting the short-term interest of the user by analyzing the historical watching program record, the real-time playing program data and the program database of the user, calculates the reference score according to the watching preference feature and the real-time program feature, sets the standard for the electronic program guide, calculates the comparison score according to the watching preference feature and the program feature, and compares the comparison score with the reference score so as to mine out the programs conforming to the long-term interest and the short-term interest of the user from the program database, thereby generating the electronic program guide, ensuring that the guide conforms to the long-term interest of the user, has high accuracy, ensures to conform to the short-term interest of the user and has good dynamic performance.
Example 2
The present embodiment provides an electronic program guide generating apparatus, as shown in fig. 2, including:
the acquisition module is used for acquiring historical watching program records, real-time playing program data and a program database;
The analysis module is used for analyzing the historical watching program records to obtain watching preference characteristics, analyzing the real-time broadcasting program data to obtain real-time program characteristics, and analyzing the program database to obtain the program characteristics of each program in the program database;
The computing module is used for computing a first similarity between the watching preference feature and the real-time program feature, generating a reference score according to the first similarity, computing a second similarity between the watching preference feature and the program feature of each program in the program database, and generating a comparison score according to the second similarity;
The screening module is used for screening programs with the comparison score larger than the reference score in the program database and setting the programs to be played;
And the generation module is used for sorting the comparison scores of the programs to be played and generating an electronic program guide according to the sorting result.
Example 3
The present embodiment provides an electronic device, as shown in fig. 3, including a memory and a processor, where the memory stores a computer program, and the computer program implements the electronic program guide generating method according to any one of the embodiments above when executed by the processor.
Example 4
The present embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the electronic program guide generating method as described in any of the above embodiments.
Computer-readable storage media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, read only compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by the computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of function in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The foregoing description of the embodiments has been provided for the purpose of illustrating the general principles of the invention, and is not meant to limit the scope of the invention, but to limit the invention to the particular embodiments, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the invention are intended to be included within the scope of the invention.