Word cloud image generation method, word cloud image generation device and readable storage medium

By extracting text information from the data to be predicted, using a large language model to generate and evaluate word clouds, and performing cluster analysis, the problem that word clouds in the existing technology cannot accurately summarize the full text, and effective words for non-text data are achieved Cloud generation.

CN118643170BActive Publication Date: 2024-11-15SHENZHEN SMARTCITY TECH DEV GRP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411118343.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-11-15
Estimated Expiration
2044-08-15

AI Technical Summary

Technical Problem

The existing word cloud generation methods cannot accurately summarize the full text content, and cannot generate word clouds for non-text data.

Method used

By extracting text information from the data to be predicted, using a large language model to generate word clouds, and performing word cloud evaluation and clustering analysis, a word cloud map can accurately reflect the content and meaning of the data.

Benefits of technology

The accurate summary of the full text content and significance of the predicted data is achieved, and the generated word cloud map displays different aspects and themes of the data more clearly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118643170B_ABST
    Figure CN118643170B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of electronic digital data processing, and in particular to a method for generating a word cloud diagram, a device for generating a word cloud diagram, and a readable storage medium. The method outputs a data upload interface to be predicted when entering the word cloud diagram generation process; after the data upload interface to be predicted receives the data to be predicted, the text information in the data to be predicted is extracted; the text information is input into the large language model as an input parameter of a large language model to obtain a word cloud corresponding to the data to be predicted; a word cloud evaluation operation is performed on the word cloud to obtain a word cloud evaluation result corresponding to the word cloud; when the word cloud evaluation result reaches a preset generation index, a cluster analysis is performed on the word cloud to generate a word cloud diagram corresponding to the word cloud. The method realizes the generation of a word cloud diagram that can accurately reflect the content and meaning of the full text of the data to be predicted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to a method for generating a word cloud graph, a device for generating a word cloud graph, and a readable storage medium. Background Art

[0002] As a visualization tool, word cloud is used to show the frequency or importance of words in text data. Word cloud presents keywords in an artistic way, by adjusting the size, color and layout of words to reflect the frequency or importance of words in the text.

[0003] Among the related word cloud generation methods, there are two main commonly used word cloud generation methods. One is to first collect and organize the text data for generating the word cloud diagram, then remove the irrelevant words and symbols in the collected text data, and perform word segmentation on the text data; then after the word segmentation, perform statistics on the frequency of occurrence of each word, and then generate a word cloud diagram based on the statistical data. The second is to use the pre-processed sample articles of various categories as the subject sample set, train the subject extraction model, and train the similarity detection model based on the subject sample set, then input the article to be detected into the trained subject extraction model, obtain the predicted keyword subject in the article to be detected, and then determine the similarity between the predicted keyword subjects based on the trained similarity detection model, and then calculate the weight of the predicted keyword subject according to the similarity, and then generate the word cloud of the article to be detected. In summary, in the relevant word cloud generation methods, the word cloud display is obtained from a known word cloud sample set or from the input article based on word frequency statistics. It only displays the content information of the article in a one-sided way and lacks a summary of the content of the full text. In other words, the generated word cloud cannot accurately summarize the full text, and it is impossible to generate a word cloud for data other than text form.

[0004] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of the present invention is to provide a method for generating a word cloud diagram, aiming to solve the problem that the word cloud generated in the related word cloud generation method cannot accurately summarize the full text.

[0006] To achieve the above object, the present invention provides a method for generating a word cloud graph, which comprises the following steps:

[0007] When entering the word cloud graph generation process, the interface for uploading the data to be predicted is output;

[0008] After the data to be predicted uploading interface receives the data to be predicted, extracting text information in the data to be predicted;

[0009] Inputting the text information into the large language model as an input parameter of the large language model to obtain a word cloud corresponding to the data to be predicted;

[0010] Performing a word cloud evaluation operation on the word cloud to obtain a word cloud evaluation result corresponding to the word cloud;

[0011] When the word cloud evaluation result reaches a preset generation index, a cluster analysis is performed on the word cloud to generate a word cloud graph corresponding to the word cloud.

[0012] Optionally, after the data to be predicted uploading interface receives the data to be predicted, the step of extracting text information from the data to be predicted includes:

[0013] Determining the data type of the data to be predicted;

[0014] When the data type is text data, reading the text data to obtain the text information;

[0015] When the data type is image data, a character recognition algorithm is called to extract character information in the image data, and the text information is generated based on the character information.

[0016] Optionally, the step of calling a character recognition algorithm to extract character information in the image data and generating the text information based on the character information includes:

[0017] Locating a text area in the image data, and segmenting the text area according to characters to obtain at least one character image;

[0018] extracting character information from the character image;

[0019] Matching a target character in a character library according to the character information;

[0020] The text information is generated according to the target character.

[0021] Optionally, the step of inputting the text information into the large language model as an input parameter of the large language model to obtain a word cloud corresponding to the data to be predicted includes:

[0022] Based on natural paragraphs, dividing the text information into paragraphs to obtain at least one text paragraph;

[0023] Calling an N-gram algorithm to perform N-gram encoding on the text paragraph to obtain a semantic encoding corresponding to the text paragraph;

[0024] Calling the cosine similarity algorithm to perform a similarity calculation on the semantic codes corresponding to the text paragraphs to obtain the semantic similarities between the text paragraphs;

[0025] Associating the text paragraphs whose semantic similarities are in the same preset similarity interval to obtain at least one text paragraph set;

[0026] Each of the text paragraph sets is input into the large language model to obtain a word cloud corresponding to the data to be predicted.

[0027] Optionally, the step of inputting each of the text paragraph sets into the large language model to obtain a word cloud corresponding to the data to be predicted includes:

[0028] Output prompt word input interface;

[0029] After the prompt word input interface receives the prompt word for generating the word cloud, the prompt word for generating the word cloud is input into the large language model, and each of the text paragraph sets is input into the large language model respectively;

[0030] The large language model performs a reading comprehension task on the text paragraph set based on the prompt words for generating the word cloud, and generates a word cloud corresponding to the data to be predicted.

[0031] Optionally, the step of performing a word cloud evaluation operation on the word cloud to obtain a word cloud evaluation result corresponding to the word cloud includes:

[0032] Calling a word cloud evaluation algorithm to evaluate the word cloud as a whole and obtain an overall word cloud evaluation result, wherein the overall word cloud evaluation result includes the accuracy of overall keyword extraction, the clarity of information and the applicability of text data;

[0033] The word cloud evaluation algorithm is called to evaluate the word cloud in segments to obtain segmented word cloud evaluation results, which include the accuracy of keyword extraction of paragraphs, the clarity of information and the applicability of text data.

[0034] Optionally, after the step of performing a word cloud evaluation operation on the word cloud to obtain a word cloud evaluation result corresponding to the word cloud, the step further includes:

[0035] Determine whether each evaluation index in the word cloud evaluation result reaches the corresponding preset generation index;

[0036] When all evaluation indicators in the word cloud evaluation result reach the corresponding preset generation indicators, performing the step of clustering analysis on the word cloud to generate a word cloud graph corresponding to the word cloud;

[0037] When there is at least one evaluation index in the word cloud evaluation result that fails to reach the preset generation index, the step of inputting the text information into the large language model as an input parameter of the large language model to obtain the word cloud corresponding to the data to be predicted is executed.

[0038] Optionally, when the word cloud evaluation result reaches a preset generation index, the step of performing cluster analysis on the word cloud to generate a word cloud graph corresponding to the word cloud includes:

[0039] Calling an N-gram algorithm to perform N-gram encoding on the word cloud to obtain a semantic encoding corresponding to the word cloud;

[0040] Calling a cluster analysis algorithm to perform cluster analysis on the semantic coding corresponding to the word cloud to obtain word cloud clusters corresponding to the word cloud;

[0041] The word cloud diagram is generated according to the word cloud clustering.

[0042] In addition, to achieve the above-mentioned purpose, the present invention also provides a word cloud map generation device, which includes a memory, a processor, and a word cloud map generation program stored in the memory and executable on the processor, and the word cloud map generation program, when executed by the processor, implements the steps of the word cloud map generation method as described above.

[0043] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a word cloud map generation program is stored. When the word cloud map generation program is executed by a processor, the steps of the word cloud map generation method as described above are implemented.

[0044] The embodiment of the present invention provides a method for generating a word cloud map, a device for generating a word cloud map, and a readable storage medium, by extracting text information from the data to be predicted and using it as an input parameter of a large language model to comprehensively determine the subject, keywords, and semantic features of the data to be predicted. The word cloud corresponding to the data to be predicted is generated by the large language model. A meaningful word cloud result can be obtained based on the semantic knowledge of the large language model. An evaluation operation is performed on the generated word cloud to obtain an evaluation result of the word cloud. When the word cloud evaluation result reaches a preset generation index, it means that the word cloud summarizes the data to be predicted well. Cluster analysis is performed on the generated word cloud, and a corresponding word cloud map is generated. Cluster analysis can aggregate word clouds with similar themes or semantics together so that the generated word cloud map can more clearly show different aspects and themes of the data to be predicted. Therefore, by using text information as an input parameter, generating a word cloud using the ability of a large language model, evaluating the word cloud, and clustering the word cloud, the key features and themes of the data to be predicted can be extracted and summarized, thereby realizing the generation of a word cloud map that can accurately reflect the content and meaning of the full text of the data to be predicted. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present invention, and together with the specification are used to explain the principles of the present invention. In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the description of the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.

[0046] Figure 1 A schematic diagram of the architecture of the hardware operating environment of a device for generating a word cloud diagram according to an embodiment of the present invention;

[0047] Figure 2 It is a flowchart of a first embodiment of a method for generating a word cloud graph of the present invention;

[0048] Figure 3 It is a flow chart of a second embodiment of a method for generating a word cloud graph of the present invention;

[0049] Figure 4 4 is a flow chart of a third embodiment of a method for generating a word cloud diagram of the present invention.

[0050] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0051] The method for generating a word cloud map of the present application includes: when entering the word cloud map generation process, outputting an interface for uploading data to be predicted; after the interface for uploading data to be predicted receives the data to be predicted, extracting text information from the data to be predicted; inputting the text information into the large language model as an input parameter of the large language model to obtain a word cloud corresponding to the data to be predicted; performing a word cloud evaluation operation on the word cloud to obtain a word cloud evaluation result corresponding to the word cloud; and when the word cloud evaluation result reaches a preset generation index, performing a cluster analysis on the word cloud to generate a word cloud map corresponding to the word cloud. The method realizes the generation of a word cloud map that can accurately reflect the content and meaning of the full text of the data to be predicted.

[0052] In order to better understand the above technical solution, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0053] As an implementation plan, Figure 1The present invention is a schematic diagram of the hardware operating environment of a device for generating a word cloud diagram according to an embodiment of the present invention.

[0054] like Figure 1 As shown, the device for generating the word cloud diagram may include: a processor 101, such as a core processor, a memory 102, and a communication bus 103. Among them, the memory 102 may be a high-speed random access memory (RAM) memory, or a stable non-volatile memory (NVM), such as a disk memory. The memory 102 may optionally be a storage device independent of the aforementioned processor 101. The communication bus 103 is used to realize the connection and communication between these components.

[0055] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the device for generating a word cloud diagram, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.

[0056] like Figure 1 As shown, the memory 102 as a computer-readable storage medium may include an operating system, a data storage module, a network communication module, a user interface module, and a word cloud diagram generation program.

[0057] exist Figure 1 In the device for generating a word cloud diagram shown in the figure, the processor 101 and the memory 102 may be arranged in the device for generating a word cloud diagram, and the device for generating a word cloud diagram calls the word cloud diagram generating program stored in the memory 102 through the processor 101, and performs the following operations:

[0058] When entering the word cloud graph generation process, the interface for uploading the data to be predicted is output;

[0059] After the data to be predicted uploading interface receives the data to be predicted, extracting text information in the data to be predicted;

[0060] Inputting the text information into the large language model as an input parameter of the large language model to obtain a word cloud corresponding to the data to be predicted;

[0061] Performing a word cloud evaluation operation on the word cloud to obtain a word cloud evaluation result corresponding to the word cloud;

[0062] When the word cloud evaluation result reaches a preset generation index, a cluster analysis is performed on the word cloud to generate a word cloud graph corresponding to the word cloud.

[0063] In one embodiment, the processor 101 may be used to call a word cloud diagram generation program stored in the memory 102, and perform the following operations:

[0064] Determining the data type of the data to be predicted;

[0065] When the data type is text data, reading the text data to obtain the text information;

[0066] When the data type is image data, a character recognition algorithm is called to extract character information in the image data, and the text information is generated based on the character information.

[0067] In one embodiment, the processor 101 may be used to call a word cloud diagram generation program stored in the memory 102, and perform the following operations:

[0068] Locating a text area in the image data, and segmenting the text area according to characters to obtain at least one character image;

[0069] extracting character information from the character image;

[0070] Matching a target character in a character library according to the character information;

[0071] The text information is generated according to the target character.

[0072] In one embodiment, the processor 101 may be used to call a word cloud diagram generation program stored in the memory 102, and perform the following operations:

[0073] Based on natural paragraphs, dividing the text information into paragraphs to obtain at least one text paragraph;

[0074] Calling an N-gram algorithm to perform N-gram encoding on the text paragraph to obtain a semantic encoding corresponding to the text paragraph;

[0075] Calling the cosine similarity algorithm to perform a similarity calculation on the semantic codes corresponding to the text paragraphs to obtain the semantic similarities between the text paragraphs;

[0076] Associating the text paragraphs whose semantic similarities are in the same preset similarity interval to obtain at least one text paragraph set;

[0077] Each of the text paragraph sets is input into the large language model to obtain a word cloud corresponding to the data to be predicted.

[0078] In one embodiment, the processor 101 may be used to call a word cloud diagram generation program stored in the memory 102, and perform the following operations:

[0079] Output prompt word input interface;

[0080] After the prompt word input interface receives the prompt word for generating the word cloud, the prompt word for generating the word cloud is input into the large language model, and each of the text paragraph sets is input into the large language model respectively;

[0081] The large language model performs a reading comprehension task on the text paragraph set based on the prompt words for generating the word cloud, and generates a word cloud corresponding to the data to be predicted.

[0082] In one embodiment, the processor 101 may be used to call a word cloud diagram generation program stored in the memory 102, and perform the following operations:

[0083] Calling a word cloud evaluation algorithm to evaluate the word cloud as a whole and obtain an overall word cloud evaluation result, wherein the overall word cloud evaluation result includes the accuracy of overall keyword extraction, the clarity of information and the applicability of text data;

[0084] The word cloud evaluation algorithm is called to evaluate the word cloud in segments to obtain segmented word cloud evaluation results, which include the accuracy of keyword extraction of paragraphs, the clarity of information and the applicability of text data.

[0085] In one embodiment, the processor 101 may be used to call a word cloud diagram generation program stored in the memory 102, and perform the following operations:

[0086] Determine whether each evaluation index in the word cloud evaluation result reaches the corresponding preset generation index;

[0087] When all evaluation indicators in the word cloud evaluation result reach the corresponding preset generation indicators, performing the step of clustering analysis on the word cloud to generate a word cloud graph corresponding to the word cloud;

[0088] When there is at least one evaluation index in the word cloud evaluation result that fails to reach the preset generation index, the step of inputting the text information into the large language model as an input parameter of the large language model to obtain the word cloud corresponding to the data to be predicted is executed.

[0089] In one embodiment, the processor 101 may be used to call a word cloud diagram generation program stored in the memory 102, and perform the following operations:

[0090] Calling an N-gram algorithm to perform N-gram encoding on the word cloud to obtain a semantic encoding corresponding to the word cloud;

[0091] Calling a cluster analysis algorithm to perform cluster analysis on the semantic coding corresponding to the word cloud to obtain word cloud clusters corresponding to the word cloud;

[0092] The word cloud diagram is generated according to the word cloud clustering.

[0093] Based on the hardware architecture of the above-mentioned word cloud map generation device, an embodiment of the word cloud map generation method of the present invention is proposed.

[0094] Reference Figure 2 In the first embodiment, the method for generating a word cloud diagram comprises the following steps:

[0095] Step S100: When entering the word cloud graph generation process, an interface for uploading data to be predicted is output.

[0096] In this embodiment, when a word cloud image generation instruction is received, the word cloud image generation process is entered, and an interface for uploading data to be predicted is output. It should be noted that the interface for uploading data to be predicted here includes a text data upload window and an image data upload window. The text data upload window is used to receive the data to be predicted of the text data type uploaded by the user; the image data upload window is used to receive the data to be predicted of the image data type uploaded by the user. In other words, the interface for uploading data to be predicted output here is used to receive the data to be predicted uploaded by the user.

[0097] Step S200: After the data to be predicted uploading interface receives the data to be predicted, text information in the data to be predicted is extracted.

[0098] In this embodiment, after receiving the data to be predicted on the data upload interface to be predicted, the data type of the received data to be predicted is first determined, and then the corresponding text information extraction strategy is called according to the data type of the data to be predicted to extract text information from the received data to be predicted.

[0099] Optionally, the received data to be predicted may be data to be predicted containing only text data type; may be data to be predicted containing only image data type; or may be data to be predicted containing both text data type and image data type.

[0100] Specifically, after receiving the data to be predicted on the data upload interface to be predicted, the data type of the received data to be predicted is determined. Then, when the data type of the data to be predicted is text data, a reading action is performed on the text data to obtain text information of the data to be predicted; when the data type of the data to be predicted is image data, a character recognition algorithm is called to extract character information in the image data, and the text information is generated based on the character information.

[0101] Optionally, the data type of the data to be predicted is determined by judging the file extension of the received data to be predicted. Exemplarily, assuming that the file extension of the received data to be predicted is ".txt", the data type of the received data to be predicted is determined to be text data; assuming that the file extension of the received data to be predicted is ".jpg" or ".png", the data type of the received data to be predicted is determined to be image data.

[0102] By selecting the corresponding text information extraction strategy according to the data type of the data to be predicted, it can be ensured that the text information can be accurately extracted and then used for subsequent word cloud generation.

[0103] Since different types of data require different methods to extract text information, by selecting the corresponding text information extraction method according to the data type of the data to be predicted, it can be ensured that the text information can be accurately extracted for subsequent word cloud generation.

[0104] As an optional implementation, after determining that the data type of the received data to be predicted is image data, a character recognition algorithm is called to locate the text area in the image data, and the text area is segmented by characters to obtain at least one character image. Then, character information is extracted from the character image, and a target character is matched in a character library according to the character information, and then the text information is generated according to the target character.

[0105] In this embodiment, the text area in the data to be predicted is segmented by locating a set through a character recognition algorithm, and then the character image of each character is extracted. The specific content of each character image, that is, the target character, is determined by matching the extracted character image with the predefined characters in the character library. By combining each target character in turn according to the matched target characters, complete text information is generated. The purpose of this is to extract the text information in the data to be predicted of the image data type, and then obtain the text information of the data to be predicted. Further, the method for generating a word cloud map has the ability to generate a word cloud map based on image data, thereby improving the applicability of the method for generating a word cloud map.

[0106] Step S300: inputting the text information into the large language model as an input parameter of the large language model to obtain a word cloud corresponding to the data to be predicted.

[0107] In this embodiment, after obtaining the text information of the data to be predicted, the text information is input into the large language model; after receiving the text information, the large language model outputs the word cloud corresponding to the data to be predicted based on the received text information. Optionally, the large language model here can be a Llama2 large model or a Llama large model.

[0108] Optionally, after extracting the text information of the data to be predicted, the text information is divided into paragraphs based on natural paragraphs to obtain at least one text paragraph. Then, the N-gram algorithm is called to perform N-gram encoding on the text paragraph to obtain the semantic encoding corresponding to the text paragraph; and the cosine similarity algorithm is called to perform similarity calculation on the semantic encoding corresponding to the text paragraph to obtain the semantic similarity between each of the text paragraphs. Then, the text paragraphs whose semantic similarities are in the same preset similarity interval are associated to obtain at least one text paragraph set; and each of the text paragraph sets is further input into the large language model to obtain the word cloud corresponding to the data to be predicted.

[0109] Specifically, based on the preset word unit length, after dividing the text paragraphs, an N-gram sequence is generated. For example, assuming the preset word unit length N=2, and the text paragraph is "I love natural language processing", the generated 2-gram sequence is "I love", "love natural", "natural language", "languageprocessing". In other words, the appearance of the Nth word is only related to the previous N-1 words, and is not related to any other words. Then, the generated N-gram sequence is converted into a numerical type of encoding, such as an integer index. Through the N-gram encoding process, the meaning encoding corresponding to each text paragraph can be obtained for further semantic similarity calculation. Among them, each N-gram sequence is a feature vector dimension.

[0110] The cosine similarity algorithm is expressed as: Cosine Similarity (A,B) = A·B / (|A|*|B|). A and B represent two feature vectors, and |A| and |B| represent the modulus of feature vectors A and B, respectively.

[0111] The purpose of dividing text information into paragraphs is to divide long text into smaller natural paragraphs so as to better understand the semantic information of each paragraph. By adopting the N-gram algorithm to encode the text paragraphs, the semantic information of the text paragraph is represented by capturing the combination of N consecutive words of different lengths. The semantic similarity between each text paragraph is calculated by the cosine similarity algorithm, and the text paragraphs with similar semantics are found and associated together to form a text paragraph set. By inputting each text paragraph set into the large language model, the corresponding word cloud is generated using the generation ability of the model. In other words, through the analysis and semantic understanding of the text information, with the help of the generation ability of the large language model, a word cloud corresponding to the data to be predicted is generated. The purpose of this is to improve the accuracy and coherence of the generated word cloud, and then reflect the characteristics and themes of the data to be predicted.

[0112] Furthermore, when each of the text paragraph sets is input into the large language model, a prompt word input interface is output. Then, after the prompt word for generating a word cloud is received on the prompt word input interface, the prompt word for generating a word cloud is input into the large language model, and each of the text paragraph sets is input into the large language model. The large language model performs a reading comprehension task on the text paragraph set based on the prompt word for generating a word cloud, and generates a word cloud corresponding to the data to be predicted.

[0113] By outputting the prompt word input interface, the user is allowed to input the prompt words required to generate the word cloud. The prompt words received for generating the word cloud are used as the input of the large language model to guide the model to generate a word cloud that meets expectations. By inputting the prompt words for generating the word cloud into the large language model and processing each text paragraph set separately, the reading comprehension task is performed on each text paragraph set according to the information of the prompt words and the semantic understanding ability of the context, and a word cloud corresponding to the data to be predicted is generated. The purpose of this is to generate a word cloud that meets the user's expectations through the text paragraph set and the prompt words input by the user under the analysis of the large language model, further enhancing the relevance and interpretability of the generated word cloud.

[0114] Step S400: performing a word cloud evaluation operation on the word cloud to obtain a word cloud evaluation result corresponding to the word cloud.

[0115] In this embodiment, after obtaining the word cloud of the data to be predicted, the keyword list of the word cloud and its corresponding weight are determined. The keyword list and the weight are used to perform word frequency statistics on the text information of the data to be predicted, and a word frequency statistical result is generated. Based on the word frequency statistical result, the accuracy of keyword extraction in the word cloud is evaluated to obtain the accuracy of keyword extraction. According to the layout of the word cloud, font size and other visualization effects, the clarity of the information of the word cloud is evaluated to obtain the clarity of the information. By calculating the similarity between the word cloud and the text information of the data to be predicted, the applicability of the text data of the word cloud is evaluated to obtain the applicability of the text data. Then, a word cloud evaluation result including the accuracy of keyword extraction, the clarity of information and the applicability of text data is obtained.

[0116] The keywords displayed in the word cloud should accurately reflect the important information of the text information of the data to be predicted. By counting the word frequency and comparing it with the text information of the data to be predicted, the accuracy of keyword extraction in the word cloud is evaluated to ensure that the word cloud can effectively convey the theme and content of the text. The visualization effect of the word cloud affects the user's understanding and cognition. By evaluating the clarity of the word cloud information, it is easier for users to obtain the key information of the text. By calculating the similarity between the word cloud and the text information of the data to be predicted, the applicability of the text data of the word cloud is evaluated to ensure that the word cloud can fully show the characteristics and meaning of the text information of the data to be predicted. By evaluating the word cloud and obtaining the word cloud evaluation results, it can be determined whether the word cloud meets the preset generation indicators. When the word cloud evaluation results meet the preset generation indicators, it means that the word cloud has good quality; by evaluating the word cloud, the advantages and disadvantages of the word cloud are comprehensively considered. The purpose of this is to determine whether the word cloud meets the preset generation indicators so as to decide whether further processing or adjustment is needed.

[0117] Step S500: When the word cloud evaluation result reaches a preset generation index, cluster analysis is performed on the word cloud to generate a word cloud graph corresponding to the word cloud.

[0118] In this embodiment, after obtaining the word cloud evaluation result, it is determined whether the word cloud evaluation result reaches the preset generation index. When the word cloud evaluation result reaches the preset generation index, cluster analysis is performed on the word cloud to generate a word cloud graph corresponding to the word cloud.

[0119] Among them, by determining whether the accuracy of keyword extraction in the word cloud evaluation result reaches the preset keyword extraction accuracy index, determining whether the clarity of information in the word cloud evaluation result reaches the preset information clarity index, and determining whether the applicability of text data in the word cloud evaluation result reaches the preset text data applicability index, it is determined whether the generated word cloud reaches the preset generation index. Optionally, only when all three aspects meet the standards, it is determined that the generated word cloud reaches the preset generation index.

[0120] Optionally, when it is determined that the word cloud evaluation result reaches a preset generation index, the N-gram algorithm is called to perform N-gram encoding on the word cloud to obtain the semantic encoding corresponding to the word cloud; then, the clustering analysis algorithm is called to perform cluster analysis on the semantic encoding corresponding to the word cloud to obtain the word cloud clusters corresponding to the word cloud; and then the word cloud diagram is generated according to the word cloud clusters.

[0121] As an optional implementation, the semantic coding of the word cloud is clustered and analyzed by calling the K-means clustering algorithm to obtain word cloud clusters, and then a word cloud diagram is generated based on the word cloud clusters. It should be noted that the K-means clustering algorithm is an iterative clustering analysis algorithm. Specifically, the semantic coding of the word cloud is used as the input data of the K-means clustering algorithm, and the semantic coding of each word cloud is a feature vector. According to the preset number of clustering clusters K, the semantic coding of K word clouds is randomly selected as the clustering center, and then the distance between the semantic coding of other word clouds outside the clustering center and each clustering center is determined. Then, according to the distance, the semantic coding of other word clouds outside the clustering center is assigned to the clustering center closest to it. It can be understood that the semantic coding of the clustering center and the word cloud assigned to the clustering center is a clustering cluster. Each time a semantic coding of a word cloud is assigned, the clustering center is updated according to the semantic coding of the current word cloud in the clustering cluster. When the semantic codes of all word clouds are assigned to clusters, or the cluster centers no longer change, the cluster analysis action is terminated and the word cloud clusters are obtained.

[0122] Optionally, after the word cloud clustering is obtained, the keywords of each cluster cluster are extracted from the word cloud clustering. Then, according to the keywords of each cluster cluster, the layout of the word cloud diagram is generated. The layout of the word cloud diagram here can be a tree layout, a grid layout, a topological structure, and other different layouts. Then, the weight of the keyword is determined according to the frequency of each keyword in the corresponding cluster cluster, and then the position and size of each keyword in the layout of the word cloud diagram are configured according to the weight of the keyword to generate a word cloud diagram corresponding to the word cloud.

[0123] By performing cluster analysis on word clouds and generating corresponding word cloud diagrams, the generated word cloud diagrams can better reflect the structure and internal relationship of the data to be predicted, as well as better reflect the keywords, features, themes of the data to be predicted, and the commonalities and relevance between the word clouds.

[0124] For example, suppose there is a fire-related article that needs to generate a word cloud diagram. When the to-be-predicted data upload interface receives the fire-related article, according to the file extension of the fire-related article being ".txt", it is determined that the data type of the fire-related article is text data. Then, the fire-related article is read to obtain the text information corresponding to the fire-related article. Then, based on natural paragraphs, the text information is divided into paragraphs to obtain at least one text paragraph. Then, the N-gram algorithm is called to perform N-gram encoding on the text paragraph to obtain the semantic encoding corresponding to the text paragraph; and the cosine similarity algorithm is called to perform a similarity calculation action on the semantic encoding corresponding to the text paragraph to obtain the semantic similarity between each text paragraph. Then, the text paragraphs whose semantic similarity is in the same preset similarity interval are associated to obtain at least one text paragraph set. Then, the prompt word input interface is output, assuming that the prompt word for generating a word cloud received by the prompt word input interface is "Please summarize the keywords that can summarize the overall data based on the overall data". Then, the prompt word for generating a word cloud is input into the Llama 2 model, and each text paragraph set is input into the Llama 2 model respectively. Based on the prompt words for generating word clouds, the Llama2 model performs a reading comprehension task on a set of text paragraphs to generate a word cloud corresponding to the fire-related article. Then, a word cloud evaluation operation is performed on the word cloud to obtain a word cloud evaluation result corresponding to the word cloud, and it is determined whether the word cloud evaluation result meets the preset generation index. Assuming that the word cloud evaluation result meets the preset generation index, the N-gram algorithm is called to perform N-gram encoding on the word cloud to obtain the semantic encoding corresponding to the word cloud; then, the clustering analysis algorithm is called to perform cluster analysis on the semantic encoding corresponding to the word cloud to obtain the word cloud clustering corresponding to the word cloud; and then, the full-text word cloud diagram and the segmented word cloud diagram are generated according to the word cloud clustering.

[0125] In the technical solution provided in this embodiment, text information is extracted from the data to be predicted and used as an input parameter of the large language model to comprehensively determine the subject, keywords and semantic features of the data to be predicted. The word cloud corresponding to the data to be predicted is generated by the large language model. A meaningful word cloud result can be obtained based on the semantic knowledge of the large language model. The generated word cloud is evaluated to obtain the evaluation result of the word cloud. When the word cloud evaluation result reaches the preset generation index, it means that the word cloud summarizes the data to be predicted well. The generated word cloud is clustered and a corresponding word cloud diagram is generated. Cluster analysis can aggregate word clouds with similar themes or semantics so that the generated word cloud diagram can more clearly show the different aspects and themes of the data to be predicted. Therefore, by using text information as an input parameter, generating a word cloud using the ability of a large language model, evaluating the word cloud, and clustering the word cloud, the key features and themes of the data to be predicted can be extracted and summarized, thereby generating a word cloud diagram that can accurately reflect the content and meaning of the full text of the data to be predicted.

[0126] Reference Figure 3 Based on the above embodiment, in a second embodiment, the step of performing a word cloud evaluation operation on the word cloud to obtain a word cloud evaluation result corresponding to the word cloud includes:

[0127] Step S410: calling a word cloud evaluation algorithm to evaluate the word cloud as a whole and obtain an overall word cloud evaluation result, wherein the overall word cloud evaluation result includes the overall accuracy of keyword extraction, the clarity of information and the applicability of text data;

[0128] Step S420: calling the word cloud evaluation algorithm to evaluate the word cloud in segments to obtain segmented word cloud evaluation results, which include the accuracy of keyword extraction of paragraphs, the clarity of information and the applicability of text data.

[0129] In this embodiment, after obtaining the word cloud of the data to be predicted, the word cloud is evaluated as a whole and in sections. Specifically, by evaluating the whole word cloud, it can be determined whether the generated word cloud can accurately summarize the key information of the data to be predicted, as well as the expression effect and readability. By evaluating the sectioned word cloud, it can be determined the expression level of the word cloud in different paragraphs, and whether the key information of each paragraph can be accurately extracted.

[0130] In the technical solution provided in this embodiment, through overall and segmented evaluation, the accuracy and clarity of the word cloud in extracting and expressing key information, as well as its applicability to text data can be understood. The evaluation results can be used as a reference to determine whether the generated word cloud has achieved the expected goals. In addition, the evaluation results can also provide a basis for subsequent clustering analysis to generate a more structured and hierarchical word cloud diagram. Therefore, the purpose of performing a word cloud evaluation operation on the word cloud is to ensure that the generated word cloud is of high quality, accurate information, and can accurately summarize the full text information.

[0131] Reference Figure 4 Based on the above embodiment, in a third embodiment, after the step of performing a word cloud evaluation operation on the word cloud and obtaining a word cloud evaluation result corresponding to the word cloud, the method further includes:

[0132] Step S610: determining whether each evaluation index in the word cloud evaluation result reaches the corresponding preset generation index;

[0133] Step S620: When all evaluation indicators in the word cloud evaluation result reach the corresponding preset generation indicators, the step of performing cluster analysis on the word cloud to generate a word cloud graph corresponding to the word cloud is performed;

[0134] Step S630: When there is at least one evaluation indicator in the word cloud evaluation result that does not reach the preset generation indicator, the step of inputting the text information into the large language model as an input parameter of the large language model to obtain the word cloud corresponding to the data to be predicted is executed.

[0135] In this embodiment, after obtaining the word cloud evaluation result corresponding to the word cloud, the word cloud evaluation result is compared with the preset generation index to determine whether the generated word cloud reaches the preset generation index. Then, according to the comparison result, it is determined whether to generate a word cloud diagram based on the currently generated word cloud. If the generated word cloud reaches the preset generation index, it means that the generated word cloud meets expectations, and then a word cloud diagram is generated based on the current word cloud; if the generated word cloud does not reach the preset generation index, it means that the generated word cloud does not meet expectations, and then the action of regenerating the word cloud is performed. It should be noted that only when all indicators in the word cloud evaluation result reach the corresponding preset generation index, that is, the accuracy of keyword extraction in the word cloud evaluation result reaches the preset keyword extraction accuracy index, and the clarity of information in the word cloud evaluation result reaches the preset information clarity index, and the applicability of text data in the word cloud evaluation result reaches the preset text data applicability index, it is determined that the generated word cloud reaches the preset generation index. If there is at least one evaluation index in the word cloud evaluation result that does not reach the preset generation index, it is determined that the generated word cloud does not reach the preset generation index. It can be understood that the preset generation indicators are set according to needs and expectations, and can be specific requirements in terms of accuracy of keyword extraction, clarity of information, and applicability of text data.

[0136] In the technical solution provided in this embodiment, it is determined whether the generated word cloud meets expectations, that is, whether it can accurately reflect the content and meaning of the full text of the data to be predicted by judging whether the generated word cloud meets the preset generation indicators. If all evaluation indicators meet the preset generation indicators, that is, the overall quality of the word cloud is good, the steps of generating the word cloud diagram can be executed, and a more structured and hierarchical word cloud diagram can be obtained based on cluster analysis. If there is an evaluation indicator that does not meet the preset generation indicator, that is, the quality of the word cloud is lacking, then the word cloud is re-generated based on the data to be predicted to ensure that the generated word cloud is more accurate and close to expectations. The purpose of this is to ensure that the word cloud diagram generated based on the word cloud can further accurately reflect the content and meaning of the full text of the data to be predicted.

[0137] In addition, it can be understood by a person skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the device for generating the word cloud diagram to implement the process steps of the embodiment of the above method.

[0138] Therefore, the present invention also provides a computer-readable storage medium, which stores a word cloud map generation program. When the word cloud map generation program is executed by a processor, the various steps of the word cloud map generation method described in the above embodiment are implemented.

[0139] The computer-readable storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.

[0140] It should be noted that since the storage medium provided in the embodiment of the present application is the storage medium used to implement the method of the embodiment of the present application, based on the method introduced in the embodiment of the present application, the person skilled in the art can understand the specific structure and deformation of the storage medium, so it is not repeated here. All storage media used in the method of the embodiment of the present application belong to the scope of protection of this application.

[0141] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0142] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0143] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0144] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0145] It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claim. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second and third etc. does not indicate any order. These words may be interpreted as names.

[0146] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0147] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for generating a word cloud graph, characterized in that: The method for generating the word cloud diagram comprises the following steps: When entering the word cloud graph generation process, the interface for uploading the data to be predicted is output; After the to-be-predicted data uploading interface receives the to-be-predicted data, extracting text information from the to-be-predicted data; Inputting the text information into the large language model as an input parameter of the large language model to obtain a word cloud corresponding to the data to be predicted; Performing a word cloud evaluation operation on the word cloud to obtain a word cloud evaluation result corresponding to the word cloud; When the word cloud evaluation result reaches a preset generation index, cluster analysis is performed on the word cloud to generate a word cloud graph corresponding to the word cloud; The step of inputting the text information into the large language model as an input parameter of the large language model to obtain a word cloud corresponding to the data to be predicted includes: Based on natural paragraphs, dividing the text information into paragraphs to obtain at least one text paragraph; Based on the preset word unit length, the text paragraphs are divided into paragraphs to generate N-gram sequences, where each N-gram sequence is a feature vector dimension; Calling the N-gram algorithm to perform N-gram encoding on the N-gram sequence to obtain corresponding semantic encoding; The cosine similarity algorithm is called to perform a similarity calculation operation on the semantic coding to obtain the semantic similarity between each of the text paragraphs, wherein the cosine similarity algorithm is expressed by the formula: Cosine Similarity (A,B) = A·B / (|A|*|B|); Among them, A and B represent two eigenvectors, |A| and |B| represent the modulus of eigenvectors A and B respectively; Associating the text paragraphs whose semantic similarities are in the same preset similarity interval to obtain at least one text paragraph set; Inputting each of the text paragraph sets into the large language model respectively to obtain a word cloud corresponding to the data to be predicted; Wherein, when the word cloud evaluation result reaches the preset generation index, the step of performing cluster analysis on the word cloud to generate a word cloud graph corresponding to the word cloud includes: Calling an N-gram algorithm to perform N-gram encoding on the word cloud to obtain a semantic encoding corresponding to the word cloud; Calling a cluster analysis algorithm to perform cluster analysis on the semantic coding corresponding to the word cloud to obtain word cloud clusters corresponding to the word cloud; The word cloud diagram is generated according to the word cloud clustering.

2. The method for generating a word cloud diagram according to claim 1, wherein: After the data to be predicted uploading interface receives the data to be predicted, the step of extracting text information from the data to be predicted includes: Determining the data type of the data to be predicted; When the data type is text data, reading the text data to obtain the text information; When the data type is image data, a character recognition algorithm is called to extract character information in the image data, and the text information is generated based on the character information.

3. The method for generating a word cloud diagram according to claim 2, wherein: The step of calling a character recognition algorithm to extract character information from the image data and generating the text information based on the character information comprises: Locating a text area in the image data, and segmenting the text area according to characters to obtain at least one character image; extracting character information from the character image; Matching a target character in a character library according to the character information; The text information is generated according to the target character.

4. The method for generating a word cloud diagram according to claim 1, wherein: The steps of inputting each of the text paragraph sets into the large language model to obtain a word cloud corresponding to the data to be predicted include: Output prompt word input interface; After the prompt word input interface receives the prompt word for generating the word cloud, the prompt word for generating the word cloud is input into the large language model, and each of the text paragraph sets is input into the large language model respectively; The large language model performs a reading comprehension task on the text paragraph set based on the prompt words for generating the word cloud, and generates a word cloud corresponding to the data to be predicted.

5. The method for generating a word cloud diagram according to claim 1, wherein: The step of performing a word cloud evaluation operation on the word cloud to obtain a word cloud evaluation result corresponding to the word cloud comprises: Calling a word cloud evaluation algorithm to evaluate the word cloud as a whole and obtain an overall word cloud evaluation result, wherein the overall word cloud evaluation result includes the accuracy of overall keyword extraction, the clarity of information and the applicability of text data; The word cloud evaluation algorithm is called to evaluate the word cloud in segments to obtain segmented word cloud evaluation results, which include the accuracy of keyword extraction of paragraphs, the clarity of information and the applicability of text data.

6. The method for generating a word cloud diagram according to claim 1, wherein: After the step of performing a word cloud evaluation operation on the word cloud to obtain a word cloud evaluation result corresponding to the word cloud, the method further includes: Determine whether each evaluation index in the word cloud evaluation result reaches the corresponding preset generation index; When all evaluation indicators in the word cloud evaluation result reach the corresponding preset generation indicators, performing the step of clustering analysis on the word cloud to generate a word cloud graph corresponding to the word cloud; When there is at least one evaluation index in the word cloud evaluation result that fails to reach the preset generation index, the step of inputting the text information into the large language model as an input parameter of the large language model to obtain the word cloud corresponding to the data to be predicted is executed.

7. A device for generating a word cloud graph, characterized in that: The word cloud map generating device includes: a memory, a processor, and a word cloud map generating program stored in the memory and executable on the processor, wherein the word cloud map generating program is configured to implement the steps of the word cloud map generating method as described in any one of claims 1 to 6.

8. A readable storage medium, characterized in that: The readable storage medium stores a word cloud map generation program, and when the word cloud map generation program is executed by a processor, the steps of the word cloud map generation method according to any one of claims 1 to 6 are implemented.