Content annotation method, device, equipment and storage medium

By identifying file types, obtaining barrage or comment data, converting them into numerical data, building emotional classification models, calculating the popularity of morpheme units, and generating labeling information, it solves the problem of unintuitive content display in the existing technology and improves the user's viewing efficiency and information acquisition efficiency.

CN113869043BActive Publication Date: 2024-12-24ZHEJIANG YOUCHI ENERGY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111093253.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-17
Publication Date
2024-12-24
Estimated Expiration
2041-09-17

AI Technical Summary

Technical Problem

The prior art is difficult to visually display content summary, which makes it time-consuming and labor-intensive for users to find specific content in a large amount of information.

Method used

By identifying file types, obtaining barrage or comment data, converting them into numerical data, forming word segmentation into word bags, building emotional classification models, calculating the popularity of morphemes units, generating labeling information, labeling file content, and improving intuitiveness and efficiency.

Benefits of technology

It improves the intuitiveness of content display and user viewing efficiency, helping users quickly identify the theme of information and obtain relevant content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113869043B_ABST
    Figure CN113869043B_ABST
Patent Text Reader

Abstract

The present application relates to the field of artificial intelligence technology, and discloses a content annotation method, device, equipment and storage medium, wherein the method comprises: identifying the file type of a target file; converting a target text into numerical data, segmenting the target text to obtain a plurality of morpheme units, and generating a word bag of numerical data according to the morpheme units; dividing the numerical data into a training set and a test set, building a sentiment classification model through the training set and the word bag, and performing sentiment prediction on the test set according to the sentiment classification model; obtaining the frequency of each morpheme unit in the target text, and calculating the heat information of the morpheme unit according to the frequency; generating annotation information according to a preset format according to the prediction result and heat information of the sentiment prediction, and annotating the target file according to the annotation information; thereby improving the intuitiveness of the content summary presentation in the application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a content annotation method, device, equipment and storage medium. Background Art

[0002] With the development of electronic media, various APPs have emerged one after another. On various information APPs, news, articles, videos, and live broadcasts are often classified by financial, entertainment, military, and other divisions. However, such classification is not detailed enough. There may be thousands of articles in a category. If you don’t read them quickly, you won’t know the content and the theme expressed. But if this is not the content media that the user is looking for, you have to exit and look for new articles or videos again, which makes the user’s reading process time-consuming and laborious. Summary of the invention

[0003] The main purpose of this application is to provide a content annotation method, device, equipment and storage medium, aiming to solve the technical problem in the prior art that it is difficult for applications to intuitively display content summaries.

[0004] In order to achieve the above-mentioned invention object, the present application proposes a content annotation method, which comprises:

[0005] Identify the file type of the target file, and determine the target text based on the file type, wherein if the file type is a video type, obtain the barrage data of the target file as the target text, and if the file type is a text type, obtain the comment data of the target file as the target text;

[0006] Convert the target text into numerical data, segment the target text to obtain a plurality of morpheme units, and combine the morpheme units to form a word bag of the numerical data;

[0007] Dividing the numerical data into a training set and a test set, building a sentiment classification model through the training set and the word bag, and performing sentiment prediction on the test set according to the sentiment classification model;

[0008] Obtaining the frequency of each of the morpheme units in the target text, and calculating the heat information of the morpheme unit according to the frequency;

[0009] According to the prediction result of the emotion prediction and the heat information, annotation information is generated according to a preset format, and the target file is annotated according to the annotation information.

[0010] Furthermore, the target text is segmented to obtain a plurality of morpheme units, including:

[0011] Establish a bag-of-words model based on the preset vocabulary;

[0012] Extracting background words from the target text through the bag-of-words model, and performing semantic recognition of similar relationships on the background words;

[0013] The background words whose similarity meets a preset similarity threshold are put into the same morpheme unit, thereby obtaining a plurality of morpheme units.

[0014] Furthermore, the generating of annotation information according to a preset format based on the prediction result of the emotion prediction and the heat information includes:

[0015] Setting different display colors for each of the morpheme units according to the prediction results, wherein the prediction results include positive, neutral and negative;

[0016] According to the heat information, different brightness is set for the display color of each of the morpheme units to obtain a marked color;

[0017] The marking color of the morpheme unit is used as the marking information of the morpheme unit.

[0018] Furthermore, after marking the target file according to the marking information, the method further includes:

[0019] sorting the morpheme units according to the heat information;

[0020] The central words corresponding to the morpheme units are displayed in the first list in sequence according to the sorting order.

[0021] Furthermore, after marking the target file according to the marking information, the method further includes:

[0022] In response to a query instruction, identifying query information carried in the query instruction;

[0023] Identify morpheme units matching the query information and popularity information of the morpheme units in the corresponding target files;

[0024] According to the popularity information, the target files are displayed in a second list in descending order.

[0025] Furthermore, the semantic recognition of similarity relationship between the background words includes:

[0026] Stop words are screened for the background words, and semantic recognition of similar relationships is performed on the screened background words.

[0027] Furthermore, the identifying the file type of the target file includes:

[0028] Extract the structured data of the current page;

[0029] The file type is identified according to an object attribute of the structured data.

[0030] The present application also proposes a content annotation device, comprising:

[0031] A file type identification module, used to identify the file type of a target file, and determine a target text based on the file type, wherein if the file type is a video type, the barrage data of the target file is obtained as the target text, and if the file type is a text type, the comment data of the target file is obtained as the target text;

[0032] A bag-of-words generation module, used to convert the target text into numerical data, segment the target text to obtain a plurality of morpheme units, and combine the morpheme units to form a bag-of-words of the numerical data;

[0033] A sentiment prediction module, used for dividing the numerical data into a training set and a test set, building a sentiment classification model through the training set and the word bag, and performing sentiment prediction on the test set according to the sentiment classification model;

[0034] A heat calculation module, used for obtaining the frequency of each morpheme unit in the target text, and calculating the heat information of the morpheme unit according to the frequency;

[0035] The content annotation module is used to generate annotation information in a preset format according to the prediction result of the emotion prediction and the popularity information, and to annotate the target file according to the annotation information.

[0036] The present application also proposes a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.

[0037] The present application also proposes a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0038] The content annotation method, device, equipment and storage medium of the present application first identify the file type of the target file before performing content identification, so as to more accurately reflect the user's real emotional characteristics according to the file type of the target file; convert the target text into numerical data to realize the dataization of the target text, which is convenient for feature calculation, and segment the target text by word segmentation, so that the model can more accurately understand the meaning of the target text; divide the numerical data into a training set and a test set, so as to build a sentiment classification model according to the training set, and predict the test set through the sentiment classification model to verify the accuracy of the sentiment classification model; obtain the frequency of each morpheme unit in the target text, calculate the heat information of the morpheme unit according to the frequency, so as to accurately reflect the user's emotional tendency; generate annotation information according to a preset format, and annotate the target file according to the annotation information, so as to serve as a reference for user retrieval and viewing, thereby improving the intuitiveness of the target file display, indirectly improving the user's viewing efficiency and message acquisition efficiency, so as to facilitate information dissemination. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A schematic diagram of a flow chart of a content annotation method according to an embodiment of the present application;

[0040] Figure 2 A flowchart of a content annotation method according to a specific implementation method of the present application;

[0041] Figure 3 This is a schematic block diagram of the structure of a content annotation device according to an embodiment of the present application;

[0042] Figure 4 A schematic block diagram of the structure of a computer device according to an embodiment of the present application.

[0043] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0045] Reference Figure 1 In order to achieve the above-mentioned invention object, the present application proposes a content annotation method, which includes:

[0046] S1: Identify the file type of the target file, and determine the target text based on the file type, wherein if the file type is a video type, obtain the barrage data of the target file as the target text, and if the file type is a text type, obtain the comment data of the target file as the target text;

[0047] S2: converting the target text into numerical data, segmenting the target text to obtain a plurality of morpheme units, and combining the morpheme units to form a word bag of the numerical data;

[0048] S3: dividing the numerical data into a training set and a test set, building a sentiment classification model through the training set and the word bag, and performing sentiment prediction on the test set according to the sentiment classification model;

[0049] S4: Obtain the frequency of each of the morpheme units in the target text, and calculate the heat information of the morpheme unit according to the frequency;

[0050] S5: Generate annotation information in a preset format according to the prediction result of the emotion prediction and the heat information, and annotate the target file according to the annotation information.

[0051] This embodiment first identifies the file type of the target file before performing content identification, so as to select the file type of the target file that can more accurately reflect the user's real emotional characteristics; by converting the target text into numerical data, the target text is digitized to facilitate feature calculation, and by segmenting the target text, the target text is segmented so that the model can more accurately understand the meaning of the target text; the numerical data is divided into a training set and a test set, so as to build a sentiment classification model based on the training set, and the test set is predicted by the sentiment classification model to verify the accuracy of the sentiment classification model; by obtaining the frequency of each morpheme unit in the target text, the heat information of the morpheme unit is calculated according to the frequency, so as to accurately reflect the user's emotional tendency; by generating annotation information according to a preset format, and annotating the target file according to the annotation information, so as to serve as a reference for the user to search and view, the intuitiveness of the target file display is improved, and the user's viewing efficiency and message acquisition efficiency are indirectly improved, so as to facilitate information dissemination.

[0052] For step S1, this embodiment is usually applied in the field of content annotation, especially in the application of comment and bullet screen annotation in APP (Application), and can obtain and process text and video bullet screen based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system of using 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. Specifically, with the development of software technology, even in the same APP, there is usually a situation where text information and video information coexist. For text information, that is, article-type messages, users can often only narrate their personal opinions in the comment area, while for video information, users are often more willing to express their personal opinions in real time through bullet screen. Therefore, for target files of video type, selecting bullet screen data as target text can more accurately reflect the user's true opinion; therefore, this embodiment first identifies the file type of the target file before performing content identification, so that the selection according to the file type of the target file can more accurately reflect the user's true emotional characteristics. 。

[0053] For step S2, it is necessary to convert the text type data into numerical type data in order to form feature variables and training models. When using Python language, the CountVectorizer() function is generally used to convert the target text into numerical data, where CountVectorizer() belongs to the common feature numerical calculation class and is a text feature extraction method. For each training text, it only considers the frequency of each word in the training text. CountVectorizer() converts the words in the text into a word frequency matrix, which calculates the number of times each word appears through the fit_transform function. Specifically, lexical analysis is to "cut" the original target text into small segments to obtain several smallest grammatical units corresponding to the original target text, and a smallest grammatical unit is a "morpheme", so each small segment obtained after the segmentation of the original target text is a morpheme unit token; for example, if a target text is "I want to eat two apples today", after segmentation, six morpheme units of "I", "today", "want", "eat", "two" and "apple" can be obtained, and the above six morpheme units are combined to form a word bag of numerical data corresponding to the comment or barrage "I want to eat two apples today". Specifically, the word bag is equivalent to a dictionary, and each morpheme unit is the key of the dictionary. The word frequency of different morpheme units is calculated through the word bag model, and the same morpheme units are merged, so that repeated words can be screened for comments or barrages. This embodiment realizes the dataization of the target text by converting the target text into numerical data, which is convenient for feature calculation, and realizes the cutting of the target text by segmenting the target text, so that the model can more accurately understand the meaning of the target text.

[0054] For step S3, in order to train the model and test the effect of the training, the numerical data is divided into a training set and a test set, so as to build a sentiment classification model according to the training set. Specifically, the above-mentioned word bag is used to build a text pre-training model based on the continuous bag-of-words model (CBOW), and the text data features of the training set are extracted through the text pre-training model. The text classification model is built through the initial support vector machine classification model, and the sentiment attributes of the training set are classified according to the text data features, and the sentiment classification results output by the model are scored for accuracy according to the preset standard classification results. According to the above-mentioned accuracy scoring results, the above-mentioned text classification model is corrected to obtain the above-mentioned sentiment classification model. The test set is predicted by the sentiment classification model to verify the accuracy of the sentiment classification model. In a specific implementation, the prediction results are usually divided into prediction results of three emotions: positive, neutral, and negative.

[0055] For step S4, the target text is converted into numerical data using the CountVectorizer() function, and CountVectorizer() converts the words in the text into a word frequency matrix through the fit_transform function, and its matrix element a[i][j] represents the word frequency of the jth word in the ith text, that is, the number of times each word appears. The keywords of all texts can be seen through get_feature_names(), and the results of the word frequency matrix can be seen through toarray(), thereby obtaining the frequency of each morpheme unit in the target text, and then the frequency can be proportionally converted into the above-mentioned heat information. Generally speaking, the higher the frequency of a morpheme unit in the target text, the more the morpheme unit tends to the user's emotional tendency, that is, it can be considered that the heat for the target text is higher. This embodiment obtains the frequency of each morpheme unit in the target text, and calculates the heat information of the morpheme unit according to the frequency, thereby accurately reflecting the user's emotional tendency.

[0056] For step S5, after obtaining the predicted results and heat information of the emotion, annotation information can be generated; the format of the above annotation information can be "morpheme unit A+positive+heat 56" or "morpheme unit B+negative+heat 21", etc., as long as it can reflect the emotion and attention tendency of the target file, so as to serve as a reference for users to search and view, improve the intuitiveness of the target file display, and indirectly improve the user's viewing efficiency and message acquisition efficiency, so as to facilitate information dissemination.

[0057] In one embodiment, referring to Figure 2 , the target text is segmented to obtain a plurality of morpheme units S2, including:

[0058] S21: Building a bag-of-words model based on a preset vocabulary;

[0059] S22: extracting background words from the target text through the bag-of-words model, and performing semantic recognition of similar relationships on the background words;

[0060] S23: putting the background words whose similarity meets a preset similarity threshold into the same morpheme unit, thereby obtaining a plurality of morpheme units.

[0061] This embodiment establishes a bag-of-words model, extracts background words from the target text through the bag-of-words model, and combines semantically similar background words to form morpheme units, thereby avoiding the problem of repeated subsequent calculations on multiple semantically identical morpheme units, which leads to unnecessary waste of resources.

[0062] For step S21, the above-mentioned bag-of-words model can be a continuous bag-of-words model, which predicts a central word through multiple background words; specifically, since there are usually multiple background words in the continuous bag-of-words model, the average value of the word vectors of the background words can be calculated to obtain the likelihood function of the continuous bag-of-words model, and the likelihood function reflects the probability of generating any central word based on the background words.

[0063] In step S23, each background word is divided into morpheme units corresponding to different central words according to the above probability, thereby improving the accuracy of the extracted morpheme units.

[0064] In one embodiment, the generating of the annotation information S5 according to the prediction result of the emotion prediction and the heat information in a preset format includes:

[0065] S51: setting different display colors for each of the morpheme units according to the prediction results, wherein the prediction results include positive, neutral and negative;

[0066] S52: according to the heat information, setting different brightness for the display color of each of the morpheme units to obtain a marking color;

[0067] S53: Using the marking color of the morpheme unit as the marking information of the morpheme unit.

[0068] This embodiment generates annotation information by combining different colors and brightness, thereby visually downplaying words with lower popularity and emphasizing words with higher popularity, so that users can intuitively distinguish the main idea of ​​the video or text based on color and brightness.

[0069] For step S52, this embodiment uses a combination of color and brightness to mark morpheme units. Specifically, the central word of the morpheme unit can be selected as the display word in the word cloud, and the text color of the display word is selected according to the prediction result and popularity information.

[0070] For step S53, for example, positive, neutral, and negative morpheme units can be marked in blue, white, and red, respectively, and the morpheme units with higher heat information have higher brightness, so as to visually display the "keywords" with higher frequency in the text, and visually filter out a large amount of low-frequency text information, so that users can understand the main idea of ​​the text just by scanning the text. The word cloud library is used to build a word cloud, and a word cloud containing several display words is used as the above-mentioned annotation information, so that users can know the main idea of ​​the article or video as soon as they see the annotation information composed of the word cloud.

[0071] In one embodiment, after marking the target file according to the marking information S5, the method further includes:

[0072] S61: sorting the morpheme units according to the heat information;

[0073] S62: Display the central words corresponding to the morpheme units in the first list in order of sorting.

[0074] This embodiment generates a first list by sorting the center word popularity from high to low, and uses the first list as a hot word list, which is displayed below the article or video, so that users can quickly identify the most frequent words.

[0075] For step S62, in order to further facilitate users to understand the proportion of words with different emotions in the target file, the morpheme units can be sorted in descending order according to the popularity information, and the central word of each morpheme unit can be obtained, so as to establish a first list sorted from high to low according to the popularity of the central word, and the first list is used as a hot word list, and the hot word list is displayed below the article or video, so that users can quickly identify the most frequent words; in addition to the popularity list, the word cloud can also be placed in the preview carousel of the video to improve the intuitiveness of the video information display.

[0076] In one embodiment, after marking the target file according to the marking information S15, the method further includes:

[0077] S71: In response to a query instruction, identifying query information carried in the query instruction;

[0078] S72: Identify morpheme units matching the query information and popularity information of the morpheme units in the corresponding target file;

[0079] S73: Display the target files in a second list in descending order according to the popularity information.

[0080] This embodiment sorts the target files according to the heat information of the morpheme units in the target files so that the user can obtain the articles or videos with the highest relevance to the query information at the first time, thereby further improving the intuitiveness of the article or video content.

[0081] For step S51, in a specific APP usage scenario, to save the user's browsing time and improve the efficiency of information acquisition, the target file can be used as the object to be queried. When a query instruction is recognized, the query information carried in the query instruction, such as "football" and "event", is recognized. After the query information is recognized, the annotation information matching "football" and "event" is retrieved. Since in actual content creation, usually the higher the frequency of occurrence of a certain word, the higher the degree of association between the article or video and the word. Therefore, in this embodiment, the target files are sorted according to the morpheme unit heat information in the target files, so that the user can obtain the article or video with the highest relevance to the query information in the first time, further improving the intuitiveness of the article or video content.

[0082] In one embodiment, the semantic recognition S22 of the similarity relationship of the background word includes:

[0083] S221: Screen the stop words of the background word, and perform semantic recognition of the similarity relationship on the screened background word.

[0084] In this embodiment, by screening and deleting the stop words, the bag-of-words model can more accurately identify the similarity relationship between the background words, saving computing resources.

[0085] For step S21, stop words refer to words that will be filtered before or after processing text to save storage space and improve search efficiency. Usually, they include but are not limited to "ah", "bar", "while", etc. By screening and deleting the stop words, the bag-of-words model can more accurately identify the similarity relationship between the background words, avoiding the problem that unnecessary background words increase the computational complexity of the bag-of-words model, resulting in waste of resources.

[0086] In one embodiment, the identifying the file type S1 of the target file includes:

[0087] S11: Extract the structured data of the current page;

[0088] S12: Identify the file type according to the object attributes of the structured data.

[0089] In this embodiment, the file type of the target file in the current page is accurately identified through the structured data, so as to accurately extract the bullet screens or comments.

[0090] For step S11, obtain the source code document of the target file on the APP web page, and convert the source code document into structured data such as a data flow diagram, a data dictionary, a decision table, a decision tree, etc. Specifically, the structured data can be generated according to the DOM (Document Object Model).

[0091] Reference Figure 3 , the present application also proposes a content annotation device, including:

[0092] The file type identification module 100 is used to identify the file type of the target file and determine the target text based on the file type, wherein if the file type is a video type, the barrage data of the target file is obtained as the target text; if the file type is a text type, the comment data of the target file is obtained as the target text;

[0093] A bag-of-words generation module 200 is used to convert the target text into numerical data, segment the numerical data to obtain a plurality of morpheme units, and combine the morpheme units to form a bag-of-words for the numerical data;

[0094] The emotion prediction module 300 is used to divide the numerical data into a training set and a test set, build an emotion classification model through the training set and the word bag, and perform emotion prediction on the test set according to the emotion classification model;

[0095] A heat calculation module 400 is used to obtain the frequency of each morpheme unit in the target text, and calculate the heat information of the morpheme unit according to the frequency;

[0096] The content annotation module 500 is used to generate annotation information in a preset format according to the prediction result of the emotion prediction and the popularity information, and to annotate the target file according to the annotation information.

[0097] This embodiment first identifies the file type of the target file before performing content identification, so as to select the file type of the target file that can more accurately reflect the user's real emotional characteristics; by converting the target text into numerical data, the target text is digitized to facilitate feature calculation, and by segmenting the target text, the target text is segmented so that the model can more accurately understand the meaning of the target text; the numerical data is divided into a training set and a test set, so as to build a sentiment classification model based on the training set, and the test set is predicted by the sentiment classification model to verify the accuracy of the sentiment classification model; by obtaining the frequency of each morpheme unit in the target text, the heat information of the morpheme unit is calculated according to the frequency, so as to accurately reflect the user's emotional tendency; by generating annotation information according to a preset format, and annotating the target file according to the annotation information, so as to serve as a reference for the user to search and view, the intuitiveness of the target file display is improved, and the user's viewing efficiency and message acquisition efficiency are indirectly improved, so as to facilitate information dissemination.

[0098] In one embodiment, the bag-of-words generation module 200 is further used to:

[0099] Establish a bag-of-words model based on the preset vocabulary;

[0100] Extracting background words from the target text through the bag-of-words model, and performing semantic recognition of similar relationships on the background words;

[0101] The background words whose similarity meets a preset similarity threshold are put into the same morpheme unit, thereby obtaining a plurality of morpheme units.

[0102] In one embodiment, the content annotation module 500 is further used to:

[0103] Setting different display colors for each of the morpheme units according to the prediction results, wherein the prediction results include positive, neutral and negative;

[0104] According to the heat information, different brightness is set for the display color of each of the morpheme units to obtain a marked color;

[0105] The marking color of the morpheme unit is used as the marking information of the morpheme unit.

[0106] In one embodiment, a first list display module 600 is further included, which is used to:

[0107] sorting the morpheme units according to the heat information;

[0108] The central words corresponding to the morpheme units are displayed in the first list in sequence according to the sorting order.

[0109] In one embodiment, a second list display module 700 is further included, which is used to:

[0110] In response to a query instruction, identifying query information carried in the query instruction;

[0111] Identify morpheme units matching the query information and popularity information of the morpheme units in the corresponding target files;

[0112] According to the popularity information, the target files are displayed in a second list in descending order.

[0113] In one embodiment, the bag-of-words generation module 200 is further used to:

[0114] Stop words are screened for the background words, and semantic recognition of similar relationships is performed on the screened background words.

[0115] In one embodiment, the file type identification module 100 is further used to:

[0116] Extract the structured data of the current page;

[0117] The file type is identified according to an object attribute of the structured data.

[0118] Reference Figure 4 In an embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as a content annotation method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a content annotation method is implemented. The content annotation method includes: identifying the file type of a target file, and determining a target text based on the file type, wherein if the file type is a video type, obtaining the barrage data of the target file as the target text, and if the file type is a text type, obtaining the comment data of the target file as the target text; converting the target text into numerical data, and performing word segmentation on the target text to obtain a plurality of morpheme units, and combining the morpheme units to form a word bag of the numerical data; dividing the numerical data into a training set and a test set, building a sentiment classification model through the training set and the word bag, and performing sentiment prediction on the test set according to the sentiment classification model; obtaining the frequency of each of the morpheme units in the target text, and calculating the heat information of the morpheme unit according to the frequency; generating annotation information according to a preset format according to the prediction result of the sentiment prediction and the heat information, and annotating the target file according to the annotation information.

[0119] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, a content annotation method is implemented, comprising the steps of: identifying the file type of a target file, and determining a target text based on the file type, wherein if the file type is a video type, obtaining the barrage data of the target file as the target text, and if the file type is a text type, obtaining the comment data of the target file as the target text; converting the target text into numerical data, and performing word segmentation on the target text to obtain a plurality of morpheme units, and combining the morpheme units to form a word bag of the numerical data; dividing the numerical data into a training set and a test set, building a sentiment classification model through the training set and the word bag, and performing sentiment prediction on the test set according to the sentiment classification model; obtaining the frequency of each of the morpheme units in the target text, and calculating the heat information of the morpheme unit according to the frequency; generating annotation information according to a preset format according to the prediction result of the sentiment prediction and the heat information, and annotating the target file according to the annotation information.

[0120] The content annotation method executed above, this embodiment first identifies the file type of the target file before performing content identification, so as to select the file type of the target file that can more accurately reflect the user's real emotional characteristics; by converting the target text into numerical data, the target text is digitized to facilitate feature calculation, and by segmenting the target text, the target text is segmented so that the model can more accurately understand the meaning of the target text; the numerical data is divided into a training set and a test set, so as to build a sentiment classification model based on the training set, and the test set is predicted by the sentiment classification model to verify the accuracy of the sentiment classification model; by obtaining the frequency of each morpheme unit in the target text, the heat information of the morpheme unit is calculated according to the frequency, so as to accurately reflect the user's emotional tendency; by generating annotation information according to a preset format, and annotating the target file according to the annotation information, so as to serve as a reference for the user to search and view, the intuitiveness of the target file display is improved, and the user's viewing efficiency and message acquisition efficiency are indirectly improved, so as to facilitate information dissemination.

[0121] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0122] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.

[0123] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A content annotation method, characterized in that: The method comprises: identifying the file type of a target file, and determining a target text based on the file type, wherein if the file type is a video type, obtaining the barrage data of the target file as the target text, and if the file type is a text type, obtaining the comment data of the target file as the target text; converting the target text into numerical data, and performing word segmentation on the target text to obtain a plurality of morpheme units, and combining the morpheme units to form a word bag of the numerical data; dividing the numerical data into a training set and a test set, building a sentiment classification model through the training set and the word bag, and performing sentiment prediction on the test set according to the sentiment classification model; obtaining the frequency of each of the morpheme units in the target text, and calculating the heat information of the morpheme units according to the frequency; generating annotation information according to a preset format according to the prediction result of the sentiment prediction and the heat information, and annotating the target file according to the annotation information; The generating of the annotation information according to the prediction result of the emotion prediction and the heat information in a preset format includes: setting different display colors for each of the morpheme units according to the prediction result, wherein the prediction result includes positive, neutral and negative; setting different brightness for the display color of each of the morpheme units according to the heat information to obtain an annotation color; and using the annotation color of the morpheme unit as the annotation information of the morpheme unit; The emotion classification model is built by using the training set and the word bag, including: using the word bag to build a text pre-training model based on the continuous word bag model, extracting text data features of the training set through the text pre-training model, and building a text classification model through an initial support vector machine classification model, performing emotion classification of text attributes of the training set according to the text data features, and performing accuracy scoring on the emotion classification results output by the model according to preset standard classification results, and correcting the text classification model according to the accuracy scoring results to obtain the emotion classification model.

2. The content annotation method according to claim 1, characterized in that: The target text is segmented to obtain a plurality of morpheme units, including: establishing a bag-of-words model according to a preset vocabulary; extracting background words from the target text through the bag-of-words model, and performing semantic recognition of similarity relationships on the background words; and putting the background words whose similarity meets a preset similarity threshold into the same morpheme unit, thereby obtaining a plurality of morpheme units.

3. The content annotation method according to claim 1, characterized in that: After the target file is annotated according to the annotation information, the method further includes: sorting the morpheme units according to the popularity information; and displaying the central words corresponding to the morpheme units in the first list in the sorted order.

4. The content annotation method according to claim 1, characterized in that: After the target file is annotated according to the annotation information, the method further includes: in response to a query instruction, identifying the query information carried in the query instruction; identifying a morpheme unit matching the query information, and popularity information of the morpheme unit in the corresponding target file; and displaying the target file in a second list in a descending order according to the popularity information.

5. The content annotation method according to claim 2, characterized in that: The semantic recognition of similarity relationship of the background words includes: screening stop words of the background words, and performing semantic recognition of similarity relationship of the screened background words.

6. The content annotation method according to claim 1, characterized in that: The identifying the file type of the target file includes: extracting structured data of the current page; and identifying the file type according to object attributes of the structured data.

7. A content annotation device, characterized in that: include: A file type identification module is used to identify the file type of the target file and determine the target text based on the file type, wherein if the file type is a video type, the barrage data of the target file is obtained as the target text, and if the file type is a text type, the comment data of the target file is obtained as the target text; a bag-of-words generation module is used to convert the target text into numerical data, and segment the target text to obtain a plurality of morpheme units, and combine the morpheme units to form a bag-of-words of the numerical data; a sentiment prediction module is used to divide the numerical data into a training set and a test set, build a sentiment classification model through the training set and the bag-of-words, and perform sentiment prediction on the test set according to the sentiment classification model; a heat calculation module is used to obtain the frequency of each morpheme unit in the target text, and calculate the heat information of the morpheme unit according to the frequency; a content annotation module is used to generate annotation information in a preset format according to the prediction result of the sentiment prediction and the heat information, and annotate the target file according to the annotation information; The generating of the annotation information according to the prediction result of the emotion prediction and the heat information in a preset format includes: setting different display colors for each of the morpheme units according to the prediction result, wherein the prediction result includes positive, neutral and negative; setting different brightness for the display color of each of the morpheme units according to the heat information to obtain an annotation color; and using the annotation color of the morpheme unit as the annotation information of the morpheme unit; The emotion classification model is built by using the training set and the word bag, including: using the word bag to build a text pre-training model based on the continuous word bag model, extracting text data features of the training set through the text pre-training model, and building a text classification model through an initial support vector machine classification model, performing emotion classification of text attributes of the training set according to the text data features, and performing accuracy scoring on the emotion classification results output by the model according to preset standard classification results, and correcting the text classification model according to the accuracy scoring results to obtain the emotion classification model.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.