CN114492669A - Keyword recommendation model training method, recommendation method and device, equipment and medium - Google Patents

Keyword recommendation model training method, recommendation method and device, equipment and medium Download PDF

Info

Publication number
CN114492669A
CN114492669A CN202210143648.9A CN202210143648A CN114492669A CN 114492669 A CN114492669 A CN 114492669A CN 202210143648 A CN202210143648 A CN 202210143648A CN 114492669 A CN114492669 A CN 114492669A
Authority
CN
China
Prior art keywords
keyword
word
word vector
recommendation model
keyword recommendation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210143648.9A
Other languages
Chinese (zh)
Other versions
CN114492669B (en
Inventor
刘羲
舒畅
陈又新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202210143648.9A priority Critical patent/CN114492669B/en
Priority to PCT/CN2022/090746 priority patent/WO2023155304A1/en
Publication of CN114492669A publication Critical patent/CN114492669A/en
Application granted granted Critical
Publication of CN114492669B publication Critical patent/CN114492669B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Probability & Statistics with Applications (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the disclosure provides a keyword recommendation model training method, a keyword recommendation device, equipment and a medium, and relates to the technical field of artificial intelligence. The keyword recommendation model training method comprises the following steps: the method comprises the steps of obtaining an index sample, constructing a keyword training data set according to the index sample, obtaining word vectors of words according to the index sample, obtaining primary environment word vectors according to the word vectors, obtaining input environment word vectors according to the primary environment word vectors, generating keyword vectors according to the input environment word vectors and the word vectors, inputting the keyword vectors into a prediction classification layer to obtain recommended predicted values, and adjusting parameters according to detection errors between the recommended predicted values and classification labels to obtain a keyword recommendation model. According to the method and the device, the input environment word vectors related to the word vectors are obtained, the learning difficulty of the keywords and the environment information corresponding to the keywords are combined, so that the selected keywords meet the learning requirements of the user, and the relevance and the accuracy of keyword recommendation are improved.

Description

Keyword recommendation model training method, recommendation method and device, equipment and medium
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a keyword recommendation model training method, a keyword recommendation device, equipment and a medium.
Background
Along with the increasingly wide application of foreign languages in people's life and work, the language learning becomes the continuous pursuit of people quickly, conveniently and efficiently, and along with the development of artificial intelligence, more and more research achievements for improving the language learning efficiency by utilizing the artificial intelligence appear. For example, for english learning, word learning is the basis, after a user reads an english text, an artificial intelligence system is used to automatically extract key words (i.e., keywords) of the text for the user to learn, 20 most likely learned words of the user are provided according to english reading history information research of a user group, and recommended ranking is performed from large to small according to learning probability.
The first scheme is an unsupervised learning scheme to obtain a recommendation model, the word frequency of all texts is counted to obtain the inverse text frequency IDF (inverse document frequency) of each word, the IDF is used for representing the difficulty degree of the word, the IDF is ranked from high to low and then recommended to a user, although the recommendation model obtained by the scheme is convenient to calculate, and the IDF can reflect the difficulty trend of the word, the word with higher IDF is a rare word and is not suitable for general users to learn. Another approach is to derive a recommendation model for supervised learning schemes, such as sequential labeling scheme, which inputs all words as a text, and tries to find the relation between each word and other words by long-short term memory artificial neural network or attention mechanism network structure, so as to find the word that the user wants to learn most. When the recommendation model obtained by the scheme is used for processing long texts, the parameter quantity is large, and the influence of excessive irrelevant words is introduced, so that the keyword recommendation effect is greatly reduced. For another example, for direct prediction of a single word, the relation between words is not considered, the scheme is simple and quick, but due to lack of interaction with other words, the word most suitable for learning cannot be accurately found.
Disclosure of Invention
The main purpose of the embodiment of the disclosure is to provide a keyword recommendation model training method, a recommendation method and device, equipment and a medium, wherein a keyword recommendation model obtained by training with the keyword recommendation model training method can automatically extract keywords in a text, and the relevance and accuracy of keyword recommendation are improved.
In order to achieve the above object, a first aspect of the embodiments of the present disclosure provides a keyword recommendation model training method, including:
obtaining at least one text sample, and generating an index sample containing index information of words according to the text sample;
constructing a keyword training data set according to the index sample, wherein the keyword training data set comprises the index sample and a classification label;
inputting the index sample into a word embedding processing layer of the keyword recommendation model to perform word embedding operation, so as to obtain a word vector of the word;
inputting the word vector into a primary environment information extraction layer of the keyword recommendation model to extract primary environment information to obtain a primary environment word vector;
performing first splicing processing on the primary environment word vector and the word vector by using an input environment information extraction layer of the keyword recommendation model to generate the input environment word vector corresponding to the word;
performing second splicing processing according to the input environment word vector and the word vector to obtain a keyword vector;
inputting the keyword vector into a prediction classification layer of the keyword recommendation model to obtain a recommendation prediction value;
and adjusting parameters in the keyword recommendation model according to the detection error between the recommendation prediction value and the classification label until a loss function meets a convergence condition to obtain the keyword recommendation model, wherein the keyword recommendation model is used for performing keyword recommendation processing.
In some embodiments, the inputting the word vector into the primary environment information extraction layer of the keyword recommendation model to perform primary environment information extraction to obtain a primary environment word vector includes:
obtaining preselected words of the word vector according to the index information by utilizing the primary environment information extraction layer, wherein the preselected words are words with a first quantity adjacent to the words corresponding to the word vector, and the word vector corresponding to the preselected words is a preselected word vector;
acquiring the inverse text frequency of the preselected word;
and calculating a primary environment word vector corresponding to the word vector according to the preselected word vector and the inverse text frequency.
In some embodiments, the performing a second stitching process according to the input environment word vector and the word vector to obtain a keyword vector includes:
obtaining an inverse text frequency of the word vector;
and carrying out second splicing processing on the input environment word vector, the word vector and the inverse text frequency of the word vector to generate the keyword vector.
In some embodiments, said obtaining, by said primary context information extraction layer, a preselected word of said word vector from said index information comprises:
copying the words of the index sample to obtain a second number of copied words, wherein the second number is obtained by calculating the first number;
performing displacement operation on the second number of copied words column by column to obtain a displacement word matrix;
acquiring the list words of the displacement word matrix;
obtaining the column words corresponding to the word vectors as the preselected words according to the index information
In some embodiments, the constructing a keyword training data set from the indexed samples comprises:
obtaining at least one user keyword sample and corresponding classification label, wherein the classification label is a target label or a non-target label
Calculating the probability that each classification label is a target label to obtain label probability distribution;
merging the user keyword samples according to the label probability distribution to obtain the index samples corresponding to the text samples;
and constructing a keyword training data set according to the index sample.
In some embodiments, the constructing a keyword training data set from the index samples comprises:
acquiring a text mask;
performing length filling processing on the index sample according to the text mask to obtain the keyword training data set; wherein the text length of the index samples in the keyword training dataset is consistent.
In order to achieve the above object, a third aspect of the present disclosure provides a keyword recommendation method, including:
acquiring a text to be recommended;
generating an index text according to the text to be recommended;
inputting the index text into a keyword recommendation model to perform keyword recommendation processing to obtain a target keyword, wherein the keyword recommendation model is obtained by training with the keyword recommendation model training method according to any one of the first aspect.
In order to achieve the above object, a third aspect of the present disclosure provides a keyword recommendation model training apparatus, including:
the text sample acquisition module is used for acquiring at least one text sample and generating an index sample containing index information of words according to the text sample;
the training data set construction module is used for constructing a keyword training data set according to the index sample, and the keyword training data set comprises the index sample and a classification label;
the word vector processing module is used for inputting the index sample into a word embedding processing layer of the keyword recommendation model to perform word embedding operation so as to obtain a word vector of the word;
the primary environment word vector calculation module is used for inputting the word vectors into a primary environment information extraction layer of the keyword recommendation model to extract primary environment information to obtain primary environment word vectors;
the input environment word vector calculation module is used for performing first splicing processing on the primary environment word vector and the word vector by utilizing an input environment information extraction layer of the keyword recommendation model to generate the input environment word vector corresponding to the word;
the keyword vector generating module is used for carrying out second splicing processing according to the input environment word vector and the word vector to obtain a keyword vector;
the classification prediction module is used for inputting the keyword vector into a prediction classification layer of the keyword recommendation model to obtain a recommendation prediction value;
and the parameter adjusting module is used for adjusting parameters in the keyword recommendation model according to the detection error between the recommendation prediction value and the classification label until a loss function meets a convergence condition to obtain the keyword recommendation model, and the keyword recommendation model is used for performing keyword recommendation processing.
To achieve the above object, a fourth aspect of the present disclosure provides an electronic device, including:
at least one memory;
at least one processor;
at least one program;
the programs are stored in a memory and a processor executes the at least one program to implement the method of the present disclosure as described in the above first or second aspect.
To achieve the above object, a fifth aspect of the present disclosure proposes a storage medium which is a computer-readable storage medium storing computer-executable instructions for causing a computer to perform:
a method as claimed in the first or second aspect above.
The keyword recommendation model training method provided by the embodiment of the disclosure includes the steps of obtaining an index sample, constructing a keyword training data set according to the index sample, inputting the index sample into a word embedding processing layer of a keyword recommendation model to obtain a word vector of a word, inputting the word vector into a primary environment information extraction layer to obtain a primary environment word vector, inputting the primary environment word vector into an input environment information extraction layer to obtain an input environment word vector, generating a keyword vector according to the input environment word vector and the word vector, inputting the keyword vector into a prediction classification layer to obtain a recommendation prediction value, and adjusting parameters in the keyword recommendation model according to a detection error between the recommendation prediction value and a classification label to obtain the keyword recommendation model. According to the keyword recommendation model obtained by training in the keyword recommendation model training method, the input environment word vectors related to the word vectors are obtained, and the learning difficulty of the keywords and the environment information corresponding to the keywords are combined, so that the selected keywords meet the learning requirements of users, and the relevance and the accuracy of keyword recommendation are improved.
Drawings
Fig. 1 is a flowchart of a keyword recommendation model training method provided in an embodiment of the present disclosure.
Fig. 2 is another flowchart of a keyword recommendation model training method provided in the embodiment of the present disclosure.
Fig. 3 is a schematic diagram of a preselected word selection method of a keyword recommendation model training method provided in the embodiment of the present disclosure.
Fig. 4 is another flowchart of a keyword recommendation model training method provided in the embodiments of the present disclosure.
Fig. 5 is a schematic diagram of obtaining a preselected word according to a displacement structure in the keyword recommendation model training method provided in the embodiment of the present disclosure.
Fig. 6 is a schematic structural diagram of a keyword recommendation model training method provided in the embodiment of the present disclosure.
Fig. 7 is a schematic diagram of a prediction flow of a keyword recommendation model training method provided in the embodiment of the present disclosure.
Fig. 8 is another flowchart of a keyword recommendation model training method provided in the embodiments of the present disclosure.
Fig. 9 is a flowchart of a keyword recommendation method according to an embodiment of the present disclosure.
Fig. 10 is a block diagram of a structure of a keyword recommendation model training apparatus according to an embodiment of the present disclosure.
Fig. 11 is a block diagram of a keyword recommendation apparatus according to an embodiment of the present disclosure.
Fig. 12 is a schematic hardware structure diagram of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It should be noted that although functional blocks are partitioned in a schematic diagram of an apparatus and a logical order is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the partitioning of blocks in the apparatus or the order in the flowchart.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to be limiting of the invention.
First, several terms referred to in the present application are resolved:
inverse text frequency idf (inverse document frequency): namely TF-IDF (Term Frequency-Inverse Document Frequency), is a word segmentation algorithm and consists of two parts: TF (Term Frequency) and IDF (Inverse text Frequency). The term frequency TF refers to the number of times that the feature words appear in the selected text, which means that when the term frequency is calculated, word combinations in the text need to be divided, and the number of the words is counted after the division. IDF refers to a measure of the general importance of a feature word. And measuring the inverse text frequency of the characteristic words by counting the occurrence degree of the characteristic words for the established corpus. The IDF can effectively reduce the weight of the high-frequency feature words with small functions, thereby weakening the influence on text classification, meanwhile, evaluating the feature words with low word frequency and large functions, endowing the feature words with large weights, and improving the accuracy of text classification.
Along with the increasingly wide application of foreign languages in people's life and work, the language learning becomes the continuous pursuit of people in a fast, convenient and efficient manner, and along with the development of artificial intelligence, more and more research achievements for improving the language learning efficiency by utilizing the artificial intelligence appear. For example, for english learning, word learning is the basis, after a user reads an english text, an artificial intelligence system is used to automatically extract key words (i.e., keywords) of the text for the user to learn, 20 most likely learned words of the user are provided according to english reading history information research of a user group, and recommended ranking is performed from large to small according to learning probability.
The first solution is a recommendation model obtained by an unsupervised learning scheme, an IDF of each word is obtained by counting word frequencies of all texts, the IDF is used for representing the difficulty degree of the word, the IDF is recommended to a user after being ranked from high to low, although the recommendation model obtained by the scheme is relatively convenient and fast to calculate, and the IDF can reflect the difficulty tendency of the word, the word with higher IDF is a very rare word and is not suitable for a general user to learn. Another approach is to derive a recommendation model for supervised learning schemes, such as sequential labeling scheme, which inputs all words as a text, and tries to find the relation between each word and other words by long-short term memory artificial neural network or attention mechanism network structure, so as to find the word that the user wants to learn most. When the recommendation model obtained by the scheme is used for processing long texts, the parameter quantity is large, and the influence of excessive irrelevant words is introduced, so that the keyword recommendation effect is greatly reduced. For another example, for direct prediction of a single word, the relation between words is not considered, the scheme is simple and quick, but due to lack of interaction with other words, the word most suitable for learning cannot be accurately found.
Based on this, the embodiment of the disclosure provides a keyword recommendation model training method, a recommendation method and device, an electronic device, and a storage medium, which can realize automatic extraction of keywords in a text and improve relevance and accuracy of keyword recommendation.
The embodiments of the present disclosure provide a method and an apparatus for training a keyword recommendation model, an electronic device, and a storage medium, which are specifically described in the following embodiments.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
The embodiment of the disclosure provides a keyword recommendation model training method and a keyword recommendation method, and relates to the technical field of artificial intelligence, in particular to the technical field of artificial intelligence. The keyword recommendation model training method and the keyword recommendation method provided by the embodiment of the disclosure can be applied to a terminal, a server side and software running in the terminal or the server side. In some embodiments, the terminal may be a smartphone, tablet, laptop, desktop computer, smart watch, or the like; the server can be an independent server, and can also be a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, Network service, cloud communication, middleware service, domain name service, security service, Content Delivery Network (CDN), big data and artificial intelligence platform and the like; the software may be an application that implements a keyword recommendation model training method, a recommendation method, and the like, but is not limited to the above form.
The application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type 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 may 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, etc. that perform particular tasks or implement particular abstract data types. The application may 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 may be located in both local and remote computer storage media including memory storage devices.
Fig. 1 is an optional flowchart of a keyword recommendation model training method provided in an embodiment of the present disclosure, and the method in fig. 1 may include, but is not limited to, steps S101 to S108.
Step S101, at least one text sample is obtained, and an index sample containing index information of a word is generated according to the text sample.
In one embodiment, for example, english learning is taken as an example, a large number of text samples, that is, english articles are required for training the keyword recommendation model, and since an english article is composed of words, index information for each word is generated from the english article, and all words in the english article can be located according to the index information. For example, a database of words may be generated and then the text samples are converted into index samples, where the words are represented by their positions in the database, improving the efficiency of processing the samples.
And S102, constructing a keyword training data set according to the index samples, wherein the keyword training data set comprises the index samples and the classification labels.
In an embodiment, a keyword training data set is formed by using a large number of index samples, and the purpose of training is to enable a trained keyword recommendation model to output recommendation probabilities that all words in a text to be recommended are keywords after an index text corresponding to the text to be recommended is input. Based on this training objective, the keyword training dataset constructed in this embodiment includes: an index sample and a class label, i.e., a probability that each word in the index sample is a keyword, for example, "01" indicates that the word is not selected as a keyword, "0" indicates that the word is not selected as a keyword, and "1" indicates that the word is selected as a keyword.
Step S103, inputting the index sample into a word embedding processing layer of the keyword recommendation model to perform word embedding operation, and obtaining a word vector of a word.
In an embodiment, when the keyword recommendation model is trained, the index sample is input to a word embedding processing layer in the keyword recommendation model, and word embedding operation is performed on all words in the index sample to obtain a word vector of a corresponding word. The word embedding operation is a vectorized representation of words, representing individual words as real vectors in a predefined vector space, each word being mapped to a word vector.
In one embodiment, for example, a text contains words such as "cat", "dog", "love", etc., and these words are mapped into vector space, the word vector corresponding to cat is (0.1,0.2,0.3), "dog" is (0.2,0.2,0.4), "love" is (-0.4, -0.5, -0.2), etc., and the word vectors are only shown schematically. In this embodiment, the words are vectorized to obtain word vectors, which can improve the efficiency and accuracy of word processing by the computer, for example, "cat" and "dog" represent animals, and "love" represents an emotion, but for the computer, these three words are all represented by 0 and 1 as binary character strings, and cannot be directly calculated. Therefore, the embodiment converts the words into word vectors in the way of word embedding, and the machine computer can directly calculate the words. In the process of mapping the words into vector representations, i.e., the word embedding operation in the present embodiment, the word embedding processing layer in the keyword recommendation model is used to implement the word embedding operation on all the words in the index sample.
And step S104, inputting the word vector into a primary environment information extraction layer of the keyword recommendation model to extract primary environment information, so as to obtain a primary environment word vector.
In the actual language learning process, when a user selects a word in an article to learn, the difficulty of the word is considered by supplementary lighting, and the word is selected according to the related word in the current visual sense, namely, the user compares the word with the front word and the rear word around the word to determine whether to select the word to learn.
For example: the difficulty of the word A is not high, but the difficulty of a plurality of words around the word is low, and the user can select the word with high probability; on the contrary, the difficulty of the B word itself is high, but the difficulty of the words around the B word is also high, and the user will not select the B word with a high probability. Therefore, in an embodiment, the word vector is input into the primary environment information extraction layer of the keyword recommendation model through the visual sense range of the user to obtain a primary environment word vector for reflecting word information around the word (i.e., the word vector) as a primary environment influence factor to determine whether the word is selected as a learning word, and the selected keyword meets the learning requirement of the user by combining the learning difficulty of the keyword and the environment information corresponding to the keyword, so as to improve the relevance and accuracy of keyword recommendation.
In an embodiment, the word vector is input into a primary environment information extraction layer of the keyword recommendation model to perform primary environment information extraction, so as to obtain a primary environment word vector, with reference to fig. 2, including but not limited to steps S1041 to S1043:
and step S1041, acquiring the pre-selected words of the word vectors according to the index information by using the primary environment information extraction layer.
In an embodiment, the preselected word is a word around the word, for example, the preselected word may be a first number of words adjacent to a word corresponding to the word vector, the word may be around the word at a front-back position or a front-back upper-lower position of the word, that is, a sliding window with the first number is set at the front-back, and the words with the first number are captured as the preselected word around the word, or the words with the first number as a radius around the word, and the words with the front-back upper-lower position are captured as the preselected word, where a selection manner of the preselected word is not specifically limited, and a purpose of the selection is mainly to select a word in a word visual sense range as a primary environmental influence factor. And the word vector corresponding to the preselected word is a preselected word vector.
Fig. 3 is a schematic diagram illustrating a method for selecting a preselected word in an embodiment of the present application.
In the figure, the first number is 5, and the selection mode is a front-back position for example, that is, the word is taken as the center, and the words of the left and right 5 of the word are selected as the pre-selected words. For example, where the word "shot" is illustrated, the first five words are "Surgeon", "General", "defenses", "US" and "boost", and the last five words are "plan", "as", "much", "of" and "the", respectively, then "Surgeon", "General", "defenses", "US", "boost", "plan", "as", "much", "of" and "the" are preselected words for the word "shot".
In an embodiment of the present application, because each word in the index sample needs to be selected as a corresponding preselected word, for example, when the first number is 5, each word is taken as a center, and 5 words are taken as radii to be selected, for example, the length of a flat army word of a text is 1000 words, 1000 times of processing is required, when the number of texts is large, or the text is long, the time complexity of calculation is high, and the calculation performance is low, so as to further improve the efficiency of selecting the preselected word, in this embodiment, a preselected word is obtained according to a displacement structure, referring to fig. 4, which includes but is not limited to steps S401 to S404:
step S401 copies the words of the index sample to obtain a second number of copied words.
In an embodiment, the second number is calculated from the first number, for example, the second number is 2+1 times the first number. Referring to fig. 5, a schematic diagram of obtaining the pre-selected words according to the displacement structure in an embodiment of the present application is shown, where words and copied words are represented by numbers, and when the first number is 5, the second number is 11, that is, all words of the text are copied 11 times.
And step S402, performing displacement operation on the second number of copied words column by column to obtain a displacement word matrix.
In an embodiment, referring to fig. 5, the copied words obtained by copying are shifted column by column, that is, the first word of the next text is aligned with the previous word corresponding to the word in the previous text, and so on, to obtain a matrix of shifted words column by column, if the length of the words of the text is 1000, each text can be represented as a row vector of 1 × 1000, and the length of the obtained matrix of shifted words is 11 × 1000.
In step S403, the column words of the displacement word matrix are acquired.
In one embodiment, the matrix of displaced words is partitioned into columns to obtain column words corresponding to each column.
Step S404, the list words corresponding to the column of the word vector are obtained according to the index information and serve as the pre-selected words.
Referring to fig. 5, since the first number is 5, the words in row 6 are selected and the values are taken in columns, the column word corresponding to each word is the pre-selected word of the word, for example, the pre-selected word of "6" is "1", "2", "3", "4" and "5" and "7", "8", "9", "10" and "11", then the "6" in row 6 is the pre-selected word of "6" in the corresponding column of the shift word matrix, and so on. In this way, the time complexity can be significantly reduced, and the preselected word is selected for each word only by copying it a second number.
Step S1042, an inverse text frequency of the pre-selected word is obtained.
In one embodiment, the IDF for a word W may be obtained by dividing the total number of texts in the corpus (e.g., the keyword training data set) by the number of texts containing the word, and taking the quotient of the total number of texts, and if the number of texts containing the word W is less and the IDF is larger, the word W has a good classification capability.
In this embodiment, the IDF of the pre-selected word is calculated as:
Figure BDA0003507771870000081
IDFw=log1+M
wherein, IDFwRepresenting the inverse text frequency of the word W, | D | representing the total number of texts in the keyword training dataset, M representing the number of texts containing the word W, the denominator being incremented by 1 in order to avoid the case where the denominator is 0 as a result of the word not being in the corpus.
And S1043, calculating primary environment word vectors corresponding to the word vectors according to the pre-selected word vectors and the inverse text frequency.
In one embodiment, the pre-selected word vector may be multiplied by the corresponding inverse text frequency, and then weighted and summed to obtain the primary ambient word vector corresponding to the word vector.
And step S105, performing first splicing processing on the primary environment word vector and the word vector by using an input environment information extraction layer of the keyword recommendation model to generate an input environment word vector corresponding to a word.
In one embodiment, to further extract the context information, a further extraction of the input context word vector is performed with respect to the primary context word vector. For example, the input environment information extraction layer is used to perform a first splicing process on the primary environment word vector and the word vector to generate an input environment word vector corresponding to a word.
And step S106, performing second splicing processing according to the input environment word vector and the word vector to obtain a keyword vector.
In one embodiment, in order to introduce the word frequency information of the word vector itself, the inverse text frequency of the word vector is first obtained, and then the input environment word vector, the word vector and the IDF corresponding to the word vector are subjected to second stitching processing to generate a keyword vector for subsequent classification prediction.
And S107, inputting the keyword vector into a prediction classification layer of the keyword recommendation model to obtain a recommendation prediction value.
And S108, adjusting parameters in the keyword recommendation model according to the detection error between the recommendation prediction value and the classification label until the loss function meets the convergence condition to obtain the keyword recommendation model.
In one embodiment, the keyword vector is input into a prediction classification layer of the keyword recommendation model to obtain a recommendation prediction value y ', and the recommendation prediction value y' is compared with a classification label (i.e., a true value y) corresponding to the word to obtain a detection error between the recommendation prediction value and the classification label. The recommended predicted value y 'and the real value y can both be represented by numerical sequences, for example, a numerical sequence of the number of words in the text sample is represented by "0" or "1" as to whether each word is used as a keyword, the "0" indicates that the word is not selected as the keyword, the "1" indicates that the word is selected as the keyword, for example, a text sample contains 1000 words, and the recommended predicted value y' and the real value y are both represented by a numerical sequence consisting of 1000 "0" or "1".
In this embodiment, parameters in the keyword recommendation model are adjusted according to a detection error between the recommendation prediction value and the classification tag until the loss function reaches a convergence condition, where the convergence condition may be that the loss value of the loss function is smaller than a preset threshold value, so as to obtain the keyword recommendation model, and the loss function that can be selected is a cross entropy loss function. The cross entropy loss function is a log-likelihood function, a commonly used activation function is a sigmoid activation function, the loss function can solve the problem that the weight is updated too slowly, when the error is large, the weight is updated quickly, when the error is small, the weight is updated slowly, and the cross entropy loss function can be used for two-classification and multi-classification tasks.
Fig. 6 is a schematic structural diagram of a keyword recommendation model in an embodiment of the present application.
As can be seen in the figure, the keyword recommendation model of this embodiment at least includes:
a word embedding processing layer: receiving an index sample, performing word embedding operation on the index sample, and outputting a word vector of a word in the index sample;
a primary context information extraction layer: receiving word vectors of words in the index samples, and extracting primary environment information of the word vectors to obtain primary environment word vectors;
an input context information extraction layer: receiving a primary environment word vector, and extracting input environment information of the primary environment word vector to obtain an input environment word vector;
a splice layer: inputting an input environment word vector and a word vector to generate a keyword vector;
a prediction classification layer: the prediction layer can be a two-prediction classification layer or a classification layer for performing other types of prediction, receives the keyword vector and outputs a recommended prediction value.
In the training process, parameters in the keyword recommendation model are adjusted according to detection errors between the recommendation prediction values and the classification labels, and finally the keyword recommendation model is obtained.
Fig. 7 is a schematic diagram of a prediction process in an embodiment of the present application.
In the figure, it is assumed that the word sequence in the text sample is: "sureon", "general", "defenses", "US", "boost", "shot", "plan", "as", "much", "of", "the", "world", "awaits", "vacines", first use a word vector for each word in the text sample by means of a word embedding processing layer, and then input the primary context information extraction layer. The extraction of the preselected word is performed by using a sliding window with a first number (illustrated as 5 in the figure), for example, for the word "shot", the first five words are "sugeon", "coarse", "defenses", "US" and "boost", and the last five words are "plan", "as", "much", "of" and "the", respectively, the words "sugeon", "coarse", "defenses", "US", "boost", "plan", "as", "much", "of" and "the" are the preselected words of the word "shot". By calculating the IDF of each pre-selected word, the pre-selected word vector is multiplied by the corresponding inverse text frequency, and then weighted summation is performed, so as to obtain the primary environment word vector corresponding to the word vector (shown in the figure). And then inputting the primary environment word vector into an input environment information extraction layer of the keyword recommendation model to obtain an input environment word vector, such as the primary environment word vector shown in the figure, the square of the primary environment word vector, and the word vector and the square of the word vector, and splicing to obtain the input environment word vector. And then splicing the input environment word vector, the word vector and the IDF corresponding to the word vector to generate a keyword vector for classified prediction to obtain a recommended prediction value, wherein a prediction result is represented by '0' or '1', the '0' represents that the word is not selected as the keyword, and the '1' represents that the word is selected as the keyword.
In an embodiment, in order to improve the training efficiency of the keyword prediction model, the data compression processing is performed on the text sample, with reference to fig. 8, specifically including steps S801 to S804:
step S801, at least one user keyword sample and a corresponding classification label are obtained, wherein the classification label is a target label or a non-target label.
In one embodiment, the keywords selected by different users in the same text sample are different, that is, each text sample corresponds to a user keyword sample of a plurality of different users (the difference is only in the classification label corresponding to each word).
Step S802, calculating the probability that each classification label is the target label to obtain the label probability distribution.
In one embodiment, the probability of the category label of each word in the text sample is calculated, for example, if the first word of an article is read by 10 users and selected by 3 people, the probability of the real keyword of the word is 0.3. In this way, a tag probability distribution is obtained based on the classification tags of the user keyword samples, i.e., a probability that each word in the text sample is selected as a keyword is included.
And step S803, merging the user keyword samples by using the label probability distribution to obtain index samples corresponding to the text samples.
And step S804, constructing a keyword training data set according to the index sample.
In one embodiment, all user keyword samples in the same text sample are combined into one text sample according to the probability classification labels, an index sample of the text sample is obtained, namely one text sample does not consider the user of the text sample, only corresponds to one index sample, and then a keyword training data set is generated according to the index sample. The class label in the data set is no longer the "0" or "1" sequence described above, but rather the word is the probability value for the keyword. It will be appreciated that the model training method is the same even though the representation of the class labels is different. In this embodiment, for example, 2 ten thousand texts are selected, keyword selection information of 1000 users is selected, 2000 ten thousand text samples are generated, 2000 ten thousand data are compressed into 2 ten thousand data according to the method, that is, 2 ten thousand text samples (the classification label is a probability value of a word as a keyword) are finally obtained.
In one embodiment, to speed up the reasoning process of the keyword prediction model, the keyword prediction model is enabled to perform batch processing on the text samples. Because the words of different texts have different lengths, inputting the words into the keyword prediction model causes the change of model parameters and output, and can only support the input and prediction of a single article, in this embodiment, a text mask layer is added to the keyword prediction model, a text mask is obtained, and length filling processing (for example, the length is insufficient, the completion is performed by using 0, and the like, and no specific limitation is made here) is performed on the index sample according to the text mask, so as to obtain a keyword training data set; the text lengths of the index samples in the keyword training data set are consistent, so that the keyword prediction model supports batch input of multiple texts, and the reasoning process of the keyword prediction model is accelerated.
The keyword recommendation model training method provided by the embodiment of the disclosure includes the steps of obtaining an index sample, constructing a keyword training data set according to the index sample, inputting the index sample into a word embedding processing layer of a keyword recommendation model to obtain a word vector of a word, inputting the word vector into a primary environment information extraction layer to obtain a primary environment word vector, inputting the primary environment word vector into an input environment information extraction layer to obtain an input environment word vector, generating a keyword vector according to the input environment word vector and the word vector, inputting the keyword vector into a prediction classification layer to obtain a recommendation prediction value, and adjusting parameters in the keyword recommendation model according to a detection error between the recommendation prediction value and a classification label to obtain the keyword recommendation model. According to the method and the device, the input environment word vectors related to the word vectors are obtained, the learning difficulty of the keywords and the environment information corresponding to the keywords are combined, so that the selected keywords meet the learning requirements of the user, and the relevance and the accuracy of keyword recommendation are improved.
In an embodiment of the present application, a keyword recommendation method is further provided, referring to fig. 9, including but not limited to step S901 to step S903:
step S901, acquiring a text to be recommended;
step S902, generating an index text according to a text to be recommended;
step S903, inputting the index text into a keyword recommendation model to obtain a classification result of keyword recommendation, wherein the keyword recommendation model is obtained by training by using the keyword recommendation model training method described in the above embodiment. The keywords obtained in the index text may also be ranked according to the classification probability according to the requirement of the user for learning words, for example, the top 20 words are recommended to the user for learning. The keywords selected by the keyword recommendation model meet the learning requirements of the user, and relevance and accuracy of keyword recommendation are improved.
The embodiment of the present disclosure further provides a keyword recommendation model training apparatus, which can implement the keyword recommendation model training method, with reference to fig. 10, the apparatus includes:
the text sample acquisition module 101 is configured to acquire at least one text sample and generate an index sample containing index information of a word according to the text sample;
a training data set construction module 102, configured to construct a keyword training data set according to the index sample, where the keyword training data set includes the index sample and a classification label;
the word vector processing module 103 is configured to input the index sample into a word embedding processing layer of the keyword recommendation model to perform word embedding operation, so as to obtain a word vector of a word;
the primary environment word vector calculation module 104 is configured to input the word vector into a primary environment information extraction layer of the keyword recommendation model to perform primary environment information extraction, so as to obtain a primary environment word vector;
the input environment word vector calculation module 105 is configured to perform first stitching processing on the primary environment word vector and the word vector by using an input environment information extraction layer of the keyword recommendation model to generate an input environment word vector corresponding to a word;
a keyword vector generation module 106, configured to perform second concatenation processing according to the input environment word vector and the word vector to obtain a keyword vector;
the classification prediction module 107 is used for inputting the keyword vectors into a prediction classification layer of the keyword recommendation model to obtain a recommendation prediction value;
and the parameter adjusting module 108 is configured to adjust parameters in the keyword recommendation model according to a detection error between the recommended prediction value and the classification tag until the loss function meets a convergence condition, so as to obtain the keyword recommendation model.
In an embodiment, the primary environment word vector calculation module 104 of the keyword recommendation model training apparatus obtains a preselected word of the word vector according to the index information by using the primary environment information extraction layer, then obtains an inverse text frequency of the preselected word, and finally calculates a primary environment word vector corresponding to the word vector according to the preselected word vector and the inverse text frequency.
In an embodiment, the primary environment word vector calculation module 104 of the keyword recommendation model training apparatus is further configured to copy words in the index sample according to a second number, perform a displacement operation on the copied words column by column to obtain a displacement word matrix, obtain column words of the displacement word matrix, and finally obtain column words corresponding to the word vector as the pre-selected words according to the index information.
In an embodiment, the input environment word vector calculation module 105 of the keyword recommendation model training apparatus performs a first concatenation process on the primary environment word vector and the word vector by using the input environment information extraction layer, so as to generate an input environment word vector corresponding to a word.
In an embodiment, the keyword vector generation module 106 of the keyword recommendation model training apparatus obtains the inverse text frequency of the word vector, and performs a second concatenation process on the input environment word vector, the word vector, and the inverse text frequency of the word vector to generate the keyword vector.
The specific implementation of the keyword recommendation model training apparatus of this embodiment is substantially the same as the specific implementation of the keyword recommendation model training method, and is not described herein again.
The embodiment of the present disclosure further provides a keyword recommendation apparatus, which can implement the keyword recommendation method, with reference to fig. 11, the apparatus includes:
a text to be recommended acquisition module 111, configured to acquire a text to be recommended;
the index text generation module 112 is configured to generate an index text according to a text to be recommended;
and the keyword recommendation module 113 is configured to input the index text into a keyword recommendation model to obtain a classification result of keyword recommendation, where the keyword recommendation model is obtained by training using the keyword recommendation model training method described in the foregoing embodiment.
The specific implementation of the keyword recommendation apparatus of this embodiment is substantially the same as the specific implementation of the keyword recommendation method, and is not described herein again. An embodiment of the present disclosure further provides an electronic device, including:
at least one memory;
at least one processor;
at least one program;
the programs are stored in the memory, and the processor executes the at least one program to implement the keyword recommendation model training method and the recommendation method disclosed in the disclosure. The electronic device can be any intelligent terminal including a mobile phone, a tablet computer, a Personal Digital Assistant (PDA for short), a vehicle-mounted computer and the like.
Referring to fig. 12, fig. 12 illustrates a hardware structure of an electronic device according to another embodiment, where the electronic device includes:
the processor 1201 may be implemented by a general-purpose CPU (central processing unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits, and is configured to execute a related program to implement the technical solution provided by the embodiment of the present disclosure;
the memory 1202 may be implemented in the form of a ROM (read only memory), a static memory device, a dynamic memory device, or a RAM (random access memory). The memory 1202 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present disclosure is implemented by software or firmware, the relevant program codes are stored in the memory 1202, and the processor 1201 calls the keyword recommendation model training method and the keyword recommendation method for executing the embodiments of the present disclosure;
an input/output interface 1203 for implementing information input and output;
the communication interface 1204 is used for realizing communication interaction between the device and other devices, and may realize communication in a wired manner (e.g., USB, network cable, etc.) or in a wireless manner (e.g., mobile network, WIFI, bluetooth, etc.); and
a bus 1205 that transfers information between the various components of the device (e.g., the processor 1201, memory 1202, input/output interface 1203, and communication interface 1204);
wherein the processor 1201, the memory 1202, the input/output interface 1203 and the communication interface 1204 enable communication connections with each other within the device via the bus 1205.
The embodiment of the disclosure also provides a storage medium, which is a computer-readable storage medium, and the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used for enabling a computer to execute the keyword recommendation model training method and the keyword recommendation method.
According to the keyword recommendation model training method and device, the keyword recommendation method and device, the electronic device and the storage medium, the keyword recommendation model enables the selected keyword to meet the learning requirement of a user by acquiring the input environment word vector related to the word vector and combining the learning difficulty of the keyword and the environment information corresponding to the keyword, and the relevance and accuracy of keyword recommendation are improved.
The memory, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The embodiments described in the embodiments of the present disclosure are for more clearly illustrating the technical solutions of the embodiments of the present disclosure, and do not constitute a limitation to the technical solutions provided in the embodiments of the present disclosure, and it is obvious to those skilled in the art that the technical solutions provided in the embodiments of the present disclosure are also applicable to similar technical problems with the evolution of technology and the emergence of new application scenarios.
It will be appreciated by those skilled in the art that the solutions shown in fig. 1-9 are not meant to limit the embodiments of the present disclosure, and may include more or fewer steps than those shown, or some of the steps may be combined, or different steps.
The above-described embodiments of the apparatus are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may be located in one place, or may also be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
One of ordinary skill in the art will appreciate that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
The terms "first," "second," "third," "fourth," and the like in the description of the application and the above-described figures, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented by way of the same. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be electrical, mechanical or in the form of the same.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be 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 solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing programs, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The preferred embodiments of the present disclosure have been described above with reference to the accompanying drawings, and therefore do not limit the scope of the claims of the embodiments of the present disclosure. Any modifications, equivalents and improvements within the scope and spirit of the embodiments of the present disclosure should be considered within the scope of the claims of the embodiments of the present disclosure by those skilled in the art.

Claims (10)

1. A keyword recommendation model training method is characterized by comprising the following steps:
obtaining at least one text sample, and generating an index sample containing index information of words according to the text sample;
constructing a keyword training data set according to the index sample, wherein the keyword training data set comprises the index sample and a classification label;
inputting the index sample into a word embedding processing layer of the keyword recommendation model to perform word embedding operation, so as to obtain a word vector of the word;
inputting the word vector into a primary environment information extraction layer of the keyword recommendation model to extract primary environment information to obtain a primary environment word vector;
performing first splicing processing on the primary environment word vector and the word vector by using an input environment information extraction layer of the keyword recommendation model to generate the input environment word vector corresponding to the word;
performing second splicing processing according to the input environment word vector and the word vector to obtain a keyword vector;
inputting the keyword vector into a prediction classification layer of the keyword recommendation model to obtain a recommendation prediction value;
and adjusting parameters in the keyword recommendation model according to the detection error between the recommendation prediction value and the classification label until a loss function meets a convergence condition to obtain the keyword recommendation model, wherein the keyword recommendation model is used for performing keyword recommendation processing.
2. The method for training a keyword recommendation model according to claim 1, wherein the step of inputting the word vector into a primary environment information extraction layer of the keyword recommendation model to perform primary environment information extraction to obtain a primary environment word vector comprises:
obtaining preselected words of the word vector according to the index information by utilizing the primary environment information extraction layer, wherein the preselected words are words with a first quantity adjacent to the words corresponding to the word vector, and the word vector corresponding to the preselected words is a preselected word vector;
acquiring the inverse text frequency of the preselected word;
and calculating a primary environment word vector corresponding to the word vector according to the preselected word vector and the inverse text frequency.
3. The method for training the keyword recommendation model according to claim 1, wherein performing a second concatenation process according to the input environment word vector and the word vector to obtain a keyword vector comprises:
obtaining an inverse text frequency of the word vector;
and carrying out second splicing processing on the input environment word vector, the word vector and the inverse text frequency of the word vector to generate the keyword vector.
4. The method for training keyword recommendation models according to claim 2, wherein the obtaining, by using the primary environment information extraction layer, the preselected words of the word vector according to the index information comprises:
copying the words of the index sample to obtain a second number of copied words, wherein the second number is obtained by calculating the first number;
performing displacement operation on the second number of copied words column by column to obtain a displacement word matrix;
acquiring the list words of the displacement word matrix;
and acquiring the list of words corresponding to the word vector as the preselected word according to the index information.
5. The method for training the keyword recommendation model according to any one of claims 1 to 4, wherein the constructing the keyword training dataset according to the index sample comprises:
obtaining at least one user keyword sample and corresponding classification label, wherein the classification label is a target label or a non-target label
Calculating the probability that each classification label is a target label to obtain label probability distribution;
merging the user keyword samples according to the label probability distribution to obtain the index samples corresponding to the text samples;
and constructing a keyword training data set according to the index sample.
6. The method for training the keyword recommendation model according to any one of claims 1 to 4, wherein the constructing a keyword training dataset according to the index sample comprises:
acquiring a text mask;
performing length filling processing on the index sample according to the text mask to obtain the keyword training data set; wherein the text length of the index samples in the keyword training dataset is consistent.
7. A keyword recommendation method is characterized by comprising the following steps:
acquiring a text to be recommended;
generating an index text according to the text to be recommended;
inputting the index text into a keyword recommendation model for keyword recommendation processing to obtain a target keyword, wherein the keyword recommendation model is obtained by training by using the keyword recommendation model training method according to any one of claims 1 to 6.
8. A keyword recommendation model training device is characterized by comprising:
the text sample acquisition module is used for acquiring at least one text sample and generating an index sample containing index information of words according to the text sample;
the training data set construction module is used for constructing a keyword training data set according to the index sample, and the keyword training data set comprises the index sample and a classification label;
the word vector processing module is used for inputting the index sample into a word embedding processing layer of the keyword recommendation model to perform word embedding operation so as to obtain a word vector of the word;
the primary environment word vector calculation module is used for inputting the word vectors into a primary environment information extraction layer of the keyword recommendation model to extract primary environment information to obtain primary environment word vectors;
the input environment word vector calculation module is used for performing first splicing processing on the primary environment word vector and the word vector by utilizing an input environment information extraction layer of the keyword recommendation model to generate the input environment word vector corresponding to the word;
the keyword vector generating module is used for carrying out second splicing processing according to the input environment word vector and the word vector to obtain a keyword vector;
the classification prediction module is used for inputting the keyword vector into a prediction classification layer of the keyword recommendation model to obtain a recommendation prediction value;
and the parameter adjusting module is used for adjusting parameters in the keyword recommendation model according to the detection error between the recommendation prediction value and the classification label until a loss function meets a convergence condition to obtain the keyword recommendation model, and the keyword recommendation model is used for performing keyword recommendation processing.
9. An electronic device, comprising:
at least one memory;
at least one processor;
at least one program;
the programs are stored in a memory, and a processor executes the at least one program to implement:
the keyword recommendation model training method of any one of claims 1 to 6, or the keyword recommendation method of claim 8.
10. A storage medium that is a computer-readable storage medium having stored thereon computer-executable instructions for causing a computer to perform:
the keyword recommendation model training method of any one of claims 1 to 6, or the keyword recommendation method of claim 8.
CN202210143648.9A 2022-02-16 2022-02-16 Keyword recommendation model training method, recommendation device, equipment and medium Active CN114492669B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210143648.9A CN114492669B (en) 2022-02-16 2022-02-16 Keyword recommendation model training method, recommendation device, equipment and medium
PCT/CN2022/090746 WO2023155304A1 (en) 2022-02-16 2022-04-29 Keyword recommendation model training method and apparatus, keyword recommendation method and apparatus, device, and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210143648.9A CN114492669B (en) 2022-02-16 2022-02-16 Keyword recommendation model training method, recommendation device, equipment and medium

Publications (2)

Publication Number Publication Date
CN114492669A true CN114492669A (en) 2022-05-13
CN114492669B CN114492669B (en) 2024-06-28

Family

ID=81482362

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210143648.9A Active CN114492669B (en) 2022-02-16 2022-02-16 Keyword recommendation model training method, recommendation device, equipment and medium

Country Status (2)

Country Link
CN (1) CN114492669B (en)
WO (1) WO2023155304A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118094019A (en) * 2024-04-29 2024-05-28 中国铁道科学研究院集团有限公司电子计算技术研究所 Text associated content recommendation method and device and electronic equipment

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117951390B (en) * 2024-03-25 2024-06-11 中外运创新科技有限公司 Personalized content recommendation method and system based on large language model

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488462A (en) * 2020-04-02 2020-08-04 中国移动通信集团江苏有限公司 Recommendation method, device, equipment and medium based on knowledge graph
WO2020207431A1 (en) * 2019-04-12 2020-10-15 智慧芽信息科技(苏州)有限公司 Document classification method, apparatus and device, and storage medium
CN111985228A (en) * 2020-07-28 2020-11-24 招联消费金融有限公司 Text keyword extraction method and device, computer equipment and storage medium
CN112417866A (en) * 2020-12-03 2021-02-26 上海明略人工智能(集团)有限公司 Method and device for determining word segmentation recommendation value, electronic equipment and storage medium
CN112464656A (en) * 2020-11-30 2021-03-09 科大讯飞股份有限公司 Keyword extraction method and device, electronic equipment and storage medium
CN112667800A (en) * 2020-12-21 2021-04-16 深圳壹账通智能科技有限公司 Keyword generation method and device, electronic equipment and computer storage medium
WO2021096150A1 (en) * 2019-11-13 2021-05-20 팬 후앙고든 Method for generating customized lesson module for language learning
WO2021135446A1 (en) * 2020-06-19 2021-07-08 平安科技(深圳)有限公司 Text classification method and apparatus, computer device and storage medium
CN113111163A (en) * 2021-05-17 2021-07-13 南京贝湾信息科技有限公司 Word recommendation method and device and computing equipment
CN113869044A (en) * 2021-10-12 2021-12-31 平安科技(深圳)有限公司 Keyword automatic extraction method, device, equipment and storage medium
CN113887206A (en) * 2021-09-15 2022-01-04 北京三快在线科技有限公司 Model training and keyword extraction method and device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020207431A1 (en) * 2019-04-12 2020-10-15 智慧芽信息科技(苏州)有限公司 Document classification method, apparatus and device, and storage medium
WO2021096150A1 (en) * 2019-11-13 2021-05-20 팬 후앙고든 Method for generating customized lesson module for language learning
CN111488462A (en) * 2020-04-02 2020-08-04 中国移动通信集团江苏有限公司 Recommendation method, device, equipment and medium based on knowledge graph
WO2021135446A1 (en) * 2020-06-19 2021-07-08 平安科技(深圳)有限公司 Text classification method and apparatus, computer device and storage medium
CN111985228A (en) * 2020-07-28 2020-11-24 招联消费金融有限公司 Text keyword extraction method and device, computer equipment and storage medium
CN112464656A (en) * 2020-11-30 2021-03-09 科大讯飞股份有限公司 Keyword extraction method and device, electronic equipment and storage medium
CN112417866A (en) * 2020-12-03 2021-02-26 上海明略人工智能(集团)有限公司 Method and device for determining word segmentation recommendation value, electronic equipment and storage medium
CN112667800A (en) * 2020-12-21 2021-04-16 深圳壹账通智能科技有限公司 Keyword generation method and device, electronic equipment and computer storage medium
CN113111163A (en) * 2021-05-17 2021-07-13 南京贝湾信息科技有限公司 Word recommendation method and device and computing equipment
CN113887206A (en) * 2021-09-15 2022-01-04 北京三快在线科技有限公司 Model training and keyword extraction method and device
CN113869044A (en) * 2021-10-12 2021-12-31 平安科技(深圳)有限公司 Keyword automatic extraction method, device, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
BINGHUA REN, ET AL.: "Named-entity recognition method of key population information based on improved BiLSTM-CRF model", 2021 IEEE INTERNATIONAL CONFERENCE ON ARTIFICIAL INTELLIGENCE AND COMPUTER APPLICATIONS (ICAICA), 28 June 2021 (2021-06-28), pages 1113 - 1117 *
苏玉龙等: "基于关键词的文本向量化与分类算法研究", 贵州大学学报(自然科学版), vol. 35, no. 03, 30 June 2018 (2018-06-30), pages 101 - 105 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118094019A (en) * 2024-04-29 2024-05-28 中国铁道科学研究院集团有限公司电子计算技术研究所 Text associated content recommendation method and device and electronic equipment

Also Published As

Publication number Publication date
WO2023155304A1 (en) 2023-08-24
CN114492669B (en) 2024-06-28

Similar Documents

Publication Publication Date Title
CN112632385B (en) Course recommendation method, course recommendation device, computer equipment and medium
CN111753060B (en) Information retrieval method, apparatus, device and computer readable storage medium
CN110347835B (en) Text clustering method, electronic device and storage medium
CN109960800B (en) Weak supervision text classification method and device based on active learning
CN108875074B (en) Answer selection method and device based on cross attention neural network and electronic equipment
Cao et al. A novel neural topic model and its supervised extension
CN112819023B (en) Sample set acquisition method, device, computer equipment and storage medium
CN110427480B (en) Intelligent personalized text recommendation method and device and computer readable storage medium
CN114492669B (en) Keyword recommendation model training method, recommendation device, equipment and medium
JP7417679B2 (en) Information extraction methods, devices, electronic devices and storage media
CN112085565A (en) Deep learning-based information recommendation method, device, equipment and storage medium
CN114676704A (en) Sentence emotion analysis method, device and equipment and storage medium
CN112395487A (en) Information recommendation method and device, computer-readable storage medium and electronic equipment
CN111581923A (en) Method, device and equipment for generating file and computer readable storage medium
CN114240552A (en) Product recommendation method, device, equipment and medium based on deep clustering algorithm
CN115062134B (en) Knowledge question-answering model training and knowledge question-answering method, device and computer equipment
CN113297410A (en) Image retrieval method and device, computer equipment and storage medium
CN113392179A (en) Text labeling method and device, electronic equipment and storage medium
CN113515589A (en) Data recommendation method, device, equipment and medium
CN110262906B (en) Interface label recommendation method and device, storage medium and electronic equipment
CN117435685A (en) Document retrieval method, document retrieval device, computer equipment, storage medium and product
CN116244442A (en) Text classification method and device, storage medium and electronic equipment
CN111753199B (en) User portrait construction method and device, electronic device and medium
CN114090778A (en) Retrieval method and device based on knowledge anchor point, electronic equipment and storage medium
CN107622129B (en) Method and device for organizing knowledge base and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant