Text recommendation method, text recommendation device, electronic device, and storage medium

By classifying and merging text data using feature keywords and timeliness identification templates, the problem of inaccurate recommendations in existing text recommendation methods is solved, achieving higher recommendation accuracy and timeliness analysis results.

CN115292479BActive Publication Date: 2026-03-24CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-09
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing text recommendation methods mainly rely on user interests and preferences, which can lead to recommended texts that do not meet the user's current needs and affect the accuracy of the recommendations.

Method used

By acquiring raw text data, classifying it using preset feature keywords, and combining timeliness recognition templates and pre-trained text classification models, the timeliness of the text data is analyzed, dividing it into text data with and without time feature words, and then merging them to improve the accuracy of recommendations.

Benefits of technology

It improves the accuracy of text recommendations, makes it easier to obtain target text data that meets current timeliness requirements, and enhances the accuracy of text timeliness identification and classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115292479B_ABST
    Figure CN115292479B_ABST
Patent Text Reader

Abstract

The application provides a text recommendation method, a text recommendation device, an electronic device and a storage medium, and belongs to the technical field of artificial intelligence. The method comprises the following steps: obtaining original text data to be processed; performing classification processing on the original text data according to feature keywords, to obtain first text data and second text data; performing timeliness identification on the first text data through a timeliness identification template, to obtain first classification data; the first classification data comprises first target data; performing word segmentation processing on the second text data, to obtain initial text word segments; performing timeliness classification on the initial text word segments through a text classification model, to obtain second classification data; the second classification data comprises second target data; performing merging processing on the first target data and the second target data, to obtain target text data; and the target text data is recommended to a target object. The application can improve the accuracy of text recommendation.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to a text recommendation method, a text recommendation device, an electronic device and a storage medium. BACKGROUND

[0002] Most of the current text recommendation methods rely on the interests of users for recommendation, which often leads to the recommended text not meeting the current needs of the user, affecting the accuracy of text recommendation. Therefore, how to improve the accuracy of text recommendation has become a technical problem to be solved. SUMMARY

[0003] The main purpose of the embodiments of the present application is to provide a text recommendation method, a text recommendation device, an electronic device and a storage medium, which aims to improve the accuracy of text recommendation.

[0004] To achieve the above purpose, the first aspect of the embodiments of the present application provides a text recommendation method, which comprises:

[0005] Obtaining original text data to be processed;

[0006] Classifying the original text data according to a preset feature keyword to obtain first text data and second text data; wherein the first text data includes the feature keyword, and the second text data does not include the feature keyword;

[0007] Identifying the timeliness of the first text data through a preset timeliness identification template to obtain first classification data; wherein the first classification data includes first target data and a first timeliness category of the first target data, and the first timeliness category is used to represent the timeliness category of the first target data;

[0008] Performing word segmentation processing on the second text data to obtain an initial text word segment;

[0009] Classifying the timeliness of the initial text word segment through a pre-trained text classification model to obtain second classification data; wherein the second classification data includes second target data and a second timeliness category of the second target data, and the second timeliness category is used to represent the timeliness category of the second target data, and the first timeliness category and the second timeliness category are of the same category;

[0010] Merging the first target data and the second target data to obtain target text data;

[0011] Recommending the target text data to a target object.

[0012] In some embodiments, the feature keyword comprises a time feature keyword, and the step of classifying the original text data according to the preset feature keyword to obtain first text data and second text data comprises:

[0013] performing content analysis on the original text data according to the time feature keyword to obtain an analysis result;

[0014] if the analysis result is that the time feature keyword exists in the original text data, determining the original text data as the first text data;

[0015] if the analysis result is that the time feature keyword does not exist in the original text data, determining the original text data as the second text data.

[0016] In some embodiments, the first text data comprises a time feature keyword, and the step of performing timeliness identification on the first text data by using a preset timeliness identification template to obtain first classification data comprises:

[0017] performing comparison analysis on the time feature keyword and a preset reference time keyword segment according to a preset priority order to obtain a first comparison result;

[0018] extracting a text theme feature of the first text data;

[0019] performing comparison analysis on the text theme feature and a preset reference theme keyword segment to obtain a second comparison result;

[0020] obtaining the first classification data according to the first comparison result and the second comparison result.

[0021] In some embodiments, the text classification model comprises an embedding layer, a convolution layer, a pooling layer and a classification layer, and the step of performing timeliness classification on the initial text keyword segment by using a pre-trained text classification model to obtain second classification data comprises:

[0022] performing word embedding processing on the initial text keyword segment by using the embedding layer to obtain a text word embedding vector;

[0023] performing feature extraction on the text word embedding vector by using the convolution layer to obtain a text keyword segment feature vector;

[0024] performing down-sampling processing on the text keyword segment feature vector by using the pooling layer to obtain a target keyword segment feature vector;

[0025] performing classification prediction on the target keyword segment feature vector by using the classification layer to obtain the second classification data.

[0026] In some embodiments, the step of classifying the target word segment feature vector through the classification layer to obtain the second classification data comprises:

[0027] performing classification probability calculation on the target word segment feature vector through a classification function of the classification layer and a preset timeliness category label to obtain a classification probability value corresponding to each timeliness category label;

[0028] obtaining the second classification data according to the classification probability value and a preset probability threshold.

[0029] In some embodiments, the step of merging the first target data and the second target data to obtain target text data comprises:

[0030] performing screening processing on the first target data according to a preset first recommendation quantity to obtain first recommendation data;

[0031] performing screening processing on the second target data according to a preset second recommendation quantity to obtain second recommendation data;

[0032] performing merging processing on the first recommendation data and the second recommendation data to obtain the target text data.

[0033] In some embodiments, before the step of performing timeliness classification on the initial text word segment through the pre-trained text classification model to obtain second classification data, the method further comprises pre-training the text classification model, specifically comprising:

[0034] obtaining label text data, the label text data comprising sample text data and a reference timeliness label of the sample text data;

[0035] performing word segmentation processing on the label text data to obtain label text word segments;

[0036] performing word embedding processing on the label text word segments to obtain label text word embedding vectors;

[0037] adding a preset perturbation factor to the label text word embedding vectors to obtain sample word embedding vectors;

[0038] calculating a loss value between the sample word embedding vectors and the reference timeliness label through a loss function of the text classification model to obtain a target loss value;

[0039] optimizing model parameters of the text classification model according to the target loss value to train the text classification model.

[0040] To achieve the above object, a second aspect of the embodiment of the present application provides a text recommendation device, which comprises:

[0041] a data acquisition module configured to acquire original text data to be processed;

[0042] a feature classification module configured to perform classification processing on the original text data according to a preset feature keyword, to obtain first text data and second text data; wherein the first text data comprises the feature keyword, and the second text data does not comprise the feature keyword;

[0043] a timeliness identification module configured to perform timeliness identification on the first text data through a preset timeliness identification template, to obtain first classification data; wherein the first classification data comprises first target data and a first timeliness category of the first target data, and the first timeliness category is used to represent a timeliness category of the first target data;

[0044] a word segmentation module configured to perform word segmentation processing on the second text data, to obtain initial text word segments;

[0045] a timeliness classification module configured to perform timeliness classification on the initial text word segments through a pre-trained text classification model, to obtain second classification data; wherein the second classification data comprises second target data and a second timeliness category of the second target data, and the second timeliness category is used to represent a timeliness category of the second target data, and the first timeliness category and the second timeliness category are of the same category;

[0046] a merging module configured to perform merging processing on the first target data and the second target data, to obtain target text data;

[0047] a recommendation module configured to recommend the target text data to a target object.

[0048] To achieve the above object, a third aspect of the embodiment of the present application provides an electronic device, which comprises a memory, a processor, a program stored in the memory and executable on the processor, and a data bus used to realize connection communication between the processor and the memory, and the program is executed by the processor to realize the method of the first aspect.

[0049] To achieve the above object, a fourth aspect of the embodiment of the present application provides a storage medium, which is a computer readable storage medium, used for computer readable storage, and the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to realize the method of the first aspect.

[0050] The text recommendation method, the text recommendation device, the electronic equipment and the storage medium provided by the application, through obtaining the original text data to be processed; the original text data is classified and processed according to the preset feature keyword, and first text data and second text data are obtained; wherein the first text data includes the feature keyword, and the second text data does not include the feature keyword, in this way, the original text data can be conveniently divided into the first text data with the time feature word and the second text data without the time feature word, so that different timeliness analysis methods are used for the first text data and the second text data respectively to obtain the corresponding timeliness category. Further, the timeliness of the first text data is identified through the preset timeliness identification template, and the first classification data is obtained; wherein the first classification data includes the first target data and the first timeliness category of the first target data, and the first timeliness category is used to represent the timeliness category of the first target data, the timeliness of the text data can be identified based on the feature keyword and the template, and the identification accuracy of the text timeliness is improved. Further, the second text data is segmented, and the initial text segment is obtained; and the timeliness of the initial text segment is classified through the pre-trained text classification model, and the second classification data is obtained; wherein the second classification data includes the second target data and the second timeliness category of the second target data, and the second timeliness category is used to represent the timeliness category of the second target data, the first timeliness category and the second timeliness category have the same category, and the timeliness of the text data is classified through the model classification, so that the classification accuracy and the classification efficiency of the text timeliness are improved. Finally, the first target data and the second target data are merged, the target text data is obtained, and the target text data is recommended to the target object, in this way, the target text data meeting the current timeliness requirement can be conveniently obtained, so that the accuracy of the text recommendation is improved. BRIEF DESCRIPTION OF DRAWINGS

[0051] Figure 1 is a flowchart of the text recommendation method provided by the embodiment of the application;

[0052] Figure 2 is Figure 1 is a flowchart of step S102 in

[0053] Figure 3 is Figure 1 is a flowchart of step S103 in

[0054] Figure 4 is another flowchart of the text recommendation method provided by the embodiment of the application;

[0055] Figure 5 is Figure 1 is a flowchart of step S105 in

[0056] Figure 6is a flowchart of step S504 in Figure 5

[0057] Figure 7 is a flowchart of step S106 in Figure 1

[0058] Figure 8 is a structural schematic diagram of a text recommendation device provided by an embodiment of the present application;

[0059] Figure 9 is a hardware structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0060] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the 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.

[0061] It should be noted that although the functional modules are divided in the device schematic diagram, and the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a manner different from the module division in the device or the order in the flowchart. The terms "first", "second", and the like in the specification and claims and the above-described drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.

[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application, and are not intended to limit the present application.

[0063] First, the terms involved in the present application are analyzed:

[0064] Artificial intelligence (AI): is a new technical science of researching, developing, simulating, extending and expanding human intelligence, and is a branch of computer science. Artificial intelligence attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a similar way to human intelligence. The research in this field includes robots, language recognition, image recognition, natural language processing and expert systems. Artificial intelligence can simulate the information process of human consciousness and thinking. Artificial intelligence is also the theory, method, technology and application system of using digital computers or digital computer controlled machines to simulate, extend and expand human intelligence, to perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0065] ​​Natural language processing (NLP): NLP uses computers to process, understand, and apply human languages (such as Chinese, English, etc.), and NLP is a branch of artificial intelligence, an interdisciplinary subject of computer science and linguistics, and is also commonly referred to as computational linguistics. Natural language processing includes syntax analysis, semantic analysis, and discourse understanding. Natural language processing is commonly used in the technical fields of machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis and opinion mining, etc., and it involves language processing-related data mining, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and language computing-related linguistic research.

[0066] Information extraction (NER): A text processing technology that extracts specified types of entities, relationships, events, and other factual information from natural language text and forms structured data output. Information extraction is a technology for extracting specific information from text data. Text data is composed of specific units, such as sentences, paragraphs, and chapters, and text information is composed of small specific units, such as words, phrases, sentences, paragraphs, or combinations of these specific units. Extracting noun phrases, names, and places from text data is text information extraction, and of course, the information extracted by the text information extraction technology can be various types of information.

[0067] Convolutional Neural Networks (CNN): A class of feedforward neural networks containing convolutional computation and having deep structure, is one of the representative algorithms of deep learning. Convolutional neural networks have representation learning ability and can perform shift-invariant classification on input information according to their hierarchical structure, so they are also called "Shift-Invariant Artificial Neural Networks (SIANN)". The input layer of the convolutional neural network can process multi-dimensional data. Commonly, the input layer of the one-dimensional convolutional neural network receives one-dimensional or two-dimensional arrays, where the one-dimensional array is usually time or frequency sampling; the two-dimensional array may contain multiple channels; the input layer of the two-dimensional convolutional neural network receives two-dimensional or three-dimensional arrays; the input layer of the three-dimensional convolutional neural network receives four-dimensional arrays. The hidden layer of the convolutional neural network contains three common structures of convolutional layer, pooling layer and fully connected layer, and in some more modern algorithms, there may be Inception module, residual block and other complex structures. In common structures, convolutional layer and pooling layer are specific to convolutional neural networks. The convolution kernel in the convolutional layer contains weight coefficients, and the pooling layer does not contain weight coefficients, so in the literature, the pooling layer may not be considered as an independent layer. Taking LeNet-5 as an example, the order of the three common structures in the hidden layer is usually: input-convolutional layer-pooling layer-fully connected layer-output.

[0068] Softmax function: The Softmax function is a normalized exponential function that can "compress" a K-dimensional vector z containing any real number into another K-dimensional real vector σ(z), so that each element is in the range (0, 1) and the sum of all elements is 1. This function is commonly used in multi-classification problems.

[0069] Most of the current text recommendation methods rely on user interests to make recommendations, which often leads to recommended texts not meeting the current needs of users, affecting the accuracy of text recommendation. Therefore, how to improve the accuracy of text recommendation has become a technical problem to be solved.

[0070] Based on this, the embodiments of the present application provide a text recommendation method, a text recommendation device, an electronic device and a storage medium, aiming to improve the accuracy of text recommendation.

[0071] The text recommendation method, the text recommendation device, the electronic equipment and the storage medium provided by the embodiments of the present application are described in detail through the following embodiments. First, the text recommendation method in the embodiments of the present application is described.

[0072] The embodiments of the present application can acquire and process related data based on artificial intelligence technology. Artificial intelligence (AI) is a theory, method, technology and application system for simulating, extending and expanding human intelligence by using a digital computer or a machine controlled by a digital computer, perceiving an environment, acquiring knowledge and using the knowledge to obtain optimal results.

[0073] The basic technology of artificial intelligence generally includes technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics, etc. The software technology of artificial intelligence mainly includes computer vision technology, robot technology, biometric technology, speech processing technology, natural language processing technology, and machine learning / deep learning, etc.

[0074] The text recommendation method provided by the embodiments of the present application relates to the field of artificial intelligence technology. The text recommendation method provided by the embodiments of the present application can be applied in a terminal, can be applied in a server end, and can also be software running in a terminal or a server end. In some embodiments, the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc.; the server end can be configured as an independent physical server, can be configured as a server cluster or a distributed system composed of multiple physical servers, can also be configured as a cloud server providing basic cloud computing services such as cloud service, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and big data and artificial intelligence platform, etc.; and the software can be an application for implementing the text recommendation method, etc., but is not limited to the above forms.

[0075] The application is operable in a variety of general purpose or special purpose computer systems environments or configurations. Examples of well known computing systems, environments, and / or configurations that can be suitable for use with the application include personal computers, server computers, handheld or laptop devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application can be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and the like, that perform particular tasks or implement particular abstract data types. The application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules can be located in local and remote computer storage media including memory storage devices.

[0076] Figure 1 is an optional flowchart of a text recommendation method provided by an embodiment of the application, Figure 1 The method in the above embodiment can include, but is not limited to, steps S101 to S107.

[0077] In step S101, original text data to be processed is acquired.

[0078] In step S102, the original text data is classified and processed according to a preset feature keyword, to obtain first text data and second text data; the first text data includes the feature keyword, and the second text data does not include the feature keyword.

[0079] In step S103, the first text data is subjected to time-effectiveness identification by using a preset time-effectiveness identification template, to obtain first classification data; the first classification data includes first target data and a first time-effectiveness category of the first target data, and the first time-effectiveness category is used to represent the time-effectiveness category of the first target data.

[0080] In step S104, the second text data is subjected to word segmentation processing, to obtain initial text word segments.

[0081] In step S105, the initial text word segments are subjected to time-effectiveness classification by using a pre-trained text classification model, to obtain second classification data; the second classification data includes second target data and a second time-effectiveness category of the second target data, and the second time-effectiveness category is used to represent the time-effectiveness category of the second target data; the first time-effectiveness category and the second time-effectiveness category are of the same category.

[0082] In step S106, the first target data and the second target data are subjected to merging processing, to obtain target text data.

[0083] In step S107, the target text data is recommended to a target object.

[0084] The steps S101 to S107 shown in the embodiments of the present application can be used to obtain the original text data to be processed, and the original text data is classified according to the preset feature keywords to obtain the first text data and the second text data. In this way, the original text data can be conveniently divided into the first text data with time feature words and the second text data without time feature words, so that different timeliness analysis methods are used for the first text data and the second text data to obtain the corresponding timeliness categories. Further, the timeliness of the first text data is identified by using the preset timeliness identification template to obtain the first classification data. The timeliness of the text data can be identified based on the feature keywords and the template, thereby improving the identification accuracy of the text timeliness. The second text data is subjected to word segmentation processing to obtain the initial text word segment, and the initial text word segment is subjected to timeliness classification by using the pre-trained text classification model to obtain the second classification data. The timeliness classification of the text data is performed by using the model classification method, thereby improving the classification accuracy and classification efficiency of the text timeliness. Finally, the first target data and the second target data are merged to obtain the target text data, and the target text data is recommended to the target object. The target text data meeting the current timeliness requirement can be conveniently obtained, thereby improving the accuracy of the text recommendation.

[0085] In step S101 of some embodiments, the network crawler can be programmed to crawl data in a targeted manner after setting the data source to obtain the original text data to be processed. The original text data to be processed can also be obtained by other methods, which are not limited thereto. The original text data to be processed includes various types of articles, information, and the like.

[0086] Please refer to Figure 2 In some embodiments, the feature keywords include time feature words, and step S102 can include but is not limited to steps S201 to S203:

[0087] Step S201: The original text data is subjected to content analysis according to the time feature words to obtain an analysis result.

[0088] Step S202: If the analysis result is that the time feature words exist in the original text data, it is determined that the original text data is the first text data.

[0089] Step S203: If the analysis result is that the time feature words do not exist in the original text data, it is determined that the original text data is the second text data.

[0090] In step S201 of some embodiments, the time characteristic word includes time, date, year, morning, afternoon, or early, mid, late, etc. By traversing the original text data, the time characteristic word is matched with the word segment in the original text data, it is judged whether the time characteristic word appears in the original text data, and the analysis result is obtained according to whether the time characteristic word exists in the original text data.

[0091] In step S202 of some embodiments, if the analysis result is that the time characteristic word exists in the original text data, it indicates that the original text data has a time characteristic word that can be used for timeliness analysis, and the timeliness can be recognized by the time characteristic word. Therefore, the original text data with the time characteristic word is taken as the first text data.

[0092] In step S203 of some embodiments, if the analysis result is that the time characteristic word does not exist in the original text data, it indicates that the original text data does not have a time characteristic word that can be used for timeliness analysis, and other ways need to be used to judge the timeliness category of the original text data. Therefore, the original text data without the time characteristic word is taken as the second text data.

[0093] Through the above steps S201 to S203, the original text data can be conveniently classified by features, and the original text data is divided into first text data with time characteristic words and second text data without time characteristic words. Therefore, different timeliness analysis methods are used for the first text data and the second text data respectively to obtain the corresponding timeliness category, and the analysis accuracy of the text timeliness is improved.

[0094] Please refer to Figure 3 In some embodiments, the first text data includes the time characteristic word, and step S103 can include but is not limited to steps S301 to S304:

[0095] Step S301, according to the preset priority order, the time characteristic word is compared and analyzed with the preset reference time word segment, and the first comparison result is obtained;

[0096] Step S302, extracting the text theme feature of the first text data;

[0097] Step S303, comparing and analyzing the text theme feature with the preset reference theme word segment, and obtaining the second comparison result;

[0098] Step S304, according to the first comparison result and the second comparison result, obtaining the first classification data.

[0099] In step S301 of some embodiments, the preset priority order can be set according to actual conditions, without limitation. Specifically, in the embodiments of the present application, the time characteristic word includes time, date, year, morning, afternoon, or early, mid, and late, etc. First, it is judged whether the time characteristic word representing the year and month exists in the title of the first text data. If so, the time characteristic word is matched with the reference time word segment representing the current date. If the time characteristic word is consistent with the reference time word segment, the first text data is a strong timeliness text. If the time characteristic word is inconsistent with the reference time word segment, the first text data is a weak timeliness text.

[0100] Further, if the time characteristic word representing the year and month does not exist in the title of the first text data, the first text data is matched with the preset word matching table. If the time characteristic word of the first text data matches the preset word matching table successfully, that is, the word matching table has some word segments consistent with the time characteristic word, the first text data is a strong timeliness text.

[0101] Further, if the time characteristic word of the first text data fails to match the preset word matching table, that is, the word matching table does not have word segments consistent with the time characteristic word, the time characteristic word representing the holiday in the first text data is extracted. If the time characteristic word is consistent with the reference time word segment representing the current date, the first text data is a strong timeliness text.

[0102] Further, if the time characteristic word representing the holiday in the first text data is inconsistent with the reference time word segment representing the current date, it is judged whether the time characteristic word representing the time class entity or the time characteristic word in the form of digital time exists in the first text data. If at least one of the time characteristic word representing the time class entity or the time characteristic word in the form of digital time exists, the first text data is a strong timeliness text.

[0103] Through the above comparison process, the time characteristic word including time, date, year, morning, afternoon, or early, mid, and late, etc. can be compared and analyzed with the preset reference time word segment to obtain a first comparison result.

[0104] It should be noted that the preset word matching table includes a plurality of article strong timeliness indicating words summarized according to actual article information, such as news, morning newspaper, evening newspaper, etc. The word matching table also includes a blacklist word table constructed according to actual information article recommendation effect, and a holiday table for identifying holidays, which covers common holidays, twenty-four solar terms, etc.

[0105] In step S302 of some embodiments, the text theme feature of the first text data can be obtained by field crawling from the title and introduction part of the first text data through a preset network crawler.

[0106] In step S303 of some embodiments, the text theme feature is compared and analyzed with the preset reference theme word segment. If the text theme feature is consistent with the reference theme word segment of the season health, knowledge popularization, finance, entertainment and the like, the second comparison result is that the first text data is weak timeliness text. If the text theme feature is inconsistent with the reference theme word segment of the season health, knowledge popularization and the like, the second comparison result is that the first text data is strong timeliness text.

[0107] In step S304 of some embodiments, if the first comparison result and the second comparison result of a certain first text data both indicate that the first text data is strong timeliness text, the timeliness category of the first text data is strong timeliness, and the first text data is taken as the first target data, and the first timeliness category of the first target data is strong timeliness. If at least one of the first comparison result and the second comparison result of a certain first text data indicates that the first text data is weak timeliness text, the timeliness category of the first text data is weak timeliness.

[0108] Through the above steps S301 to S304, the timeliness of the text data can be identified based on the feature keyword and the template, and the identification accuracy of the text timeliness is improved.

[0109] It should be noted that the timeliness category of the original text data includes strong timeliness and weak timeliness, wherein the strong timeliness refers to that the text content of the original text data includes events that have occurred at a specific time point, out-of-date hot news and the like; the weak timeliness refers to that the text content of the original text data includes information that can be read for a long time, and the text content does not have expiration and invalidation, for example, the information of popular science is weak timeliness original text data and the like.

[0110] In step S104 of some embodiments, the second text data can be segmented by a pre-trained ALBERT model, and the second text data is split into a plurality of initial text segments by the ALBERT model and a preset segment length. That is, the sentence order of the second text data is processed by the ALBERT model to obtain a sentence sequence, and the sentence sequence is tokenized according to the preset segment length, that is, the sentence sequence is split to obtain a plurality of initial text segments.

[0111] Please refer to Figure 4Before step S105 of some embodiments, the text recommendation method further comprises pre-training a text classification model, which can specifically include but is not limited to steps S401 to S406:

[0112] Step S401, obtaining label text data, the label text data comprising sample text data and reference timeliness labels of the sample text data;

[0113] Step S402, performing word segmentation processing on the label text data to obtain label text word segments;

[0114] Step S403, performing word embedding processing on the label text word segments to obtain label text word embedding vectors;

[0115] Step S404, adding a preset perturbation factor to the label text word embedding vectors to obtain sample word embedding vectors;

[0116] Step S405, calculating a loss value between the sample word embedding vectors and the reference timeliness labels through a loss function of the text classification model to obtain a target loss value;

[0117] Step S406, optimizing model parameters of the text classification model according to the target loss value to train the text classification model.

[0118] In step S401 of some embodiments, the label text data can be obtained by writing a web crawler and setting a data source to crawl data targetedly. The label text data to be processed can also be obtained by other means, which are not limited. The label text data comprises sample text data and reference timeliness labels of the sample text data.

[0119] Further, when performing annotation processing on the sample text data to obtain the reference timeliness labels of the sample text data, a double-blind annotation method can be adopted, that is, two annotators independently annotate a batch of sample text data at the same time. If the annotation results are consistent, the annotation results are directly taken as the reference timeliness labels of the sample text data. If the annotation results are inconsistent, one of the annotation results is taken as the reference timeliness label of the sample text data according to a preset annotation rule.

[0120] In step S402 of some embodiments, the sentence order of the label text data is predicted through an ALBERT model to obtain a label sentence sequence, and the label sentence sequence is split according to a preset word segment length to obtain a plurality of label text word segments.

[0121] In step S403 of some embodiments, the label text word segment is subjected to word embedding processing, and the label text word segment is mapped from a semantic space to a vector space with a preset dimension to obtain a label text word embedding vector. The preset dimension can be set according to actual conditions and is not limited,

[0122] In step S404 of some embodiments, a preset perturbation factor can be set according to actual requirements, and the perturbation factor is added to the label text word embedding vector to obtain a sample word embedding vector. The perturbation factor does not cause the predicted label of the model to change. Through the perturbation factor, some training data similar to the sample text data is generated in the model training process, so that the amount of data used for model training is increased, thereby improving the robustness and generalization ability of the text classification model.

[0123] In step S405 of some embodiments, the text classification model can be constructed based on a softmax classifier, or can be constructed based on a TextCNN, BIlSTM, KMax_CNN, or the like. In the embodiments of the present application, in order to improve the classification efficiency, a text classification model based on KMax_CNN is adopted. When the target loss value is obtained by calculating the loss value between the sample word embedding vector and the reference timeliness label through the loss function of the text classification model, a general cross-entropy loss function can be selected as the loss function of the text classification model. The similarity between the sample word embedding vector and the reference timeliness label is calculated through the cross-entropy loss function to obtain a label similarity value, and the label similarity value is taken as the target loss value.

[0124] In step S406 of some embodiments, when the model parameters of the text classification model are optimized according to the target loss value, the target loss value is back propagated, the size of the target loss value is changed by adjusting the model parameters of the text classification model, so that the target loss value is minimized, and the text classification model is obtained.

[0125] Further, in the embodiments of the present application, the text classification model can be trained in an adversarial training manner, the preset perturbation factor is maximized, so that the text classification model can generate a larger gradient through the perturbation factor, thereby adding the maximized perturbation factor to the label text word embedding vector to obtain a sample word embedding vector. The minimization of the target loss value containing the perturbation is realized through the sample word embedding vector, that is, the model parameters are updated by gradient descent of the text classification model, so that the perturbation factor is maximized and the target loss value is minimized, and the text classification model is obtained.

[0126] Through the above steps S401 to S406, the text classification model can be well trained, and the classification effect of the model and the generalization ability of the model can be improved through the addition of the perturbation factor and the adversarial training manner.

[0127] Referring to Figure 5 In some embodiments, the text classification model comprises an embedding layer, a convolutional layer, a pooling layer, and a classification layer, and step S105 can comprise but is not limited to steps S501-S504:

[0128] In step S501, the initial text word segment is processed by the embedding layer for word embedding to obtain a text word embedding vector.

[0129] In step S502, the text word embedding vector is processed by the convolutional layer for feature extraction to obtain a text word segment feature vector.

[0130] In step S503, the text word segment feature vector is processed by the pooling layer for down-sampling to obtain a target word segment feature vector.

[0131] In step S504, the target word segment feature vector is processed by the classification layer for classification prediction to obtain second classification data.

[0132] In step S501 of some embodiments, the initial text word segment is processed by the embedding layer for word embedding to map the initial text word segment from a semantic space to a vector space of a preset dimension, to obtain a text word embedding vector. The preset dimension can be set according to actual conditions and is not limited, for example, the preset dimension can be 256 or 512.

[0133] In step S502 of some embodiments, the text word embedding vector is processed by the convolutional layer for feature extraction to obtain text feature information in the text word embedding vector, and a text word segment feature vector is obtained.

[0134] In step S503 of some embodiments, the text word segment feature vector is processed by multiple pooling layers for down-sampling and maximum pooling to obtain multiple text pooling feature vectors, k text pooling feature vectors with the largest feature values are selected as target pooling feature vectors, and the k target pooling feature vectors are concatenated according to the order of their feature values to obtain a target word segment feature vector, where k is an integer greater than 0. In this way, the target word segment feature vector can represent the intensity of different text features and retain more word order information, thereby improving the text classification effect.

[0135] In step S504 of some embodiments, the classification probability of the target word segment feature vector is calculated by the classification layer to obtain a classification probability value corresponding to each timeliness category label, so as to predict the timeliness category of the second text data according to the classification probability value, thereby realizing the timeliness classification of the second text data. If the timeliness category of a certain second text data is strong timeliness, the second text data is taken as a second target data, and the second timeliness category of the second target data is strong timeliness.

[0136] The steps S501 to S504 determine the timeliness category of the second text data by classifying the second text data not including the feature keyword through the pre-trained text classification model, so that the accuracy and efficiency of text classification can be effectively improved by the model classification.

[0137] Referring to Figure 6 In some embodiments, the step S504 includes but is not limited to steps S601 to S602:

[0138] In step S601, a classification probability value corresponding to each timeliness category label is obtained by performing classification probability calculation on the target word segment feature vector through the classification function of the classification layer and the preset timeliness category label.

[0139] In step S602, the second classification data is obtained according to the classification probability value and the preset probability threshold.

[0140] In step S601 of some embodiments, the classification function can be a probability function such as a softmax function, and the preset timeliness category label includes strong timeliness and weak timeliness. A probability distribution is created on each timeliness category label for the target word segment feature vector through the softmax function, so that the target word segment feature vector is classified according to the probability distribution, and a classification probability value corresponding to each timeliness category label is obtained. The classification probability value can be used to represent the possibility of the second text data belonging to each timeliness category label.

[0141] In step S602 of some embodiments, the preset probability threshold can be set according to actual business needs, for example, the probability threshold is 0.5. When the classification probability value is less than 0.5, it is determined that the timeliness category of the second text data is weak timeliness, and when the classification probability value is greater than or equal to 0.5, it is determined that the timeliness category of the second text data is strong timeliness.

[0142] Through the above steps S601 to S602, the classification probability values of different timeliness category labels can be calculated according to the classification function, the possibility of the second text data belonging to different timeliness category labels is quantified by a numerical value, so that it is determined whether the second text data is weak timeliness or strong timeliness, and the accuracy of text timeliness classification is improved.

[0143] Referring to Figure 7 In some embodiments, the step S106 can include but is not limited to steps S701 to S703:

[0144] In step S701, the first target data is filtered to obtain the first recommended data according to the preset first recommendation number.

[0145] Step S702, the second target data is filtered according to the preset second recommended number, and the second recommended data is obtained.

[0146] Step S703, the first recommended data and the second recommended data are merged, and the target text data is obtained.

[0147] It should be noted that the timeliness category of the first target data and the second target data is strong timeliness.

[0148] In step S701 of some embodiments, the preset first recommended number can be set according to actual business needs, for example, the first recommended number is 15, then 15 text data can be randomly selected from the first target data as the first recommended data.

[0149] In step S702 of some embodiments, the preset second recommended number can be set according to actual business needs, for example, the second recommended number is 5, then 5 text data can be randomly selected from the second target data as the second recommended data.

[0150] In step S703 of some embodiments, the first recommended data and the second recommended data are merged, and the first recommended data and the second recommended data are included in the same set to obtain the target text data.

[0151] Through the above steps S701 to S703, the corresponding number of first recommended data and second recommended data can be selected according to different text recommendation requirements to form the target text data, which can effectively control the text quantity of the target text data and improve the text recommendation accuracy.

[0152] In step S107 of some embodiments, the target text data can be directly pushed to the target object, or the relatively earlier content in the target text data is selected and pushed to the target object, so as to realize personalized recommendation while reducing communication cost, wherein the target object can be a target user or a third party platform, etc., without limitation.

[0153] The text recommendation method provided in the embodiments of the present application comprises the following steps: obtaining original text data to be processed; performing classification processing on the original text data according to preset feature keywords to obtain first text data and second text data; wherein the first text data comprises the feature keywords, and the second text data does not comprise the feature keywords; in this way, the original text data can be conveniently divided into the first text data with time feature keywords and the second text data without time feature keywords, so that different timeliness analysis manners are used to obtain corresponding timeliness categories for the first text data and the second text data respectively. Further, timeliness identification is performed on the first text data by using a preset timeliness identification template to obtain first classification data; wherein the first classification data comprises first target data and a first timeliness category of the first target data, and the first timeliness category is used to represent the timeliness category of the first target data; the timeliness of the text data can be identified based on the feature keywords and the template, and the identification accuracy of the timeliness of the text is improved. Further, word segmentation processing is performed on the second text data to obtain initial text word segments; and timeliness classification is performed on the initial text word segments by using a pre-trained text classification model to obtain second classification data; wherein the second classification data comprises second target data and a second timeliness category of the second target data, and the second timeliness category is used to represent the timeliness category of the second target data; the first timeliness category and the second timeliness category have the same category; the timeliness classification of the text data is performed by using the model classification manner, and the classification accuracy and the classification efficiency of the timeliness of the text are improved. Finally, the first target data and the second target data are merged to obtain target text data, and the target text data is recommended to a target object; in this way, the target text data meeting the current timeliness requirement can be conveniently obtained, and the accuracy of the text recommendation is improved.

[0154] For more details, please refer to Figure 8 The embodiments of the present application also provide a text recommendation device, which can implement the above-mentioned text recommendation method. The device comprises:

[0155] The data acquisition module 801 is configured to acquire original text data to be processed.

[0156] The feature classification module 802 is configured to perform classification processing on the original text data according to preset feature keywords to obtain first text data and second text data; wherein the first text data comprises the feature keywords, and the second text data does not comprise the feature keywords.

[0157] The timeliness identification module 803 is configured to perform timeliness identification on the first text data by using a preset timeliness identification template to obtain first classification data; wherein the first classification data comprises first target data and a first timeliness category of the first target data, and the first timeliness category is used to represent the timeliness category of the first target data.

[0158] The word segmentation module 804 is configured to perform word segmentation processing on the second text data to obtain initial text word segments.

[0159] The timeliness classification module 805 is configured to perform timeliness classification on the initial text word segments by using a pre-trained text classification model to obtain second classification data. The second classification data includes second target data and a second timeliness category of the second target data. The second timeliness category is used to represent the timeliness category of the second target data. The first timeliness category and the second timeliness category are of the same category.

[0160] The merging module 806 is configured to perform merging processing on the first target data and the second target data to obtain target text data.

[0161] The recommendation module 807 is configured to recommend the target text data to the target object.

[0162] In some embodiments, the feature keywords include time feature keywords, and the feature classification module 802 includes:

[0163] The content analysis unit is configured to perform content analysis on the original text data according to the time feature keywords to obtain an analysis result.

[0164] The first text data determination unit is configured to determine that the original text data is the first text data if the analysis result indicates that the original text data includes the time feature keywords.

[0165] The second text data determination unit is configured to determine that the original text data is the second text data if the analysis result indicates that the original text data does not include the time feature keywords.

[0166] In some embodiments, the first text data includes time feature keywords, and the timeliness identification module 803 includes:

[0167] The first comparison and analysis unit is configured to perform comparison and analysis on the time feature keywords and a preset reference time segment according to a preset priority order to obtain a first comparison result.

[0168] The extraction unit is configured to extract a text theme feature of the first text data.

[0169] The second comparison and analysis unit is configured to perform comparison and analysis on the text theme feature and a preset reference theme segment to obtain a second comparison result.

[0170] The determination unit is configured to obtain the first classification data according to the first comparison result and the second comparison result.

[0171] In some embodiments, the text classification model includes an embedding layer, a convolution layer, a pooling layer, and a classification layer, and the timeliness classification module 805 includes:

[0172] The embedding unit is configured to perform word embedding processing on the initial text word segment through an embedding layer to obtain a text word embedding vector.

[0173] The vector extraction unit is configured to perform feature extraction on the text word embedding vector through a convolution layer to obtain a text word segment feature vector.

[0174] The down-sampling unit is configured to perform down-sampling processing on the text word segment feature vector through a pooling layer to obtain a target word segment feature vector.

[0175] The classification prediction unit is configured to perform classification prediction on the target word segment feature vector through a classification layer to obtain second classification data.

[0176] In some embodiments, the classification prediction unit includes:

[0177] The probability calculation sub-unit is configured to perform classification probability calculation on the target word segment feature vector through a classification function of the classification layer and a preset timeliness category label to obtain a classification probability value corresponding to each timeliness category label.

[0178] The comparison sub-unit is configured to obtain the second classification data according to the classification probability value and a preset probability threshold.

[0179] In some embodiments, the merging module 806 includes:

[0180] The first screening unit is configured to perform screening processing on the first target data according to a preset first recommendation quantity to obtain first recommendation data.

[0181] The second screening unit is configured to perform screening processing on the second target data according to a preset second recommendation quantity to obtain second recommendation data.

[0182] The merging unit is configured to perform merging processing on the first recommendation data and the second recommendation data to obtain target text data.

[0183] In some embodiments, the text recommendation method further includes a training module, specifically including:

[0184] The label data acquisition unit is configured to acquire label text data, the label text data including sample text data and a reference timeliness label of the sample text data.

[0185] The word segmentation unit is configured to perform word segmentation processing on the label text data to obtain label text word segments.

[0186] The word embedding unit is configured to perform word embedding processing on the label text word segments to obtain label text word embedding vectors.

[0187] The perturbation adding unit is configured to add a preset perturbation factor to the label text word embedding vector to obtain a sample word embedding vector.

[0188] a loss calculation unit configured to calculate a loss value between the sample word embedding vector and the reference timeliness label by using a loss function of the text classification model, to obtain a target loss value;

[0189] an optimization unit configured to optimize model parameters of the text classification model according to the target loss value, to train the text classification model.

[0190] The detailed implementation of the text recommendation apparatus is basically the same as the above-mentioned text recommendation method, and will not be repeated here.

[0191] The embodiments of the present application further provide an electronic device, which comprises a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and the program is executed by the processor to realize the above-mentioned text recommendation method. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.

[0192] Please refer to Figure 9 , Figure 9 The hardware structure of the electronic device of another embodiment is illustrated, which comprises:

[0193] The processor 901 can be implemented in a general-purpose CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, etc., and is used to execute related programs to realize the technical solutions provided by the embodiments of the present application;

[0194] The memory 902 can be implemented in the form of ROM (ReadOnly Memory), a static storage device, a dynamic storage device, or RAM (Random Access Memory), etc. The memory 902 can store an operating system and other application programs, and when the technical solutions provided by the embodiments of the present application are implemented by software or firmware, the related program codes are saved in the memory 902 and are called and executed by the processor 901 to implement the text recommendation method of the embodiments of the present application;

[0195] The input / output interface 903 is used to realize information input and output;

[0196] The communication interface 904 is used to realize the communication interaction between the device and other devices, which can realize communication through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);

[0197] A bus 905 is used to transmit information between the various components (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904) of the device.

[0198] The processor 901, the memory 902, the input / output interface 903, and the communication interface 904 are communicatively connected to each other within the device through the bus 905.

[0199] The embodiments of the present application also provide a storage medium, which is a computer readable storage medium, for computer readable storage. The storage medium stores one or more programs, which can be executed by one or more processors to implement the above-mentioned text recommendation method.

[0200] The memory, as a non-transitory computer readable storage medium, can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory remotely arranged with respect to the processor, and these remote memories can be connected to the processor through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0201] The text recommendation method, the text recommendation device, the electronic equipment and the storage medium provided by the embodiments of the present application can obtain original text data to be processed, perform classification processing on the original text data according to a preset feature keyword, and obtain first text data and second text data. The first text data includes the feature keyword, and the second text data does not include the feature keyword. In this way, the original text data can be conveniently divided into the first text data with the time feature keyword and the second text data without the time feature keyword, so that different timeliness analysis methods are used for the first text data and the second text data respectively to obtain corresponding timeliness categories. Further, the first text data is subjected to timeliness identification through a preset timeliness identification template to obtain first classification data. The first classification data includes first target data and a first timeliness category of the first target data. The first timeliness category is used to represent the timeliness category of the first target data. The timeliness of the text data can be identified based on the feature keyword and the template, and the identification accuracy of the timeliness of the text is improved. Further, the second text data is subjected to word segmentation processing to obtain initial text segments, and the initial text segments are subjected to timeliness classification through a pre-trained text classification model to obtain second classification data. The second classification data includes second target data and a second timeliness category of the second target data. The second timeliness category is used to represent the timeliness category of the second target data. The first timeliness category and the second timeliness category have the same category. The timeliness classification of the text data is performed through the model classification, and the classification accuracy and the classification efficiency of the timeliness of the text are improved. Finally, the first target data and the second target data are subjected to merging processing to obtain target text data, and the target text data is recommended to a target object. In this way, the target text data meeting the current timeliness requirement can be conveniently obtained, and the accuracy of the text recommendation is improved.

[0202] The embodiments described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

[0203] Those skilled in the art can understand that, Figures 1-7 The technical solutions shown in the drawings do not constitute a limitation on the embodiments of the present application, and can include more or fewer steps, or combine certain steps, or different steps.

[0204] The apparatus embodiments described above are merely exemplary, and the units described as separate units can or can not be physically separate, i.e., can be located in one place, or can be distributed over multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment.

[0205] Those skilled in the art can understand that all or some of the steps in the method disclosed above, the functional modules / units in the system and the device can be implemented as software, firmware, hardware and appropriate combinations thereof.

[0206] The terms "first", "second", "third", "fourth" and the like in the description of the application and in the claims of the foregoing drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of the terms so construed can be interchanged, such that, for example, without departing from the scope of the application, the embodiments described herein can be carried out in a different order than the one illustrated or described herein. In addition, the terms "comprising", "having" and any variations thereof are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or apparatus that comprises a list of steps or units not necessarily limited to those explicitly listed, but can include other not expressly listed or inherent to such processes, methods, products or apparatus.

[0207] It should be understood that in this application, "at least one" means one or more, and "multiple" means two or more. "And / or" is used to describe the relationship between the associated objects, which means that there can be three relationships, for example, "A and / or B" can mean that there are three cases: only A, only B, and A and B at the same time, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0208] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented by other manners. For example, the apparatus embodiments described above are merely illustrative, for example, the division of the above units is merely a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, apparatuses or units, and can be electrical, mechanical or other forms.

[0209] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they can be located in one place or distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0210] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0211] If the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part of the prior art that makes a contribution or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method of each embodiment of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program storage media.

[0212] The preferred embodiments of the embodiments of the present application are described above with reference to the accompanying drawings, but this does not limit the scope of the embodiments of the present application. Any modifications, equivalent replacements and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of the embodiments of the present application.

Claims

1. A text recommendation method characterized by, The method comprises: acquiring original text data to be processed; classifying the original text data according to preset characteristic keywords to obtain first text data and second text data; wherein the first text data comprises the characteristic keywords, and the second text data does not comprise the characteristic keywords; identifying the first text data for timeliness by using a preset timeliness identification template to obtain first classification data; wherein the first classification data comprises first target data and a first timeliness category of the first target data, and the first timeliness category is used to represent the timeliness category of the first target data; performing word segmentation processing on the second text data to obtain initial text word segments; classifying the initial text word segments for timeliness by using a pre-trained text classification model to obtain second classification data; wherein the second classification data comprises second target data and a second timeliness category of the second target data, and the second timeliness category is used to represent the timeliness category of the second target data, and the first timeliness category and the second timeliness category are of the same category; when the first timeliness category and the second timeliness category are both strong timeliness, merging the first target data and the second target data to obtain target text data; recommending the target text data to a target object.

2. The text recommendation method of claim 1, wherein, The characteristic keywords comprise time characteristic keywords, and the step of classifying the original text data according to the preset characteristic keywords to obtain the first text data and the second text data comprises: performing content analysis on the original text data according to the time characteristic keywords to obtain an analysis result; if the analysis result is that the time characteristic keywords exist in the original text data, determining that the original text data is the first text data; if the analysis result is that the time characteristic keywords do not exist in the original text data, determining that the original text data is the second text data.

3. The text recommendation method of claim 1, wherein, The first text data comprises time characteristic keywords, and the step of identifying the first text data for timeliness by using the preset timeliness identification template to obtain the first classification data comprises: comparing and analyzing the time characteristic keywords with a preset reference time word segment according to a preset priority order to obtain a first comparison result; extracting text theme features of the first text data; comparing and analyzing the text theme features with a preset reference theme word segment to obtain a second comparison result; obtaining the first classification data according to the first comparison result and the second comparison result.

4. The text recommendation method of claim 1, wherein, The text classification model comprises an embedding layer, a convolution layer, a pooling layer, and a classification layer, and the step of classifying the initial text word segments for timeliness by using the pre-trained text classification model to obtain the second classification data comprises: performing word embedding processing on the initial text word segments by using the embedding layer to obtain text word embedding vectors; extracting features of the text word embedding vectors by using the convolution layer to obtain text word segment feature vectors; performing down-sampling processing on the text word segment feature vectors by using the pooling layer to obtain target word segment feature vectors; and performing classification on the target word segment feature vectors by using the classification layer to obtain the second classification data. The target word segment feature vector is classified and predicted through the classification layer to obtain the second classification data.

5. The text recommendation method of claim 4, wherein, The step of classifying and predicting the target word segment feature vector through the classification layer to obtain the second classification data comprises: The classification function of the classification layer and the preset timeliness category label are used to perform classification probability calculation on the target word segment feature vector to obtain a classification probability value corresponding to each timeliness category label; The second classification data is obtained according to the classification probability value and a preset probability threshold.

6. The text recommendation method according to any one of claims 1 to 5, characterized in that, The step of performing merging processing on the first target data and the second target data to obtain target text data comprises: The first target data is filtered according to a preset first recommendation quantity to obtain first recommendation data; The second target data is filtered according to a preset second recommendation quantity to obtain second recommendation data; The first recommendation data and the second recommendation data are merged to obtain the target text data.

7. The text recommendation method according to any one of claims 1 to 5, characterized in that, Before the step of performing timeliness classification on the initial text word segment through the pre-trained text classification model to obtain second classification data, the method further comprises pre-training the text classification model, specifically comprising: Obtaining label text data, wherein the label text data comprises sample text data and a reference timeliness label of the sample text data; Performing word segmentation processing on the label text data to obtain label text word segments; Performing word embedding processing on the label text word segments to obtain label text word embedding vectors; Adding a preset perturbation factor to the label text word embedding vectors to obtain sample word embedding vectors; Calculating a loss value between the sample word embedding vectors and the reference timeliness label through a loss function of the text classification model to obtain a target loss value; Optimizing model parameters of the text classification model according to the target loss value to train the text classification model.

8. A text recommendation apparatus characterized by comprising: The device comprises: A data acquisition module configured to acquire original text data to be processed; A feature classification module configured to perform classification processing on the original text data according to a preset feature keyword to obtain first text data and second text data; wherein the first text data comprises the feature keyword, and the second text data does not comprise the feature keyword; A timeliness identification module configured to perform timeliness identification on the first text data through a preset timeliness identification template to obtain first classification data; wherein the first classification data comprises first target data and a first timeliness category of the first target data, and the first timeliness category is used to represent a timeliness category of the first target data; A word segmentation module configured to perform word segmentation processing on the second text data to obtain initial text word segments; The timeliness classification module is configured to perform timeliness classification on the initial text word segment by using a pre-trained text classification model to obtain second classification data; the second classification data includes second target data and a second timeliness category of the second target data; the second timeliness category is used to represent the timeliness category of the second target data; the first timeliness category and the second timeliness category are of the same category; The merging module is configured to perform merging processing on the first target data and the second target data when the first timeliness category and the second timeliness category are both strong timeliness, to obtain target text data. The recommendation module is configured to recommend the target text data to a target object.

9. An electronic device, comprising: The electronic device includes a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for realizing connection communication between the processor and the memory, and the program, when executed by the processor, realizes the steps of the text recommendation method according to any one of claims 1 to 7.

10. A storage medium, the storage medium being a computer-readable storage medium for computer-readable storage, characterized in that, The storage medium stores one or more programs, and the one or more programs are executable by one or more processors to realize the steps of the text recommendation method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Enquiring method and device based on vertical search, computer equipment and storage medium

    CA3177671A1

  • Data processing method and device based on timeliness, electronic equipment and storage medium

    CN113407714A