Word cloud creation method, device, medium, and product based on natural language processing
By combining natural language processing technology, we can obtain the frequency of occurrence, emotional scores and topic relevance in the text, filter out keywords and generate word clouds, solving the problems of inefficiency and insufficient representation of traditional word cloud generation tools, and achieving more accurate and vivid text information display.
Patent Information
- Application Number
- CN202410492845.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-23
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-04-23
AI Technical Summary
Traditional word cloud generation tools are cumbersome and inefficient when processing large amounts of text data. They rely solely on TF-IDF technology and cannot effectively reflect the emotions and themes of the text, resulting in the keywords being unrepresentative.
By combining natural language processing technology, we can obtain the frequency of occurrence, emotional scores and topic relevance in the text, filter out keywords, and generate word clouds.
The generated word cloud can better reflect the key points, emotional tendencies and themes of the text content, making it easier for the audience to understand and absorb information.
Smart Images

Figure CN118194863B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data visualization technology, and in particular to a word cloud creation method, device, medium, and product based on natural language processing. Background Art
[0002] Word cloud is a popular data visualization technology that represents text through visual graphics of "keyword cloud layer" or "keyword rendering" to show the key information of the text. Usually, the most obvious word in the word cloud is also the most important keyword in the text. Traditional word cloud generation tools usually require users to manually enter text and set parameters, which is cumbersome and inefficient when processing large amounts of text data. In addition, these tools usually only use TF-IDF technology to obtain keywords, and have limited capabilities in sentiment analysis and topic identification, resulting in the final keywords being unrepresentative and unable to reflect the views of the text well. Summary of the invention
[0003] In view of this, the embodiments of the present disclosure provide a word cloud creation method, device, medium, and product based on natural language processing, which can generate a word cloud that effectively reflects the key points, emotional tendencies, and themes of the text content by combining the frequency of occurrence, sentiment score, and relevance.
[0004] In a first aspect, the embodiments of the present disclosure provide a word cloud creation method based on natural language processing, which adopts the following technical solutions:
[0005] Preprocess the text to obtain multiple valid words;
[0006] Obtaining the frequency of occurrence of the effective words in the text;
[0007] Performing sentiment analysis on the effective words to obtain sentiment scores of the effective words;
[0008] Obtaining the relevance of the effective words to the subject of the text;
[0009] Filter out keywords from the valid words based on the occurrence frequency, the sentiment score, and the relevance;
[0010] A word cloud is generated based on the keywords.
[0011] Optionally, performing sentiment analysis on the effective words to obtain sentiment scores includes:
[0012] Assigning a basic score to the effective words based on the sentiment dictionary;
[0013] Obtaining the occurrence position of the valid word in the text;
[0014] Obtaining the weight of the effective word based on the occurrence position;
[0015] A sentiment score is obtained based on the weight and the base score.
[0016] Optionally, obtaining the relevance between the effective words and the subject of the text includes:
[0017] Extracting the topic of the text based on a topic model;
[0018] Convert the topic into a first word vector;
[0019] Convert the valid words into second word vectors;
[0020] The relevance is obtained based on the first word vector and the second word vector.
[0021] Optionally, the filtering out keywords from the valid words based on the occurrence frequency, the sentiment score, and the relevance includes:
[0022] Obtaining a comprehensive score based on the occurrence frequency, the sentiment score, and the relevance;
[0023] When the comprehensive score is greater than a preset score threshold, the valid word is selected as the keyword.
[0024] Optionally, the word cloud creation method based on natural language processing further includes:
[0025] Constructing an information list for each of the keywords, wherein the information list is used to store context information of the keywords;
[0026] In response to a first trigger instruction for the keyword in the word cloud, an information list of the keyword is displayed.
[0027] Optionally, the word cloud creation method based on natural language processing further includes:
[0028] Constructing a network relationship graph for each of the keywords;
[0029] In response to a second trigger instruction for the keywords in the word cloud, a network relationship diagram of the keywords is displayed.
[0030] Optionally, the word cloud creation method based on natural language processing further includes:
[0031] Constructing a parameter setting list for each of the keywords, wherein the parameter setting list is used to modify the parameters of the keyword;
[0032] In response to a third trigger instruction for the keyword in the word cloud, a parameter setting list of the keyword is displayed.
[0033] In a second aspect, the embodiment of the present disclosure further provides a word cloud creation system based on natural language processing, which adopts the following technical solutions:
[0034] A text preprocessing module is used to preprocess the text to obtain multiple valid words;
[0035] An occurrence frequency acquisition module, used to acquire the occurrence frequency of the effective words in the text;
[0036] A sentiment score acquisition module is used to perform sentiment analysis on the effective words to obtain the sentiment scores of the effective words;
[0037] A relevance acquisition module, used to acquire the relevance between the effective words and the subject of the text;
[0038] A keyword screening module, used to screen out keywords from the valid words based on the occurrence frequency, the sentiment score, and the relevance;
[0039] The word cloud generation module is used to generate a word cloud based on the keywords.
[0040] In a third aspect, the embodiments of the present disclosure further provide a computer device, which adopts the following technical solution:
[0041] The computer device comprises:
[0042] at least one processor; and,
[0043] a memory communicatively connected to the at least one processor; wherein,
[0044] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the above-mentioned word cloud creation methods based on natural language processing.
[0045] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute any of the above-mentioned word cloud creation methods based on natural language processing.
[0046] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program / instruction, which implements the steps of any of the above methods when executed by a processor.
[0047] The natural language processing-based word cloud creation method provided by the embodiment of the present disclosure breaks down a text into multiple valid words, and then obtains the occurrence frequency, sentiment score, and relevance of the valid words to the topic, selects keywords based on the occurrence frequency, sentiment score, and relevance, and then generates a word cloud with the keywords. Compared with the traditional method of generating a word cloud using only the occurrence frequency, the method also combines sentiment analysis and topic relevance analysis. Among them, by performing sentiment analysis on the valid words, the word cloud can present more sentiment information, making the word cloud more vivid and rich. By performing topic relevance analysis on the valid words, the word cloud can be more closely displayed around the text topic, and the correlation between words is enhanced. Combined with the objective indicator of occurrence frequency, the importance or prevalence of the valid words in the text is objectively reflected, and finally the generated word cloud can better reflect the key points, sentiment tendency and theme of the text content, making it easier for the audience to understand and absorb the text information.
[0048] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following preferred embodiments are specifically cited and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0050] Figure 1 A flowchart of a word cloud creation method based on natural language processing provided in an embodiment of the present disclosure;
[0051] Figure 2 A schematic diagram of a process for obtaining a sentiment score provided in an embodiment of the present disclosure;
[0052] Figure 3 A principle block diagram of a word cloud creation system based on natural language processing provided in an embodiment of the present disclosure;
[0053] Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0054] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0055] It should be clear that the following embodiments of the present disclosure are described by specific specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other in the absence of conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0056] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0057] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0058] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.
[0059] Reference Figure 1 The present invention provides a word cloud creation method based on natural language processing, comprising the following steps:
[0060] S1: preprocess the text to obtain multiple valid words;
[0061] S2: Get the frequency of occurrence of valid words in the text;
[0062] S3: Perform sentiment analysis on valid words to obtain sentiment scores of valid words;
[0063] S4: Obtain the relevance of effective words to the topic of the text;
[0064] S5: Filter out keywords from valid words based on frequency of occurrence, sentiment score, and relevance;
[0065] S6: Generate word cloud based on keywords.
[0066] Since the effective words that appear frequently in the text are not necessarily related to the topic, if only the effective words that appear frequently are selected as the keywords of the word cloud, it may cause the keywords in the word cloud to lack representativeness and fail to represent the topic of the article well. In addition, the effective words that appear frequently do not necessarily have good emotions, resulting in the word cloud failing to reflect the viewpoint of the text well.
[0067] The disclosed word cloud creation method based on natural language processing can screen out more relevant and meaningful keywords by preprocessing the text, calculating the frequency of occurrence, analyzing sentiment and analyzing the relevance of the topic, thereby generating a higher quality word cloud. Among them, the frequency of occurrence is an objective indicator of effective words, which is not affected by subjective factors, and can therefore objectively reflect the importance or prevalence of effective words in the text; by performing sentiment analysis on effective words to increase the sentiment dimension, more sentiment information can be presented in the word cloud, making the word cloud more vivid and rich; considering the relevance of effective words to the text theme, the word cloud can be displayed more closely around the text theme, enhancing the relevance between words.
[0068] In summary, this method can reduce the noise words in the word cloud by filtering keywords based on frequency of occurrence, sentiment score and relevance, making the word cloud clearer and easier to understand. The generated word cloud can better reflect the key points, sentiment tendencies and themes of the text content, improve the interpretability of the word cloud, and make it easier for the audience to understand and absorb information.
[0069] In S1, preprocessing includes at least one of word segmentation, stop word removal, and lemmatization. In natural language processing, word segmentation is the process of cutting a continuous text string into meaningful words or symbol sequences; stop word removal is the process of removing frequently appearing words that usually have no actual meaning or have little information from the text to reduce the complexity of processing and noise interference; stop word removal can improve the efficiency and accuracy of text processing and analysis. Lemmatization is the process of restoring the various forms of words to their original forms, usually by changing the words into roots or stems, which helps to merge words with the same meaning but different forms in the text into a unified form to reduce the interference of word variants on text analysis. For example, words with forms such as "running", "runs", and "ran" are restored to their roots "run". Lemmatization can be achieved by stemming or lemmatization, which are slightly different, but the purpose is to normalize words with different forms.
[0070] In S2, the TF (Term Frequency) method is used to obtain the occurrence frequency of each valid word in the text.
[0071] Reference Figure 2 The flowchart of obtaining sentiment scores is shown. In S3, "performing sentiment analysis on valid words to obtain sentiment scores" specifically includes the following steps:
[0072] S21: Assign basic scores to valid words based on the sentiment dictionary;
[0073] S22: Obtain the occurrence position of valid words in the text;
[0074] S23: Obtaining weights of valid words based on the occurrence positions;
[0075] S24: Obtain a sentiment score based on the weight and the base score.
[0076] In S21, a sentiment dictionary is constructed, valid words are matched with sentiment words in the sentiment dictionary, and the scores of the successfully matched sentiment words are used as the basic scores of the valid words.
[0077] In S22, the title, opening paragraph, middle paragraph and closing paragraph of the text are determined, wherein the title of the text is usually the first sentence of the entire text and appears in a specific tag or format, such as <h1>Labels or fonts that are clearly different from the body paragraphs; for the body part, the opening paragraph is the first natural paragraph of the text, the closing paragraph is the last natural paragraph of the text, and the remaining paragraphs are the middle paragraphs of the text. Query the position of each valid word in the text, and the position of occurrence includes at least one of the title, opening paragraph, middle paragraph, and closing paragraph.
[0078] In S23, the weight of a valid word is Z, and its calculation formula is as follows:
[0079] Z = A + B + C + D;
[0080]
[0081] Wherein, A, B, C, and D are all component weight values of valid words; a, b, c, and d are all preset values, a>b>d>c or a>b=d>c.
[0082] In S24, the product of the weight of the effective word and the basic score is taken as the sentiment score of the effective word.
[0083] In S4, stop words, punctuation marks, numbers and other non-text elements are removed from the text, and then the text is lemmatized or stemmed to ensure clean and standardized text data. The text data is analyzed using a topic model (such as an LDA (Latent Dirichlet Allocation) model), the topic in the text data is identified, the topic is converted into a first word vector, and the valid words are converted into a second word vector. A pre-trained semantic model (such as BERT) or a word vector model (such as Word2Vec, GloVe, etc.) is used to calculate the correlation between the first word vector and the second word vector, which is the correlation between the valid words and the topic of the text.
[0084] In S5, a comprehensive score is obtained based on the frequency of occurrence, sentiment score, and relevance, and it is determined whether the comprehensive score is greater than a preset score threshold; if so, a valid word is selected as a keyword; if not, no valid word is selected as a keyword. The comprehensive score is P, and its calculation formula is as follows:
[0085] P = q1*P1+q2*|P2|+q3*P3;
[0086] In the formula, q1, q2, and q3 are all preset weights; P1 is the frequency of occurrence of effective words in the text; P2 is the sentiment score of the effective words; and P3 is the relevance of the effective words to the theme of the text. In the present disclosure, P1∈[0,1], where 0 indicates that the effective words do not appear, and 1 indicates the proportion of effective words in all words in the text; P2∈[-1,1], where -1 indicates negative sentiment, 0 indicates neutral sentiment, and 1 indicates positive sentiment; P3∈[0,1], where 0 indicates irrelevance and 1 indicates complete relevance.
[0087] In S6, formulate the display rules of keywords in the word cloud, set the parameters of keywords according to the display rules, and then generate the word cloud with keywords. For example, the frequency of occurrence of keywords in the text determines the font size of keywords displayed in the word cloud; the sentiment score of keywords determines the font color of keywords displayed in the word cloud. Keywords with positive emotions can be displayed in warm tones, and keywords with negative emotions can be displayed in cold tones. This makes the word cloud more intuitively reflect the emotional information in the text; the relevance of keywords to the theme of the text determines the position of keywords displayed in the word cloud. The higher the relevance, the closer the keyword display position is to the center of the word cloud.
[0088] Optionally, the present invention supports users to upload their favorite pictures and generate a background of a word cloud based on the content of the pictures. Specifically, the pictures uploaded by users are read, and the pictures are resized, cropped, grayed, binarized, etc., so as to better extract the picture content later, and an image segmentation algorithm (such as threshold segmentation, color segmentation or edge detection) or a machine learning model (such as a CNN convolutional neural network) is applied to extract the main content area in the picture as the background of the word cloud.
[0089] In order to make the word cloud blend better with the background, the color, font and transparency of each keyword in the word cloud can be adjusted. You can also use image fusion techniques such as overlay, blending mode, and background blur processing to process the word cloud and the background to ensure that each keyword in the word cloud can be naturally combined with the background. Among them, overlay refers to stacking two or more layers together in a certain order. When the word cloud is fused with the background, the word cloud layer can be superimposed on the background so that the text of the word cloud appears on the surface of the background. This method allows a certain interaction between the word cloud and the background; blending mode means that when processing the image, you can select different blending modes for the layer (such as soft light and color deepening) to change the way they interact and make the word cloud blend better with the background; background blur processing is to adjust the degree of background blur effect to make the word cloud blend more naturally with the background. The above methods can be adjusted according to specific needs and effects to achieve the perfect fusion of the word cloud and the background, presenting a visually impactful and attractive effect.
[0090] Furthermore, an information list is constructed for each keyword, the context information of each keyword is extracted, and the context information is stored in the corresponding information list. When the user points the mouse to a keyword in the word cloud, the word cloud generation software will detect that the mouse is hovering over the keyword, triggering the first trigger instruction for the keyword, and in response to the first trigger instruction, the information list of the keyword is displayed in the display interface, and the displayed information list does not cover the word cloud as much as possible. If the content of the context information exceeds the visible area of the information list, the information list is adjusted to a drop-down list. Among them, the context information can be the paragraph where the keyword is located, or it can be the short sentence where the keyword is located. The scope of the context information can also be adjusted according to specific needs. For example, if the content of the text is all comments on the store, the context information can be the comment where the keyword is located.
[0091] Furthermore, a network relationship diagram is constructed for each keyword. When a user clicks a keyword in the word cloud with a mouse, a second trigger instruction for the keyword is triggered. In response to the second trigger instruction, the network relationship diagram of the keyword is displayed in the display interface.
[0092] The present disclosure provides an implementable method for constructing a network relationship graph, which is as follows: traverse keywords, record the keyword being traversed as the first keyword, record the keywords other than the first keyword as the second keyword, and obtain the association value between the first keyword and the second keyword. Specifically, the association value between the first keyword and the second keyword can be calculated by the co-occurrence relationship, semantic relevance, etc. of the first keyword and the second keyword. The word vector model (such as Word2Vec, GloVe, etc.) can also be used to learn the distributed representation of words, and then the association value between the first keyword and the second keyword is measured by the similarity between the vectors. Determine whether the association value is greater than the preset association value threshold; if so, retain the second keyword; if not, do not retain the second keyword. After all the second keywords are filtered through the association value, the first keyword is used as the central node and the second keyword is used as the edge node. The edge node is connected to the central node to form a network relationship graph of the first keyword. In addition to the above method, other methods can also be selected according to actual needs to complete the construction of the network relationship graph.
[0093] Furthermore, a parameter setting list is constructed for each keyword. When the user double-clicks a keyword in the word cloud with the mouse, a third trigger instruction for the keyword is triggered. In response to the third trigger instruction, the parameter setting list of the keyword is displayed in the display interface. The user can modify various parameters of the keyword through the parameter setting list. The parameters include but are not limited to font style, size, color, transparency, rotation angle, animation effect, and shadow effect.
[0094] Furthermore, a general setting list is constructed. When the user right-clicks anywhere on the word cloud with the mouse, the fourth trigger instruction is triggered. In response to the fourth trigger instruction, the general setting list is displayed in the display interface. The user can use the general setting list to modify the parameters of the word cloud and the background. For example, the fonts of all keywords in the word cloud and the spacing between keywords can be uniformly modified, and the background transparency, blur effect, fill color, border color, border thickness, border shape and other parameters can be modified.
[0095] Furthermore, when the user triple-clicks a keyword in the word cloud with the mouse, a fifth trigger instruction for the keyword is triggered. In response to the fifth trigger instruction, the text is opened and the text display interface is jumped to, and the keyword is retrieved from the text using the search function, and the keyword is highlighted. The present disclosure supports cooperation with office software (e.g., Microsoft Office), using the office software to open the text, and using the search function of the office software itself to complete the highlighting of the keyword in the text.
[0096] In the above method, by making full use of the mouse's click function to display the information list and network relationship diagram, setting the parameters of the word cloud and background, and restoring the position of keywords in the text, it can not only enrich the word cloud processing function, but also enable users to query more effective text information.
[0097] Reference Figure 3 The present disclosure provides a word cloud creation system based on natural language processing, comprising:
[0098] The text preprocessing module 101 is used to preprocess the text to obtain a plurality of valid words;
[0099] The occurrence frequency acquisition module 102 is used to acquire the occurrence frequency of valid words in the text;
[0100] The sentiment score obtaining module 103 is used to perform sentiment analysis on the effective words to obtain the sentiment scores of the effective words;
[0101] A relevance acquisition module 104 is used to acquire the relevance between the effective words and the subject of the text;
[0102] The keyword screening module 105 is used to screen out keywords from valid words based on the frequency of occurrence, sentiment score, and relevance;
[0103] The word cloud generation module 106 is used to generate a word cloud based on keywords.
[0104] The natural language processing-based word cloud creation system further includes an information list construction module, which is used to construct an information list for each keyword, the information list being used to store context information of the keyword; and in response to a first trigger instruction for a keyword in the word cloud, displaying the information list of the keyword.
[0105] The natural language processing-based word cloud creation system further includes a network relationship diagram construction module. The network relationship diagram construction module is used to construct a network relationship diagram for each keyword and display the network relationship diagram of the keyword in response to a second trigger instruction for the keyword in the word cloud.
[0106] The natural language processing-based word cloud creation system further includes a parameter setting list construction module. The parameter setting list construction module is used to construct a parameter setting list for each keyword, and the parameter setting list is used to modify the parameters of the keyword; in response to the third trigger instruction for the keyword in the word cloud, the parameter setting list of the keyword is displayed.
[0107] The natural language processing-based word cloud creation system further includes a total setting list construction module. The total setting list construction module is used to construct a total setting list, which is used to modify the parameters of the word cloud in a unified manner and modify the parameters of the background; in response to the fourth trigger instruction of the word cloud, the total setting list is displayed.
[0108] The natural language processing-based word cloud creation system further includes a text display keyword module, which is used to respond to the fifth trigger instruction for the keyword in the word cloud, open the text and jump to the text display interface, use the search function to retrieve the keyword in the text, and highlight the keyword.
[0109] The various variations and specific examples of the word cloud creation method based on natural language processing provided above are also applicable to the word cloud creation system based on natural language processing provided in the present disclosure. Through the above detailed description of the word cloud creation method based on natural language processing, those skilled in the art can clearly know the implementation method of the word cloud creation system based on natural language processing. For the sake of brevity of the specification, it will not be described in detail here.
[0110] The computer device according to the embodiment of the present disclosure includes a memory and a processor. The memory is used to store non-temporary computer-readable instructions. Specifically, the memory may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may, for example, include a read-only memory (ROM), a hard disk, a flash memory, etc.
[0111] The processor may be a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and may control other components in the computer device to perform desired functions. In one embodiment of the present disclosure, the processor is used to run the computer-readable instructions stored in the memory, so that the computer device performs all or part of the steps of the word cloud creation method based on natural language processing in the aforementioned embodiments of the present disclosure.
[0112] Those skilled in the art should be able to understand that in order to solve the technical problem of how to obtain a good user experience, the present embodiment may also include well-known structures such as a communication bus and an interface, and these well-known structures should also be included in the protection scope of the present disclosure.
[0113] like Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure is shown, which is a schematic diagram of the structure of a computer device suitable for implementing the embodiment of the present disclosure. Figure 4 The computer device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0114] like Figure 4 As shown, the computer device may include a processor (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage device into a random access memory (RAM). In the RAM, various programs and data required for the operation of the computer device are also stored. The processor, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0115] Typically, the following devices can be connected to the I / O interface: input devices such as sensors or visual information acquisition devices; output devices such as display screens; storage devices such as tapes, hard disks, etc.; and communication devices. The communication device can allow the computer device to communicate with other devices (such as edge computing devices) wirelessly or by wire to exchange data. Figure 4 A computer device having various devices is shown, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0116] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processor, all or part of the steps of the word cloud creation method based on natural language processing of the embodiment of the present disclosure are executed.
[0117] For detailed description of this embodiment, reference may be made to the corresponding descriptions in the aforementioned embodiments, which will not be repeated here.
[0118] According to the computer-readable storage medium of the embodiment of the present disclosure, non-transitory computer-readable instructions are stored thereon. When the non-transitory computer-readable instructions are executed by a processor, all or part of the steps of the word cloud creation method based on natural language processing of the aforementioned embodiments of the present disclosure are executed.
[0119] The above-mentioned computer-readable storage media include, but are not limited to: optical storage media (e.g., CD-ROM and DVD), magneto-optical storage media (e.g., MO), magnetic storage media (e.g., magnetic tape or mobile hard disk), media with built-in rewritable non-volatile memory (e.g., memory card) and media with built-in ROM (e.g., ROM box).
[0120] For detailed description of this embodiment, reference may be made to the corresponding descriptions in the aforementioned embodiments, which will not be repeated here.
[0121] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0122] In the present disclosure, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. The block diagrams of the devices, devices, equipment, and systems involved in the present disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be recognized by those skilled in the art, these devices, devices, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, meaning "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The word "such as" used here refers to the phrase "such as but not limited to", and can be used interchangeably with it.
[0123] Additionally, as used herein, "or" used in a list of items beginning with "at least one" indicates a disjunctive list, so that, for example, a list of "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not mean that the example described is preferred or better than other examples.
[0124] It should also be noted that in the system and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0125] Various changes, substitutions, and modifications of the techniques described herein may be made without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of the present disclosure is not limited to the specific aspects of the processes, machines, manufactures, compositions of events, means, methods, and actions described above. Currently existing or later to be developed processes, machines, manufactures, compositions of events, means, methods, or actions that perform substantially the same functions or achieve substantially the same results as the corresponding aspects described herein may be utilized. Thus, the appended claims include such processes, machines, manufactures, compositions of events, means, methods, or actions within their scope.
[0126] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0127] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.< / h1>
Claims
1. A word cloud creation method based on natural language processing, characterized in that: include: Preprocess the text to obtain multiple valid words; Obtaining the frequency of occurrence of the effective words in the text; Performing sentiment analysis on the effective words to obtain sentiment scores of the effective words; Obtaining the relevance of the effective words to the subject of the text; Filter out keywords from the valid words based on the occurrence frequency, the sentiment score, and the relevance; generating a word cloud based on the keywords; The performing sentiment analysis on the effective words to obtain sentiment scores includes: Assigning a basic score to the effective words based on the sentiment dictionary; Obtaining the occurrence position of the valid word in the text; Obtaining the weight of the effective word based on the occurrence position; Obtaining a sentiment score based on the weight and the base score; Wherein, assigning a basic score to the effective words based on the sentiment dictionary includes: Construct a sentiment dictionary, match the valid words with the sentiment words in the sentiment dictionary, and use the score of the successfully matched sentiment words as the basic score of the valid words; Wherein, obtaining the occurrence position of the valid word in the text includes: Determine the title, opening paragraph, middle paragraph, and closing paragraph of the text; Querying the occurrence position of each valid word in the text, wherein the occurrence position includes at least one of a title, an opening paragraph, a middle paragraph, and an ending paragraph; The weight of the effective word is Z, and the calculation formula is as follows: Z = A + B + C + D; Wherein, A, B, C, and D are all weight values of valid words; a, b, c, and d are all preset values, a>b>d>c or a>b=d>c; Wherein, obtaining the sentiment score based on the weight and the basic score includes: The product of the weight of the effective word and the basic score is taken as the sentiment score of the effective word; The word cloud creation method based on natural language processing also includes: Constructing a parameter setting list for each of the keywords, wherein the parameter setting list is used to modify the parameters of the keyword; In response to a third trigger instruction for the keyword in the word cloud, a parameter setting list of the keyword is displayed.
2. The word cloud creation method based on natural language processing according to claim 1 is characterized in that: The obtaining of the relevance between the effective words and the subject of the text includes: Extracting the topic of the text based on a topic model; Convert the topic into a first word vector; Convert the valid words into second word vectors; The relevance is obtained based on the first word vector and the second word vector.
3. The word cloud creation method based on natural language processing according to claim 1 is characterized in that: The step of selecting keywords from the valid words based on the occurrence frequency, the sentiment score, and the relevance includes: Obtaining a comprehensive score based on the occurrence frequency, the sentiment score, and the relevance; When the comprehensive score is greater than a preset score threshold, the valid word is selected as the keyword.
4. The word cloud creation method based on natural language processing according to claim 1, characterized in that: Also includes: Constructing an information list for each of the keywords, wherein the information list is used to store context information of the keyword; In response to a first trigger instruction for the keyword in the word cloud, an information list of the keyword is displayed.
5. The word cloud creation method based on natural language processing according to claim 1, characterized in that: Also includes: Constructing a network relationship diagram for each of the keywords; In response to a second trigger instruction for the keywords in the word cloud, a network relationship diagram of the keywords is displayed.
6. A computer device, characterized in that: The computer device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the word cloud creation method based on natural language processing as described in any one of claims 1-5.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which are used to enable a computer to execute the word cloud creation method based on natural language processing as described in any one of claims 1-5.
8. A computer program product comprising computer instructions, characterized in that: When the computer instruction is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Multi-language emotional data processing and classifying method and system based on key sentences
CN103995853A
Automatic analysis scheme for mass text data
CN108536762A
Topic content aggregation analysis method based on TF-IDF and domain dictionary
CN110110047A