WO2019105432A1 - 文本推荐方法、装置及电子设备 - Google Patents

文本推荐方法、装置及电子设备 Download PDF

Info

Publication number
WO2019105432A1
WO2019105432A1 PCT/CN2018/118274 CN2018118274W WO2019105432A1 WO 2019105432 A1 WO2019105432 A1 WO 2019105432A1 CN 2018118274 W CN2018118274 W CN 2018118274W WO 2019105432 A1 WO2019105432 A1 WO 2019105432A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
semantic vector
target text
semantic
training
Prior art date
Application number
PCT/CN2018/118274
Other languages
English (en)
French (fr)
Inventor
李冰锋
范欣
冯晓强
李彪
Original Assignee
腾讯科技(深圳)有限公司
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 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2019105432A1 publication Critical patent/WO2019105432A1/zh
Priority to US16/848,028 priority Critical patent/US11182564B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2207/00Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F2207/38Indexing scheme relating to groups G06F7/38 - G06F7/575
    • G06F2207/48Indexing scheme relating to groups G06F7/48 - G06F7/575
    • G06F2207/4802Special implementations
    • G06F2207/4818Threshold devices
    • G06F2207/4824Neural networks

Definitions

  • the embodiments of the present invention relate to the field of text analysis technologies, and in particular, to a text recommendation method, apparatus, and electronic device.
  • Text analysis technology refers to a technique of quantifying feature words extracted from text to represent text information.
  • text analysis technology is mainly applied to the field of text recommendation, that is, to recommend other content that the user may be interested in based on the text content browsed by the user.
  • the text recommendation method provided by the related art is generally based on a collaborative filtering algorithm.
  • the collaborative filtering algorithm may be a collaborative filtering algorithm based on user and/or content.
  • a similar user set is determined based on the behavior data of each user, and the similar user set includes at least two users, and when the text recommendation is performed subsequently, one of the similar user sets is browsed.
  • the text is recommended to other users in the similar user set above. For example, if the similar user set includes user A and user B, the text browsed by user A is recommended to user B.
  • the degree of association between the text recommended to the user and the text that the user wants to browse or browse is small, and the accuracy of the recommendation is low.
  • the embodiment of the present application provides a text recommendation method, a device, and an electronic device, which are used to solve the problem that the association between the text recommended by the user in the related art and the text that the user wants to browse or browse is small, and the accuracy of the recommendation is relatively small. Low problem.
  • the technical solution is as follows:
  • a text recommendation method comprising:
  • a text recommendation apparatus comprising:
  • a preprocessing module configured to preprocess the target text to obtain feature content of the target text
  • a text analysis module configured to process the feature content based on at least two text analysis models to obtain at least two semantic vectors of the target text
  • a vector obtaining module configured to acquire an integrated semantic vector of the target text according to the at least two semantic vectors
  • a text recommendation module configured to select, according to the integrated semantic vector of the target text and the integrated semantic vector of the at least one text to be recommended, the recommended text corresponding to the target text from the at least one text to be recommended.
  • an electronic device including a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or a set of instructions, the at least one instruction, the at least one segment A program, the set of codes, or a set of instructions is loaded and executed by the processor to implement the text recommendation method as described in the first aspect.
  • a computer readable storage medium having stored therein at least one instruction, at least one program, a code set, or a set of instructions, the at least one instruction, the at least one program,
  • the set of codes or sets of instructions is loaded and executed by the processor to implement the text recommendation method as described in the first aspect.
  • a computer program product for performing the text recommendation method of the first aspect described above when the computer program product is executed.
  • FIG. 1 is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application.
  • FIG. 2 is a flowchart of a text recommendation method provided by an exemplary embodiment of the present application.
  • FIG. 3A is a flowchart of a text recommendation method provided by an exemplary embodiment of the present application.
  • FIG. 3B is a schematic diagram of an interface of text recommendation provided by an exemplary embodiment of the present application.
  • FIG. 4A is a flowchart of a text recommendation method illustrated by another exemplary embodiment of the present application.
  • 4B is a schematic diagram showing acquisition of a second semantic vector by a DNN model, in accordance with an exemplary embodiment of the present application.
  • FIG. 4C is a schematic diagram of the embodiment shown in FIG. 4A applied to the field of news recommendation;
  • FIG. 5 is a flowchart showing training of a first analysis model according to an exemplary embodiment of the present application.
  • 6A is a flowchart showing training of a second analysis model according to an exemplary embodiment of the present application.
  • 6B is a schematic diagram showing training of a second analysis model according to an exemplary embodiment of the present application.
  • Figure 7 is a block diagram of a text recommending apparatus shown in an exemplary embodiment of the present application.
  • FIG. 8 is a block diagram showing a text recommendation apparatus according to another exemplary embodiment of the present application.
  • FIG. 9 is a block diagram showing a text recommendation apparatus according to another exemplary embodiment of the present application.
  • FIG. 10 is a block diagram of an electronic device shown in an exemplary embodiment of the present application.
  • FIG. 1 shows a schematic diagram of an implementation environment shown by an embodiment of the present application.
  • the implementation environment includes a first device 11 and a second device 12.
  • the first device 11 may be an electronic device having a text analysis function.
  • the first device 11 can perform each step of the text recommendation method provided by the example of the present application by using the text analysis function.
  • the first device 11 may be a terminal device such as a PC (Personal Computer), a smart phone, or a tablet computer, or may be a server.
  • the server can be a server, a server cluster consisting of multiple servers, or a cloud computing service center.
  • the second device 12 may be an electronic device having a text display function.
  • the second device 12 is installed with a client of a specified type, and the client of the specified type is used to implement the text display function described above. That is, the client of the specified type can receive the recommended text sent by the first device 11 and display the recommended text.
  • the client of the specified type may be a reading client, an information client, or the like.
  • the second device 12 may be a terminal device such as a PC (Personal Computer), a smart phone, or a tablet computer.
  • a communication connection is established between the first device 11 and the second device 12 through a wired network or a wireless network.
  • the second device 12 is only a terminal device, and the first device 11 is a server corresponding to a client of a specified type in the second device 12 as an example.
  • At least two semantic vectors of the target text are obtained by at least two text analysis models, and the at least two semantic vectors are integrated to obtain an integrated semantic vector of the target text, which is obtained by using different analysis models.
  • the semantic vectors have their own advantages.
  • the integrated semantic vector obtained by integrating them combines the advantages of each semantic vector. Therefore, the integrated semantic vector has stronger representation ability and can better represent the text information of the target text, and the subsequent semantics.
  • the degree of association between the recommended text and the target text can be improved, thereby improving the accuracy of the recommendation.
  • FIG. 2 shows a flowchart of a text recommendation method according to an embodiment of the present application.
  • This text recommendation method can be applied to the first device 11 in the implementation environment shown in FIG.
  • the method includes:
  • Step 201 Preprocess the target text to obtain feature content of the target text.
  • a database is set up in the server, and the database includes multiple texts.
  • the target text may be any one of the above plurality of texts.
  • the server reads the target text directly from the database.
  • the feature content of the target text is a highly refined version of the target text, which can generally be used to generalize the textual information included in the target text.
  • the feature content of the target text includes a title of the target text and a body feature word.
  • the title of the target text is usually obtained directly by the server. After the server obtains the title of the target text, it is usually necessary to perform word segmentation on the above title.
  • Word segmentation refers to dividing the title of the target text into a single word. Illustratively, for the sentence "word segmentation is the basis of text mining", the sentence is processed by word segmentation, and five words such as "word segmentation", "yes”, “text mining", “of” and “foundation” are obtained.
  • the algorithm used for the word segmentation processing of the title of the target text may be a word segmentation algorithm based on string matching, a word segmentation algorithm based on understanding, a word segmentation algorithm based on statistics, and the like, which are not limited in the embodiment of the present application.
  • the body feature word of the target text refers to a keyword included in the body of the target text, which can generally be used to generalize the body of the target text.
  • Step 202 Process feature content based on at least two text analysis models to obtain at least two semantic vectors of the target text.
  • the above semantic vector is the result of processing the feature content by the text analysis model. There is a one-to-one correspondence between the text analysis model and the semantic vector. When different semantic analysis models are used, the size, direction and dimension of the obtained semantic vector may be different. The specific implementation process for obtaining at least two semantic vectors will be explained in the following embodiments.
  • the text analysis model may be a word2vec model, a deep neural network (DNN) model, a Latent Dirichlet Allocation (LDA) model, etc., which is not limited in this embodiment of the present application.
  • DNN deep neural network
  • LDA Latent Dirichlet Allocation
  • Step 203 Integrate at least two semantic vectors of the target text to generate an integrated semantic vector of the target text.
  • the feature content is processed based on at least two text analysis models, and the at least two semantic vectors are integrated to obtain an integrated semantic vector of the target text, because the semantic vectors obtained by different analysis models are respectively.
  • the integrated semantic vector obtained by integrating it combines the advantages of each semantic vector. Therefore, the integrated semantic vector has stronger representation ability, which can better represent the text information of the target text, and then based on the integrated semantic vector.
  • the degree of association between the recommended text and the target text is better, thereby improving the accuracy of the recommendation.
  • the at least two semantic vectors are spliced to obtain a semantic vector corresponding to the target text.
  • Vector stitching refers to stitching at least two vectors into one vector.
  • the dimension of the stitched vector should be larger than the dimension of any vector before stitching.
  • the dimension of the vector is used to indicate the representation ability of the vector. The more dimensions of the vector, the stronger the representation ability of the vector.
  • Step 204 Select, according to the integrated semantic vector of the target text and the integrated semantic vector of the at least one text to be recommended, the recommended text corresponding to the target text from the at least one text to be recommended.
  • the text to be recommended may be text in the database other than the target text.
  • the method for obtaining the integrated semantic vector of the text to be recommended is the same as the method for obtaining the integrated semantic vector of the target text, that is, the server first preprocesses the recommended text to obtain the feature content of the text to be recommended, and then the server uses at least The two text analysis models process the feature content of the recommended text, obtain at least two semantic vectors of the text to be recommended, and integrate the at least two semantic vectors to obtain an integrated semantic vector of the text to be recommended.
  • the technical solution provided by the embodiment of the present application obtains at least two semantic vectors of the target text by using at least two text analysis models, and integrates the at least two semantic vectors to obtain an integrated semantic vector of the target text. Since the semantic vectors obtained by different analysis models have their own advantages, the integrated semantic vector obtained by integrating them combines the advantages of each semantic vector, so the integrated semantic vector has stronger representation ability and can better represent the target text.
  • the text information when the text recommendation is based on the semantic vector, the degree of association between the recommended text and the target text can be improved, thereby improving the accuracy of the recommendation.
  • FIG. 3A shows a flowchart of a text recommendation method according to an embodiment of the present application.
  • the method can include the following steps:
  • Step 301 Preprocess the target text to obtain feature content of the target text.
  • Step 301a performing word segmentation on the body of the target text to obtain a plurality of words.
  • This step is to divide the body of the target text into a single word.
  • the algorithm used for the word segmentation processing of the text of the target text may also be a segmentation algorithm based on string matching, a word segmentation algorithm based on understanding, a word segmentation algorithm based on statistics, and the like, which are not limited in the embodiment of the present application.
  • Step 301b Obtain a term frequency-inverse document frequency (TF-IDF) indicator corresponding to each word.
  • TF-IDF term frequency-inverse document frequency
  • the TF-IDF indicator of a word can be measured by the number of occurrences of the word in the target text and the number of occurrences of the word in the text to be recommended. If the number of occurrences of a word in the target text is greater, and the number of occurrences of the word in the text to be recommended is less, the higher the TF-IDF indicator of the word; if the number of occurrences of a word in the target text The less the number of occurrences of the word in the text to be recommended, the lower the TF-IDF indicator of the word.
  • the TF-IDF indicator can be used to assess the importance of the word in the target text.
  • the TF-IDF index is positively correlated with the importance of words in the target text. That is, the higher the TF-IDF index of the word, the higher the importance of the word in the target text; the lower the TF-IDF index of the word, the lower the TF-IDF index The lower the importance of words in the target text.
  • step 303c the TF-IDF indicator is matched to the preset size, and the part whose part of speech is the preset part of speech is determined as the feature feature word of the target text.
  • the preset size can be set according to actual experience, which is not limited by the embodiment of the present application.
  • the part of speech can be any of a noun, a verb, an adjective, and an adverb. Since the adjectives and the adverbs usually have a modification, but have no substantial meaning, for example, the adjectives are usually used to modify the nouns, and the adverbs are usually used to modify the verbs. Therefore, in the embodiment of the present application, the predetermined part of speech can be a noun and/or a verb.
  • the words whose individual parts of speech are nouns or verbs are arranged according to the size of the TF-IDF indicator, and the words whose TF-IDF index is ranked in the top n are determined as the body feature words of the target text.
  • the value of n can be set in advance, and exemplarily, n is 5.
  • Step 302 Process feature content based on at least two text analysis models to obtain at least two semantic vectors.
  • Step 303 Acquire a semantic vector corresponding to the target text according to at least two semantic vectors.
  • Step 304 Acquire an association degree between a semantic vector corresponding to the target text and a semantic vector corresponding to the text to be recommended.
  • the degree of association is used to characterize the similarity between the target text and the text to be recommended. There is a positive correlation between the degree of association and the similarity, that is, the greater the similarity between the target text and the text to be recommended, the greater the degree of association between the semantic vector corresponding to the target text and the semantic vector corresponding to the text to be recommended. The smaller the similarity between the target text and the text to be recommended, the smaller the degree of association between the semantic vector corresponding to the target text and the semantic vector corresponding to the text to be recommended.
  • the server calculates a degree of association between the semantic vector corresponding to the target text and the semantic vector corresponding to the text to be recommended by calculating a cosine distance between the semantic vector of the target text and the semantic vector of the text to be recommended.
  • a degree of association between the semantic vector corresponding to the target text and the semantic vector corresponding to the text to be recommended.
  • the degree of association there is a positive correlation between the cosine distance and the degree of association, that is, the greater the cosine distance between the semantic vector of the target text and the semantic vector of the text to be recommended, and the semantic vector corresponding to the target text and the semantic vector corresponding to the text to be recommended.
  • the cosine distance cos ⁇ between two semantic vectors can be calculated by the following formula:
  • n is the dimension of two semantic vectors
  • a i is the first semantic vector
  • B i is the second semantic vector. Is the size of the first semantic vector, Is the size of the second semantic vector.
  • Step 305 Determine a text corresponding to the semantic vector whose degree of association is consistent with the first preset condition as the recommended text corresponding to the target text, and perform recommendation.
  • the degree of association between the semantic vector corresponding to the target text and the semantic vector corresponding to the text to be recommended is arranged in descending order.
  • the first preset condition is a semantic vector corresponding to the target text and a semantic vector corresponding to the text to be recommended. The degree of association between them is in the top m position.
  • the value of m can be set in advance, which is not limited by the embodiment of the present invention.
  • the first preset condition may also be that the degree of association between the semantic vector corresponding to the target text and the semantic vector corresponding to the text to be recommended is greater than a preset degree.
  • the preset degree can be set according to actual experience, which is not limited by the embodiment of the present invention.
  • the cosine distance between the semantic vector corresponding to the target text and the semantic vector corresponding to the text to be recommended is arranged in descending order, and the first preset condition is corresponding to the target text.
  • the cosine distance between the semantic vector and the semantic vector corresponding to the text to be recommended is ranked in the first m bits.
  • the first preset condition may also be that a cosine distance between a semantic vector corresponding to the target text and a semantic vector corresponding to the text to be recommended is greater than a preset distance.
  • the preset distance can be set according to actual experience, which is not limited by the embodiment of the present invention.
  • the server when the subsequent user requests the target text from the server through the terminal, the server sends the target text to the terminal, and also sends the recommended text to the terminal, thereby implementing the recommendation of the text to the user.
  • the server after browsing the target text, the user can continue to browse other texts with a greater degree of association with the target text, thereby increasing the user's stay time in the user interface of the related application and increasing user stickiness.
  • the user interface of the application providing the reading function displays the identifier of each target text (for example, the title of the target text), and after the user triggers the identifier of any target text, the client of the application sends the text acquisition to the server.
  • the request, the text acquisition request carries the identifier of the target text selected by the user, and the server obtains the target text according to the identifier of the target text carried by the text acquisition request, and obtains the recommended text corresponding to the target text by using the method provided in the embodiment shown in FIG. 3A, and then
  • the target text and the recommended text are sent to the client of the above application, and the client displays the target text and the recommended text simultaneously on the user interface of the application.
  • FIG. 3B an interface diagram of a text recommendation shown by an exemplary embodiment of the present application is shown.
  • the target text 31 and the recommended text 32 are displayed on the user interface 30 of the application providing the reading function.
  • the method provided by the embodiment of the present application obtains at least two semantic vectors based on at least two text analysis models, and integrates the at least two semantic vectors to obtain an integrated semantic vector of the target text.
  • the semantic vectors obtained by different analysis models have their own advantages.
  • the integrated semantic vector obtained by integrating them combines the advantages of each semantic vector. Therefore, the integrated semantic vector has stronger representation ability and can better represent the text information of the target text.
  • the text recommendation is based on the integrated semantic vector, the degree of association between the recommended text and the target text can be improved, thereby improving the accuracy of the recommendation.
  • FIG. 4A shows a flowchart of a text recommendation method according to another embodiment of the present application.
  • the at least two text analysis models include a first analysis model and a second analysis model.
  • the method can include the following steps:
  • Step 401 Preprocess the target text to obtain feature content of the target text.
  • Step 401 is the same as step 101 and will not be described here.
  • Step 402 The feature content is processed by using the first analysis model to obtain a first semantic vector of the target text.
  • the first analysis model is a word4vec model.
  • the Word4vec model can solve the problems of "one word polysemy” and “multiple words and one meaning” in Chinese. It should be noted that when the feature content of the target text is processed by the word2vec model, only the body feature words of the target text are processed.
  • the feature content of the target text includes a body feature word of the target text
  • the first analysis model includes a correspondence between the word and the semantic vector
  • step 402 may include the following sub-steps:
  • Step 402a searching for a correspondence relationship, and obtaining a semantic vector corresponding to each text feature word
  • Step 402b Acquire a first semantic vector based on a semantic vector corresponding to each text feature word.
  • the semantic vectors corresponding to each of the feature words are added, and an average value is calculated to obtain a first semantic vector.
  • the semantic vectors corresponding to the body feature words A, B, and C are w A , w B , and w C , respectively, and the first semantic vector w a can be calculated by the following formula:
  • Step 403 The feature content is processed by using the second analysis model to obtain a second semantic vector of the target text.
  • the second analysis model is a DNN model.
  • the semantic vector obtained by the DNN model is more representative.
  • the degree of association between the target text and the recommended text is calculated more accurately.
  • the text feature words are processed, there is no need to consider the order between the feature words, but when the title is processed, it is necessary to consider the order between the words obtained by segmenting the titles, and therefore the feature words and The titles are processed separately.
  • the feature content of the target text includes a body feature word and a title of the target text
  • step 403 may include the following sub-steps:
  • Step 403a processing the feature feature word by using the second analysis model to obtain a semantic vector of the feature word of the body;
  • the second analysis model includes a BOW layer
  • the BOW layer is configured to process the feature feature words to obtain a semantic vector of the body feature words.
  • step 403a is specifically implemented by: processing the feature feature words by using the BOW layer to obtain a semantic vector of the feature words.
  • each text feature word is processed to obtain a semantic vector of each text feature word.
  • the semantic vectors of the feature words of each body are added and averaged to obtain a semantic vector of the feature words of the body.
  • Step 403b processing the title by using the second analysis model to obtain a semantic vector corresponding to the title
  • the second analysis model includes a CNN layer, and the CNN layer is used to process the title to obtain a semantic vector of the title.
  • step 403b is specifically implemented by: processing the title by using the CNN layer to obtain a semantic vector of the title.
  • the title is subjected to word segmentation, and the words obtained after the word segmentation are fixed in the order of the title. Therefore, the title is processed by the CNN layer to obtain a semantic vector corresponding to the title.
  • Step 403c Acquire a second semantic vector based on a semantic vector corresponding to the feature word and a semantic vector corresponding to the title.
  • the semantic vector corresponding to the body feature word and the semantic vector corresponding to the title are added to obtain a second semantic vector.
  • the second analysis model further includes an input layer, an embedded layer, and a full connectivity layer.
  • the input layer is used to input the text feature words and the title of the target text, wherein the title and the body feature words are input at different positions of the input layer, and in addition, before the target feature words and the title are input into the input layer, a different id is usually adopted.
  • the embedding layer is used to represent the body feature words and the title using a random initialization vector.
  • the all-communication layer is further processed for the semantic vector corresponding to the header outputted by the CNN layer and the semantic vector corresponding to the text feature word output by the BOW layer, and the semantic vector corresponding to the target text output by the full-communication layer is more powerful.
  • the DNN model includes an input layer, an embedded layer, a CNN layer, a BOW layer, and two full connectivity layers.
  • the title of the target text and the feature characters are input into the input layer respectively, and then input to the embedded layer to obtain an initialization vector corresponding to the title and an initialization vector corresponding to the feature character.
  • the initialization vector corresponding to the title is input to the CNN layer, and is composed of the CNN layer.
  • the semantic vector corresponding to the title is output, the initialization vector corresponding to the feature character is input to the BOW layer, and the semantic vector corresponding to the feature character is output by the BOW layer, and then the semantic vector corresponding to the title is added to the semantic vector corresponding to the feature word.
  • a second semantic vector corresponding to the target text is obtained.
  • the text feature word is processed separately from the title based on the order in which the title exists, so that the second semantic vector obtained by the DNN model can more accurately represent the text information of the target text, and subsequent text recommendation.
  • the degree of association between the recommended text and the target text can be further improved.
  • Step 404 Acquire a semantic vector corresponding to the target text based on the first semantic vector and the second semantic vector.
  • the first semantic vector is spliced with the second semantic vector to obtain a semantic vector corresponding to the target text.
  • the first semantic vector is 128 dimensions
  • the second semantic vector is 200 dimensions
  • the semantic vector corresponding to the target text obtained by the vector splicing is 328 dimensions.
  • step 404 can include the following two sub-steps:
  • Step 404a Acquire a first coefficient corresponding to the first semantic vector and a second coefficient corresponding to the second semantic vector.
  • the first coefficient and the second coefficient are empirically set.
  • the first coefficient and the second coefficient may be adjusted according to the degree of association between the target text and the recommended text.
  • Step 404b splicing a product between the first semantic vector and the first coefficient and a product between the second semantic vector and the second coefficient to obtain a semantic vector corresponding to the target text.
  • the first coefficient is k1
  • the second coefficient is k2
  • the first semantic vector is w a
  • the second semantic vector is w b
  • the semantic vector w s corresponding to the target text obtained by the splicing can be expressed as (k1w a ,k4w b ).
  • Step 405 Acquire a degree of association between a semantic vector corresponding to the target text and a semantic vector corresponding to the text to be recommended.
  • Step 406 Determine a text corresponding to the semantic vector whose degree of association meets the first preset condition as the recommended text corresponding to the target text, and perform recommendation.
  • Steps 405 to 406 are the same as steps 104 to 105, and are not described herein again.
  • FIG. 4A shows a schematic diagram of the embodiment shown in FIG. 4A applied to the field of news recommendation.
  • FIG. 4C shows a schematic diagram of the embodiment shown in FIG. 4A applied to the field of news recommendation.
  • the news candidate pool includes a plurality of news (to be recommended text), pre-processes each news in the news candidate pool, obtains feature content of each news, and subsequently processes the feature content of each news through the word4vec model and the DNN model to obtain
  • the semantic vector corresponding to each news constitutes a news vector set, and each time a news is generated, the newly generated news is preprocessed, and the feature content of the newly generated news is obtained, and subsequently passed the word4vec model and the DNN.
  • the model processes the feature content of the newly generated news to obtain a semantic vector corresponding to the news, and calculates a cosine distance between the semantic vector corresponding to the news and each vector in the news vector set, and the respective cosine distances are as large as In a small order, the news corresponding to the cosine distance of the top m position is used as the recommended news corresponding to the newly generated news.
  • the method provided by the embodiment of the present application obtains at least two semantic vectors based on at least two text analysis models, and integrates the at least two semantic vectors to obtain an integrated semantic vector of the target text.
  • the semantic vectors obtained by different analysis models have their own advantages.
  • the integrated semantic vector obtained by integrating them combines the advantages of each semantic vector. Therefore, the integrated semantic vector has stronger representation ability and can better represent the text information of the target text.
  • the text recommendation is based on the semantic vector, the degree of association between the recommended text and the target text can be improved, thereby improving the accuracy of the recommendation.
  • the semantic feature word is further processed separately from the title, so that the second semantic vector obtained by the DNN model can more accurately represent the text information of the target text, and the degree of association between the recommended text and the target text in subsequent text recommendation. Can be further improved.
  • Training the first analysis model may include the following steps 501 to 504.
  • Step 501 Acquire a first training sample set.
  • the first training sample set includes a plurality of first training samples.
  • the first training sample can be a text.
  • the server may directly read the first training sample from the database, or may acquire the first training sample from other electronic devices that establish a communication connection with the server.
  • the above recommended text is applied to the field of news recommendation, and the first training sample may be news in a preset time, and the preset time may be actually determined according to the number of first training samples.
  • the first training sample is the news of the most recent year.
  • Each first training sample includes at least one word and a context for each word.
  • the context of a word refers to a word that appears before and after the word in a complete sentence. For example, in the sentence "No rain today", the context of "No” is "Today” and "Rain".
  • the words and the context of the words are obtained by the server performing word segmentation on the sentences included in the first training sample.
  • Words correspond to semantic vectors, and the context of words also corresponds to semantic vectors.
  • the semantic vector corresponding to the word and the semantic vector corresponding to the context of the word are obtained by randomization.
  • Step 502 For each word, input a semantic vector corresponding to the context of the word into the first original model to obtain a training result.
  • the first original model may be a CBOW (Continuous Bag Of Words Model) model, or may be a Skip-gram model, which is not limited by the embodiment of the present application. In the embodiment of the present application, only the first original model is used as an example for explaining the CBOW model.
  • CBOW Continuous Bag Of Words Model
  • the training results include the probability of occurrence of each word.
  • the probability of occurrence of each word refers to the probability that the word appears between the contexts corresponding to the semantic vector of the first original model.
  • Step 503 Adjust the semantic vector of the context of the word according to the training result, and input the adjusted semantic vector into the first original model again until the training result meets the expected result.
  • the expected result is that the probability of occurrence of the word corresponding to the context conforms to the second preset condition.
  • the second preset condition means that the word corresponding to the context has the highest probability of occurrence.
  • the probability of occurrence of "no" between "today” and "rain” should be greatest.
  • the server can detect whether the training result meets the expected result. If the training result does not meet the expected result, the semantic vector corresponding to the context of the input first original model is adjusted accordingly, and then the adjusted semantic vector is repeatedly input into the first original model. The steps of obtaining the training result and adjusting the input semantic vector if the training result does not meet the expected result until the training result meets the desired result.
  • Step 504 When the training result meets the expected result, the first analysis model is generated according to the semantic vector corresponding to each word.
  • the semantic vector input to the first original model at this time can be regarded as a semantic vector corresponding to the context.
  • the semantic vector corresponding to the word can be obtained for each word.
  • the preset correspondence between the semantic vectors corresponding to the words and the words may be referred to as a first analysis model.
  • Training the second analysis model may include the following steps 601 to 604.
  • Step 601 Acquire a second training sample set.
  • the second training sample set includes a plurality of second training samples.
  • the server may directly read the second training sample from the database, or may acquire the second training sample from other electronic devices that establish a communication connection with the server.
  • the above recommended text is applied to the field of news recommendation, and the second training sample may be news in a preset time, and the preset time may be actually determined according to the number of the second training sample.
  • Each second training sample includes a training text, a positive example of the training text, and a counterexample of the training text.
  • the above-mentioned training text, the positive examples of the training text, and the counterexamples of the training text can be represented by a ternary array ⁇ news, pos, neg ⁇ .
  • News is training text, which can be any text.
  • Pos is a positive example of training text, which is usually text related to training text, pos can be obtained by collaborative filtering; neg is a counterexample of training text, which can be text completely unrelated to the above training text, which can be random Select.
  • the ratio of pos to neg is 1:1.
  • Each second training text corresponds to a first similarity and a second similarity
  • the first similarity is a similarity between the training text and the positive example of the training text
  • the second similarity is a counterexample of the training text and the training text. Similarity between the two.
  • news, pos, and neg are all represented by the feature content of the text.
  • For the process of obtaining the feature content of the text refer to step 102, and details are not described herein again.
  • Step 602 For each second training sample, input the second training sample into the second original model to obtain a training result.
  • the second original model is a deep neural network model to be trained.
  • the second original model includes an input layer, an embedded layer, a CNN layer, a BOW layer, and a full connectivity layer.
  • the initial parameters of each layer can be randomly set.
  • the feature content of news, pos, and neg is usually expressed as a one-hot vector, that is, For each word included in the feature content, a unique id is used for representation.
  • the embedding layer is used to obtain an initialization semantic vector corresponding to the feature content of news, pos, and neg.
  • the CNN layer is used to process the headers of news, pos, and neg to obtain semantic vectors corresponding to the titles of news, pos, and neg.
  • the BOW layer is used to process the text feature words of news, pos and neg, and obtain the semantic vectors corresponding to the text feature words of news, pos and neg.
  • the second original model adds the semantic vector corresponding to the title and the semantic vector corresponding to the feature feature respectively, and obtains the semantic vectors corresponding to news, pos and neg respectively, and the subsequent full-communication layer performs the semantic vectors corresponding to news, pos and neg respectively. Further processing, the semantic vectors corresponding to news, pos, and neg are respectively obtained.
  • the second original model respectively calculates the similarity between the semantic vector corresponding to news and the semantic vector corresponding to pos, and the similarity between the final semantic vector corresponding to neg, and the two similarities are the second training sample Enter the training results obtained from the second original model.
  • Step 603 For each second training sample, compare the training result with the first similarity and the second similarity respectively to obtain a calculated loss.
  • the calculated loss is used to characterize the error between the training result and the first similarity and the error between the second similarity.
  • the calculated loss includes a first calculated loss and a second calculated loss, and the first calculated loss is an error between the similarity between the semantic vector corresponding to news and the semantic vector corresponding to pos in the training result, and the first similarity, the second calculation The loss is the error between the similarity between the semantic vector corresponding to news and the final semantic vector corresponding to neg in the training result.
  • the second original model further includes a loss layer, and the loss layer is configured to calculate the calculated loss according to the training result, the first similarity, and the second similarity.
  • the difference between the similarity between the semantic vector corresponding to news and the semantic vector corresponding to pos in the loss layer calculation training result and the first similarity result a first calculation loss
  • the semantic vector corresponding to news in the training result is calculated.
  • the difference between the similarity between the final semantic vectors corresponding to the neg and the second similarity yields a second computational loss.
  • Step 604 According to the calculation loss corresponding to each second training sample in the training sample set, the error analysis algorithm is used to train the second analysis model.
  • the parameters between the input layer, the embedded layer, the CNN layer, and the BOW layer in the second original model are adjusted, and the training is continued based on the adjusted second original model until the calculation
  • the loss is in accordance with the third preset condition.
  • the third preset condition is that the calculation loss is less than the preset value, and the preset value may be actually set according to the accuracy requirement of the DNN model, which is not limited in the embodiment of the present application.
  • the second original model to be trained includes an input layer, an embedded layer, a CNN layer, a BOW layer, two full connectivity layers, and a loss layer, and the training text, the positive example of the training text, and the counterexample of the training text are input into the second original model.
  • the input layer, the embedded layer, the CNN layer, the BOW layer and the two full-communication layers of the second original model are processed layer by layer, and the semantic vector corresponding to the training text is obtained, the semantic vector corresponding to the positive example of the training text and the counterexample of the training text.
  • Corresponding semantic vectors respectively calculate the similarity between the semantic vector corresponding to the training text and the semantic vector corresponding to the positive example of the training text, and the similarity between the semantic vector corresponding to the training text and the semantic vector corresponding to the counterexample of the training text
  • the two similarities are respectively input to the loss layer, and the loss is calculated by the loss layer, and then the parameters of each layer included in the second original model are adjusted according to the calculation loss, and are continued based on the adjusted second original model. Train until the calculated loss meets the third preset condition.
  • FIG. 7 shows a block diagram of a text recommendation apparatus shown in one embodiment of the present application.
  • the apparatus has the functions of implementing the above-described method examples, which may be implemented by hardware or by hardware to execute corresponding software.
  • the device can include:
  • the pre-processing module 701 is configured to perform pre-processing on the target text to obtain feature content of the target text.
  • the text analysis module 702 is configured to process the feature content by using at least two text analysis models to obtain at least two semantic vectors of the target text.
  • the vector obtaining module 703 is configured to integrate at least two semantic vectors of the target text to generate an integrated semantic vector of the target text.
  • the text recommendation module 704 is configured to select, according to the integrated semantic vector of the target text and the integrated semantic vector of the at least one text to be recommended, the recommended text corresponding to the target text from the at least one text to be recommended.
  • FIG. 8 shows a block diagram of a text recommendation apparatus according to an embodiment of the present invention.
  • the apparatus has the functions of implementing the above-described method examples, which may be implemented by hardware or by hardware to execute corresponding software.
  • the apparatus may include: a pre-processing module 801, a text analysis module 802, a vector acquisition module 803, a degree acquisition module 804, and a text recommendation module 805.
  • the pre-processing module 801 is configured to perform pre-processing on the target text to obtain feature content of the target text.
  • the text analysis module 802 is configured to process the feature content based on at least two text analysis models to obtain at least two semantic vectors.
  • the vector obtaining module 803 is configured to acquire a semantic vector corresponding to the target text according to the at least two semantic vectors.
  • a degree acquisition module 804 configured to acquire a degree of association between a semantic vector corresponding to the target text and a semantic vector corresponding to the text to be recommended, where the degree of association is used to represent between the target text and the text to be recommended Similarity.
  • the text recommendation module 805 is configured to determine the to-be-recommended text corresponding to the semantic vector whose association degree meets the first preset condition as the recommended text corresponding to the target text, and perform recommendation.
  • the at least two text analysis models include a first analysis model and a second analysis model
  • the text analysis module 802 includes: a first processing unit, Two processing units (not shown).
  • a first processing unit configured to process the feature content by using the first analysis model to obtain a first semantic vector corresponding to the target text.
  • a second processing unit configured to process the feature content by using the second analysis model to obtain a second semantic vector corresponding to the target text.
  • the vector obtaining module 803 is configured to acquire a semantic vector corresponding to the target text based on the first semantic vector and the second semantic vector.
  • the feature content of the target text includes a body feature word of the target text
  • the first analysis model includes a correspondence between a word and a semantic vector
  • the first processing unit is configured to:
  • the feature content of the target text includes a body feature word and a title of the target text; and the second processing unit is configured to:
  • the text feature word is processed by using the second analysis model to obtain a semantic vector corresponding to the text feature word;
  • the second analysis model includes a BOW layer and a CNN layer
  • the second processing unit is configured to process the feature feature words by using the BOW layer to obtain semantics corresponding to the feature words.
  • Vector processing the title by using the CNN layer to obtain a semantic vector corresponding to the title.
  • the vector obtaining module 803 is specifically configured to:
  • the apparatus further includes: a first obtaining module 806, a second obtaining module 807, a vector adjusting module 808, and a first generating module. 809.
  • a first obtaining module 806, configured to acquire a first training sample set, where the first training sample set includes a plurality of first training samples, each first training sample includes at least one word and a context of each word, the words Corresponding to the semantic vector, the context of the word also corresponds to a semantic vector.
  • the second obtaining module 807 is configured to input, for each word, a semantic vector corresponding to the context of the word into the first original model to obtain a training result, where the training result includes an appearance probability of each word.
  • a vector adjustment module 808 configured to adjust a semantic vector of a context of the word according to the training result, and input the adjusted semantic vector into the first original model again, until the training result meets a desired result, the expectation The result is that the probability of occurrence of the word corresponding to the context conforms to the second preset condition.
  • the first generating module 809 is configured to generate the first analysis model according to a semantic vector corresponding to each word when the training result meets the expected result.
  • the apparatus further includes: a third obtaining module 810, a fourth obtaining module 811, a loss calculating module 812, and a second generating. Module 813.
  • a third obtaining module 810 configured to acquire a second training sample set, where the second training sample set includes a plurality of second training samples, each second training sample includes a training text, a positive example of the training text, and the a counterexample of the training text, each second training text corresponding to a first similarity and a second similarity, the first similarity being a similarity between the training text and a positive example of the training text,
  • the second similarity is a similarity between the training text and a counterexample of the training text.
  • the fourth obtaining module 811 is configured to input the second training sample into the second original model for each second training sample to obtain a training result.
  • the loss calculation module 812 is configured to compare the training result with the first similarity and the second similarity for each second training sample to obtain a calculation loss, where the calculation loss is used to represent the An error between the training result and the first similarity and an error between the second similarity.
  • the second generation module 813 is configured to perform the second analysis model by using an error back propagation algorithm according to a calculation loss corresponding to each second training sample in the training sample set.
  • the apparatus obtains at least two semantic vectors based on at least two text analysis models, and obtains a semantic vector corresponding to the target text based on the at least two semantic vectors, and uses the semantics obtained by the foregoing manner.
  • the representation ability of the vector is stronger, and the text information of the target text can be better represented.
  • the text recommendation is based on the semantic vector, the degree of association between the recommended text and the target text can be improved, thereby improving the accuracy of the recommendation.
  • FIG. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • the electronic device can be a server.
  • the electronic device is used to implement the text recommendation method provided in the above embodiments. Specifically:
  • the electronic device 1000 includes a central processing unit (CPU) 1001, a system memory 1004 including a random access memory (RAM) 1002 and a read only memory (ROM) 1003, and a system bus 1005 that connects the system memory 1004 and the central processing unit 1001. .
  • the electronic device 1000 also includes a basic input/output system (I/O system) 1006 that facilitates transfer of information between various devices within the computer, and a large capacity for storing the operating system 1013, the application 1014, and other program modules 1015.
  • the basic input/output system 1006 includes a display 1008 for displaying information and an input device 1009 such as a mouse, a keyboard for inputting information by a user.
  • the display 1008 and the input device 1009 are both connected to the central processing unit 1001 via an input/output controller 1010 connected to the system bus 1005.
  • the basic input/output system 1006 can also include an input output controller 1010 for receiving and processing input from a plurality of other devices, such as a keyboard, mouse, or electronic stylus.
  • input-output controller 1010 also provides output to a display screen, printer, or other type of output device.
  • the mass storage device 1007 is connected to the central processing unit 1001 by a mass storage controller (not shown) connected to the system bus 1005.
  • the mass storage device 1007 and its associated computer readable medium provide non-volatile storage for the electronic device 1000. That is, the mass storage device 1007 may include a computer readable medium (not shown) such as a hard disk or a CD-ROM drive.
  • the computer readable medium can include computer storage media and communication media.
  • Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data.
  • Computer storage media include RAM, ROM, EPROM, EEPROM, flash memory or other solid state storage technologies, CD-ROM, DVD or other optical storage, tape cartridges, magnetic tape, magnetic disk storage or other magnetic storage devices.
  • RAM random access memory
  • ROM read only memory
  • EPROM Erasable programmable read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • the electronic device 1000 can also be operated by a remote computer connected to the network through a network such as the Internet. That is, the electronic device 1000 can be connected to the network 1012 through the network interface unit 1011 connected to the system bus 1005, or the network interface unit 1011 can be used to connect to other types of networks or remote computer systems (not shown). ).
  • a computer readable storage medium having stored therein at least one instruction, at least one program, a code set or a set of instructions, the at least one instruction, the at least one program
  • the code set or instruction set is loaded and executed by a processor of the electronic device to implement the text recommendation method in the above method embodiment.
  • the computer readable storage medium described above may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device.
  • a plurality as referred to herein means two or more.
  • "and/or” describing the association relationship of the associated objects, indicating that there may be three relationships, for example, A and/or B, which may indicate that there are three cases where A exists separately, A and B exist at the same time, and B exists separately.
  • the character “/” generally indicates that the contextual object is an “or” relationship.
  • the words “first,” “second,” and similar terms used herein do not denote any order, quantity, or importance, but are used to distinguish different components.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • Biomedical Technology (AREA)
  • Evolutionary Computation (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Machine Translation (AREA)

Abstract

一种文本推荐方法、装置和电子设备。方法包括:对目标文本进行预处理,得到目标文本的特征内容(201);采用至少两种文本分析模型对特征内容进行处理,得到至少两种语义向量(202);对目标文本的至少两种语义向量进行整合,生成目标文本的整合语义向量(203);根据目标文本的整合语义向量和至少一个待推荐文本的整合语义向量,从至少一个待推荐文本中选取目标文本对应的推荐文本(204)。由于目标文本的整合语义向量是基于至少两种文本分析模型得到,该整合语义向量融合了各个语义向量的优势,因此该整合语义向量的表征能力更强,后续进行文本推荐时,推荐文本与目标文本之间的关联程度能得到提高,进而提高推荐的准确性。

Description

文本推荐方法、装置及电子设备
本申请要求于2017年11月29日提交的申请号为201711225593.1、发明名称为“文本推荐方法、装置及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及文本分析技术领域,特别涉及一种文本推荐方法、装置及电子设备。
背景技术
文本分析技术是指将从文本中提取的特征词进行量化以表示文本信息的技术。目前,文本分析技术主要应用于文本推荐领域,也即基于用户所浏览的文本内容向用户推荐用户可能感兴趣的其它内容。
相关技术提供的文本推荐方法通常基于协同过滤算法。协同过滤算法可以是基于用户和/或内容的协同过滤算法。以基于用户的协同过滤算法为例,首先基于各个用户的行为数据确定相似用户集合,相似用户集合中包括至少两个用户,后续进行文本推荐时,将相似用户集合中的其中一个用户所浏览的文本推荐给上述相似用户集合中的其他用户。例如,相似用户集合包括用户A与用户B,则将用户A所浏览的文本推荐给用户B。
相关技术中,向用户推荐的文本与用户想浏览或者浏览过的文本之间的关联程度较小,推荐的准确性较低。
发明内容
本申请实施例提供了一种文本推荐方法、装置及电子设备,用以解决相关技术中向用户推荐的文本与用户想浏览或者浏览过的文本之间的关联程度较小,推荐的准确性较低的问题。所述技术方案如下:
一方面,提供了一种文本推荐方法,所述方法包括:
对目标文本进行预处理,得到所述目标文本的特征内容;
基于至少两种文本分析模型对所述特征内容进行处理,得到所述目标文本的至少两种语义向量;对所述目标文本的至少两种语义向量进行整合,生成所述目标文本的整合语义向量;
根据所述目标文本的整合语义向量和至少一个待推荐文本的整合语义向量,从所述至少一个待推荐文本中选取所述目标文本对应的推荐文本。
一方面,提供了一种文本推荐装置,其特征在于,所述装置包括:
预处理模块,用于对目标文本进行预处理,得到所述目标文本的特征内容;
文本分析模块,用于基于至少两种文本分析模型对所述特征内容进行处理,得到所述目标文本的至少两种语义向量;
向量获取模块,用于根据所述至少两种语义向量获取所述目标文本的整合语义向量;
文本推荐模块,用于根据所述目标文本的整合语义向量和至少一个待推荐文本的整合语义向量,从所述至少一个待推荐文本中选取所述目标文本对应的推荐文本。
一方面,提供了一种电子设备,所述电子设备包括处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如第一方面所述的文本推荐方法。
一方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由处理器加载并执行以实现如第一方面所述的文本推荐方法。
一方面,提供了一种计算机程序产品,当该计算机程序产品被执行时,其用于执行上述第一方面所述的文本推荐方法。
本申请实施例提供的技术方案可以带来如下有益效果:
通过基于至少两个文本分析模型获取至少两种语义向量,并对上述至少两种语义向量进行整合处理,得到目标文本的整合语义向量,由于通过不同分析模型获取的语义向量各有优势,将其进行整合后得到的整合语义向量融合了各个语义向量的优势,因此该整合语义向量的表征能力更强,能更好地表示目标 文本的文本信息,后续基于整合语义向量进行文本推荐时,推荐文本与目标文本之间的关联程度能得到提高,进而提高推荐的准确性。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一个示例性实施例提供的实施环境的示意图;
图2是本申请一个示例性实施例提供的文本推荐方法的流程图;
图3A是本申请一个示例性实施例提供的文本推荐方法的流程图;
图3B是本申请一个示例性实施例提供的文本推荐的界面示意图;
图4A是本申请另一个示例性实施例示出的文本推荐方法的流程图;
图4B是本申请一个示例性实施例示出通过DNN模型获取第二语义向量的示意图;
图4C是图4A所示实施例应用于新闻推荐领域的示意图;
图5是本申请一个示例性实施例示出的训练第一分析模型的流程图;
图6A是本申请一个示例性实施例示出的训练第二分析模型的流程图;
图6B是本申请一个示例性实施例示出的训练第二分析模型的示意图;
图7是本申请一个示例性实施例示出的文本推荐装置的方框图;
图8是本申请另一个示例性实施例示出的文本推荐装置的方框图;
图9是本申请另一个示例性实施例示出的文本推荐装置的方框图;
图10是本申请一个示例性实施例示出的电子设备的方框图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
请参考图1,其示出了本申请一个实施例示出的实施环境的示意图。该实施环境包括第一设备11与第二设备12。
第一设备11可以是具有文本分析功能的电子设备。可选地,第一设备11能够通过该文本分析功能来执行本申请例提供的文本推荐方法的各个步骤。该第一设备11可以是PC(Personal Computer,个人计算机)、智能手机、平板电脑之类的终端设备,也可以是服务器。服务器可以是一台服务器,也可以是由多台服务器组成的服务器集群,或者是一个云计算服务中心。
第二设备12可以是具有文本展示功能的电子设备。可选地,第二设备12安装有指定类型的客户端,该指定类型的客户端用于实现上述文本展示功能。也即,该指定类型的客户端能够接收第一设备11发送的推荐文本,并展示上述推荐文本。上述指定类型的客户端可以是阅读类客户端、资讯类客户端等等。该第二设备12可以是PC(Personal Computer,个人计算机)、智能手机、平板电脑之类的终端设备。
第一设备11与第二设备12之间通过有线网络或无线网络建立通信连接。在本申请实施例中,仅以第二设备12为终端设备,第一设备11为第二设备12中的指定类型的客户端对应的服务器为例进行说明。
在本申请实施例中,通过至少两个文本分析模型获取目标文本的至少两种语义向量,并对上述至少两种语义向量进行整合处理,得到目标文本的整合语义向量,由于通过不同分析模型获取的语义向量各有优势,将其进行整合后得到的整合语义向量融合了各个语义向量的优势,因此该整合语义向量的表征能力更强,能更好地表示目标文本的文本信息,后续基于语义向量进行文本推荐时,推荐文本与目标文本之间的关联程度能得到提高,进而提高推荐的准确性。
请参考图2,其示出了本申请一个实施例示出的文本推荐方法的流程图。该文本推荐方法可以应用于图1所示实施环境中的第一设备11。该方法包括:
步骤201,对目标文本进行预处理,得到目标文本的特征内容。
服务器中设置有数据库,数据库中包括多个文本。目标文本可以是上述多个文本中的任意一个。可选地,服务器直接从数据库中读取目标文本。
目标文本的特征内容是对目标文本的高度提炼,通常可用于概括性地表示目标文本所包括的文本信息。可选地,目标文本的特征内容包括目标文本的标题和正文特征词。
目标文本的标题通常由服务器直接获取。服务器获取目标文本的标题之后,通常需要对上述标题进行分词处理。分词处理是指将目标文本的标题划分为一个一个单独的词语。示例性地,对于句子“分词是文本挖掘的基础”,对该句子进行分词处理,得到“分词”、“是”、“文本挖掘”、“的”以及“基础”等五个词语。对目标文本的标题进行分词处理所采取的算法可以是基于字符串匹配的分词算法、基于理解的分词算法、基于统计的分词算法等等,本申请实施例对此不作限定。目标文本的正文特征词是指目标文本的正文中所包括的关键词,其通常能用于概括性地表示目标文本的正文。
步骤202,基于至少两种文本分析模型对特征内容进行处理,得到目标文本的至少两种语义向量。
上述语义向量是文本分析模型对特征内容进行处理的结果。文本分析模型与语义向量之间存在一一对应的关系,采用不同的语义分析模型时,所得到的语义向量的大小、方向、维度均有可能不同。对于获取至少两种语义向量的具体实现过程,将在下文实施例进行讲解。
文本分析模型可以是word2vec模型,深层神经网络(Dynamic Neural Network,DNN)模型、文档主题生成(Latent Dirichlet Allocation,LDA)模型等等,本申请实施例对此不作限定。
步骤203,对目标文本的至少两种语义向量进行整合,生成目标文本的整合语义向量。
在本发明实施例中,基于至少两种文本分析模型对特征内容进行处理,并对上述至少两种语义向量进行整合处理,得到目标文本的整合语义向量,由于通过不同分析模型获取的语义向量各有优势,将其进行整合后得到的整合语义向量融合了各个语义向量的优势,因此该整合语义向量的表征能力更强,能更好地即表示目标文本的文本信息,后续基于整合语义向量进行文本推荐时,推荐文本与目标文本之间的关联程度较好,进而提高推荐的准确性。
可选地,将上述至少两种语义向量进行拼接得到目标文本对应的语义向量。向量拼接是指将至少两个向量拼接成一个向量,拼接后的向量的维度应该大于拼接前的任意一个向量的维度。向量的维度用于指示该向量的表征能力,向量的维度越多时,向量的表征能力就越强。
步骤204,根据目标文本的整合语义向量和至少一个待推荐文本的整合语义 向量,从至少一个待推荐文本中选取目标文本对应的推荐文本。
待推荐文本可以是数据库中除目标文本之外的文本。可选地,待推荐文本的整合语义向量的获取方式与目标文本的整合语义向量的获取方式相同,也即,服务器先对待推荐文本进行预处理,得到待推荐文本的特征内容,之后服务器采用至少两个文本分析模型对待推荐文本的特征内容进行处理,得到待推荐文本的至少两种语义向量,并对上述至少两种语义向量进行整合处理,得到待推荐文本的整合语义向量。
综上所述,本申请实施例提供的技术方案,通过至少两个文本分析模型获取目标文本的至少两种语义向量,并对上述至少两种语义向量进行整合处理,得到目标文本的整合语义向量,由于通过不同分析模型获取的语义向量各有优势,将其进行整合后得到的整合语义向量融合了各个语义向量的优势,因此该整合语义向量的表征能力更强,能更好地表示目标文本的文本信息,后续基于语义向量进行文本推荐时,推荐文本与目标文本之间的关联程度能得到提高,进而提高推荐的准确性。
请参考图3A,其示出了本申请一个实施例示出的文本推荐方法的流程图。该方法可以包括如下步骤:
步骤301,对目标文本进行预处理,得到目标文本的特征内容。
目标文本的正文特征词的获取过程如下:
步骤301a,对目标文本的正文进行分词处理,得到多个词语。
该步骤是将目标文本的正文划分为一个一个单独的词语。对目标文本的正文进行分词处理所采取的算法也可以是基于字符串匹配的分词算法、基于理解的分词算法、基于统计的分词算法等等,本申请实施例对此不作限定。
步骤301b,获取各个词语对应的词频和逆向文件频率(term frequency–inverse document frequency,TF-IDF)指标。
词语的TF-IDF指标可通过词语在目标文本中的出现次数,以及词语在待推荐文本中的出现次数来衡量。若某个词语在目标文本中的出现次数越多,并且该词语在待推荐文本中的出现次数越少,则该词语的TF-IDF指标越高;若某个词语在目标文本中的出现次数越少,并且该词语在待推荐文本中的出现次数越多,则该词语的TF-IDF指标越低。
TF-IDF指标可用于评估该词语在目标文本中的重要程度。TF-IDF指标与词语在目标文本中的重要程度呈正相关关系,也即,词语的TF-IDF指标越高,该词语在目标文本的重要程度越高;词语的TF-IDF指标越低,该词语在目标文本的重要程度越低。
步骤303c,将TF-IDF指标符合预设大小,且词性为预设词性的词语确定为目标文本的正文特征词。
预设大小可以根据实际经验设定,本申请实施例对此不作限定。词语的词性可以是名词、动词、形容词、副词中的任意一种。由于形容词以及副词通常起修饰作用,而并没有实质含义,例如形容词通常用于修饰名词,副词通常用于修饰动词,因此在本申请实施例中,预设词性可以是名词和/或动词。在其它可能的示例中,将各个词性为名词或动词的词语按照TF-IDF指标的大小进行排列,将TF-IDF指标排名在前n位的词语确定为目标文本的正文特征词。n的数值可以预先设定,示例性地,n为5。
步骤302,基于至少两种文本分析模型对特征内容进行处理,得到至少两种语义向量。
步骤303,根据至少两种语义向量获取目标文本对应的语义向量。
步骤304,获取目标文本对应的语义向量与待推荐文本对应的语义向量之间的关联程度。
关联程度用于表征目标文本与待推荐文本之间的相似度。关联程度与相似度之间呈正相关关系,也即,目标文本与待推荐文本之间的相似度越大,则目标文本对应的语义向量与待推荐文本对应的语义向量之间的关联程度越大;目标文本与待推荐文本之间的相似度越小,则目标文本对应的语义向量与待推荐文本对应的语义向量之间的关联程度越小。
可选地,服务器通过计算目标文本的语义向量与待推荐文本的语义向量之间的余弦距离,以获取目标文本对应的语义向量与待推荐文本对应的语义向量之间的关联程度。其中,余弦距离与关联程度之间呈正相关关系,也即,目标文本的语义向量与待推荐文本的语义向量之间的余弦距离越大,目标文本对应的语义向量与待推荐文本对应的语义向量之间的关联程度越大;目标文本的语义向量与待推荐文本的语义向量之间的余弦距离越小,目标文本对应的语义向量与待推荐文本对应的语义向量之间的关联程度越小。
两个语义向量之间的余弦距离cosθ可以通过如下公式计算得到:
Figure PCTCN2018118274-appb-000001
其中,n是两个语义向量的维度,A i是第一个语义向量,B i是第二个语义向量,
Figure PCTCN2018118274-appb-000002
是第一个语义向量的大小,
Figure PCTCN2018118274-appb-000003
是第二个语义向量的大小。
步骤305,将关联程度符合第一预设条件的语义向量对应的文本确定为目标文本对应的推荐文本,并进行推荐。
将目标文本对应的语义向量与待推荐文本对应的语义向量之间的关联程度按照由高到低的顺序进行排列,第一预设条件是目标文本对应的语义向量与待推荐文本对应的语义向量之间的关联程度排在前m位。m的数值可以预先设定,本发明实施例对此不作限定。另外,第一预设条件也可以是目标文本对应的语义向量与待推荐文本对应的语义向量之间的关联程度大于预设程度。预设程度可以根据实际经验设定,本发明实施例对此不作限定。
当通过余弦距离来获取关联程度时,将目标文本对应的语义向量与待推荐文本对应的语义向量之间的余弦距离按照由高到低的顺序进行排列,第一预设条件是目标文本对应的语义向量与待推荐文本对应的语义向量之间的余弦距离排在前m位。另外,第一预设条件也可以是目标文本对应的语义向量与待推荐文本对应的语义向量之间的余弦距离大于预设距离。预设距离可以根据实际经验设定,本发明实施例对此不作限定。
本实施例的部分步骤与图2所示的实施例相同,详细论述可以参见图2的相关描述。另外,后续用户通过终端向服务器请求目标文本时,服务器将目标文本发送至终端的同时,也将推荐文本发送至终端,从而实现向用户推荐文本。通过上述方式可以使用户在浏览完目标文本之后,可以继续浏览与目标文本的关联程度较大的其它文本,从而增大用户在相关应用程序的用户界面的停留时间,增加用户粘性。
具体地,提供阅读功能的应用程序的用户界面中显示有各个目标文本的标识(例如,目标文本的标题),用户触发任一目标文本的标识之后,上述应用程序的客户端向服务器发送文本获取请求,文本获取请求携带有用户选择的目标 文本的标识,服务器根据文本获取请求携带的目标文本的标识获取目标文本,并采取图3A所示实施例提供的方法获取目标文本对应的推荐文本,之后将目标文本与推荐文本发送至上述应用程序的客户端,由客户端在该应用程序的用户界面上同时显示目标文本和推荐文本。
结合参考图3B,其示出了本申请一个示例性实施例示出的文本推荐的界面示意图。其中,提供阅读功能的应用程序的用户界面30上显示有目标文本31和推荐文本32。
综上所述,本申请实施例提供的方法,通过基于至少两个文本分析模型获取至少两种语义向量,并对上述至少两种语义向量进行整合处理,得到目标文本的整合语义向量,由于通过不同分析模型获取的语义向量各有优势,将其进行整合后得到的整合语义向量融合了各个语义向量的优势,因此该整合语义向量的表征能力更强,能更好地表示目标文本的文本信息,后续基于整合语义向量进行文本推荐时,推荐文本与目标文本之间的关联程度能得到提高,进而提高推荐的准确性。
请参考图4A,其示出了本申请另一个实施例示出的文本推荐方法的流程图。在本申请实施例中,至少两个文本分析模型包括第一分析模型和第二分析模型。该方法可以包括如下步骤:
步骤401,对目标文本进行预处理,得到目标文本的特征内容。
步骤401与步骤101相同,此处不作赘述。
步骤402,采用第一分析模型对特征内容进行处理,得到目标文本的第一语义向量。
在本申请实施例中,第一分析模型是word4vec模型。Word4vec模型可以解决汉语中存在的“一词多义”、“多词一义”等问题。需要说明的是,通过word2vec模型对目标文本的特征内容进行处理时,通常只会对目标文本的正文特征词进行处理。
可选地,目标文本的特征内容包括目标文本的正文特征词,第一分析模型包括词语与语义向量之间的对应关系,步骤402可以包括如下子步骤:
步骤402a,查找对应关系,得到每个正文特征词对应的语义向量;
上述对应关系也即是训练word4vec模型得到的训练结果。另外,word4vec 模型的训练过程,将在下文实施例进行解释说明。
步骤402b,基于每个正文特征词对应的语义向量获取第一语义向量。
可选地,将每个正文特征词对应的语义向量相加后计算平均值,得到第一语义向量。示例性地,正文特征词A、B和C对应的语义向量分别为w A、w B和w C,则第一语义向量w a可以通过如下公式计算得到:
Figure PCTCN2018118274-appb-000004
步骤403,采用第二分析模型对特征内容进行处理,得到目标文本的第二语义向量。
在本申请实施例中,第二分析模型是DNN模型。通过DNN模型得到的语义向量的表征性较强,后续再进行文本推荐时,目标文本与推荐文本之间的关联程度计算得较为准确。另外,由于对正文特征词进行处理时,无需考虑正文特征词之间的顺序,而在对标题进行处理时,需要考虑对标题进行分词得到的词语之间的顺序,因此需要对正文特征词和标题分开进行处理。
可选地,目标文本的特征内容包括目标文本的正文特征词和标题,步骤403可以包括如下子步骤:
步骤403a,采用第二分析模型对正文特征词进行处理,得到正文特征词的语义向量;
可选地,第二分析模型包括BOW层,BOW层用于对正文特征词进行处理,得到正文特征词的语义向量。此时,步骤403a具体实现为:采用BOW层对正文特征词进行处理,得到正文特征词的语义向量。
正文特征词的数量通常有多个,并且正文特征词是从目标文本的正文中的不同句子提取得到的,因此正文特征词之间并不存在特定的顺序,因此采用第二分析模型的BOW层对各个正文特征词进行处理,得到各个正文特征词的语义向量。可选地,将各个正文特征词的语义向量相加后求平均值,得到正文特征词的语义向量。
步骤403b,采用第二分析模型对标题进行处理,得到标题对应的语义向量;
可选地,第二分析模型包括CNN层,CNN层用于对标题进行处理,得到标题的语义向量。此时,步骤403b具体实现为:采用CNN层对标题进行处理,得到标题的语义向量。
在对标题进行处理之前,需要对标题进行分词处理,分词处理后得到的各 个词语在标题中的顺序固定,因此,采用CNN层对标题进行处理,得到标题对应的语义向量。
步骤403c,基于正文特征词对应的语义向量和标题对应的语义向量获取第二语义向量。
可选地,将正文特征词对应的语义向量和标题对应的语义向量相加,得到第二语义向量。
可选地,第二分析模型还包括输入层、嵌入层、全联通层。输入层用于输入目标文本的正文特征词以及标题,其中,标题与正文特征词是在输入层的不同位置进行输入的,另外,将目标特征词与标题输入输入层之前,通常采用不同的id来表示正文特征词以及对标题进行分词得到的词语。嵌入层用于采用随机的初始化向量表示正文特征词以及标题。全联通层用于对CNN层输出的标题对应的语义向量以及BOW层输出的正文特征词对应的语义向量之和进行进一步处理,全联通层输出的目标文本对应的语义向量的表征能力更强。
结合参考图4B,其示出了本申请一个示例性实施例示出的采用DNN模型获取第二语义向量的示意图。DNN模型包括输入层、嵌入层、CNN层、BOW层以及两个全联通层。将目标文本的标题以及正文特征词分别输入输入层,再输入至嵌入层,得到标题对应的初始化向量以及正文特征词对应的初始化向量,标题对应的初始化向量被输入至CNN层,并由CNN层输出标题对应的语义向量,正文特征词对应的初始化向量被输入至BOW层,并由BOW层输出正文特征词对应的语义向量,之后将标题对应的语义向量与正文特征词对应的语义向量相加后输入至全联通层,得到目标文本对应的第二语义向量。
在本申请实施例中,基于标题所存在的顺序,将正文特征词与标题分开进行处理,从而使通过DNN模型得到的第二语义向量能更加准确地表示目标文本的文本信息,后续进行文本推荐时,推荐文本与目标文本之间的关联程度能得到进一步提高。
步骤404,基于第一语义向量和第二语义向量获取目标文本对应的语义向量。
可选地,将第一语义向量与第二语义向量进行向量拼接,得到目标文本对应的语义向量。示例性地,第一语义向量为128维,第二语义向量为200维,则向量拼接后得到的目标文本对应的语义向量为328维。
可选地,步骤404可以包括如下两个子步骤:
步骤404a,获取第一语义向量对应的第一系数和第二语义向量对应的第二系数。
第一系数与第二系数根据经验设定。另外,后续得到目标文本对应的推荐文本时,还可以依据目标文本与推荐文本之间的关联程度对第一系数、第二系数进行调整。
步骤404b,对第一语义向量与第一系数之间的乘积和第二语义向量和第二系数之间的乘积进行拼接处理,得到目标文本对应的语义向量。
示例性地,第一系数为k1,第二系数为k2,第一语义向量为w a,第二语义向量为w b,则拼接得到的目标文本对应的语义向量w s可以表示为(k1w a,k4w b)。
步骤405,获取目标文本对应的语义向量与待推荐文本对应的语义向量之间的关联程度。
步骤406,将关联程度符合第一预设条件的语义向量对应的文本确定为目标文本对应的推荐文本,并进行推荐。
步骤405至步骤406与步骤104至105相同,此处不再赘述。
下面对图4A所示实施例应用于新闻推荐领域进行讲解,结合参考图4C,其示出了图4A所示实施例应用于新闻推荐领域的示意图。
新闻候选池中包括多个新闻(待推荐文本),对新闻候选池中的各个新闻进行预处理,得到各个新闻的特征内容,后续通过word4vec模型和DNN模型对各个新闻的特征内容进行处理,得到各个新闻对应的语义向量,上述各个新闻对应的语义向量组成了新闻向量集合,后续每生成一个新闻,对新生成的新闻进行预处理,得到新生成的新闻的特征内容,后续通过word4vec模型和DNN模型对新生成的新闻的特征内容进行处理,得到上述新闻对应的语义向量,计算上述新闻对应的语义向量与新闻向量集合中的各个向量之间的余弦距离,将上述各个余弦距离按从大到小的顺序排列,将排在前m位的余弦距离对应的新闻作为上述新生成的新闻对应的推荐新闻。
综上所述,本申请实施例提供的方法,通过基于至少两个文本分析模型获取至少两种语义向量,并对上述至少两种语义向量进行整合处理,得到目标文本的整合语义向量,由于通过不同分析模型获取的语义向量各有优势,将其进行整合后得到的整合语义向量融合了各个语义向量的优势,因此该整合语义向 量的表征能力更强,能更好地表示目标文本的文本信息,后续基于语义向量进行文本推荐时,推荐文本与目标文本之间的关联程度能得到提高,进而提高推荐的准确性。
还通过将正文特征词与标题分开进行处理,从而使通过DNN模型得到的第二语义向量能更加准确地表示目标文本的文本信息,后续进行文本推荐时,推荐文本与目标文本之间的关联程度能得到进一步提高。
下面将对第一分析模型的训练过程进行讲解。
结合参考图5,其示出了本申请实施例示出的训练第一分析模型的流程图。训练第一分析模型可以包括如下步骤501至504。
步骤501,获取第一训练样本集。
第一训练样本集包括多个第一训练样本。第一训练样本可以是一个文本。服务器可以从数据库中直接读取第一训练样本,也可以从与服务器建立有通信连接的其它电子设备处获取第一训练样本。以上述推荐文本应用于新闻推荐领域为例,上述第一训练样本可以是预设时间内的新闻,预设时间可以根据对第一训练样本的数量要求实际确定。比如,第一训练样本是最近一年的新闻。
每个第一训练样本包括至少一个词语和每个词语的上下文。词语的上下文是指在一个完整的句子中在该词语之前和之后出现的词语。例如,在句子“今天没有下雨”中,“没有”的上下文是“今天”和“下雨”。词语以及词语的上下文是由服务器对第一训练样本所包括的句子进行分词处理得到的。
词语对应有语义向量,词语的上下文也对应有语义向量。词语对应的语义向量,以及词语的上下文对应的语义向量均是通过随机化的方式获取到的。
步骤502,对于每一个词语,将词语的上下文对应的语义向量输入第一原始模型,得到训练结果。
第一原始模型可以是CBOW(Continuous Bag Of Words Model)模型,也可以是Skip-gram模型,本申请实施例对此不作限定。在本申请实施例中,仅以第一原始模型为CBOW模型为例进行解释说明。
训练结果包括每个词语的出现概率。每个词语的出现概率是指该词语出现在输入第一原始模型的语义向量对应的上下文之间的概率。
步骤503,根据训练结果调整词语的上下文的语义向量,并将调整后的语义 向量再次输入第一原始模型,直至训练结果符合期望结果。
期望结果是指上下文对应的词语的出现概率符合第二预设条件。第二预设条件是指上下文对应的词语的出现概率最大。示例性地,“没有”在“今天”和“下雨”之间的出现概率应当最大。
服务器可以检测训练结果是否符合期望结果,若训练结果不符合期望结果时,则相应地对输入第一原始模型的上下文对应的语义向量进行调整,之后重复将调整后的语义向量输入第一原始模型,得到训练结果,并在训练结果不符合期望结果的情况下调整输入的语义向量的步骤,直到训练结果符合期望结果。
步骤504,当训练结果符合期望结果时,根据各个词语对应的语义向量生成第一分析模型。
当训练结果符合期望结果时,此时输入第一原始模型的语义向量可以视为上下文对应的语义向量,当第一训练样本足够时,对于每个词语,均可以得到该词语对应的语义向量,其中,词语与词语对应的语义向量之间的预设对应关系可以称之为第一分析模型。
下面将对第二分析模型的训练过程进行讲解。
结合参考图6A,其示出了本申请实施例示出的训练第二分析模型的流程图。训练第二分析模型可以包括如下步骤601至604。
步骤601,获取第二训练样本集。
第二训练样本集包括多个第二训练样本。服务器可以从数据库中直接读取第二训练样本,也可以从与服务器建立有通信连接的其它电子设备处获取第二训练样本。以上述推荐文本应用于新闻推荐领域为例,上述第二训练样本可以是预设时间内的新闻,预设时间可以根据对第二训练样本的数量要求实际确定。
每个第二训练样本包括训练文本、训练文本的正例和训练文本的反例。上述训练文本、训练文本的正例和训练文本的反例可以采用三元数组{news,pos,neg}表示。News为训练文本,其可以是任何一个文本。Pos是训练文本的正例,其通常是与训练文本较为相关的文本,pos可以通过协同过滤的方法得到;neg为训练文本的反例,其可以是与上述训练文本完全无关的文本,其可以随机选取。通常,pos与neg的比例为1:1。
每个第二训练文本对应有第一相似度和第二相似度,第一相似度是训练文 本与训练文本的正例之间的相似度,第二相似度是训练文本与训练文本的反例之间的相似度。需要说明的是,news,pos,neg均是采用文本的特征内容来表示的,得到文本的特征内容的过程可以参考步骤102,此处不再赘述。
步骤602,对于每一个第二训练样本,将第二训练样本输入第二原始模型,得到训练结果。
第二原始模型是待训练的深层神经网络模型。可选地,第二原始模型包括输入层、嵌入层、CNN层、BOW层、全联通层。每一层的初始参数可以是随机设置的。
将第二训练样本所包括的news、pos和neg的特征内容输入输入层,需要说明的是,在输入之前,通常会将news、pos和neg的特征内容表示为one-hot向量,也即,对于特征内容所包括的每一个词语,均采用唯一的id进行表示。
嵌入层用于得到news、pos和neg的特征内容对应的初始化语义向量。CNN层用于对news、pos和neg的标题进行处理,得到news、pos和neg的标题对应的语义向量。BOW层用于对news、pos和neg的正文特征词进行处理,得到news、pos和neg的正文特征词对应的语义向量。
第二原始模型将标题对应的语义向量和正文特征词对应的语义向量分别相加,得到news、pos和neg分别对应的语义向量,后续全联通层对news、pos和neg分别对应的语义向量进行进一步处理,得到news、pos和neg分别对应的语义向量。
第二原始模型分别计算news对应的语义向量与pos对应的语义向量之间的相似度,以及和neg对应的最终语义向量之间的相似度,上述两个相似度也即是将第二训练样本输入第二原始模型所得到的训练结果。
步骤603,对于每一个第二训练样本,将训练结果分别与第一相似度和第二相似度进行比较,得到计算损失。
计算损失用于表征训练结果与第一相似度之间的误差以及与第二相似度之间的误差。计算损失包括第一计算损失和第二计算损失,第一计算损失是训练结果中news对应的语义向量与pos对应的语义向量之间的相似度与第一相似度之间的误差,第二计算损失是训练结果中news对应的语义向量与neg对应的最终语义向量之间的相似度与第二相似度之间的误差。可选地,第二原始模型还包括损耗层,损耗层用于根据训练结果、第一相似度以及第二相似度计算得到 计算损失。具体地,损耗层计算训练结果中news对应的语义向量与pos对应的语义向量之间的相似度与第一相似度的差值得到第一计算损失,并计算训练结果中news对应的语义向量与neg对应的最终语义向量之间的相似度与第二相似度之间的差值得到第二计算损失。
步骤604,根据训练样本集中的各个第二训练样本分别对应的计算损失,采用误差反向传播算法训练得到第二分析模型。
当计算损失不符合第三预设条件时,调整第二原始模型中的输入层、嵌入层、CNN层以及BOW层之间的参数,并基于调整后的第二原始模型继续进行训练,直至计算损失符合第三预设条件。其中,第三预设条件是指计算损失小于预设数值,预设数值可以根据DNN模型的精度要求实际设定,本申请实施例对此不作限定。
结合参考图6B,其示出了本申请一个示例性实施例示出的训练第二分析模型的示意图。待训练的第二原始模型包括输入层、嵌入层、CNN层、BOW层、两个全联通层以及损耗层,将训练文本、训练文本的正例、训练文本的反例输入第二原始模型,经过第二原始模型的输入层、嵌入层、CNN层、BOW层以及两个全联通层逐层进行处理后,得到训练文本对应的语义向量,训练文本的正例对应的语义向量以及训练文本的反例对应的语义向量,分别计算训练文本对应的语义向量与训练文本的正例对应的语义向量之间的相似度,以及训练文本对应的语义向量与训练文本的反例对应的语义向量之间的相似度,将上述两个相似度分别输入至损耗层,由损耗层计算计算损失,之后可根据计算损失对第二原始模型所包括的各个层的参数进行调整,并基于调整后的第二原始模型继续进行训练,直至计算损失符合第三预设条件。
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。
请参考图7,其示出了本申请一个实施例示出的文本推荐装置的框图。。该装置具有实现上述方法示例中的功能,所述功能可以由硬件实现,也可以由硬件执行相应的软件实现。该装置可以包括:
预处理模块701、文本分析模块702、向量获取模块703和文本推荐模块704。
预处理模块701,用于对目标文本进行预处理,得到所述目标文本的特征内 容。
文本分析模块702,用于通过至少两种文本分析模型对所述特征内容进行处理,得到所述目标文本的至少两种语义向量。
向量获取模块703,用于对所述目标文本的至少两种语义向量进行整合,生成所述目标文本的整合语义向量。
文本推荐模块704,用于根据所述目标文本的整合语义向量和至少一个待推荐文本的整合语义向量,从所述至少一个待推荐文本中选取所述目标文本对应的推荐文本。
请参考图8,其示出了本发明一个实施例提供的文本推荐装置的框图。该装置具有实现上述方法示例中的功能,所述功能可以由硬件实现,也可以由硬件执行相应的软件实现。该装置可以包括:预处理模块801、文本分析模块802、向量获取模块803、程度获取模块804和文本推荐模块805。
预处理模块801,用于对目标文本进行预处理,得到所述目标文本的特征内容。
文本分析模块802,用于基于至少两种文本分析模型对所述特征内容进行处理,得到至少两种语义向量。
向量获取模块803,用于根据所述至少两种语义向量获取所述目标文本对应的语义向量。
程度获取模块804,用于获取所述目标文本对应的语义向量与待推荐文本对应的语义向量之间的关联程度,所述关联程度用于表征所述目标文本与所述待推荐文本之间的相似度。
文本推荐模块805,用于将关联程度符合第一预设条件的语义向量对应的待推荐文本确定为所述目标文本对应的推荐文本,并进行推荐。
在基于图8所示实施例提供的可选实施例中,所述至少两种文本分析模型包括第一分析模型和第二分析模型,所述文本分析模块802,包括:第一处理单元、第二处理单元(图中未示出)。
第一处理单元,用于采用所述第一分析模型对所述特征内容进行处理,得到所述目标文本对应的第一语义向量。
第二处理单元,用于采用所述第二分析模型对所述特征内容进行处理,得 到所述目标文本对应的第二语义向量。
所述向量获取模块803,用于基于所述第一语义向量和所述第二语义向量获取所述目标文本对应的语义向量。
可选地,所述目标文本的特征内容包括所述目标文本的正文特征词,所述第一分析模型包括词语与语义向量之间的对应关系,所述第一处理单元,用于:
查找所述对应关系,得到每个正文特征词对应的语义向量;
基于所述每个正文特征词对应的语义向量获取所述第一语义向量。
可选地,所述目标文本的特征内容包括所述目标文本的正文特征词和标题;所述第二处理单元,用于:
采用所述第二分析模型对所述正文特征词进行处理,得到所述正文特征词对应的语义向量;
采用所述第二分析模型对所述标题进行处理,得到所述标题对应的语义向量;
基于所述正文特征词对应的语义向量和所述标题对应的语义向量获取所述第二语义向量。
可选地,所述第二分析模型包括BOW层和CNN层;所述第二处理单元,具体用于采用所述BOW层对所述正文特征词进行处理,得到所述正文特征词对应的语义向量;采用所述CNN层对所述标题进行处理,得到所述标题对应的语义向量。
可选地,所述向量获取模块803,具体用于:
获取所述第一语义向量对应的第一系数和所述第二语义向量对应的第二系数;
对所述第一语义向量与所述第一系数之间的乘积和所述第二语义向量和所述第二系数之间的乘积进行拼接处理,得到所述目标文本对应的语义向量。
在基于图8所示实施例提供的另一个可选实施例中,请参考图9,所述装置还包括:第一获取模块806、第二获取模块807、向量调整模块808和第一生成模块809。
第一获取模块806,用于获取第一训练样本集,所述第一训练样本集包括多个第一训练样本,每个第一训练样本包括至少一个词语和每个词语的上下文,所述词语对应有语义向量,所述词语的上下文也对应有语义向量。
第二获取模块807,用于对于每一个词语,将所述词语的上下文对应的语义向量输入第一原始模型,得到训练结果,所述训练结果包括每个词语的出现概率。
向量调整模块808,用于根据所述训练结果调整所述词语的上下文的语义向量,并将调整后的语义向量再次输入所述第一原始模型,直至所述训练结果符合期望结果,所述期望结果是指所述上下文对应的词语的出现概率符合第二预设条件。
第一生成模块809,用于当所述训练结果符合所述期望结果时,根据各个词语对应的语义向量生成所述第一分析模型。
在基于图8所示实施例提供的另一个可选实施例中,请参考图9,请所述装置还包括:第三获取模块810、第四获取模块811、损失计算模块812和第二生成模块813。
第三获取模块810,用于获取第二训练样本集,所述第二训练样本集包括多个第二训练样本,每个第二训练样本包括训练文本、所述训练文本的正例和所述训练文本的反例,每个第二训练文本对应有第一相似度和第二相似度,所述第一相似度是所述训练文本与所述训练文本的正例之间的相似度,所述第二相似度是所述训练文本与所述训练文本的反例之间的相似度。
第四获取模块811,用于对于每一个第二训练样本,将所述第二训练样本输入第二原始模型,得到训练结果。
损失计算模块812,用于对于每一个第二训练样本,将所述训练结果分别与所述第一相似度、所述第二相似度进行比较,得到计算损失,所述计算损失用于表征所述训练结果与所述第一相似度之间的误差以及与所述第二相似度之间的误差。
第二生成模块813,用于根据所述训练样本集中的各个第二训练样本分别对应的计算损失,采用误差反向传播算法训练得到所述第二分析模型。
综上所述,本申请实施例提供的装置,通过基于至少两个文本分析模型获取至少两种语义向量,并基于上述至少两种语义向量获取目标文本对应的语义向量,采用上述方式得到的语义向量的表征能力更强,能更好地表示目标文本的文本信息,后续基于语义向量进行文本推荐时,推荐文本与目标文本之间的关联程度能得到提高,进而提高推荐的准确性。
请参考图10,其示出了本申请一个实施例提供的电子设备的结构示意图。该电子设备可以是服务器。该电子设备用于实施上述实施例中提供的文本推荐方法。具体来讲:
所述电子设备1000包括中央处理单元(CPU)1001、包括随机存取存储器(RAM)1002和只读存储器(ROM)1003的***存储器1004,以及连接***存储器1004和中央处理单元1001的***总线1005。所述电子设备1000还包括帮助计算机内的各个器件之间传输信息的基本输入/输出***(I/O***)1006,和用于存储操作***1013、应用程序1014和其他程序模块1015的大容量存储设备1007。
所述基本输入/输出***1006包括有用于显示信息的显示器1008和用于用户输入信息的诸如鼠标、键盘之类的输入设备1009。其中所述显示器1008和输入设备1009都通过连接到***总线1005的输入输出控制器1010连接到中央处理单元1001。所述基本输入/输出***1006还可以包括输入输出控制器1010以用于接收和处理来自键盘、鼠标、或电子触控笔等多个其他设备的输入。类似地,输入输出控制器1010还提供输出到显示屏、打印机或其他类型的输出设备。
所述大容量存储设备1007通过连接到***总线1005的大容量存储控制器(未示出)连接到中央处理单元1001。所述大容量存储设备1007及其相关联的计算机可读介质为电子设备1000提供非易失性存储。也就是说,所述大容量存储设备1007可以包括诸如硬盘或者CD-ROM驱动器之类的计算机可读介质(未示出)。
不失一般性,所述计算机可读介质可以包括计算机存储介质和通信介质。计算机存储介质包括以用于存储诸如计算机可读指令、数据结构、程序模块或其他数据等信息的任何方法或技术实现的易失性和非易失性、可移动和不可移动介质。计算机存储介质包括RAM、ROM、EPROM、EEPROM、闪存或其他固态存储其技术,CD-ROM、DVD或其他光学存储、磁带盒、磁带、磁盘存储或其他磁性存储设备。当然,本领域技术人员可知所述计算机存储介质不局限于上述几种。上述的***存储器1004和大容量存储设备1007可以统称为存储器。
根据本申请的各种实施例,所述电子设备1000还可以通过诸如因特网等网 络连接到网络上的远程计算机运行。也即电子设备1000可以通过连接在所述***总线1005上的网络接口单元1011连接到网络1012,或者说,也可以使用网络接口单元1011来连接到其他类型的网络或远程计算机***(未示出)。
所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现上述方法实施例中的文本推荐方法。
在示例性实施例中,还提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由电子设备的处理器加载并执行以实现上述方法实施例中的文本推荐方法。
可选地,上述计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。
应当理解的是,在本文中提及的“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。本文中使用的“第一”、“第二”以及类似的词语并不表示任何顺序、数量或者重要性,而只是用来区分不同的组成部分。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
以上仅为本申请的示例性实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (17)

  1. 一种文本推荐方法,应用于电子设备中,所述方法包括:
    对目标文本进行预处理,得到所述目标文本的特征内容;
    基于至少两种文本分析模型对所述特征内容进行处理,得到所述目标文本的至少两种语义向量;
    对所述目标文本的至少两种语义向量进行整合,生成所述目标文本的整合语义向量;
    根据所述目标文本的整合语义向量和至少一个待推荐文本的整合语义向量,从所述至少一个待推荐文本中选取所述目标文本对应的推荐文本。
  2. 根据权利要求1所述的方法,其中,所述至少两种文本分析模型包括第一分析模型和第二分析模型,所述采用至少两种文本分析模型对所述特征内容进行处理,得到所述目标文本的至少两种语义向量,包括:
    采用所述第一分析模型对所述特征内容进行处理,得到所述目标文本的第一语义向量;
    采用所述第二分析模型对所述特征内容进行处理,得到所述目标文本的第二语义向量;
    其中,所述整合语义向量是对所述第一语义向量和所述第二语义向量进行整合生成的。
  3. 根据权利要求2所述的方法,其中,所述特征内容包括所述目标文本的正文特征词;
    所述采用所述第一分析模型对所述特征内容进行处理,得到所述目标文本的第一语义向量,包括:
    通过所述第一分析模型获取所述目标文本的正文特征词的语义向量;
    基于所述正文特征词的语义向量获取所述第一语义向量。
  4. 根据权利要求2所述的方法,其中,所述特征内容包括所述目标文本的正文特征词与标题,所述采用所述第二分析模型对所述特征内容进行处理,得到所述目标文本的第二语义向量,包括:
    采用所述第二分析模型对所述正文特征词进行处理,得到所述正文特征词的语义向量;
    采用所述第二分析模型对所述标题进行处理,得到所述标题的语义向量;
    基于所述正文特征词的语义向量和所述标题的语义向量获取所述第二语义向量。
  5. 根据权利要求4所述的方法,其中,所述第二分析模型包括词袋BOW层和卷积神经网络CNN层;所述BOW层用于对所述正文特征词进行处理,得到所述正文特征词的语义向量;所述CNN层用于对所述标题进行处理,得到所述标题的语义向量。
  6. 根据权利要求2所述的方法,其中,所述对所述目标文本的至少两种语义向量进行整合,生成所述目标文本的整合语义向量,包括:
    获取所述第一语义向量对应的第一系数和所述第二语义向量对应的第二系数;
    对所述第一语义向量与所述第一系数之间的乘积和所述第二语义向量与所述第二系数之间的乘积进行拼接处理,得到所述目标文本的整合语义向量。
  7. 根据权利要求1至6任一项所述的方法,其中,所述根据所述目标文本的整合语义向量和至少一个待推荐文本的整合语义向量,从所述至少一个待推荐文本中选取所述目标文本对应的推荐文本,包括:
    获取所述目标文本的整合语义向量与各个所述待推荐文本的整合语义向量之间的关联程度,所述关联程度用于表征所述目标文本与所述待推荐文本之间的相似度;
    将所述关联程度符合第一预设条件的待推荐文本确定为所述目标文本对应的推荐文本。
  8. 根据权利要求1至6任一项所述的方法,其中,所述采用至少两种文本分析模型对所述特征内容进行处理,得到所述目标文本的至少两种语义向量之前,还包括:
    获取第一训练样本集,所述第一训练样本集包括多个第一训练样本,每个第一训练样本包括至少一个词语和每个词语的上下文,所述词语对应有语义向量,所述词语的上下文也对应有语义向量;
    对于每一个词语,将所述词语的上下文对应的语义向量输入第一原始模型,得到训练结果,所述训练结果包括每个词语的出现概率;
    根据所述训练结果调整所述词语的上下文的语义向量,并将调整后的语义向量再次输入所述第一原始模型,直至所述训练结果符合期望结果,所述期望结果是指所述上下文对应的词语的出现概率符合第二预设条件;
    当所述训练结果符合所述期望结果时,根据各个词语对应的语义向量生成第一分析模型。
  9. 根据权利要求1至6任一项所述的方法,其中,所述采用至少两种文本分析模型对所述特征内容进行处理,得到所述目标文本的至少两种语义向量之前,还包括:
    获取第二训练样本集,所述第二训练样本集包括多个第二训练样本,每个第二训练样本包括训练文本、所述训练文本的正例和所述训练文本的反例,每个第二训练文本对应有第一相似度和第二相似度,所述第一相似度是所述训练文本与所述训练文本的正例之间的相似度,所述第二相似度是所述训练文本与所述训练文本的反例之间的相似度;
    对于每一个第二训练样本,将所述第二训练样本输入第二原始模型,得到训练结果;
    对于每一个第二训练样本,将所述训练结果分别与所述第一相似度、所述第二相似度进行比较,得到计算损失,所述计算损失用于表征所述训练结果与所述第一相似度之间的误差以及与所述第二相似度之间的误差;
    根据所述训练样本集中的各个第二训练样本分别对应的计算损失,采用误差反向传播算法训练得到第二分析模型。
  10. 一种文本推荐装置,应用于电子设备中,所述装置包括:
    预处理模块,用于对目标文本进行预处理,得到所述目标文本的特征内容;
    文本分析模块,用于基于少两种文本分析模型对所述特征内容进行处理, 得到所述目标文本的至少两种语义向量;
    向量获取模块,用于对所述目标文本的至少两种语义向量进行整合,生成所述目标文本的整合语义向量;
    文本推荐模块,用于根据所述目标文本的整合语义向量和至少一个待推荐文本的整合语义向量,从所述至少一个待推荐文本中选取所述目标文本对应的推荐文本。
  11. 根据权利要求10所述的装置,其中,所述至少两种文本分析模型包括第一分析模型和第二分析模型,所述向量获取模块,用于:
    采用所述第一分析模型对所述特征内容进行处理,得到所述目标文本的第一语义向量;
    采用所述第二分析模型对所述特征内容进行处理,得到所述目标文本的第二语义向量;
    其中,所述整合语义向量是对所述第一语义向量和所述第二语义向量进行整合生成的。
  12. 根据权利要求10所述的装置,其中,所述特征内容包括所述目标文本的正文特征词,所述向量获取模块,用于:
    通过所述第一分析模型获取每个所述正文特征词的语义向量;
    基于所述每个正文特征词对应的语义向量获取所述第一语义向量。
  13. 根据权利要求10所述的装置,其中,所述特征内容包括正文特征词与标题,所述向量获取模块,用于:
    采用所述第二分析模型对所述正文特征词进行处理,得到所述正文特征词的语义向量;
    采用所述第二分析模型对所述标题进行处理,得到所述标题的语义向量;
    基于所述正文特征词的语义向量和所述标题的语义向量获取所述第二语义向量。
  14. 根据权利要求13所述的装置,其中,所述第二分析模型包括词袋BOW 层和卷积神经网络CNN层;所述BOW层用于对所述正文特征词进行处理,得到所述正文特征词的语义向量;所述CNN层用于对所述标题进行处理,得到所述标题的语义向量。
  15. 根据权利要求10至14任一项所述的装置,其特征在于,所述文本推荐模块,用于:获取所述目标文本的整合语义向量与所述至少一个待推荐文本的整合语义向量之间的关联程度,所述关联程度用于表征所述目标文本与所述待推荐文本之间的相似度;
    将所述关联程度符合第一预设条件的待推荐文本确定为所述目标文本对应的推荐文本。
  16. 一种电子设备,所述电子设备包括处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如权利要求1至9任一项所述的文本推荐方法。
  17. 一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由处理器加载并执行以实现如权利要求1至9任一项所述的文本推荐方法。
PCT/CN2018/118274 2017-11-29 2018-11-29 文本推荐方法、装置及电子设备 WO2019105432A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/848,028 US11182564B2 (en) 2017-11-29 2020-04-14 Text recommendation method and apparatus, and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711225593.1 2017-11-29
CN201711225593.1A CN109840321B (zh) 2017-11-29 2017-11-29 文本推荐方法、装置及电子设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/848,028 Continuation US11182564B2 (en) 2017-11-29 2020-04-14 Text recommendation method and apparatus, and electronic device

Publications (1)

Publication Number Publication Date
WO2019105432A1 true WO2019105432A1 (zh) 2019-06-06

Family

ID=66664699

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/118274 WO2019105432A1 (zh) 2017-11-29 2018-11-29 文本推荐方法、装置及电子设备

Country Status (3)

Country Link
US (1) US11182564B2 (zh)
CN (1) CN109840321B (zh)
WO (1) WO2019105432A1 (zh)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110334356A (zh) * 2019-07-15 2019-10-15 腾讯科技(深圳)有限公司 文章质量的确定方法、文章筛选方法、以及相应的装置
CN110457574A (zh) * 2019-07-05 2019-11-15 深圳壹账通智能科技有限公司 基于数据比较的信息推荐方法、装置及存储介质
CN110737834A (zh) * 2019-10-14 2020-01-31 腾讯科技(深圳)有限公司 业务对象的推荐方法、装置、存储介质和计算机设备
CN110929017A (zh) * 2019-11-25 2020-03-27 三角兽(北京)科技有限公司 文本的推荐方法及装置
CN111144129A (zh) * 2019-12-26 2020-05-12 成都航天科工大数据研究院有限公司 一种基于自回归与自编码的语义相似度获取方法
CN111782964A (zh) * 2020-06-23 2020-10-16 北京智能工场科技有限公司 一种社区帖子的推荐方法
US20200387806A1 (en) * 2019-06-04 2020-12-10 Konica Minolta, Inc. Idea generation support device, idea generation support system, and recording medium
CN112364236A (zh) * 2019-07-24 2021-02-12 阿里巴巴集团控股有限公司 目标对象推荐***、方法、装置、数据处理方法及装置
CN112364663A (zh) * 2020-11-16 2021-02-12 上海优扬新媒信息技术有限公司 用户特征的识别方法、装置、设备以及存储介质
CN112667919A (zh) * 2020-12-28 2021-04-16 山东大学 一种基于文本数据的个性化社区矫正方案推荐***及其工作方法
CN112836010A (zh) * 2020-10-22 2021-05-25 长城计算机软件与***有限公司 用于专利的检索方法、存储介质及装置
CN112861543A (zh) * 2021-02-04 2021-05-28 吴俊� 一种面向研发供需描述文本撮合的深层语义匹配方法和***
CN113536743A (zh) * 2020-11-06 2021-10-22 腾讯科技(深圳)有限公司 一种文本处理方法和相关装置
CN116127321A (zh) * 2023-02-16 2023-05-16 广东工业大学 一种船舶新闻推送模型的训练方法、推送方法及***

Families Citing this family (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110442735B (zh) * 2019-08-13 2022-05-13 北京金山数字娱乐科技有限公司 一种成语近义词推荐方法及装置
CN110795913B (zh) * 2019-09-30 2024-04-12 北京大米科技有限公司 一种文本编码方法、装置、存储介质及终端
US11393036B2 (en) * 2019-10-11 2022-07-19 S&P Global Inc. Deep learning-based two-phase clustering algorithm
CN110990533B (zh) * 2019-11-29 2023-08-25 支付宝(杭州)信息技术有限公司 确定查询文本所对应标准文本的方法及装置
CN111444331B (zh) * 2020-03-12 2023-04-07 腾讯科技(深圳)有限公司 基于内容的分布式特征提取方法、装置、设备及介质
CN111507104B (zh) * 2020-03-19 2022-03-25 北京百度网讯科技有限公司 建立标签标注模型的方法、装置、电子设备和可读存储介质
CN111476029A (zh) * 2020-04-13 2020-07-31 武汉联影医疗科技有限公司 资源推荐方法和装置
CN111506836A (zh) * 2020-04-16 2020-08-07 广东南方新媒体科技有限公司 一种内容相似度排序算法
CN111797204A (zh) * 2020-07-01 2020-10-20 北京三快在线科技有限公司 文本匹配方法、装置、计算机设备及存储介质
CN112131345B (zh) * 2020-09-22 2024-02-06 腾讯科技(深圳)有限公司 文本质量的识别方法、装置、设备及存储介质
CN112463918B (zh) * 2020-10-13 2023-10-31 腾讯科技(深圳)有限公司 一种信息推荐方法、***及存储介质和终端设备
CN112163165B (zh) * 2020-10-21 2024-05-17 腾讯科技(深圳)有限公司 信息推荐方法、装置、设备及计算机可读存储介质
CN112182166B (zh) * 2020-10-29 2023-03-10 腾讯科技(深圳)有限公司 一种文本匹配方法、装置、电子设备及存储介质
CN112417147A (zh) * 2020-11-05 2021-02-26 腾讯科技(深圳)有限公司 训练样本的选取方法与装置
CN112541338A (zh) * 2020-12-10 2021-03-23 平安科技(深圳)有限公司 相似文本匹配方法、装置、电子设备及计算机存储介质
CN112231485B (zh) * 2020-12-14 2021-03-26 平安科技(深圳)有限公司 文本推荐方法、装置、计算机设备及存储介质
CN113836942B (zh) * 2021-02-08 2022-09-20 宏龙科技(杭州)有限公司 一种基于隐关键词的文本匹配方法
CN112905793B (zh) * 2021-02-23 2023-06-20 山西同方知网数字出版技术有限公司 一种基于Bilstm+Attention文本分类的案例推荐方法及***
CN112883729B (zh) * 2021-03-11 2023-08-11 网易(杭州)网络有限公司 文本创作的词汇推荐方法、装置及服务器
CN112733508B (zh) * 2021-03-30 2021-06-18 中国电子技术标准化研究院 标准文本标注、标准图谱构建方法及装置
CN113821587B (zh) * 2021-06-02 2024-05-17 腾讯科技(深圳)有限公司 文本相关性确定方法、模型训练方法、装置及存储介质
CN113377909B (zh) * 2021-06-09 2023-07-11 平安科技(深圳)有限公司 释义分析模型训练方法、装置、终端设备及存储介质
CN113536785B (zh) * 2021-06-15 2022-08-12 合肥讯飞数码科技有限公司 一种文本推荐方法、智能终端及计算机可读存储介质
CN115774992A (zh) * 2021-09-07 2023-03-10 北京三星通信技术研究有限公司 信息处理方法、装置、电子设备、存储介质及程序产品
CN115186086B (zh) * 2022-06-27 2023-08-08 长安大学 一种异构环境下嵌入预期价值的文献推荐方法
CN114996439A (zh) * 2022-08-01 2022-09-02 太极计算机股份有限公司 一种文本搜索方法及装置
CN117474703B (zh) * 2023-12-26 2024-03-26 武汉荟友网络科技有限公司 基于社交网络的话题智能推荐方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104657350A (zh) * 2015-03-04 2015-05-27 中国科学院自动化研究所 融合隐式语义特征的短文本哈希学习方法
CN104850537A (zh) * 2014-02-17 2015-08-19 腾讯科技(深圳)有限公司 对文本内容进行筛选的方法及装置
CN106445919A (zh) * 2016-09-28 2017-02-22 上海智臻智能网络科技股份有限公司 一种情感分类方法及装置
CN106502989A (zh) * 2016-10-31 2017-03-15 东软集团股份有限公司 情感分析方法及装置
CN106874258A (zh) * 2017-02-16 2017-06-20 西南石油大学 一种基于汉字属性向量表示的文本相似性计算方法及***
CN107291699A (zh) * 2017-07-04 2017-10-24 湖南星汉数智科技有限公司 一种句子语义相似度计算方法

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103186527B (zh) * 2011-12-27 2017-04-26 北京百度网讯科技有限公司 建立音乐分类模型的***、推荐音乐的***及相应方法
US20150356152A1 (en) * 2013-01-11 2015-12-10 Nec Corporation Text mining device, text mining method, and recording medium
US9558743B2 (en) * 2013-03-15 2017-01-31 Google Inc. Integration of semantic context information
CN103207899B (zh) * 2013-03-19 2016-12-07 新浪网技术(中国)有限公司 文本文件推荐方法及***
CN103823848B (zh) * 2014-02-11 2017-11-14 浙江大学 一种基于lda和vsm的中草药相似文献的推荐方法
CN105630928B (zh) * 2015-12-22 2019-06-21 北京奇虎科技有限公司 文本的标识方法及装置
CN106959966A (zh) * 2016-01-12 2017-07-18 腾讯科技(深圳)有限公司 一种信息推荐方法及***
CN106407280B (zh) * 2016-08-26 2020-02-14 合一网络技术(北京)有限公司 查询目标匹配方法及装置
US10437833B1 (en) * 2016-10-05 2019-10-08 Ontocord, LLC Scalable natural language processing for large and dynamic text environments
CN107168992A (zh) * 2017-03-29 2017-09-15 北京百度网讯科技有限公司 基于人工智能的文章分类方法及装置、设备与可读介质
CN107330023B (zh) * 2017-06-21 2021-02-12 北京百度网讯科技有限公司 基于关注点的文本内容推荐方法和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850537A (zh) * 2014-02-17 2015-08-19 腾讯科技(深圳)有限公司 对文本内容进行筛选的方法及装置
CN104657350A (zh) * 2015-03-04 2015-05-27 中国科学院自动化研究所 融合隐式语义特征的短文本哈希学习方法
CN106445919A (zh) * 2016-09-28 2017-02-22 上海智臻智能网络科技股份有限公司 一种情感分类方法及装置
CN106502989A (zh) * 2016-10-31 2017-03-15 东软集团股份有限公司 情感分析方法及装置
CN106874258A (zh) * 2017-02-16 2017-06-20 西南石油大学 一种基于汉字属性向量表示的文本相似性计算方法及***
CN107291699A (zh) * 2017-07-04 2017-10-24 湖南星汉数智科技有限公司 一种句子语义相似度计算方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ZHANG, QUN ET AL.: "Classifying Short Texts with Word Embedding and LDA Model", NEW TECHNOLOGY OF LIBRARY AND INFORMATION SERVICE, 25 December 2016 (2016-12-25) *

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200387806A1 (en) * 2019-06-04 2020-12-10 Konica Minolta, Inc. Idea generation support device, idea generation support system, and recording medium
CN110457574A (zh) * 2019-07-05 2019-11-15 深圳壹账通智能科技有限公司 基于数据比较的信息推荐方法、装置及存储介质
CN110334356B (zh) * 2019-07-15 2023-08-04 腾讯科技(深圳)有限公司 文章质量的确定方法、文章筛选方法、以及相应的装置
CN110334356A (zh) * 2019-07-15 2019-10-15 腾讯科技(深圳)有限公司 文章质量的确定方法、文章筛选方法、以及相应的装置
CN112364236A (zh) * 2019-07-24 2021-02-12 阿里巴巴集团控股有限公司 目标对象推荐***、方法、装置、数据处理方法及装置
CN110737834B (zh) * 2019-10-14 2024-04-02 腾讯科技(深圳)有限公司 业务对象的推荐方法、装置、存储介质和计算机设备
CN110737834A (zh) * 2019-10-14 2020-01-31 腾讯科技(深圳)有限公司 业务对象的推荐方法、装置、存储介质和计算机设备
CN110929017A (zh) * 2019-11-25 2020-03-27 三角兽(北京)科技有限公司 文本的推荐方法及装置
CN111144129A (zh) * 2019-12-26 2020-05-12 成都航天科工大数据研究院有限公司 一种基于自回归与自编码的语义相似度获取方法
CN111144129B (zh) * 2019-12-26 2023-06-06 成都航天科工大数据研究院有限公司 一种基于自回归与自编码的语义相似度获取方法
CN111782964A (zh) * 2020-06-23 2020-10-16 北京智能工场科技有限公司 一种社区帖子的推荐方法
CN111782964B (zh) * 2020-06-23 2024-02-09 北京智能工场科技有限公司 一种社区帖子的推荐方法
CN112836010B (zh) * 2020-10-22 2024-04-05 新长城科技有限公司 用于专利的检索方法、存储介质及装置
CN112836010A (zh) * 2020-10-22 2021-05-25 长城计算机软件与***有限公司 用于专利的检索方法、存储介质及装置
CN113536743A (zh) * 2020-11-06 2021-10-22 腾讯科技(深圳)有限公司 一种文本处理方法和相关装置
CN112364663A (zh) * 2020-11-16 2021-02-12 上海优扬新媒信息技术有限公司 用户特征的识别方法、装置、设备以及存储介质
CN112667919A (zh) * 2020-12-28 2021-04-16 山东大学 一种基于文本数据的个性化社区矫正方案推荐***及其工作方法
CN112861543A (zh) * 2021-02-04 2021-05-28 吴俊� 一种面向研发供需描述文本撮合的深层语义匹配方法和***
CN116127321A (zh) * 2023-02-16 2023-05-16 广东工业大学 一种船舶新闻推送模型的训练方法、推送方法及***

Also Published As

Publication number Publication date
US20200242304A1 (en) 2020-07-30
CN109840321A (zh) 2019-06-04
CN109840321B (zh) 2022-02-01
US11182564B2 (en) 2021-11-23

Similar Documents

Publication Publication Date Title
WO2019105432A1 (zh) 文本推荐方法、装置及电子设备
US20210192220A1 (en) Video classification method and apparatus, computer device, and storage medium
CN110162593B (zh) 一种搜索结果处理、相似度模型训练方法及装置
US11017178B2 (en) Methods, devices, and systems for constructing intelligent knowledge base
KR101721338B1 (ko) 검색 엔진 및 그의 구현 방법
CN111062871B (zh) 一种图像处理方法、装置、计算机设备及可读存储介质
CN107066464B (zh) 语义自然语言向量空间
KR101754473B1 (ko) 문서를 이미지 기반 컨텐츠로 요약하여 제공하는 방법 및 시스템
KR20200094627A (ko) 텍스트 관련도를 확정하기 위한 방법, 장치, 기기 및 매체
WO2021189951A1 (zh) 文本搜索方法、装置、计算机设备和存储介质
CN110162771B (zh) 事件触发词的识别方法、装置、电子设备
US20210406324A1 (en) System and method for providing a content item based on computer vision processing of images
US20220050833A1 (en) Dynamically suppressing query answers in search
US20140280232A1 (en) Method and system for tagging objects comprising tag recommendation based on query-based ranking and annotation relationships between objects and tags
CN111539197A (zh) 文本匹配方法和装置以及计算机***和可读存储介质
Ah-Pine et al. Unsupervised visual and textual information fusion in cbmir using graph-based methods
US20180285448A1 (en) Producing personalized selection of applications for presentation on web-based interface
CN111444387A (zh) 视频分类方法、装置、计算机设备和存储介质
CN114880447A (zh) 信息检索方法、装置、设备及存储介质
JP4906900B2 (ja) 画像検索装置、画像検索方法及びプログラム
CN112765387A (zh) 图像检索方法、图像检索装置和电子设备
CN113688310A (zh) 一种内容推荐方法、装置、设备及存储介质
CN106663123B (zh) 以评论为中心的新闻阅读器
WO2021000400A1 (zh) 导诊相似问题对生成方法、***及计算机设备
CN110309355B (zh) 内容标签的生成方法、装置、设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18883909

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18883909

Country of ref document: EP

Kind code of ref document: A1