Keyword extraction method, device, equipment and computer-readable storage medium

By calculating the criticality of keywords in the second text and splicing consecutive keywords, the problem of inaccurate keyword extraction in the prior art is solved and the accuracy of retrieval is improved.

CN114186012BActive Publication Date: 2024-10-22SOUNDAI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202111505008.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-10
Publication Date
2024-10-22
Estimated Expiration
2041-12-10

AI Technical Summary

Technical Problem

In the existing keyword extraction technology, the extracted keywords are not accurate enough, resulting in reduced retrieval accuracy and lack of practical significance.

Method used

By extracting candidate keywords from the first text, a second text lacking these keywords is generated, the criticality of each candidate keyword in the second text is calculated, and the final keyword extraction result is determined based on the criticality, and incorrect keywords are deleted. Keywords that meet the conditions, and consecutive keywords are spliced ​​into new keywords.

Benefits of technology

It improves the accuracy of keyword extraction, avoids meaningless keyword extraction results, and enhances the accuracy of retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114186012B_ABST
    Figure CN114186012B_ABST
Patent Text Reader

Abstract

The present application discloses a keyword extraction method, device, equipment and computer-readable storage medium, and belongs to the field of computer technology. The method includes: extracting at least one candidate keyword from a first text; obtaining at least one second text based on the first text, wherein each second text lacks a candidate keyword in the first text, and the number of second texts is determined based on the number of candidate keywords; determining the criticality of the candidate keywords missing from each second text; based on the criticality, determining the keyword extraction result from at least one candidate keyword. The present application determines the criticality of the candidate keywords, which can reflect whether the corresponding keywords have practical significance, and then determines the keyword extraction result from at least one candidate keyword based on the criticality of the candidate keywords missing from each second text, thereby avoiding the keyword extraction result being meaningless and improving the accuracy of keyword extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a keyword extraction method, device, equipment, and computer-readable storage medium. Background Art

[0002] With the development of computer technology, keyword extraction technology is often used, and the application scenarios of keyword extraction technology are becoming more and more numerous. For example, keyword extraction can be applied to targeted retrieval.

[0003] In the related art, the content in the text that cannot be matched with the dictionary or the rules can be directly extracted as the keyword extraction result.

[0004] However, the methods provided in the related art may have problems such as the keyword extraction results being meaningless, and therefore, the extracted keywords are not accurate enough, further reducing the accuracy of the retrieval. Summary of the invention

[0005] The embodiments of the present application provide a keyword extraction method, device, equipment and computer-readable storage medium, which can be used to solve the problems in the related art. The technical solution is as follows:

[0006] On the one hand, an embodiment of the present application provides a keyword extraction method, the method comprising:

[0007] extracting at least one candidate keyword from the first text;

[0008] Acquire at least one second text based on the first text, wherein each second text in the at least one second text lacks a candidate keyword in the first text, and the number of the second texts is determined based on the number of the candidate keywords;

[0009] Determining the criticality of the candidate keywords missing from each second text;

[0010] Based on the criticality of the candidate keywords missing from the respective second texts, a keyword extraction result is determined from the at least one candidate keyword.

[0011] In a possible implementation, determining a keyword extraction result from the at least one candidate keyword based on the criticality of the candidate keywords missing from each second text includes:

[0012] When the criticality of any keyword meets the reference condition, the keyword is deleted from the at least one candidate keyword, and the remaining keywords are used as keyword extraction results.

[0013] In a possible implementation, determining a keyword extraction result from the at least one candidate keyword based on the criticality of the candidate keywords missing from each second text includes:

[0014] When the criticality of any keyword meets the reference condition, the keyword is deleted from the at least one candidate keyword to obtain remaining keywords;

[0015] When any two of the remaining keywords are continuous in the first text, the remaining keywords that are continuous and meet the splicing condition are spliced ​​to obtain a spliced ​​keyword;

[0016] The concatenated keywords, the remaining keywords that are continuous and do not meet the concatenation condition, and the remaining keywords that are discontinuous in the first text are taken as the keyword extraction results.

[0017] In a possible implementation, determining the criticality of the candidate keywords missing from each second text includes:

[0018] Determining the similarity between each second text and the first text, wherein the similarity between any second text and the first text is used to indicate the criticality of the candidate keyword missing from any second text;

[0019] The step of determining a keyword extraction result from the at least one candidate keyword based on the criticality of the candidate keywords missing from each second text comprises:

[0020] Based on the similarity between each of the second texts and the first text, a keyword extraction result is determined from the at least one candidate keyword.

[0021] In a possible implementation, extracting at least one candidate keyword from the first text includes:

[0022] Determine a word segmentation result of the first text, wherein the word segmentation result includes at least one word segmentation;

[0023] Stop words are filtered out from the word segmentation results, and the word segmentation results that are not filtered out are used as the candidate keywords.

[0024] In a possible implementation, the stop words include at least one of words that hit a stop word list, words that are matched by a dictionary, and words that are matched by a rule.

[0025] In another aspect, a keyword extraction device is provided, the device comprising:

[0026] An extraction module, used to extract at least one candidate keyword from the first text;

[0027] an acquisition module, configured to acquire at least one second text based on the first text, wherein each second text in the at least one second text lacks a candidate keyword in the first text, and the number of the second texts is determined based on the number of the candidate keywords;

[0028] A first determination module is used to determine the criticality of each candidate keyword missing from the second text;

[0029] The second determination module is used to determine a keyword extraction result from the at least one candidate keyword based on the criticality of the candidate keywords missing from each of the second texts.

[0030] In a possible implementation, the second determination module is configured to delete any keyword from the at least one candidate keyword when the criticality of any keyword meets the reference condition, and use the remaining keywords as keyword extraction results.

[0031] In a possible implementation, the second determination module is used to delete any keyword from the at least one candidate keyword to obtain the remaining keywords when the criticality of any keyword meets the reference condition; when any two of the remaining keywords are continuous in the first text, the continuous remaining keywords that meet the splicing condition are spliced ​​to obtain the spliced ​​keywords; the spliced ​​keywords, the continuous remaining keywords that do not meet the splicing condition, and the discontinuous remaining keywords in the first text are used as the keyword extraction results.

[0032] In a possible implementation, the first determination module is used to determine the similarity between each second text and the first text, and the similarity between any second text and the first text is used to indicate the criticality of the candidate keyword missing from any second text;

[0033] The second determination module is used to determine a keyword extraction result from the at least one candidate keyword based on the similarity between each of the second texts and the first text.

[0034] In a possible implementation, the extraction module is used to determine a segmentation result of the first text, the segmentation result including at least one segmentation word; filter out stop words from the segmentation result, and use the segmentation results that are not filtered out as the candidate keywords.

[0035] In a possible implementation, the stop words include at least one of words that hit a stop word list, words that are matched by a dictionary, and words that are matched by a rule.

[0036] On the other hand, a computer device is provided, comprising a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor so that the computer device implements any of the above-mentioned keyword extraction methods.

[0037] On the other hand, a computer-readable storage medium is provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor so that a computer implements any of the above-mentioned keyword extraction methods.

[0038] On the other hand, a computer program product or a computer program is also provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs any of the above keyword extraction methods.

[0039] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:

[0040] The present application determines the criticality of candidate keywords, which can reflect whether the corresponding keywords have practical significance, and then determines the keyword extraction result from at least one candidate keyword based on the criticality of the candidate keywords missing from each second text, thereby avoiding the keyword extraction result being meaningless and improving the accuracy of keyword extraction. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] 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 creative work.

[0042] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present application;

[0043] Figure 2 is a flow chart of a keyword extraction method provided in an embodiment of the present application;

[0044] Figure 3 is a flow chart of a keyword extraction method provided in an embodiment of the present application;

[0045] Figure 4 is a schematic diagram of a keyword extraction device provided in an embodiment of the present application;

[0046] Figure 5is a structural schematic diagram of a computer device provided in an embodiment of the present application;

[0047] Figure 6 It is a structural diagram of another computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0049] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0050] This application embodiment provides a keyword extraction method, please refer to Figure 1 , which shows a schematic diagram of an implementation environment of the method provided in an embodiment of the present application. The implementation environment may include: a terminal 11 and a server 12.

[0051] Among them, the terminal 11 can obtain the first text based on the keyword extraction method provided in the embodiment of the present application, perform keyword extraction on the first text to obtain a keyword extraction result, and send the keyword extraction result to the server 12. The server 12 can search the keyword extraction result. Alternatively, the server 12 can obtain the first text based on the keyword extraction method provided in the embodiment of the present application, perform keyword extraction on the first text to obtain a keyword extraction result, and send the keyword extraction result to the terminal 11, and the terminal 11 can search based on the keyword extraction result. Alternatively, the terminal 11 can obtain the first text based on the keyword extraction method provided in the embodiment of the present application, perform keyword extraction on the first text to obtain a keyword extraction result, and search for the keyword extraction result. Alternatively, the server 12 can obtain the first text based on the keyword extraction method provided in the embodiment of the present application, perform keyword extraction on the first text to obtain a keyword extraction result, and search for the keyword extraction result.

[0052] Optionally, the terminal 11 can be any electronic product that can interact with the user through one or more methods such as keyboard, touchpad, touch screen, remote control, voice interaction or handwriting device, such as PC (Personal Computer), mobile phone, smart phone, PDA (Personal Digital Assistant), wearable device, PPC (Pocket PC), tablet computer, smart car machine, smart TV, smart speaker, etc. The server 12 can be a server, a server cluster composed of multiple servers, or a cloud computing service center. The terminal 11 establishes a communication connection with the server 12 through a wired or wireless network.

[0053] Those skilled in the art should understand that the above-mentioned terminal 11 and server 12 are only examples, and other existing or future terminals or servers that are applicable to the present application should also be included in the protection scope of the present application and are included here by reference.

[0054] Based on the above Figure 1 In the implementation environment shown, the present application embodiment provides a keyword extraction method, taking the method applied to a terminal as an example. Figure 2 As shown, the method provided in the embodiment of the present application may include the following steps 201 to 204.

[0055] In step 201, at least one candidate keyword is extracted from a first text.

[0056] The embodiments of the present application do not limit the method for obtaining the first text. For example, in a voice control scenario, the execution subject of the embodiments of the present application may be a terminal with a voice recognition function, and the first text may be a text obtained by any terminal with a voice recognition function recognizing the voice of the interactive object of the terminal. For another example, in a web page retrieval scenario, the execution subject of the embodiments of the present application may be a terminal capable of performing web page retrieval, and the first text may be a text input by the interactive object of the terminal through a text input method or other methods. The embodiments of the present application do not limit the content of the first text either. For example, the method is applied to a voice control scenario, and the content of the first text may be an instruction issued to the terminal by the interactive object of any terminal with a voice recognition function. For another example, the method may be applied to a web page retrieval scenario, and the content of the first text may be the content that needs to be retrieved by the interactive object of any terminal capable of performing web page retrieval.

[0057] In an exemplary embodiment, after the terminal obtains the first text, it is necessary to perform subsequent operations corresponding to the content according to the content contained in the first text. For example, in a voice control scenario, the first text can be applied to the news field in this scenario. The first text can be "play a news related to unmanned driving". After the terminal obtains the first text, it is necessary to retrieve news related to unmanned driving and play the retrieved news. In order for the terminal to perform corresponding searches based on the content of the first text, the first text can be matched based on a dictionary or rules to extract the matched content. However, the content in the first text that cannot be matched with the dictionary or rules may also contain content that needs to be retrieved, so it is also necessary to extract keywords from the first text. The terminal can perform corresponding retrieval and playback operations after analyzing the matched content and keyword extraction results.

[0058] Optionally, extracting at least one candidate keyword from the first text includes: determining a segmentation result of the first text, the segmentation result including at least one segmentation word; filtering out stop words from the segmentation result, and using the segmentation results that are not filtered out as candidate keywords.

[0059] Exemplarily, the first text may be segmented using the Jieba word segmentation tool to obtain a segmentation result, or the first text may be segmented using the StanfordNLP (Stanford Natural Language Processing) word segmentation tool to obtain a segmentation result. The present application embodiment does not limit the method for determining the segmentation result of the first text. In one possible implementation, when the first text is "play a news related to unmanned driving", the Jieba word segmentation tool is used to segment the first text, and the segmentation results obtained may be "play", "one", "unmanned", "driving", "related", "of", and "news".

[0060] In a possible implementation, stop words include at least one of the participles that hit the stop word list, the participles matched by the dictionary, and the participles matched by the rule. The embodiment of the present application does not limit the stop word list, and the stop word list can be determined according to experience or implementation scenarios. For example, the stop word list may include "for example", "other", "of", "bar", etc., which do not contain words of substantial content. When it is necessary to search the content in the first text, the participles that can hit the stop word list in the word segmentation result corresponding to the first text have little effect on reducing the search scope, so the above-mentioned participles can be filtered out. In a possible implementation, when the first text is "playing a news related to unmanned driving", the word segmentation result determined based on the first text can be "play", "one", "unmanned", "driving", "related", "of", "news". The participles that hit the stop word list in the word segmentation result can be "related" and "of".

[0061] The embodiments of the present application do not limit the dictionary and rules. Both the dictionary and the rules can be determined based on experience or implementation scenarios. For example, when the dictionary or rules are applied in the news field, the dictionary or rules may include words such as place names such as "China" and "Jilin", time words such as "2021" and "October", and news type words such as "Finance" and "Entertainment".

[0062] Optionally, when it is necessary to search for the content in the first text, if there are segmented words that can be matched by the above-mentioned dictionary or rules in the word segmentation results corresponding to the first text, the segmented words can be directly used as keywords without the need to extract them through the method provided in the embodiments of the present application. In one possible implementation, when the first text is "play a news related to unmanned driving", the segmented words determined based on the first text may be "play", "one", "unmanned", "driving", "related", "of", and "news". In the segmented words, the segmented words that can be matched by dictionaries or rules may be "play", "one", and "news". In summary, the first text of "play a news related to unmanned driving" is segmented and stop words are filtered out, and the candidate keywords obtained may be "unmanned" and "driving".

[0063] In step 202, at least one second text is acquired based on the first text, wherein each second text in the at least one second text lacks a candidate keyword in the first text, and the number of the second texts is determined based on the number of the candidate keywords.

[0064] In a possible implementation, a candidate keyword can be deleted from each of the first texts to obtain a second text, and the number of the second texts is consistent with the number of candidate keywords. The first text is "play a news related to unmanned driving", and the candidate keywords determined based on the first text can be "unmanned" and "driving", then the second text obtained based on the first text can be "play a news related to driving" and "play a news related to unmanned". Among them, the second text "play a news related to driving" is obtained by deleting the candidate keyword "unmanned" from the first text; the second text "play a news related to unmanned" is obtained by deleting the candidate keyword "driving" from the first text.

[0065] In step 203, the criticality of each candidate keyword missing from the second text is determined.

[0066] Exemplarily, determining the criticality of the candidate keywords missing from each second text includes: determining the similarity between each second text and the first text, wherein the similarity between any second text and the first text is used to indicate the criticality of the candidate keywords missing from any second text.

[0067] Optionally, the higher the similarity, the more similar the second text corresponding to the similarity is to the first text, and therefore the lower the criticality of the candidate keywords missing from the second text corresponding to the similarity. The embodiment of the present application does not limit the method for calculating the similarity between each second text and the first text. Exemplarily, a first text vector can be obtained based on the first text (for example, the first text vector is a one-dimensional vector), and corresponding second text vectors can be obtained based on each second text (for example, each second text vector is a one-dimensional vector). After obtaining the first text vector and each second text vector, the distance between the first text vector and each second text vector can be calculated based on a distance formula, and the corresponding similarity is determined based on the distance, and any distance corresponds to the distance between any second text vector and the first text.

[0068] In some embodiments, the first text may be input into an ALBERT (A Lite Bidirectional Encoder Representations from Transformers, a pre-trained model) model to obtain a corresponding first text vector, and each second text may be input into the ALBERT model to obtain a corresponding second text vector. After obtaining the first text vector and each second text vector, the distance between the first text vector and each second text vector may be calculated based on a distance formula, and the larger the distance, the lower the corresponding similarity.

[0069] The embodiment of the present application does not limit the distance formula, for example, the distance formula may be a formula for calculating the Euclidean distance. Based on the formula for calculating the Euclidean distance, the Euclidean distance between the first text vector and each second text vector may be obtained, and finally the corresponding similarity may be determined based on the obtained Euclidean distance. The larger the Euclidean distance, the lower the corresponding similarity, and the higher the criticality of the candidate keyword missing from the second text corresponding to the similarity.

[0070] In step 204, a keyword extraction result is determined from at least one candidate keyword based on the criticality of the candidate keywords missing from each second text.

[0071] The embodiments of the present application do not limit the method of indicating the criticality. Optionally, similarity can be used to indicate the criticality. In this manner, based on the criticality of the candidate keywords missing from each second text, a keyword extraction result is determined from at least one candidate keyword, including: based on the similarity between each second text and the first text, a keyword extraction result is determined from at least one candidate keyword.

[0072] Exemplarily, based on the criticality of the candidate keywords missing from each second text, determining the keyword extraction result from at least one candidate keyword includes but is not limited to the following two methods.

[0073] Method 1: Based on the criticality of the candidate keywords missing from each second text, determine the keyword extraction result from at least one candidate keyword, including: when the criticality of any keyword meets the reference condition, delete any keyword from at least one candidate keyword and use the remaining keywords as the keyword extraction result.

[0074] The embodiment of the present application does not limit the reference condition, and the condition can be set according to experience or implementation scenarios. For example, when indicating the criticality of the candidate keywords missing from each second text based on the similarity between each second text and the first text, the reference condition can be set based on the similarity. For example, a similarity threshold can be set. When any similarity is higher than the similarity threshold, it proves that the second text corresponding to the similarity is highly similar to the first text, so that the criticality of the candidate keywords missing from the second text corresponding to the similarity meets the reference condition. Therefore, the candidate keywords missing from the second text corresponding to the similarity can be deleted, and the remaining keywords are used as keyword extraction results.

[0075] The embodiment of the present application does not limit the similarity threshold. In a possible implementation, the similarity is determined based on the distance. The larger the distance, the lower the corresponding similarity. Therefore, the similarity threshold can be determined based on the distance threshold. In response to any distance being greater than the distance threshold, the similarity corresponding to the distance satisfies the similarity threshold, and the candidate keyword corresponding to the distance can be deleted from at least one candidate keyword to obtain the remaining keywords, and then the keyword extraction result can be determined from the remaining keywords. The embodiment of the present application does not limit the distance threshold. The distance threshold can be set according to experience or implementation scenarios. For example, if the distance is set to the Euclidean distance, the distance threshold corresponding to the Euclidean distance can be set to 10. When the Euclidean distance between any second text vector and the first text vector is less than 10, the similarity of the candidate keyword missing from the second text corresponding to the second text vector satisfies the similarity threshold, and the candidate keyword missing from the second text is deleted to obtain the remaining keywords.

[0076] Method 2: Based on the criticality of the candidate keywords missing from each second text, determine the keyword extraction result from at least one candidate keyword, including: when the criticality of any keyword meets the reference condition, delete any keyword from at least one candidate keyword to obtain the remaining keywords; when any two remaining keywords are continuous in the first text, splice the continuous remaining keywords that meet the splicing condition to obtain the spliced ​​keywords; use the spliced ​​keywords, the continuous remaining keywords that do not meet the splicing condition, and the discontinuous remaining keywords in the first text as the keyword extraction results.

[0077] In an exemplary embodiment, the criticality of the candidate keywords missing from each second text can be indicated based on the similarity between each second text and the first text. Therefore, based on the criticality of the candidate keywords missing from each second text, a keyword extraction result is determined from at least one candidate keyword, including: when the similarity corresponding to any keyword is higher than a similarity threshold, any keyword is deleted from at least one candidate keyword to obtain remaining keywords; when any two remaining keywords are continuous in the first text, the continuous remaining keywords that meet the splicing conditions are spliced ​​to obtain the spliced ​​keywords; the spliced ​​keywords, the continuous remaining keywords that do not meet the splicing conditions, and the discontinuous remaining keywords in the first text are used as keyword extraction results.

[0078] In a possible implementation, the first text is "play a news related to unmanned driving technology", and the candidate keywords corresponding to the first text can be "unmanned", "driving", and "technology". The remaining keywords obtained by the method provided in the embodiment of the present application can be "unmanned" and "driving". Since the remaining keywords "unmanned" and "driving" are continuous in the first text, and "unmanned" and "driving" can form the word "unmanned driving", the word is semantically smooth and meets the splicing condition. Therefore, "unmanned" and "driving" can be spliced ​​to obtain a spliced ​​keyword "unmanned driving". At this time, there are no discontinuous remaining keywords in the remaining keywords, so "unmanned driving" can be used as a keyword extraction result. The embodiment of the present application does not limit the splicing condition. The splicing condition can be set based on experience or implementation scenarios. For example, when any two consecutive remaining keywords are semantically smooth after splicing, the splicing condition is met. In some embodiments, NLP (Natural Language Processing) analysis can be used to determine whether any two consecutive remaining keywords are semantically smooth after splicing.

[0079] In another possible implementation, the first text is "play a soothing classical pastoral music", and the remaining keywords obtained by the method provided in the embodiment of the present application may be "soothing", "classical", and "pastoral". Since the remaining keywords "classical" and "pastoral" are continuous in the first text, and "classical" and "pastoral" can form the word "classical pastoral", the word has smooth semantics and meets the splicing conditions. Therefore, "classical" and "pastoral" can be spliced ​​to obtain a spliced ​​keyword "classical pastoral". At this time, there is a discontinuous remaining keyword "soothing" in the remaining keywords, so "soothing" and "classical pastoral" can be used as keyword extraction results.

[0080] In another possible implementation, the first text is "play a hypnotic piano piece", and the remaining keywords obtained by the method provided in the embodiment of the present application may be "hypnosis" and "piano". Although the remaining keywords "hypnosis" and "piano" are continuous in the first text, the "hypnosis piano" composed of "hypnosis" and "piano" is not semantically smooth and does not meet the splicing condition, so "hypnosis" and "piano" are not spliced. Therefore, the keyword extraction result may be two continuous remaining keywords "hypnosis" and "piano" that do not meet the splicing condition.

[0081] After obtaining the keyword extraction results, you can search based on the keyword extraction results to obtain the search results. For example, the first text is "play a news related to driverless technology", and the keyword extraction result is "driverless", then you can search based on the keyword "driverless", which improves the accuracy of the search.

[0082] The technical solution provided in the embodiment of the present application can determine the criticality of candidate keywords, which can reflect whether the corresponding keywords have practical significance. Then, based on the criticality of the candidate keywords missing from each second text, the keyword extraction result is determined from at least one candidate keyword, thereby avoiding the keyword extraction result being meaningless and improving the accuracy of keyword extraction.

[0083] See also Figure 3 , an embodiment of the present application provides a keyword extraction method, which may include the following steps 301 to 306.

[0084] 301, extract at least one candidate keyword from the first text. The implementation of this step can refer to the above step 201, which will not be repeated here.

[0085] 302, obtaining at least one second text based on the first text, wherein each second text in the at least one second text lacks a candidate keyword in the first text. The implementation of this step can refer to the above step 202, which will not be repeated here.

[0086] 303, determine the similarity between each second text and the first text. The similarity between any second text and the first text is used to indicate the criticality of the candidate keywords missing from any second text. The implementation of this step can be found in the above step 203, which will not be repeated here.

[0087] 304, in response to any similarity being greater than a similarity threshold, the candidate keywords corresponding to the similarity are deleted to obtain the remaining keywords. The implementation of this step can refer to the above step 204, which will not be repeated here.

[0088] 305, concatenate the remaining keywords that are continuous in the first text to obtain a concatenated keyword; based on the concatenated keyword, the remaining keywords that are continuous and do not meet the concatenation condition, and the remaining keywords that are discontinuous in the first text as keyword extraction results. The implementation method of this step can refer to the above step 204, which will not be repeated here.

[0089] 306, search based on the keyword extraction result to obtain the search result. The implementation of this step can refer to the above step 204, which will not be repeated here.

[0090] See also Figure 4 , an embodiment of the present application provides a keyword extraction device, the device comprising:

[0091] An extraction module 401 is used to extract at least one candidate keyword from the first text;

[0092] An acquisition module 402 is configured to acquire at least one second text based on the first text, wherein each second text in the at least one second text lacks a candidate keyword in the first text, and the number of the second texts is determined based on the number of the candidate keywords;

[0093] A first determination module 403 is used to determine the criticality of each candidate keyword missing from the second text;

[0094] The second determination module 404 is configured to determine a keyword extraction result from at least one candidate keyword based on the criticality of the candidate keywords missing from each second text.

[0095] In a possible implementation, the second determination module 404 is configured to delete any keyword from at least one candidate keyword when the criticality of any keyword meets the reference condition, and use the remaining keywords as keyword extraction results.

[0096] In one possible implementation, the second determination module 404 is used to delete any keyword from at least one candidate keyword to obtain remaining keywords when the criticality of any keyword meets the reference condition; when any two remaining keywords are continuous in the first text, the continuous remaining keywords that meet the splicing condition are spliced ​​to obtain the spliced ​​keywords; the spliced ​​keywords, the continuous remaining keywords that do not meet the splicing condition, and the discontinuous remaining keywords in the first text are used as keyword extraction results.

[0097] In a possible implementation, the first determination module 403 is used to determine the similarity between each second text and the first text, and the similarity between any second text and the first text is used to indicate the criticality of the candidate keyword missing from any second text;

[0098] The second determination module 404 is configured to determine a keyword extraction result from at least one candidate keyword based on the similarity between each second text and the first text.

[0099] In a possible implementation, the extraction module 401 is used to determine a segmentation result of the first text, where the segmentation result includes at least one segmentation word; filter out stop words from the segmentation result, and use the segmentation results that are not filtered out as candidate keywords.

[0100] In a possible implementation, the stop words include at least one of words that hit a stop word list, words that are matched by a dictionary, and words that are matched by a rule.

[0101] The technical solution provided in the embodiment of the present application can determine the criticality of candidate keywords, which can reflect whether the corresponding keywords have practical significance. Then, based on the criticality of the candidate keywords missing from each second text, the keyword extraction result is determined from at least one candidate keyword, thereby avoiding the keyword extraction result being meaningless and improving the accuracy of keyword extraction.

[0102] It should be noted that the device provided in the above embodiment only uses the division of the above functional modules as an example to implement its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and their specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0103] Figure 5 It is a structural diagram of a computer device provided in an embodiment of the present application. The computer device may be a server. The server may have relatively large differences due to different configurations or performances. It may include one or more processors (Central Processing Units, CPU) 501 and one or more memories 502, wherein at least one computer program is stored in the one or more memories 502, and the at least one computer program is loaded and executed by the one or more processors 501, so that the server implements the keyword extraction method provided in the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server may also include other components for implementing device functions, which will not be repeated here.

[0104] Figure 6 1 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The device may be a terminal, such as a smart phone, a tablet computer, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer or a desktop computer. The terminal may also be referred to as a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.

[0105] Typically, the terminal includes: a processor 601 and a memory 602 .

[0106] The processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 601 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 601 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0107] The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 602 is used to store at least one instruction, which is used to be executed by the processor 601 so that the terminal implements the keyword extraction method provided in the method embodiment of the present application.

[0108] In some embodiments, the terminal may further optionally include: a peripheral device interface 603 and at least one peripheral device. The processor 601, the memory 602 and the peripheral device interface 603 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 603 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 604, a display screen 605, a camera assembly 606, an audio circuit 607, a positioning assembly 608 and a power supply 609.

[0109] The peripheral device interface 603 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 601 and the memory 602. In some embodiments, the processor 601, the memory 602, and the peripheral device interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 601, the memory 602, and the peripheral device interface 603 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0110] The radio frequency circuit 604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 604 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 604 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 604 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 604 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 604 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.

[0111] The display screen 605 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 605 is a touch display screen, the display screen 605 also has the ability to collect touch signals on the surface or above the surface of the display screen 605. The touch signal can be input to the processor 601 as a control signal for processing. At this time, the display screen 605 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 605 can be one, set on the front panel of the terminal; in other embodiments, the display screen 605 can be at least two, respectively set on different surfaces of the terminal or in a folding design; in other embodiments, the display screen 605 can be a flexible display screen, set on a curved surface or a folding surface of the terminal. Even, the display screen 605 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 605 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc.

[0112] The camera assembly 606 is used to capture images or videos. Optionally, the camera assembly 606 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 606 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0113] The audio circuit 607 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 601 for processing, or input them into the radio frequency circuit 604 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 601 or the radio frequency circuit 604 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 607 may also include a headphone jack.

[0114] The positioning component 608 is used to locate the current geographical location of the terminal to implement navigation or LBS (Location Based Service). The positioning component 608 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system, Russia's Grenas system or the European Union's Galileo system.

[0115] The power supply 609 is used to power various components in the terminal. The power supply 609 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 609 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0116] In some embodiments, the terminal further includes one or more sensors 610 , including but not limited to: an acceleration sensor 611 , a gyroscope sensor 612 , a pressure sensor 613 , a fingerprint sensor 614 , an optical sensor 615 , and a proximity sensor 616 .

[0117] The acceleration sensor 611 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal. For example, the acceleration sensor 611 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 601 can control the display screen 605 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 611. The acceleration sensor 611 can also be used for collecting game or user motion data.

[0118] The gyroscope sensor 612 can detect the body direction and rotation angle of the terminal, and the gyroscope sensor 612 can cooperate with the acceleration sensor 611 to collect the user's 3D actions on the terminal. The processor 601 can implement the following functions based on the data collected by the gyroscope sensor 612: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0119] The pressure sensor 613 can be set in the side frame of the terminal and / or the lower layer of the display screen 605. When the pressure sensor 613 is set in the side frame of the terminal, the user's holding signal of the terminal can be detected, and the processor 601 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 613. When the pressure sensor 613 is set in the lower layer of the display screen 605, the processor 601 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 605. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0120] The fingerprint sensor 614 is used to collect the user's fingerprint, and the processor 601 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 614, or the fingerprint sensor 614 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 601 authorizes the user to perform relevant sensitive operations, which include unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 614 can be set on the front, back, or side of the terminal. When a physical button or a manufacturer logo is set on the terminal, the fingerprint sensor 614 can be integrated with the physical button or the manufacturer logo.

[0121] The optical sensor 615 is used to collect the ambient light intensity. In one embodiment, the processor 601 can control the display brightness of the display screen 605 according to the ambient light intensity collected by the optical sensor 615. Specifically, when the ambient light intensity is high, the display brightness of the display screen 605 is increased; when the ambient light intensity is low, the display brightness of the display screen 605 is reduced. In another embodiment, the processor 601 can also dynamically adjust the shooting parameters of the camera assembly 606 according to the ambient light intensity collected by the optical sensor 615.

[0122] The proximity sensor 616, also known as a distance sensor, is usually arranged on the front panel of the terminal. The proximity sensor 616 is used to collect the distance between the user and the front of the terminal. In one embodiment, when the proximity sensor 616 detects that the distance between the user and the front of the terminal is gradually decreasing, the processor 601 controls the display screen 605 to switch from the screen-on state to the screen-off state; when the proximity sensor 616 detects that the distance between the user and the front of the terminal is gradually increasing, the processor 601 controls the display screen 605 to switch from the screen-off state to the screen-on state.

[0123] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the terminal, and may include more or less components than those shown in the figure, or combine certain components, or adopt a different component arrangement.

[0124] In an exemplary embodiment, a computer device is also provided, the computer device comprising a processor and a memory, wherein at least one computer program is stored in the memory. The at least one computer program is loaded and executed by one or more processors, so that the computer device implements any of the above keyword extraction methods.

[0125] In an exemplary embodiment, a computer-readable storage medium is further provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor of a computer device to enable the computer to implement any of the above keyword extraction methods.

[0126] In one possible implementation, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0127] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs any of the above-mentioned keyword extraction methods.

[0128] It should be understood that the "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0129] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A keyword extraction method, characterized in that: The method comprises: extracting at least one candidate keyword from the first text; Acquire at least one second text based on the first text, wherein each second text in the at least one second text lacks a candidate keyword in the first text, and the number of the second texts is determined based on the number of the candidate keywords; Determining the criticality of the candidate keywords missing from each second text; When the criticality of any keyword meets the reference condition, deleting the any keyword from the at least one candidate keyword to obtain remaining keywords; When any two of the remaining keywords are continuous in the first text, the remaining keywords that are continuous and meet the splicing condition are spliced ​​to obtain a spliced ​​keyword; The concatenated keywords, the remaining keywords that are continuous and do not meet the concatenation condition, and the remaining keywords that are discontinuous in the first text are taken as keyword extraction results.

2. The method according to claim 1, characterized in that: The step of determining the criticality of the candidate keywords missing from each second text includes: Determining the similarity between each second text and the first text, wherein the similarity between any second text and the first text is used to indicate the criticality of the candidate keyword missing from any second text; The step of determining a keyword extraction result from the at least one candidate keyword based on the criticality of the candidate keywords missing from each second text comprises: Based on the similarity between each of the second texts and the first text, a keyword extraction result is determined from the at least one candidate keyword.

3. The method according to claim 1 or 2, characterized in that: The step of extracting at least one candidate keyword from the first text includes: Determine a word segmentation result of the first text, wherein the word segmentation result includes at least one word segmentation; Stop words are filtered out from the word segmentation results, and the word segmentation results that are not filtered out are used as the candidate keywords.

4. The method according to claim 3, characterized in that The stop words include at least one of words that hit a stop word list, words that are matched by a dictionary, and words that are matched by a rule.

5. A keyword extraction device, characterized in that: The device comprises: An extraction module, used to extract at least one candidate keyword from the first text; an acquisition module, configured to acquire at least one second text based on the first text, wherein each second text in the at least one second text lacks a candidate keyword in the first text, and the number of the second texts is determined based on the number of the candidate keywords; A first determination module is used to determine the criticality of each candidate keyword missing from the second text; The second determination module is used to delete any keyword from the at least one candidate keyword to obtain remaining keywords when the criticality of any keyword meets the reference condition; when any two of the remaining keywords are continuous in the first text, splice the remaining keywords that are continuous and meet the splicing condition to obtain spliced ​​keywords; and use the spliced ​​keywords, the remaining keywords that are continuous and do not meet the splicing condition, and the remaining keywords that are discontinuous in the first text as keyword extraction results.

6. A computer device, characterized in that: The computer device includes a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor, so that the computer device implements the keyword extraction method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor so that a computer implements the keyword extraction method according to any one of claims 1 to 4.

8. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the keyword extraction method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Keyword extraction method and device, electronic equipment and medium

    CN110852100A

  • Text clustering method and device, electronic equipment and computer storage medium

    CN111930883A

  • Keyword extraction method and device, storage medium and equipment

    CN112257424A

  • Keyword extraction method and device, electronic equipment and storage medium

    CN112650830A

  • Keyword extraction method and device, and storage medium and electronic device

    WO2019076191A1