Central word extraction method, device, computer equipment and storage medium
By obtaining the query text and related data input by the user, and using the word vector model and intent recognition technology to extract the center word, the problem of poor center word extraction and cold start in the existing technology is solved, and more accurate query results are achieved.
Patent Information
- Application Number
- CN202210277310.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-17
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-03-17
AI Technical Summary
Existing center word extraction methods suffer from over-broad keyword extraction, cold start problem and Matthew effect, and are especially unsuitable for large-scale network applications.
By obtaining the query text, click behavior data and sound text data input by the user, we generate query node data, perform word segmentation processing and word vector generation, combine intent recognition and part-of-speech tagging, use the word vector model to extract candidate center words, and use cosine similarity Determine the center word.
It improves the extraction effect of center words, solves the cold start problem, weakens the Matthew effect, and improves query accuracy.
Smart Images

Figure CN114661877B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information processing technology, and in particular to a core word extraction method, device, computer equipment and storage medium. Background Art
[0002] With the development of computer technology and the widespread application of query engines, users have higher and higher requirements for query accuracy. In order to improve the query accuracy, when querying based on the sentence input by the user, the central word that can accurately express the meaning of the sentence can be extracted from the sentence. Querying based on the central word can avoid the problem of fewer query results due to querying based on the sentence.
[0003] Related technologies include topic model-based and supervised learning-based. The topic model-based is a statistical model that clusters the implicit semantic structure of documents in an unsupervised learning manner, and the LDA (Latent Dirichlet Allocation) algorithm is a type of topic model. LDA fits the distribution of words-documents-topics based on the analysis of word co-occurrence information, thereby mapping words and queries into a semantic space. The steps for extracting the central word are as follows:
[0004] 1) Obtain candidate central words in the document;
[0005] 2) Based on the implicit topic model learned from a large-scale corpus, the topic distribution of the query and candidate central words is calculated;
[0006] 3) Calculate the topic similarity between the document and the candidate keywords, sort them and select the highest ones as keywords.
[0007] shortcoming:
[0008] The extracted keywords are generally too broad and cannot reflect the topic of the article well;
[0009] There are keyword cold start problems and the Matthew effect.
[0010] Supervised learning is a method that treats keyword extraction as a classification problem, that is, a binary classification problem of determining whether each candidate keyword is a central word. Commonly used classification algorithms such as LR, Naive Bayes, SVM, GBDT, and neural networks can be used.
[0011] shortcoming:
[0012] It requires manual annotation of training sets, which is time-consuming and labor-intensive, and therefore not suitable for large-scale applications on the Internet. Summary of the invention
[0013] In view of the above problems, the present invention is proposed to provide a core word extraction method, apparatus, computer device and storage medium that overcome the above problems or at least partially solve the above problems.
[0014] In a first aspect, an embodiment of the present invention provides a method for extracting a central word, the method comprising the following steps:
[0015] Obtain the query text input by the user, the user's click behavior data on the query results corresponding to the query text, and the text data of the user's click sound;
[0016] Generate query node data based on query text, click behavior data, and voice text data;
[0017] Perform word segmentation on the query text, and determine the target word segmentation of the query text according to the obtained word segmentation;
[0018] The target word segmentation is input into a word vector generation model to obtain a word vector of the target word segmentation; the word vector generation model is obtained by training a preset model, and the training data of the word vector generation model is constructed based on the query node data;
[0019] Identify query intent based on query text; determine the weight of the target word in the corresponding intent category based on the number of occurrences of the target word in all query texts of the corresponding intent category, the number of all query texts of the corresponding intent category, and the number of occurrences of the target word in all query texts; perform weighted summation of the word vectors corresponding to all target words in the query text to obtain a vector representation of the query text;
[0020] Build a domain vocabulary knowledge base based on sound text data;
[0021] Perform part-of-speech tagging on the target word to determine the candidate central word;
[0022] The candidate central word is input into a word vector generation model to obtain a word vector of the candidate central word, and the central word is extracted based on the cosine similarity between the word vector of the candidate central word and the vector representation of the query text.
[0023] Optionally, the text data of the sound includes a sound title, a sound introduction, sound keywords, and custom tags.
[0024] Optionally, determining a target word segmentation of the query text according to the obtained word segmentation includes:
[0025] Remove the stop words from the obtained segmentations and use the remaining segmentations as the target segmentations.
[0026] Optionally, the constructing of a domain vocabulary knowledge base based on the sound text data includes:
[0027] The domain vocabulary is mined based on the sound text data, and the domain vocabulary is integrated with the pre-built basic vocabulary to obtain the domain vocabulary knowledge base.
[0028] Optionally, extracting the central word based on the cosine similarity between the word vector of the candidate central word and the vector representation of the query text includes:
[0029] Calculate the cosine similarity between the word vector of the candidate central word and the vector representation of the query text;
[0030] If the cosine similarity between the word vector of the candidate central word and the vector representation of the query text is less than the preset value, the candidate central word corresponding to the maximum cosine similarity is selected as the central word;
[0031] If the cosine similarity between the word vectors of some candidate central words and the vector representation of the query text is greater than or equal to a preset value, the candidate central word corresponding to the cosine similarity of the part is selected as the central word.
[0032] In a second aspect, an embodiment of the present invention provides a central word extraction device, the device comprising:
[0033] An acquisition module is used to acquire the query text input by the user, the user's click behavior data on the query result corresponding to the query text, and the text data of the user's click sound;
[0034] A query node data generation module is used to generate query node data according to query text, click behavior data, and voice text data;
[0035] A target word segmentation determination module is used to perform word segmentation processing on the query text and determine the target word segmentation of the query text according to the obtained word segmentation;
[0036] A word vector generation module is used to input the target word segmentation into a word vector generation model to obtain a word vector of the target word segmentation; the word vector generation model is obtained by training a preset model, and the training data of the word vector generation model is constructed based on the query node data;
[0037] A query text vector representation determination module is used to identify the query intent based on the query text; determine the weight of the target word in the corresponding intent category based on the number of occurrences of the target word in all query texts of the corresponding intent category, the number of all query texts of the corresponding intent category, and the number of occurrences of the target word in all query texts; perform weighted summation on the word vectors corresponding to all target words in the query text to obtain the vector representation of the query text;
[0038] A knowledge base construction module is used to construct a domain vocabulary knowledge base based on the sound text data;
[0039] A candidate core word determination module is used to perform part-of-speech tagging on the target word segmentation to determine the candidate core word;
[0040] The central word extraction module is used to input the candidate central word into the word vector generation model to obtain the word vector of the candidate central word, and extract the central word based on the cosine similarity between the word vector of the candidate central word and the vector representation of the query text.
[0041] Optionally, the text data of the sound includes a sound title, a sound introduction, sound keywords, and custom tags.
[0042] Optionally, the target segmentation determination module is further used to remove stop words from the obtained segmentations and use the remaining segmentations as target segmentations.
[0043] Optionally, the knowledge base construction module includes:
[0044] The domain vocabulary mining submodule is used to mine domain vocabulary based on sound text data;
[0045] The lexicon fusion submodule is used to fuse the domain lexicon with the pre-built basic lexicon to obtain the domain vocabulary knowledge base.
[0046] Optionally, the central word extraction module includes:
[0047] A calculation submodule is used to calculate the cosine similarity between the word vector of the candidate central word and the vector representation of the query text;
[0048] The judgment submodule is used to select the candidate central word corresponding to the maximum cosine similarity as the central word if the cosine similarity between the word vector of the candidate central word and the vector representation of the query text is less than a preset value; if the cosine similarity between the word vector of some candidate central words and the vector representation of the query text is greater than or equal to the preset value, then select the candidate central word corresponding to the part of the cosine similarity as the central word.
[0049] In a third aspect, an embodiment of the present invention provides a computer device, the computer device comprising:
[0050] one or more processors;
[0051] A memory for storing one or more programs;
[0052] When the one or more programs are executed by the one or more processors, the one or more processors implement the central word extraction method as described in any one of the first aspects.
[0053] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium.
[0054] The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the central word extraction method as described in any one of the first aspects is implemented.
[0055] In an embodiment of the present invention, query text input by a user, click behavior data of the user on the query result corresponding to the query text, and text data of the sound clicked by the user are obtained; query node data is generated according to the query text, click behavior data, and text data of the sound; the query text is segmented, and a target segmentation of the query text is determined according to the obtained segmentation; the target segmentation is input into a word vector generation model to obtain a word vector of the target segmentation; the word vector generation model is obtained by training a preset model, and the training data of the word vector generation model is constructed based on the query node data; the query intent is identified according to the query text; based on the corresponding The weight of the target word in the corresponding intent category is determined based on the number of occurrences of the target word in all query texts of the intent category, the number of all query texts of the corresponding intent category, and the number of occurrences of the target word in all query texts; the word vectors corresponding to all target words in the query text are weighted and summed to obtain the vector representation of the query text; a domain vocabulary knowledge base is built based on the text data of the sound; the target word is tagged with part of speech to determine the candidate central word; the candidate central word is input into the word vector generation model to obtain the word vector of the candidate central word, and the central word is extracted based on the cosine similarity between the word vector of the candidate central word and the vector representation of the query text. This improves the extraction effect of the query central word, solves the cold start problem of the central word, and also weakens the Matthew effect of the central word. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0057] Figure 1 A flowchart of a method for extracting a central word provided in the first embodiment of the present invention;
[0058] Figure 1A A schematic diagram of a session data combination provided in the first embodiment of the present invention;
[0059] Figure 2 A schematic diagram of the structure of a core word extraction device provided in Embodiment 2 of the present invention;
[0060] Figure 3 A schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0061] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0062] With the development of computer technology and the widespread application of query engines, users have higher and higher requirements for query accuracy. In order to improve the query accuracy, when querying based on the sentence input by the user, the central word that can accurately express the meaning of the sentence can be extracted from the sentence. Querying based on the central word can avoid the problem of fewer query results due to querying based on the sentence.
[0063] Related technologies include topic model-based and supervised learning-based. The topic model-based is a statistical model that clusters the implicit semantic structure of documents in an unsupervised learning manner, and the LDA (Latent Dirichlet Allocation) algorithm is a type of topic model. LDA fits the distribution of words-documents-topics based on the analysis of word co-occurrence information, thereby mapping words and queries into a semantic space. The steps for extracting the central word are as follows:
[0064] 1) Obtain candidate central words in the document;
[0065] 2) Based on the implicit topic model learned from a large-scale corpus, the topic distribution of the query and candidate central words is calculated;
[0066] 3) Calculate the topic similarity between the document and the candidate keywords, sort them and select the highest ones as keywords.
[0067] shortcoming:
[0068] The extracted keywords are generally too broad and cannot reflect the topic of the article well;
[0069] There are keyword cold start problems and the Matthew effect.
[0070] Supervised learning is a method that treats keyword extraction as a classification problem, that is, a binary classification problem of determining whether each candidate keyword is a central word. Commonly used classification algorithms such as LR, Naive Bayes, SVM, GBDT, and neural networks can be used.
[0071] shortcoming:
[0072] It requires manual annotation of training sets, which is time-consuming and labor-intensive, and therefore not suitable for large-scale applications on the Internet.
[0073] In order to overcome the above problems or at least partially solve the above problems, the embodiment of the present application provides a central word extraction method. The method can extract the central word of the query, improve the extraction effect of the central word of the query, solve the cold start problem of the central word, and also weaken the Matthew effect of the central word. The following is a detailed description through an embodiment.
[0074] Embodiment 1
[0075] Figure 1 This is a flowchart of a core word extraction method provided in Embodiment 1 of the present invention. The method can be executed by a core word extraction device. The core word extraction device can be implemented by software and / or hardware and can be configured in a computer device, such as a server, a personal computer, a smart phone, a smart watch, etc. The core word extraction method can be applied to a voice query scenario. The core word extraction method specifically includes the following steps:
[0076] Step 101: Obtain the query text input by the user, the user's click behavior data on the query results corresponding to the query text, and the text data of the user's click sound.
[0077] In the sound data retrieval scenario, when the user enters the search content in the search bar, clicks the query button, and clicks to select the corresponding sound content based on the displayed query results, this series of search behaviors has more or less relationship with the series of search behaviors before and after this series of search behaviors.
[0078] The sound text can be stored in the database as sound title, sound introduction, sound keywords, custom tags (primary tags, secondary tags, etc.), etc. Of course, in actual applications, the above-mentioned sound text can also contain other information or be replaced by other information, etc. The specific information or data contained varies for different usage scenarios, and the embodiment of the present invention does not impose specific restrictions on this.
[0079] Step 102: Generate query node data based on the query text, click behavior data, and voice text data.
[0080] After the user enters the query text, the click behavior under the same query request belongs to the same query node session; and if the time interval between two consecutive query requests of the user does not exceed the preset request time interval, the click behavior under the two consecutive query requests belongs to the same query node session.
[0081] For example, Figure 1A, user U1 clicks to play sounds I1, I3, and I8 in the query results of query request query1, and clicks to play sounds I2, I6, and I5 in the query results of query request query2. The time interval between query request query1 and query request query2 exceeds 20 seconds (the preset request time interval), then the retrieval series of behaviors corresponding to query request query1 and the retrieval series of behaviors corresponding to query request query2 belong to two different query nodes session1 and session2.
[0082] User U2 clicks to play sounds I5, I4, I9, and I2 in the query results of query request query3, and clicks to play sounds I7 and I6 in the query results of query request query4. The time interval between query request query3 and query request query4 does not exceed 20 seconds (the preset request time interval). Then the retrieval series of behaviors corresponding to query request query3 and the retrieval series of behaviors corresponding to query request query4 belong to the same query node session3.
[0083] Step 103: perform word segmentation processing on the query text, and determine the target word segmentation of the query text according to the obtained word segmentation.
[0084] In one implementation, after the query text is segmented, the data is cleaned, such as removing stop words from the obtained segmented words and using the remaining segmented words as target segmented words.
[0085] Stop words refer to certain words or phrases that are automatically filtered out before or after processing natural language data (or text) in information retrieval to save storage space and improve query efficiency. These words or phrases are called Stop Words. For a given purpose, any type of words can be selected as stop words. For the purpose of query, stop words refer to words that have no actual meaning, such as "is", "in", "this", "a", "on", etc., so stop words can be removed.
[0086] Step 104: input the target word segmentation into a word vector generation model to obtain a word vector of the target word segmentation.
[0087] The word vector generation model is obtained by training a preset model, and the training data of the word vector generation model is constructed based on query node data.
[0088] For example, the training samples constructed based on the query node session1 data can be as follows:
[0089] Query1 target word segmentation I1 naming word segmentation I1ID I1 anchor ID I1 first-level label I1 second-level label I1 sound keyword Query1 target word segmentation I3 naming word segmentation I3ID I3 anchor ID I3 first-level label I3 second-level label I3 sound keyword Query1 target word segmentation I8 naming word segmentation I8ID I8 anchor ID I8 first-level label I8 second-level label I8 sound keyword
[0090] The training samples constructed based on the query node session2 data can be as follows:
[0091] Query2 target word segmentation I2 named word segmentation I2ID I2 anchor ID I2 first-level label I2 second-level label I2 sound keyword Query2 target word segmentation I6 named word segmentation I6ID I6 anchor ID I6 first-level label I6 second-level label I6 sound keyword Query2 target word segmentation I5 named word segmentation I5ID I5 anchor ID I5 first-level label I5 second-level label I5 sound keyword
[0092] The training samples constructed based on the query node session3 data can be as follows:
[0093] Query3 target participle I5 named participle I5ID I5 anchor ID I5 first-level label I5 second-level label I5 sound keyword Query3 target participle I4 named participle I4ID I4 anchor ID I4 first-level label I4 second-level label I4 sound keyword Query3 target participle I9 named participle I9ID I9 anchor ID I9 first-level label I9 second-level label I9 sound keyword Query3 target participle I2 named participle I2ID I2 anchor ID I2 first-level label I2 second-level label I2 sound keyword Query4 target participle I7 named participle I7ID I7 anchor ID I7 first-level label I7 second-level label I7 sound keyword Query4 target participle I6 named participle I6ID I6 anchor ID I6 first-level label I6 second-level label I6 sound keyword
[0094] Input the constructed training data into a preset model, such as the word2vec model, to obtain a word vector generation model. Then input the target word segmentation into the word vector generation model to obtain the word vector of the target word segmentation.
[0095] Step 105, identifying the query intent according to the query text; determining the weight of the target word in the corresponding intent category based on the number of occurrences of the target word in all query texts of the corresponding intent category, the number of all query texts of the corresponding intent category, and the number of occurrences of the target word in all query texts; performing weighted summation on the word vectors corresponding to all target words in the query text to obtain a vector representation of the query text.
[0096] By identifying the intent of the query text, the query intent can be classified, for example, it can be divided into news, parent-child, emotion, comedy, audiobooks, etc. Of course, in specific use, the category can be defined according to the actual situation, and this implementation does not limit this.
[0097] For the query input by the user, the probability of each intent can be calculated according to the statistical classification model, and the intent of the query can be finally given. Intent recognition can also be achieved through machine learning methods. This embodiment does not limit the specific method of identifying the query intent according to the query text.
[0098] In one implementation, TF-CR (Term Frequency-Category Ratio) is used to score the target word segment of the query text, and the target word segment is assigned a weight in the corresponding intent category.
[0099] For example, the expression of TF-CR of target word w for intent category c is:
[0100]
[0101] where w c represents the target word w in the query text of intent category c, |w c | represents the number of occurrences of the target word w in all query texts of intent category c, N c represents the number of all query texts with intent category c, and |w| represents the number of occurrences of the target word w in all query texts.
[0102] The first item is term frequency, which measures the frequency of the target word w in all query texts with intent category c. Its physical meaning is to indicate the importance of this target word in intent category c.
[0103] The second term is called category ratio, which measures the proportion of the total number of times the target word w appears in category c. Its physical meaning is to express the correlation between the distribution of the target word and the intended category c.
[0104] According to the expression of TF-CR, words that are both high in frequency and unique to a certain intent category will have a larger TF-CR value, while words that are unique to the intent category but have a low frequency, or high-frequency words but low uniqueness, will have a smaller TF-CR value.
[0105] In the same way, the weight of each target word in other corresponding intent categories can be obtained.
[0106] For example, the defined intent has k intent categories (k classification task), and each target segmentation calculates the TF-CR value for each intent category, so a target segmentation has k TF-CR values.
[0107] It should be noted that, in the above-described implementation, the weight calculation (assignment) of the target word segmentation to the corresponding intent category is merely an exemplary description and does not limit this specification. In practical applications, other determination methods (calculation methods) may also be used.
[0108] The word vectors corresponding to all target words in the query text are weighted summed to obtain the vector representation of the query text. For example, if the intent category of the query text query I is j, then the jth embedding is the vector representation of the query. The details are as follows: The target words of query I are w1, w2, ..., w m , target word w i The k TF-CR values corresponding to (i=1, ..., m) are TF-CR i1 , TF-CR i2 , ..., TF-CR ik , target word w i The word vector is v i , then the vector representation of the query text query I is
[0109] vec Ij =TF-CR 1j *v1+TF-CR 2j *v2, ..., TF-CR mj *v m .
[0110] Step 106: construct a domain vocabulary knowledge base based on the text data of the sound.
[0111] Based on the acquired sound text data, the domain vocabulary is mined and the domain vocabulary is integrated with the pre-built basic vocabulary to obtain the domain vocabulary knowledge base. The pre-built basic vocabulary can be an external open source vocabulary (names of people, places, works, company names, etc.).
[0112] Step 107: Perform part-of-speech tagging on the target word segmentation to determine the candidate central word.
[0113] Perform part-of-speech tagging on the target words, and only retain words with specified parts of speech, such as proper nouns, gerunds, idioms, names of people, places, names of organizations, names of works, etc., as candidate core words. Of course, target words with other parts of speech can also be retained as candidate core words according to actual business needs.
[0114] Step 108: Input the candidate central word into a word vector generation model to obtain the word vector of the candidate central word, and extract the central word based on the cosine similarity between the word vector of the candidate central word and the vector representation of the query text.
[0115] Calculate the cosine similarity between the word vector of the candidate central word and the vector representation of the query text, and extract the central word according to the preset judgment logic.
[0116] For example, if the cosine similarities between the word vector of the candidate central word and the vector representation of the query text are both less than a preset value (the preset value may be 0.5), the candidate central word corresponding to the maximum cosine similarity is selected as the central word.
[0117] If the cosine similarity between the word vectors of some candidate central words and the vector representation of the query text is greater than or equal to a preset value, the candidate central word corresponding to the partial cosine similarity is selected as the central word.
[0118] In an embodiment of the present invention, query text input by a user, click behavior data of the user on the query result corresponding to the query text, and text data of the sound clicked by the user are obtained; query node data is generated according to the query text, click behavior data, and text data of the sound; the query text is segmented, and a target segmentation of the query text is determined according to the obtained segmentation; the target segmentation is input into a word vector generation model to obtain a word vector of the target segmentation; the word vector generation model is obtained by training a preset model, and the training data of the word vector generation model is constructed based on the query node data; the query intent is identified according to the query text; based on the corresponding The weight of the target word in the corresponding intent category is determined based on the number of occurrences of the target word in all query texts of the intent category, the number of all query texts of the corresponding intent category, and the number of occurrences of the target word in all query texts; the word vectors corresponding to all target words in the query text are weighted and summed to obtain the vector representation of the query text; a domain vocabulary knowledge base is built based on the text data of the sound; the target word is tagged with part of speech to determine the candidate central word; the candidate central word is input into the word vector generation model to obtain the word vector of the candidate central word, and the central word is extracted based on the cosine similarity between the word vector of the candidate central word and the vector representation of the query text. This improves the extraction effect of the query central word, solves the cold start problem of the central word, and also weakens the Matthew effect of the central word.
[0119] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0120] Embodiment 2
[0121] Figure 2 This is a schematic diagram of the structure of a core word extraction device provided in Embodiment 2 of the present invention. The core word extraction device may specifically include the following modules:
[0122] The acquisition module 201 is used to acquire the query text input by the user, the click behavior data of the user on the query result corresponding to the query text, and the text data of the click sound of the user;
[0123] A query node data generating module 202 is used to generate query node data according to the query text, click behavior data, and voice text data;
[0124] The target segmentation determination module 203 is used to perform segmentation processing on the query text and determine the target segmentation of the query text according to the obtained segmentation;
[0125] A word vector generation module 204 is used to input the target word segmentation into a word vector generation model to obtain a word vector of the target word segmentation; the word vector generation model is obtained by training a preset model, and the training data of the word vector generation model is constructed based on the query node data;
[0126] The query text vector representation determination module 205 is used to identify the query intent according to the query text; determine the weight of the target word in the corresponding intent category based on the number of occurrences of the target word in all query texts of the corresponding intent category, the number of all query texts of the corresponding intent category, and the number of occurrences of the target word in all query texts; perform weighted summation on the word vectors corresponding to all target words in the query text to obtain the vector representation of the query text;
[0127] A knowledge base construction module 206 is used to construct a domain vocabulary knowledge base based on the text data of the sound;
[0128] A candidate core word determination module 207 is used to perform part-of-speech tagging on the target word to determine a candidate core word;
[0129] The central word extraction module 208 is used to input the candidate central word into the word vector generation model to obtain the word vector of the candidate central word, and extract the central word based on the cosine similarity between the word vector of the candidate central word and the vector representation of the query text.
[0130] In one implementation, the text data of the sound includes a sound title, a sound introduction, sound keywords, and a custom tag.
[0131] In one implementation, the target segmentation determination module 203 is further configured to remove stop words from the obtained segmentations and use the remaining segmentations as target segmentations.
[0132] In one implementation, the knowledge base construction module 206 includes:
[0133] The domain vocabulary mining submodule is used to mine domain vocabulary based on sound text data;
[0134] The lexicon fusion submodule is used to fuse the domain lexicon with the pre-built basic lexicon to obtain the domain vocabulary knowledge base.
[0135] In one implementation, the core word extraction module 208 includes:
[0136] A calculation submodule is used to calculate the cosine similarity between the word vector of the candidate central word and the vector representation of the query text;
[0137] The judgment submodule is used to select the candidate central word corresponding to the maximum cosine similarity as the central word if the cosine similarity between the word vector of the candidate central word and the vector representation of the query text is less than a preset value; if the cosine similarity between the word vector of some candidate central words and the vector representation of the query text is greater than or equal to a preset value, then select the candidate central word corresponding to the part of the cosine similarity as the central word.
[0138] The core word extraction device provided in the embodiment of the present invention can execute the core word extraction method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0139] Embodiment 3
[0140] Figure 3 A schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention. Figure 3 A block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 3 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0141] like Figure 3As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0142] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0143] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0144] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 3 not shown, usually called a "hard drive"). Although Figure 3 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0145] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0146] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the computer device 12, and / or may communicate with any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the computer device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computer device 12, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0147] The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28, such as implementing the central word extraction method provided in the embodiment of the present invention.
[0148] Embodiment 4
[0149] Embodiment 4 of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned central word extraction method are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0150] Among them, computer-readable storage media may include, for example, but are not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device.
[0151] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for extracting a central word, characterized in that: include: Obtain the query text input by the user, the user's click behavior data on the query results corresponding to the query text, and the text data of the user's click sound; Generate query node data based on query text, click behavior data, and voice text data; Perform word segmentation on the query text, and determine the target word segmentation of the query text according to the obtained word segmentation; Inputting the target word segmentation into a word vector generation model to obtain a word vector of the target word segmentation; The word vector generation model is obtained by training a preset model, and the training data of the word vector generation model is constructed based on the query node data; Identify query intent based on query text; Determine the weight of the target word in the corresponding intent category based on the number of occurrences of the target word in all query texts of the corresponding intent category, the number of all query texts of the corresponding intent category, and the number of occurrences of the target word in all query texts; Perform weighted summation on the word vectors corresponding to all target words in the query text to obtain the vector representation of the query text; Build a domain vocabulary knowledge base based on sound text data; Perform part-of-speech tagging on the target word to determine the candidate central word; Input the candidate central word into a word vector generation model to obtain a word vector of the candidate central word, and extract the central word based on the cosine similarity between the word vector of the candidate central word and the vector representation of the query text; The calculation method for determining the weight of the target participle in the corresponding intent category based on the number of occurrences of the target participle in all query texts of the corresponding intent category, the number of all query texts of the corresponding intent category, and the number of occurrences of the target participle in all query texts is as follows: Among them, TF-CR(w,c) represents the weight of the target word w to the intent category c, w c represents the target word w in the query text of intent category c, |w c | represents the number of occurrences of the target word w in all query texts of intent category c, N c represents the number of all query texts with intent category c, and |w| represents the number of occurrences of the target word w in all query texts.
2. The method according to claim 1, characterized in that: The text data of the sound includes a sound title, a sound introduction, sound keywords, and a custom tag.
3. The method according to claim 1, characterized in that Determining the target word segmentation of the query text according to the obtained word segmentation includes: Remove the stop words from the obtained segmentations and use the remaining segmentations as the target segmentations.
4. The method according to claim 1, characterized in that: The domain vocabulary knowledge base is constructed based on the sound text data, including: The domain vocabulary is mined based on the sound text data, and the domain vocabulary is integrated with the pre-built basic vocabulary to obtain the domain vocabulary knowledge base.
5. The method according to claim 1, characterized in that The method of extracting the central word based on the cosine similarity between the word vector of the candidate central word and the vector representation of the query text includes: Calculate the cosine similarity between the word vector of the candidate central word and the vector representation of the query text; If the cosine similarity between the word vector of the candidate central word and the vector representation of the query text is less than the preset value, the candidate central word corresponding to the maximum cosine similarity is selected as the central word; If the cosine similarity between the word vectors of some candidate central words and the vector representation of the query text is greater than or equal to a preset value, the candidate central word corresponding to the cosine similarity greater than or equal to the preset value is selected as the central word.
6. A central word extraction device, characterized in that: include: An acquisition module is used to acquire the query text input by the user, the user's click behavior data on the query result corresponding to the query text, and the text data of the user's click sound; A query node data generation module is used to generate query node data based on query text, click behavior data, and voice text data; A target word segmentation determination module is used to perform word segmentation processing on the query text and determine the target word segmentation of the query text according to the obtained word segmentation; A word vector generation module, used for inputting the target word segmentation into a word vector generation model to obtain a word vector of the target word segmentation; The word vector generation model is obtained by training a preset model, and the training data of the word vector generation model is constructed based on the query node data; A query text vector representation determination module is used to identify the query intent based on the query text; Determine the weight of the target word in the corresponding intent category based on the number of occurrences of the target word in all query texts of the corresponding intent category, the number of all query texts of the corresponding intent category, and the number of occurrences of the target word in all query texts; Perform weighted summation on the word vectors corresponding to all target words in the query text to obtain the vector representation of the query text; A knowledge base construction module is used to construct a domain vocabulary knowledge base based on the sound text data; A candidate core word determination module is used to perform part-of-speech tagging on the target word segmentation to determine the candidate core word; A central word extraction module is used to input the candidate central word into a word vector generation model to obtain a word vector of the candidate central word, and extract the central word based on the cosine similarity between the word vector of the candidate central word and the vector representation of the query text; The calculation method for determining the weight of the target participle in the corresponding intent category based on the number of occurrences of the target participle in all query texts of the corresponding intent category, the number of all query texts of the corresponding intent category, and the number of occurrences of the target participle in all query texts is as follows: Among them, TF-CR(w,c) represents the weight of the target word w to the intent category c, w c represents the target word w in the query text of intent category c, |w c | represents the number of occurrences of the target word w in all query texts of intent category c, N c represents the number of all query texts with intent category c, and |w| represents the number of occurrences of the target word w in all query texts.
7. The device according to claim 6, characterized in that The knowledge base construction module includes: The domain vocabulary mining submodule is used to mine domain vocabulary based on sound text data; The lexicon fusion submodule is used to fuse the domain lexicon with the pre-built basic lexicon to obtain the domain vocabulary knowledge base.
8. The device according to claim 6, characterized in that The central word extraction module comprises: A calculation submodule is used to calculate the cosine similarity between the word vector of the candidate central word and the vector representation of the query text; The judgment submodule is used to select the candidate central word corresponding to the maximum cosine similarity as the central word if the cosine similarity between the word vector of the candidate central word and the vector representation of the query text is less than a preset value; if the cosine similarity between the word vector of some candidate central words and the vector representation of the query text is greater than or equal to the preset value, then select the candidate central word corresponding to the cosine similarity greater than or equal to the preset value as the central word.
9. A computer device, characterized in that: The computer device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the central word extraction method as described in any one of claims 1-5.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the central word extraction method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Object query method and device based on keyword extraction, medium and equipment
CN112818091A
Keyword extraction method and device, computer equipment and storage medium
CN113656429A
Keyword extraction method and apparatus, storage medium, and electronic apparatus
US20200081977A1
Conversation intention recognition method, apparatus, computer device, and storage medium
WO2021042904A1
