A tree metaphor visualization generation method and system based on word classification
Patent Information
- Application Number
- CN202611002513.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-07
- Publication Date
- 2026-10-09
AI Technical Summary
[0003]然而,现有技术大多以“主题”或“关键词群”为单元,无法深入揭示领域内基本语义单元(即“词”)反映的领域发展状态变化(如新兴、成熟、衰退)
可视化模块,用于根据各个词汇对应的树结构角色、权重和所述词汇坐标点集,将所述树根词、所述树干词、所述绿叶词和所述枯叶词渲染在裁剪后的树结构区域,以生成所述领域词汇数据的可视化树形图。
Smart Images

Figure CN122885186A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of word classification display technology, specifically to a method and system for generating tree-shaped metaphor visualizations based on word classification. Background Technology
[0002] Current domain development analysis often employs macro-level methods, such as keyword co-occurrence networks (e.g., CiteSpace tool) and theme river maps (e.g., ThemeRiver). These methods focus more on clustering and evolutionary path visualization at the theme level.
[0003] However, most existing technologies use "topics" or "keyword groups" as units, which cannot deeply reveal the changes in the development status of the domain (such as emerging, mature, and declining) reflected by the basic semantic units (i.e., "words") within the domain. Moreover, although traditional analysis methods (such as topic river maps) can display time trends, they lack an intuitive expression of the domain's hierarchical structure, and the output results lack natural tree-like metaphors, resulting in a heavy cognitive burden on users. Therefore, they have technical defects such as coarse analysis granularity and insufficient visualization of topic structure. Summary of the Invention
[0004] The purpose of this application is to overcome the shortcomings and deficiencies of the existing technology and provide a tree-shaped metaphor visualization generation method and system based on word classification.
[0005] The first aspect of this application provides a method for generating tree-like metaphor visualizations based on word classification, including: Acquire domain vocabulary data to be processed; the domain vocabulary data includes words and their corresponding weight values; The domain vocabulary data is classified and identified to obtain tree structure roles corresponding to each vocabulary; wherein, the tree structure roles include root words corresponding to basic concept words, trunk words corresponding to supporting concepts, green leaf words corresponding to emerging hot topics, and withered leaf words corresponding to peripheral concepts. Based on preset regional parameters, construct tree structure regions corresponding to the tree structure roles, and obtain the target sampling point number of each tree structure region based on the number of words corresponding to each tree structure role and the effective area ratio of each tree structure region. By combining the vocabulary coordinate point set sampling algorithm, vocabulary coordinate point sets for each tree structure region are generated based on the target number of sampling points for each tree structure region. The tree structure regions are pruned by combining the vocabulary coordinate point set of each tree structure region with a preset region pruning method; Based on the tree structure role, weight, and coordinate point set corresponding to each word, the root word, the trunk word, the green leaf word, and the withered leaf word are rendered in the cropped tree structure area to generate a visual tree diagram of the domain vocabulary data.
[0006] As one implementation method, the step of classifying and identifying the domain vocabulary data to obtain the tree structure roles corresponding to each vocabulary includes: The domain vocabulary data is classified using a classification model to obtain the tree structure roles corresponding to each vocabulary. The weights of each root word, trunk word, green leaf word, and withered leaf word are obtained from the domain vocabulary data.
[0007] As one implementation method, the step of obtaining the target sampling point number for each tree structure region based on the number of words corresponding to each tree structure role and the effective area ratio corresponding to each tree structure region includes: The target number of sampling points can be obtained using the following formula: desired_samples = ceil(C_i / TR_i); Where desired_samples is the number of target sampling points in the tree structure region, C_i is the number of words corresponding to the i-th tree structure role, TR_i is the effective area ratio of the i-th tree structure region, and ceil is the round-up function.
[0008] In one implementation, the tree structure region includes a leaf region, a trunk region, and a root region, wherein the effective area ratio of the leaf region TR_1 = 0.6, the effective area ratio of the trunk region TR_2 = 1, and the effective area ratio of the root region is: TR_2=(top_width+bottom_width)*root_height / (2*bottom_width*root_height); Where top_width is the preset top width of the root region, bottom_width is the preset bottom width of the root region, and root_height is the preset height of the root region.
[0009] As one implementation method, the steps of generating the vocabulary coordinate point set for each tree structure region based on the target number of sampling points in each tree structure region, combined with a vocabulary coordinate point set sampling algorithm, include: Based on the target number of sampling points in each tree structure region and the preset coordinate point density factor, the point repulsion radius of each tree structure region is obtained; Based on the point rejection radius of each tree structure region, the set of word coordinate points is obtained from the regional coordinate points of each tree structure region.
[0010] As one implementation method, the step of obtaining the point repulsion radius of each tree structure region based on the target sampling point number and the preset coordinate point density factor includes: The repulsion radius of the point can be obtained using the following formula: r = sqrt(2) / ceil(sqrt(desired_samples / POISSON_AREA_FACTOR)) Where r is the point rejection radius, sqrt is the square root calculation, ceil is the round-up function, desired_samples is the number of target sampling points in the tree structure region, and POISSON_AREA_FACTOR is the coordinate point density factor.
[0011] In one implementation, the initial region of the tree structure region is a rectangular region; The steps of pruning the tree structure regions by combining the vocabulary coordinate point set of each of the tree structure regions and the preset region pruning method include: The leaf area is cropped into a canopy shape to filter out the corner positions and coordinate points located in the rectangular area, and to filter out the coordinate points where the leaf area overlaps with the trunk area; wherein, the filtered coordinate points do not belong to the vocabulary coordinate point set. The root region is cut into a trapezoidal shape.
[0012] As one implementation method, the step of rendering the root word, the trunk word, the green leaf word, and the dead leaf word in the pruned tree structure area according to the tree structure role, weight, and word coordinate point set corresponding to each word to generate a visual tree diagram of the domain vocabulary data includes: Based on the tree structure role corresponding to each word, and the pre-defined correspondence between the tree structure role and the word rendering parameters, obtain the word rendering parameters. Get the tree structure role corresponding to each word, and get the font size of each word; Based on the tree structure role, font size, and word rendering parameters corresponding to each word, all words are rendered to the cropped tree structure area to obtain the visualized tree diagram. As one implementation method, the steps of obtaining the tree structure role corresponding to each word and obtaining the font size of each word include: Based on the weight values of all words corresponding to each tree structure role, obtain the minimum and maximum weight values; Based on the weight of each word, the minimum and maximum weights of the corresponding tree structure roles, and the preset minimum and maximum font sizes, obtain the font size of each word.
[0013] Compared to related technologies, the tree-like metaphor visualization generation method based on word classification in this application classifies and identifies domain vocabulary data to obtain root words, trunk words, green leaf words, and withered leaf words, along with their corresponding weights. Then, it constructs tree structure regions corresponding to the tree structure roles based on preset region parameters. Based on the number of words corresponding to each tree structure role and the effective area ratio of each tree structure region, it obtains the target sampling point count for each tree structure region. Then, combining a vocabulary coordinate point set sampling algorithm, it generates vocabulary coordinate point sets for each tree structure region based on the target sampling point count. Finally, it performs pruning processing on the tree structure regions based on the vocabulary coordinate point sets and a preset region pruning method. Finally, based on the tree structure role, weight, and vocabulary coordinate point set corresponding to each word, it renders the root words, trunk words, green leaf words, and withered leaf words in the pruned tree structure regions to generate a visualized tree diagram of the domain vocabulary data. This method can generate tree structures for domain words with more fine-grained processing, supports flexible customization and is easy to integrate, and can intuitively reflect the dynamic changes in the domain's development process.
[0014] A second aspect of this application provides a tree-based metaphor visualization generation system based on word classification, comprising: The domain vocabulary data acquisition module is used to acquire domain vocabulary data to be processed; the domain vocabulary data includes words and their corresponding weight values; The classification and recognition module is used to classify and recognize the domain vocabulary data to obtain the tree structure role corresponding to each word; wherein, the tree structure role includes the root word corresponding to the basic concept word, the trunk word corresponding to the supporting concept, the green leaf word corresponding to the emerging hot topic, and the withered leaf word corresponding to the peripheral concept. The target sampling point acquisition module is used to construct a tree structure region corresponding to the tree structure role according to the preset region parameters, and to obtain the target sampling point number of each tree structure region according to the number of words corresponding to each tree structure role and the effective area ratio corresponding to each tree structure region. The vocabulary coordinate point set acquisition module is used to combine the vocabulary coordinate point set sampling algorithm to generate the vocabulary coordinate point set for each tree structure region based on the target number of sampling points for each tree structure region. The cropping module is used to crop the tree structure regions by combining the vocabulary coordinate point set of each tree structure region with a preset region cropping method. The visualization module is used to render the root word, the trunk word, the green leaf word, and the dead leaf word in the cropped tree structure area according to the tree structure role, weight, and the set of word coordinate points corresponding to each word, so as to generate a visualized tree diagram of the domain vocabulary data.
[0015] Compared to related technologies, the tree-like metaphor visualization generation system based on word classification in this application classifies and identifies domain vocabulary data to obtain root words, trunk words, green leaf words, and withered leaf words, along with their corresponding weights. Then, it constructs tree structure regions corresponding to the tree structure roles based on preset region parameters. Based on the number of words corresponding to each tree structure role and the effective area ratio of each tree structure region, it obtains the target sampling point count for each tree structure region. Then, combining a vocabulary coordinate point set sampling algorithm, it generates vocabulary coordinate point sets for each tree structure region based on the target sampling point count. Finally, it performs pruning processing on the tree structure regions based on the vocabulary coordinate point sets and preset region pruning methods. Finally, based on the tree structure roles, weights, and vocabulary coordinate point sets corresponding to each word, it renders the root words, trunk words, green leaf words, and withered leaf words in the pruned tree structure regions to generate a visualized tree diagram of the domain vocabulary data. This system can generate tree structures for domain words with more fine-grained processing, supports flexible customization and is easy to integrate, and can intuitively reflect the dynamic changes in the domain's development process.
[0016] To provide a clearer understanding of this application, the specific embodiments of this application will be described below in conjunction with the accompanying drawings. Attached Figure Description
[0017] Figure 1 This is a flowchart of a tree-based metaphor visualization generation method based on word classification, according to one embodiment of this application.
[0018] Figure 2 This is a schematic diagram of step S6 of a tree-shaped metaphor visualization generation method based on word classification according to an embodiment of this application.
[0019] Figure 3 This is a schematic diagram of a module of a tree-shaped metaphor visualization generation system based on word classification, according to an embodiment of this application.
[0020] 100. Tree-shaped metaphor visualization generation system; 101. Domain vocabulary data acquisition module; 102. Classification and recognition module; 103. Target sampling point acquisition module; 104. Vocabulary coordinate point set acquisition module; 105. Pruning processing module; 106. Visualization module. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0022] It should be understood that the described embodiments are merely some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of the embodiments of this application.
[0023] In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. In the description of this application, it should be understood that the terms "first," "second," "third," etc., are used only to distinguish similar objects and are not necessarily used to describe a specific order or sequence, nor should they be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances. The singular forms "a," "the," and "the" used in this application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. The word "if" as used herein can be interpreted as "when," "when," or "in response to determination."
[0024] Furthermore, in the description of this application, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0025] Please see Figure 1 This is a flowchart of a tree-based metaphor visualization generation method based on word classification, according to the first embodiment of this application. The method includes: S1: Obtain domain vocabulary data to be processed; the domain vocabulary data includes words and corresponding weight values.
[0026] Specifically, this application supports two data input methods. One is to read from a standardized Excel file, which should contain two columns: word and weight (TF-IDF value in this system); the other is to directly input a list containing word-weight pairs through the program interface.
[0027] S2: Classify and identify the domain vocabulary data to obtain the tree structure roles corresponding to each vocabulary; the tree structure roles include root words corresponding to basic concept words, trunk words corresponding to supporting concepts, green leaf words corresponding to emerging hot topics, and withered leaf words corresponding to peripheral concepts. Step S2 includes: S21: The domain vocabulary data is classified using a classification model to obtain the tree structure roles corresponding to each vocabulary.
[0028] The classification model is a pre-trained network model used to classify domain vocabulary data. The data is divided into four roles, with the following classification criteria: ① Using existing classification models, core concepts (core keywords) are extracted from the entire domain corpus. These words play the role of the "trunk" in the tree and are the main body supporting the overall knowledge structure.
[0029] ② Based on the core concept, the main knowledge points are selected according to their relevance to the core concept (such as semantic similarity) and their own significance (TF-IDF weight), and they are divided into two categories: relatively new and active concepts are marked as "green leaves", and marginal or inactive concepts are marked as "withered leaves".
[0030] ③ Basic terminology, fundamental definitions, and underlying principles constitute the "foundation" of knowledge and are categorized as "roots".
[0031] The categorized data correspond to different parts of the tree structure: tree_words_with_weights (leaf words), dead_words_with_weights (dead leaf words), trunk_words_with_weights (trunk words), and root_words_with_weights (root words).
[0032] S22: Obtain the weights of each root word, trunk word, green leaf word, and withered leaf word from the domain vocabulary data.
[0033] S3: Construct tree structure regions corresponding to the tree structure roles according to preset regional parameters, and obtain the target sampling points of each tree structure region according to the number of words corresponding to each tree structure role and the effective area ratio of each tree structure region. The parameters for each tree structure region include the width and height of the leaf area (leaf_width) and trunk area (trunk_width) and trunk_height, as well as the top width (top_width), bottom width (bottom_width), and root_height of the root area. These parameters can be dynamically loaded from an external file (parameters.xlsx) or use default values to flexibly adapt to different data sizes and display requirements. For example, the default parameters used are shown below: leaf_width = 40 leaf_height = 20 trunk_width = 10 trunk_height = 20 top_width = 15 bottom_width = 40 root_height = 10 Based on the above default parameters, three initial rectangular layout areas can be defined on the canvas, corresponding to the leaf area, trunk area, and root area.
[0034] Then, the target sampling point number for each tree structure region is obtained using the following formula: desired_samples = ceil(C_i / TR_i); Where desired_samples is the number of target sampling points in the tree structure region, C_i is the number of words corresponding to the i-th tree structure role, TR_i is the effective area ratio of the i-th tree structure region, and ceil is the round-up function.
[0035] It should be noted that the effective area ratios differ for different tree structural regions. For example, the effective area ratio TR_1 for the leaf region is 0.6, the effective area ratio TR_2 for the trunk region is 1, and the effective area ratio for the root region is: TR_2=(top_width+bottom_width)*root_height / (2*bottom_width*root_height); Where top_width is the preset top width of the root region, bottom_width is the preset bottom width of the root region, and root_height is the preset height of the root region.
[0036] S4: Combining the vocabulary coordinate point set sampling algorithm, based on the target sampling point number of each tree structure region, generate the vocabulary coordinate point set for each tree structure region, including: S41: Based on the target sampling point number and the preset coordinate point density factor of each tree structure region, obtain the point repulsion radius of each tree structure region; Specifically, the repulsion radius of the point is obtained using the following formula: r = sqrt(2) / ceil(sqrt(desired_samples / POISSON_AREA_FACTOR)) Where r is the point rejection radius, sqrt is the square root calculation, ceil is the round-up function, desired_samples is the number of target sampling points in the tree structure region, and POISSON_AREA_FACTOR is the coordinate point density factor.
[0037] S42: Based on the point rejection radius of each tree structure region, obtain the set of word coordinate points from the region coordinate points of each tree structure region.
[0038] In this process, a preset starting coordinate point for each tree structure region can be used as the first word coordinate point. Then, the next word coordinate point is found based on the repulsion radius of that point, and so on, until all the region coordinate points have been traversed. Alternatively, a region coordinate point can be randomly selected from each tree structure region as the first word coordinate point. Then, the next word coordinate point is found based on the repulsion radius of that point, and so on, until all the region coordinate points have been traversed. Through the above process, the actual distance between adjacent word coordinate points in the resulting set of word coordinate points will be greater than or equal to the repulsion radius of that point.
[0039] It should be noted that when searching for the next word coordinate point based on the point repulsion radius, the maximum number of attempts can be limited to avoid getting stuck in an infinite loop when the current word coordinate point cannot find the next word coordinate point.
[0040] S5: Combine the vocabulary coordinate point set of each tree structure region with the preset region pruning method to perform pruning processing on the tree structure region; To conform to the tree outline, different tree structure areas use different clipping methods. For example, the leaf area uses the leaf_filter_coordinates function to filter out points close to the rectangular edge (LEAF_EDGE_MARGIN_RATIO defines the edge width ratio) and the four corners (LEAF_CORNER_MARGIN_RATIO defines the corner ratio) to simulate a circular canopy, and removes the coordinates of the area overlapping with the trunk (overlap_part_height defines the overlap height).
[0041] The root region calls the `roots_filter_coordinates` function to crop the rectangular point set into a trapezoid. A height ratio (`ROOT_RECTANGULAR_PART_RATIO`) is set for the rectangular region. Points above this height have their effective horizontal range linearly interpolated between `top_width` and `bottom_width` based on their y-coordinates, forming a trapezoid.
[0042] Therefore, both the leaf and root regions need to be edited. As we know from step S2, the effective area ratio of both the leaf and root regions is less than 1. The smaller the effective area ratio, the more target sampling points there are. Therefore, the number of target sampling points in the leaf and root regions is greater than the number of words for the corresponding tree structure roles. That is, the number of target sampling points in the leaf region is greater than the total number of words for green leaf and withered leaf, and the number of target sampling points in the root region is greater than the number of words for root. Therefore, after editing the leaf and root regions, there are still enough regional coordinate points to serve as the coordinate points for the corresponding words.
[0043] Specifically, this application uses the optimization_points function to iteratively adjust and ensure that the number of points after pruning matches the number of words. The optimization process is achieved by dynamically adjusting the repulsion radius r of the S41 midpoint. Optimization parameters include: ①OPT_MAX_ITERATIONS: Maximum number of iterations to prevent infinite loops.
[0044] ②OPT_CONVERGENCE_FACTOR: Convergence factor. Optimization is considered complete and convergence is satisfied when the number of target words ≤ the number of current word coordinates ≤ the number of target words * OPT_CONVERGENCE_FACTOR. Here, the number of target words refers to the number of words in the corresponding tree structure region, i.e., the number of words in the corresponding tree structure role.
[0045] ③OPT_INCREASE_SAMPLES_FACTOR: Sampling point expansion factor. Used to increase the number of sampling points if the number of vocabulary coordinate points is consistently insufficient.
[0046] The optimization function `optimize_points` starts a loop, and its core logic is as follows: Convergence check: In each iteration, first check if the number of candidate points after pruning satisfies the above convergence condition. If it does, exit the loop, and the optimization is successful.
[0047] Dynamically adjust r: If the convergence condition is not met, adjust the point repulsion radius r used in the next Poisson sampling based on the relationship between the current number of word coordinate points and the number of target words. If the current number of word coordinates is greater than the target number of words * OPT_CONVERGENCE_FACTOR, it means that the word coordinates are too dense. Increase r to generate fewer points in the same area.
[0048] If the number of current word coordinate points is less than the number of target words, it means the points are too sparse. Decrease r to allow the points to be closer together, thereby generating more current word coordinate points within the same area.
[0049] Auxiliary amplification strategy: To avoid low algorithm efficiency or impact on subsequent visualization effects due to excessively small r, the system checks the current word coordinate points every 5 iterations. If the current word coordinate points are consistently insufficient (i.e., still in the state of "current candidate points < target word count" after 5 iterations), it indicates that simply reducing r is no longer effective in increasing the number of points (r may already be extremely small, resulting in extremely low algorithm efficiency or a large number of overlapping points). In this case, it is necessary to use OPT_INCREASE_SAMPLES_FACTOR (sample point amplification factor) to amplify desired_samples (target sample point count) to fundamentally increase the upper limit of point density. According to the formula r = sqrt(2) / ceil(sqrt(desired_samples / POISSON_AREA_FACTOR)) in step S41, increasing desired_samples will cause the calculated r to decrease, thereby increasing the upper limit of point density from the source.
[0050] Termination: The loop continues until convergence or the maximum number of iterations is reached.
[0051] The above process can also be understood as follows: In S4, the point repulsion radius *r* is a static initial value calculated based on the initial parameters. In the optimization loop of S5, if the convergence condition is not met, the point repulsion radius *r* becomes a dynamically adjusted variable. The optimization process subtly increases or decreases the value of the point repulsion radius *r*, re-invoking the Poisson disk sampling and pruning process to generate point sets with different densities until the number of output points meets the requirements. Therefore, the entire S5 process can be understood as follows: starting from the initial *r* and sampling results of S4, through the iteration of "sampling -> pruning -> counting -> adjusting *r*", a suitable point repulsion radius *r* value that makes the number of output points match the number of words is finally found.
[0052] S6: Based on the tree structure role, weight, and coordinate point set corresponding to each word, render the root word, trunk word, green leaf word, and withered leaf word in the cropped tree structure area to generate a visual tree diagram of the domain vocabulary data.
[0053] Please see Figure 2 Step S6 includes: S61: Obtain the word rendering parameters based on the tree structure role corresponding to each word and the preset correspondence between the tree structure role and the word rendering parameters. The word rendering parameters include rotation angle and background rendering. For example, words with green leaves and words with withered leaves can both call the `draw_text_with_image_background` function. Each word is drawn on a leaf icon background (TREE_LEAF_IMG_PATH or DEAD_LEAF_IMG_PATH, for green leaves and withered leaves respectively) that is randomly rotated (between -30 degrees and 30 degrees). The icon transparency is controlled by `LEAF_IMG_ALPHA`. Even words with green leaves and withered leaves can be distinguished using different colors and icons.
[0054] The tree trunk words are uniformly rotated 90 degrees and arranged vertically to simulate the texture of a tree trunk, without using a background image.
[0055] The root words can call the `draw_root_text` function. Based on their relative x-coordinates within the trapezoidal area, the tilt angle is dynamically calculated, causing all root words to radiate towards the bottom center of the canvas, creating a visual effect of them sinking into the ground.
[0056] S62: Obtain the tree structure role corresponding to each word, and obtain the font size of each word, including: S621: Based on the weight values of all words corresponding to each tree structure role, obtain the minimum and maximum weight values; S622: Obtain the font size of each word based on its weight, the minimum and maximum weights of the corresponding tree structure roles, and the preset minimum and maximum font sizes.
[0057] Specifically, the font size of each word is calculated through linear mapping: font_size=MIN_FONT_SIZE+((w-min_weight) / (max_weight-min_weight))*(MAX_FONT_SIZE-MIN_FONT_SIZE) Where font_size is the font size, MIN_FONT_SIZE is the minimum font size of the corresponding tree structure role, MAX_FONT_SIZE is the maximum font size of the corresponding tree structure role, w is the weight of the current word, min_weight is the minimum weight of the corresponding tree structure role, and max_weight is the maximum weight of the corresponding tree structure role.
[0058] In this implementation, the minimum and maximum font sizes for each tree structure role are set by the user. For example, the minimum font size for each tree structure role is set to 5, and the maximum font size is set to 10. In other implementations, the user can set different values for the minimum font size and different values for the maximum font size for each tree structure role.
[0059] S63: Based on the tree structure role, font size, and word rendering parameters corresponding to each word, render all words to the cropped tree structure area to obtain the visualized tree diagram.
[0060] The distribution of words can be determined based on their corresponding tree structure roles. For example, words representing green leaves and withered leaves are distributed in the leaf area, words representing trunks are distributed in the trunk area, and words representing roots are distributed in the root area. The distribution of words representing green leaves and withered leaves can be further controlled. For example, words representing withered leaves can be placed at the left and right edges of the leaf area, while words representing green leaves can be placed in the middle of the leaf area.
[0061] Specifically, when determining the tree structure region or position corresponding to the word distribution based on the set of word coordinate points, the word distribution can be made more uniform by limiting the spacing between words of the same font size; alternatively, a pre-trained distribution model can be used to complete the distribution. The distribution model can be obtained by training a deep learning model with a tree-structured word distribution, and its training samples include positive samples with good distribution performance and negative samples with poor distribution performance.
[0062] In addition, the cropped tree structure area will also have pre-made background images of the crown, trunk and roots added through the add_png_background function to enhance the visual intuitiveness of the tree metaphor.
[0063] In summary, compared with existing methods, the present invention has the following advantages: ① Intuitive structure and low cognitive burden: It innovatively uses the natural metaphor of "tree" to visualize the knowledge structure of the domain, mapping abstract basic concepts, supporting theories and cutting-edge hot topics to tree roots, trunk and leaves respectively, and generating a tree structure of domain terms in a more granular way, which greatly reduces the user's understanding threshold and intuitively reveals the internal hierarchy and ecological relationship of the domain.
[0064] ② Intelligent layout and high degree of automation: It overcomes the drawbacks of traditional visualization tools that require manual dragging and adjustment of the layout. It can automatically generate a neat tree diagram from data based on the role and weight of words, without the need for manual layout intervention.
[0065] ③ It has good encapsulation and is easy to integrate and apply: The complex tree generation logic (including region partitioning, coordinate calculation, and visual rendering) can be encapsulated into independent software packages or modules, providing concise code packages. Users only need to input the categorized vocabulary data to quickly generate visualization results, which are easy to integrate into various academic analysis or business intelligence processes.
[0066] Please see Figure 3 The second embodiment of this application provides a tree-based metaphor visualization generation system 100 based on word classification, including: Domain vocabulary data acquisition module 101 is used to acquire domain vocabulary data to be processed; the domain vocabulary data includes vocabulary and corresponding weight values. The classification and recognition module 102 is used to classify and recognize the domain vocabulary data to obtain the tree structure role corresponding to each vocabulary; wherein, the tree structure role includes the root word corresponding to the basic concept word, the trunk word corresponding to the supporting concept, the green leaf word corresponding to the emerging hot topic, and the withered leaf word corresponding to the peripheral concept. The target sampling point acquisition module 103 is used to construct a tree structure region corresponding to the tree structure role according to the preset region parameters, and to acquire the target sampling point number of each tree structure region according to the number of words corresponding to each tree structure role and the effective area ratio corresponding to each tree structure region. The vocabulary coordinate point set acquisition module 104 is used to combine the vocabulary coordinate point set sampling algorithm to generate the vocabulary coordinate point set of each tree structure region according to the target sampling point number of each tree structure region. The cropping module 105 is used to crop the tree structure region by combining the vocabulary coordinate point set of each tree structure region with a preset region cropping method. The visualization module 106 is used to render the root word, the trunk word, the green leaf word and the dead leaf word in the cropped tree structure area according to the tree structure role, weight and the set of word coordinate points corresponding to each word, so as to generate a visualized tree diagram of the domain vocabulary data.
[0067] It should be noted that the tree-like metaphor visualization generation system 100 based on word classification provided in the second embodiment of this application is only illustrated by the above-described division of functional modules when executing the tree-like metaphor visualization generation method based on word classification. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the tree-like metaphor visualization generation system 100 based on word classification provided in the second embodiment of this application and the tree-like metaphor visualization generation method based on word classification in the first embodiment of this application belong to the same concept, and its implementation process is detailed in the method embodiment, which will not be repeated here.
[0068] The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without any inventive effort.
[0069] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied 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.
[0070] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function selected in one or more boxes.
[0071] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function selected in one or more boxes.
[0072] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0073] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0074] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0075] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0076] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for generating tree-shaped metaphor visualizations based on word classification, characterized in that, include: Obtain the domain vocabulary data to be processed; The domain vocabulary data includes words and their corresponding weight values; The domain vocabulary data is classified and identified to obtain tree structure roles corresponding to each vocabulary; wherein, the tree structure roles include root words corresponding to basic concept words, trunk words corresponding to supporting concepts, green leaf words corresponding to emerging hot topics, and withered leaf words corresponding to peripheral concepts. Based on preset regional parameters, construct tree structure regions corresponding to the tree structure roles, and obtain the target sampling point number of each tree structure region based on the number of words corresponding to each tree structure role and the effective area ratio of each tree structure region. By combining the vocabulary coordinate point set sampling algorithm, vocabulary coordinate point sets for each tree structure region are generated based on the target number of sampling points for each tree structure region. The tree structure regions are pruned by combining the vocabulary coordinate point set of each tree structure region with a preset region pruning method; Based on the tree structure role, weight, and coordinate point set corresponding to each word, the root word, the trunk word, the green leaf word, and the withered leaf word are rendered in the cropped tree structure area to generate a visual tree diagram of the domain vocabulary data.
2. The tree-based metaphor visualization generation method based on word classification according to claim 1, characterized in that, The steps of classifying and identifying the domain vocabulary data to obtain the tree-structured roles corresponding to each vocabulary include: The domain vocabulary data is classified using a classification model to obtain the tree structure roles corresponding to each vocabulary. The weights of each root word, trunk word, green leaf word, and withered leaf word are obtained from the domain vocabulary data.
3. The tree-based metaphor visualization generation method based on word classification according to claim 1, characterized in that, The steps for obtaining the target sampling point number for each tree structure region based on the number of words corresponding to each tree structure role and the effective area ratio of each tree structure region include: The target number of sampling points can be obtained using the following formula: desired_samples = ceil(C_i / TR_i); Where desired_samples is the number of target sampling points in the tree structure region, C_i is the number of words corresponding to the i-th tree structure role, TR_i is the effective area ratio of the i-th tree structure region, and ceil is the round-up function.
4. The tree-based metaphor visualization generation method based on word classification according to claim 3, characterized in that, The tree structure region includes a leaf region, a trunk region, and a root region. The effective area ratio of the leaf region is TR_1 = 0.6, the effective area ratio of the trunk region is TR_2 = 1, and the effective area ratio of the root region is: TR_2=(top_width+bottom_width)*root_height / (2*bottom_width*root_height); Where top_width is the preset top width of the root region, bottom_width is the preset bottom width of the root region, and root_height is the preset height of the root region.
5. The tree-based metaphor visualization generation method based on word classification according to claim 4, characterized in that, Combining the vocabulary coordinate point set sampling algorithm, the steps for generating the vocabulary coordinate point set for each tree structure region based on the target number of sampling points for each tree structure region include: Based on the target number of sampling points in each tree structure region and the preset coordinate point density factor, the point repulsion radius of each tree structure region is obtained; Based on the point rejection radius of each tree structure region, the set of word coordinate points is obtained from the regional coordinate points of each tree structure region.
6. The tree-based metaphor visualization generation method based on word classification according to claim 5, characterized in that, The steps for obtaining the point repulsion radius of each tree structure region based on the target sampling point number and the preset coordinate point density factor include: The repulsion radius of the point can be obtained using the following formula: r = sqrt(2) / ceil(sqrt(desired_samples / POISSON_AREA_FACTOR)) Where r is the point rejection radius, sqrt is the square root calculation, ceil is the round-up function, desired_samples is the number of target sampling points in the tree structure region, and POISSON_AREA_FACTOR is the coordinate point density factor.
7. The tree-based metaphor visualization generation method based on word classification according to claim 6, characterized in that, The initial regions of the tree structure regions are all rectangular regions; The steps of pruning the tree structure regions by combining the vocabulary coordinate point set of each of the tree structure regions and the preset region pruning method include: The leaf area is cropped into a canopy shape to filter out the corner positions and coordinate points located in the rectangular area, and to filter out the coordinate points where the leaf area overlaps with the trunk area; wherein, the filtered coordinate points do not belong to the set of word coordinate points; The root region is cut into a trapezoidal shape.
8. The tree-based metaphor visualization generation method based on word classification according to claim 7, characterized in that, The steps of rendering the root word, trunk word, green leaf word, and withered leaf word in the pruned tree structure area to generate a visual tree diagram of the domain vocabulary data, based on the tree structure role, weight, and word coordinate point set corresponding to each word, include: Based on the tree structure role corresponding to each word, and the pre-defined correspondence between the tree structure role and the word rendering parameters, obtain the word rendering parameters. Get the tree structure role corresponding to each word, and get the font size of each word; Based on the tree structure role, font size, and word rendering parameters corresponding to each word, all words are rendered to the cropped tree structure area to obtain the visualized tree diagram.
9. The tree-based metaphor visualization generation method based on word classification according to claim 8, characterized in that, The steps to obtain the tree structure role corresponding to each word and to obtain the font size of each word include: Based on the weight values of all words corresponding to each tree structure role, obtain the minimum and maximum weight values; Based on the weight of each word, the minimum and maximum weights of the corresponding tree structure roles, and the preset minimum and maximum font sizes, obtain the font size of each word.
10. A tree-structured metaphor visualization generation system based on word classification, characterized in that, include: The domain terminology data acquisition module is used to acquire domain terminology data to be processed; The domain vocabulary data includes words and their corresponding weight values; The classification and recognition module is used to classify and recognize the domain vocabulary data to obtain the tree structure role corresponding to each word; wherein, the tree structure role includes the root word corresponding to the basic concept word, the trunk word corresponding to the supporting concept, the green leaf word corresponding to the emerging hot topic, and the withered leaf word corresponding to the peripheral concept. The target sampling point acquisition module is used to construct a tree structure region corresponding to the tree structure role according to the preset region parameters, and to obtain the target sampling point number of each tree structure region according to the number of words corresponding to each tree structure role and the effective area ratio corresponding to each tree structure region. The vocabulary coordinate point set acquisition module is used to combine the vocabulary coordinate point set sampling algorithm to generate the vocabulary coordinate point set for each tree structure region based on the target number of sampling points for each tree structure region. The cropping module is used to crop the tree structure regions by combining the vocabulary coordinate point set of each tree structure region with a preset region cropping method. The visualization module is used to render the root word, the trunk word, the green leaf word, and the dead leaf word in the cropped tree structure area according to the tree structure role, weight, and the set of word coordinate points corresponding to each word, so as to generate a visualized tree diagram of the domain vocabulary data.