Webpage keyword rendering method and device, equipment and medium
Patent Information
- Application Number
- CN202611336772.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-10-23
AI Technical Summary
由于缺乏对网页结构化层级关系与业务语义类型的联合考量,仅依赖文本内容本身进行关键词提取与渲染,导致无法区分标题、正文、表头、注释等不同层级节点中相同词汇的重要性差异,也无法根据“风险”“收益”“合规”等不同语义类型动态调整视觉呈现强度,最终造成高亮结果杂乱、重点不突出,甚至因对低优先级节点(如页脚免责声明、导航栏标签)中的关键词进行同等渲染而干扰用户对核心信息的获取,严重降低了对网页关键词检索的精准度
[0010]本申请通过对文档对象模型树的结构化解析与正文区域识别,得到目标文本节点,有效过滤了导航栏、侧边栏及广告等非核心区域的噪声干扰,降低了后续数据处理量并提升了关键词提取的信噪比;基于预设的页面类型与文本片段筛选规则的映射关系表,从目标文本节点中筛选候选文本片段,解决通用规则在财报、研报等复杂金融网页中适配性差的问题。
Smart Images

Figure CN122964340A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, device and medium for rendering web page keywords. Background Technology
[0002] With the explosive growth of internet information, users often need to quickly locate key information when browsing web pages. To improve reading efficiency, various web page keyword highlighting or rendering tools have emerged. These tools typically extract keywords by matching preset thesaurus or using general natural language processing models, and then highlight them in a uniform style within the original web page text.
[0003] However, the aforementioned existing technologies have the following problems when dealing with the web pages of financial platforms such as securities, banking, and insurance platforms (e.g., financial research reports, financial statements, market data, etc.): Due to a lack of joint consideration of the structural hierarchy of web pages and business semantic types, keyword extraction and rendering rely solely on the text content itself. This results in an inability to distinguish the differences in importance of the same words in different levels of nodes such as titles, body text, table headers, and comments. It also fails to dynamically adjust the visual presentation intensity according to different semantic types such as "risk," "benefit," and "compliance." Ultimately, this leads to cluttered highlighting results, a lack of emphasis on key points, and even interference with users' acquisition of core information by rendering keywords in low-priority nodes (such as footer disclaimers and navigation bar labels) equally, severely reducing the accuracy of web page keyword retrieval.
[0004] Therefore, there is an urgent need for a method that can accurately extract web page keywords and perform differentiated rendering to solve the problem of inaccurate information presentation caused by using a uniform style to render the original text of a web page in existing technologies. Summary of the Invention
[0005] In view of the above, it is necessary to provide a technical solution that can accurately extract web page keywords and perform differentiated rendering.
[0006] Firstly, a method for rendering webpage keywords is provided, including: Obtain the document object model tree of the target webpage, perform structuring processing on the document object model tree, and obtain structured webpage data containing multiple text nodes and text data of each text node; Identify the page region to which the text data of each text node belongs in the target webpage, and select the text node whose page region belongs to the preset target region as the target text node; From the preset mapping table of page types and text fragment filtering rules, obtain the text fragment filtering rules that match the page type of the target webpage, and use the text fragment filtering rules to filter candidate text fragments from the text data of the target text node. The candidate text fragments are identified using a preset keyword recognition model to obtain multiple keywords labeled with semantic type tags; Based on the semantic type tag corresponding to each keyword and the hierarchical relationship of the target text node corresponding to the text segment to which the keyword belongs in the structured web page data, the semantic weight value of each keyword is calculated. Calculate the pixel distance between the position coordinates of each keyword on the target webpage and the preset reference coordinates in the display area of the target webpage; Using the pixel distance value and the semantic weight value as query indexes, a preset mapping table between query indexes and rendering parameters is queried to obtain the rendering mode and rendering priority of each keyword. Rendering is then performed on each keyword using the rendering mode and rendering priority of each keyword.
[0007] Secondly, a webpage keyword rendering device is provided, comprising: The processing module is used to obtain the document object model tree of the target webpage, perform structuring processing on the document object model tree, and obtain structured webpage data containing multiple text nodes and text data of each text node. The identification module is used to identify the page area to which the text data of each text node belongs in the target webpage, and select the text node whose page area belongs to the preset target area as the target text node. The filtering module is used to obtain the text fragment filtering rules that match the page type of the target webpage from a preset mapping table of page types and text fragment filtering rules, and use the text fragment filtering rules to filter out candidate text fragments from the text data of the target text node. The module is used to perform keyword recognition on the candidate text fragment using a preset keyword recognition model to obtain multiple keywords labeled with semantic type tags; The calculation module is used to calculate the semantic weight value of each keyword in the structured web page data based on the semantic type tag corresponding to each keyword and the hierarchical relationship of the target text node corresponding to the text segment to which the keyword belongs. The distance module is used to calculate the pixel distance between the position coordinates of each keyword on the target webpage and the preset reference coordinates in the display area of the target webpage; The rendering module is used to use the pixel distance value and the semantic weight value as query indexes to query a preset mapping table between query indexes and rendering parameters, obtain the rendering mode and rendering priority of each keyword, and perform rendering on each keyword using the rendering mode and rendering priority of each keyword.
[0008] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described webpage keyword rendering method.
[0009] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the above-described webpage keyword rendering method.
[0010] This application obtains target text nodes through structured parsing of the document object model tree and identification of the main text region. This effectively filters out noise interference from non-core areas such as navigation bars, sidebars, and advertisements, reducing the amount of subsequent data processing and improving the signal-to-noise ratio of keyword extraction. Based on a preset mapping table between page types and text fragment filtering rules, candidate text fragments are filtered from the target text nodes, solving the problem of poor adaptability of general rules in complex financial web pages such as financial reports and research reports.
[0011] A keyword recognition model is used to perform sequence labeling on candidate text fragments to obtain keywords with semantic type labels. Based on the hierarchical relationship between the semantic type label and the text node to which the keyword belongs in the structured data, the semantic weight value is calculated. This makes the weight evaluation no longer rely solely on word frequency statistics, but integrates the hierarchical relationship of text nodes, thereby enhancing the distinguishability of high-value information (such as keywords in the title and abstract areas).
[0012] Using pixel distance values and semantic weight values as query indexes, the rendering mode and priority for each keyword are obtained by retrieving a pre-defined mapping table between query indexes and rendering parameters. Finally, ordered rendering is performed based on this rendering mode and priority, achieving dual adaptive driving of "content semantic importance" and "user's current visual focus area." This ensures that key information is prioritized for highlighting within the display area, optimizing browser main thread resource usage and page interaction smoothness.
[0013] This application improves the readability and retrieval efficiency of key information in complex business web pages by organically coupling web page structural information, business semantic understanding, and visual focus of the display area. It accurately extracts web page keywords and performs differentiated rendering to solve the problem of inaccurate information presentation caused by using a uniform style to render the original text of the web page in the prior art. Attached Figure Description
[0014] Figure 1 This is a schematic diagram of an application environment for a webpage keyword rendering method according to an embodiment of this application; Figure 2 A schematic flowchart illustrating a webpage keyword rendering method provided in an embodiment of this application; Figure 3 for Figure 2 A detailed flowchart illustrating the process of obtaining structured web page data in step S1. Figure 4 for Figure 2 A detailed flowchart illustrating the process of obtaining multiple keywords labeled with semantic type in step S4. Figure 5 for Figure 2 A detailed flowchart illustrating the training process of the keyword recognition model in step S4. Figure 6 for Figure 2 A detailed flowchart illustrating the calculation of the semantic weight value of each keyword in step S5; Figure 7 for Figure 6 A detailed flowchart illustrating the process of determining the hierarchical depth value of the target text node and the importance coefficient of the parent node in step S52. Figure 8 for Figure 2 A schematic diagram of the refinement process for calculating pixel distance values in step S6; Figure 9 A schematic diagram of a webpage keyword rendering apparatus provided in an embodiment of this application; Figure 10 This is a schematic diagram of the structure of a computer device according to one embodiment of this application; Figure 11 This is another structural schematic diagram of a computer device according to one embodiment of this application.
[0015] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0017] It should be noted that the use of terms such as "first" and "second" in this application is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of those features. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed in this application.
[0018] The webpage keyword rendering method provided in this application embodiment can be applied to, for example, Figure 1 In this application environment, the client communicates with the server via a network. The server obtains the document object model tree (DOM) of the target webpage, performs structured processing on the DOM to obtain structured webpage data containing multiple text nodes and text data for each text node; identifies the page region to which the text data of each text node belongs in the target webpage, and selects text nodes whose page regions belong to a preset target region as target text nodes; from a preset mapping table of page types and text fragment filtering rules, it obtains text fragment filtering rules that match the page type of the target webpage, and uses these text fragment filtering rules to filter candidate text fragments from the text data of the target text nodes. The candidate text fragments are identified using a pre-defined keyword recognition model to obtain multiple keywords labeled with semantic type tags. Based on the semantic type tag corresponding to each keyword and the hierarchical relationship of the target text node corresponding to the text fragment to which the keyword belongs in the structured web page data, the semantic weight value of each keyword is calculated. The pixel distance value between the position coordinates of each keyword on the target web page and the pre-defined reference coordinates in the display area of the target web page is calculated. The pixel distance value and the semantic weight value are used as a query index to query a pre-defined mapping table between the query index and rendering parameters to obtain the rendering mode and rendering priority of each keyword. The rendering mode and rendering priority of each keyword are then used to render each keyword.
[0019] This application obtains target text nodes through structured parsing of the document object model tree and identification of the main text region. This effectively filters out noise interference from non-core areas such as navigation bars, sidebars, and advertisements, significantly reducing the amount of subsequent data processing and improving the signal-to-noise ratio of keyword extraction. Based on a preset mapping table between page types and text fragment filtering rules, candidate text fragments are specifically filtered from the target text nodes, solving the problem of poor adaptability of general rules in complex financial web pages such as financial reports and research reports.
[0020] A keyword recognition model is used to perform sequence labeling on candidate text fragments to obtain keywords with semantic type labels. Based on the hierarchical relationship between the semantic type label and the text node to which the keyword belongs in the structured data, the semantic weight value is calculated. This makes the weight evaluation no longer rely solely on word frequency statistics, but integrates the hierarchical relationship of text nodes, thereby enhancing the distinguishability of high-value information (such as keywords in the title and abstract areas).
[0021] Using pixel distance values and semantic weight values as query indexes, the rendering mode and priority for each keyword are obtained by retrieving a pre-defined mapping table between query indexes and rendering parameters. Finally, ordered rendering is performed based on this rendering mode and priority, achieving dual adaptive driving of "content semantic importance" and "user's current visual focus area." This ensures that key information is prioritized for highlighting within the display area, optimizing browser main thread resource usage and page interaction smoothness.
[0022] This application improves the readability and retrieval efficiency of key information in complex business web pages by organically coupling web page structural information, business semantic understanding, and visual focus of the display area. It accurately extracts web page keywords and performs differentiated rendering to solve the problem of inaccurate information presentation caused by using a uniform style to render the original text of the web page in the prior art.
[0023] Reference Figure 2 The diagram shown is a flowchart illustrating a webpage keyword rendering method according to an embodiment of this application. This method is executed by a device.
[0024] In this embodiment, a method for rendering web page keywords includes: S1. Obtain the document object model tree of the target webpage, and perform structuring processing on the document object model tree to obtain structured webpage data containing multiple text nodes and text data of each text node. In this embodiment, when a user clicks on a target webpage in a browser, such as the webpages of insurance, banking, and securities institutions, the document object model tree (DOM) of the target webpage is obtained through the browser's native API. This includes: obtaining the Hypertext Markup Language (HTML) source code of the target webpage, parsing and loading the HTML source code using a preset browser rendering engine, and generating the DOM of the target webpage.
[0025] The Document Object Model (DOM) tree is a tree-like data structure generated by the browser after parsing HTML / XML documents. The DOM tree abstracts each tag, text (including text nodes and non-text nodes), attribute, etc. in the target webpage into nodes and organizes them through hierarchical relationships such as parent-child and sibling.
[0026] In one embodiment, reference Figure 3As shown, the structuring of the document object model tree to obtain structured webpage data containing multiple text nodes and text data for each text node includes: S11. Delete the non-text nodes in the document object model tree to obtain multiple text nodes; S12. Extract the text content of each text node as text data; S13. Associate each text node with its corresponding text data; S14. Encapsulate each associated text node and its corresponding text data according to the preset standardized field format to generate structured web page data.
[0027] Traverse the Document Object Model (DOM) tree, removing non-text nodes and retaining text nodes. A text node is a fundamental component of the DOM tree, containing text content. Text nodes include at least one of the following: heading nodes, paragraph nodes, list nodes, table nodes, and navigation nodes. Nodes other than text nodes are collectively referred to as non-text nodes.
[0028] Extract the text data of each text node. The text data of a text node refers to the pure character sequence carried by the text node in the DOM tree. That is, after removing HTML tags, scripts and style code, the natural language content that the user can actually see on the webpage or that can be parsed by the semantic model.
[0029] To maintain the mapping between text content and corresponding text nodes, a key-value pair mapping structure or array of objects is constructed. Specifically, the mapping is established using the reference address of the text node as the key and the text data as the value. This association mechanism allows the original DOM node in the Document Object Model tree to be queried based on the identified keyword location information during the subsequent keyword rendering stage, thereby achieving accurate rendering mode injection and avoiding a repaint of the entire page.
[0030] Each associated text node and its corresponding text data are encapsulated according to a pre-defined standardized field format (such as a JSON object), generating structured web page data containing node identifiers, text content, location information, and semantic tags. This structured web page data unifies the data representation of different areas within the web page, providing a standardized input foundation for subsequent page-type-based differentiated text fragment filtering and keyword recognition models, effectively improving the compatibility of the data processing chain and the efficiency of model inference.
[0031] S2. Identify the page area to which the text data of each text node belongs in the target webpage, and select the text node whose page area belongs to the preset target area as the target text node. In this embodiment, the document object model tree of the target webpage is traversed to obtain the document structure features of each text node. The document structure features refer to the position, level and attribute information of the text node in the DOM (Document Object Model) tree. Based on the document structure features of the text nodes, initial region labels are marked for each text node. A preset page region label classification table is queried to obtain the page region corresponding to the initial region label. The page region label classification table records the correspondence between each region label and the main text region or non-main text region.
[0032] Non-text areas refer to page blocks on the target webpage that serve functions such as navigation, page declaration, auxiliary display, or commercial promotion, and do not contain core information. Examples include the top navigation bar, bottom footer, sidebar, and embedded advertising areas.
[0033] The text nodes of the preset target area are defined as the main text area, which refers to the page blocks on the target webpage that carry core business data and substantive analytical content. For example, in the fintech field, for a financial statement webpage, the main text area includes the financial statement data display area, the management discussion and analysis area, and the audit report text area; for a research report webpage, the main text area includes the research report summary area, rating information area, analysis text area, and risk warning area; for a market data webpage, the main text area includes the real-time market data panel, market information area, fund flow display area, and related news list area. The definition of the main text area is dynamically determined according to the type of target webpage, ensuring that the selected target text nodes always correspond to the core information carrier of the current webpage.
[0034] The initial region labels are mapped to either main text or non-main text region categories. Text nodes identified as non-main text regions are directly filtered out; only text nodes mapped to the preset target region (main text region) are retained as target text nodes. This mechanism effectively eliminates noisy data such as navigation and advertisements, ensuring that the subsequent keyword recognition model focuses on core business content such as financial statements, research report paragraphs, and market data, significantly improving processing accuracy and computational efficiency.
[0035] S3. Obtain the text fragment filtering rules that match the page type of the target webpage from the preset mapping table of page types and text fragment filtering rules, and use the text fragment filtering rules to filter out candidate text fragments from the text data of the target text node. In this embodiment, at least one of the following identifiers is parsed: the URL feature, meta tags, and DOM structure fingerprint of the target webpage. Based on the identifier, the page type to which the target webpage belongs is automatically identified, such as a financial report page, research report page, market data page, or announcement page.
[0036] Once the page type of the target webpage is determined, the mapping table between page type and text fragment filtering rules is queried to obtain the corresponding text fragment filtering rules. These rules are then applied to the text data of the target text nodes for parsing and filtering, extracting candidate text fragments that meet the preset conditions.
[0037] Existing technologies employ general parsing rules, which are difficult to adapt to the heterogeneous structures of financial web pages, easily leading to the omission of key information or extraction errors. This application constructs dedicated filtering rules for different types of financial pages, which can accurately locate core content areas such as financial statements and research reports, effectively filtering out noise interference from navigation bars, advertisements, etc., and significantly improving the accuracy and completeness of information extraction. At the same time, differentiated rules avoid invalid DOM traversal, reduce computational overhead, and balance the professionalism and efficiency of data processing in financial scenarios.
[0038] The page types include financial report web pages, research report web pages, and market data web pages. The mapping table between the page types and text fragment filtering rules is constructed as follows: Text fragment filtering rules for financial report web pages, research report web pages, and market data web pages are constructed; each text fragment filtering rule is associated with its corresponding page type to obtain multiple key-value pairs; and a mapping table between the page types and text fragment filtering rules is generated based on these multiple key-value pairs.
[0039] When the target webpage is a financial report webpage, the target text nodes are filtered using the text fragment filtering rules of the financial report webpage, including: matching the target text nodes with preset table tag selector expressions (containing...). 、 、 and The system matches the DOM path of the target text node using the table tag selector expression. If the DOM path of the target text node matches the table tag selector expression, the node is determined to belong to a structured table area, and its text data is extracted as a candidate text fragment. If no match is found, the node is discarded. This method accurately identifies core data nodes such as balance sheets and profit and loss statements, and automatically filters navigation bar and advertising noise in non-table areas.
[0040] When the target webpage is a research report webpage, the target text nodes are filtered using the text fragment filtering rules of the research report webpage. This includes: obtaining a preset semantic region positioning pattern (a structured configuration object composed of parent node labels, class names, and hierarchical paths); traversing the target text nodes and detecting whether the parent labels, class names, and hierarchical paths of each node match the semantic region positioning pattern; identifying the text paragraphs corresponding to successfully matched nodes as semantic regions such as abstracts, preset indicators, risk analyses, or conclusions, and extracting their text data as candidate text fragments; and excluding unmatched nodes (such as sidebar recommended content). This method achieves precise semantic block-level segmentation and extraction of unstructured long texts from research reports.
[0041] When the target webpage is a market data page, the target text nodes are filtered using the text fragment filtering rules of the market data page. This includes: using a pre-defined numeric text regular expression matching template (covering integer, decimal, percentage, and thousands place formats) to perform regular expression detection on the text content of the target text nodes; for target text nodes that match the regular expression matching template, further verification is performed to check whether their parent tags belong to a predefined parent tag whitelist; only when both the regular expression detection result and the parent tag whitelist verification pass are the text data of that node extracted as a candidate text fragment. Through this composite matching condition of "regular expression + tag whitelist", dynamic numerical elements such as real-time prices and percentage changes are extracted first, while effectively blocking false matches caused by pop-up scripts and irrelevant text.
[0042] S4. Use a preset keyword recognition model to identify keywords in the candidate text fragments to obtain multiple keywords labeled with semantic type tags; In one embodiment, reference Figure 4 As shown, the candidate text fragment is identified using a preset keyword recognition model to obtain multiple keywords labeled with semantic type tags, including: S41. The keyword recognition model is used to perform sequence labeling on the candidate text fragments to obtain a labeling sequence containing the boundary identifiers and semantic type identifiers of each text unit in the candidate text fragments; S42. Extract keywords from the candidate text fragments based on the combination relationship between the boundary markers of each text unit in the annotation sequence; S43. The semantic type identifier of the text unit corresponding to each keyword is determined as the semantic type of the keyword.
[0043] The keyword recognition model adopts a sequence labeling architecture based on a combination of deep bidirectional encoding representation and conditional random fields, which can simultaneously capture the deep semantic features and contextual dependencies of financial texts.
[0044] The keyword recognition model is used to perform sequence labeling on the candidate text segments, outputting the boundary identifiers and semantic type identifiers corresponding to each text unit (token) in the candidate text segments. Specifically: the candidate text segments are semantically encoded using bidirectional encoding of a pre-trained language model to obtain the semantic vector representation of each text unit; then, the semantic vector representation is globally optimally decoded using a conditional random field layer based on a pre-learned label transition matrix, outputting the boundary identifiers and semantic type identifiers of each text unit, thereby obtaining the labeled sequence.
[0045] The boundary identifier of a single text unit is used to characterize its relative position within the keywords (e.g., B-beginning, I-middle, O-outer in BIO format); the semantic type identifier represents the business category to which the text unit belongs (e.g., company name, financial indicators, etc.). Obtaining this identifier enables fine-grained keyword classification, providing a semantic basis for subsequent differentiated weight calculations based on business value. Sequence labeling of candidate text segments accurately locates the start and end boundaries of keywords within the text, avoiding ambiguity and truncation issues common in traditional matching methods, and ensuring complete extraction.
[0046] When extracting keywords based on the labeled sequence, the system traverses the labeled sequence in sequence and extracts keywords from the candidate text fragments based on the combination relationship between the boundary markers of each text unit.
[0047] The combination relationship between boundary markers refers to the legal transfer rules and temporal dependencies between boundary markers in a predefined annotation system (such as the BIO format). For example, only intermediate or external tags of the same semantic type are allowed after the starting tag. By parsing this combination relationship, the complete entity span of the keyword can be accurately defined.
[0048] Specifically, when the boundary marker of the current text unit is detected as a start label (such as a B label), the current position is recorded as the keyword start index, and the semantic type identifier carried in the start label is parsed as the target semantic type. The scanning continues, and if the boundary markers of subsequent consecutive text units are all intermediate labels (such as I labels), the keyword end index is continuously updated until a non-intermediate label (such as an O label or a new B label) or the end of the sequence is encountered. The continuous text unit interval between the start index and the end index is extracted from the candidate text fragment to obtain the keyword, and the target semantic type is bound to the keyword. That is, the semantic type identifier of the text unit corresponding to each keyword is determined as the semantic type of the keyword, thus completing the extraction of the keyword and its semantic type.
[0049] For example, through the above sequence labeling and boundary decoding process, the keyword "AA Company" can be extracted from the research report summary and marked as a listed company (semantic type), the keyword "buy" can be extracted and marked as an investment rating (semantic type), and the keyword "two thousand one hundred yuan" can be extracted and marked as a target price (semantic type).
[0050] This application upgrades keywords from simple text strings to structured data units carrying semantic types. In financial document review scenarios, the same words may correspond to different legal meanings (e.g., "interest rate" belongs to pricing elements or risk indicators in different clauses). Semantic type identification realizes the automatic resolution of such contextual ambiguity.
[0051] In one embodiment, reference Figure 5 As shown, the keyword recognition model is obtained according to the following training methods, including: S44. Collect historical webpage data of preset business types, parse the structured tags and preset text regions in the historical webpage data, and obtain a training sample set; S45. Perform sequence annotation on each text unit of each text segment in the training sample set to obtain an annotated sample containing the boundary identifier and the semantic type identifier of each text unit. S46. The pre-trained language model is trained under supervision using the labeled samples to obtain the keyword recognition model.
[0052] Historical webpage data of preset business types is collected, and the structured tags and preset text regions in the historical webpage data are parsed to obtain a training sample set. The historical webpage data includes financial report webpages, research report webpages, and market data webpages. Structured tags refer to table tags such as `table`, `tr`, and `td`, and container tags such as `div` and `span` in HTML, used to define content hierarchy. Preset text regions refer to text paragraphs, table cells, or specific semantic blocks located according to rules, excluding noise such as navigation and advertisements, ensuring that the training samples focus on core business information.
[0053] Sequence annotation is performed on each text unit of each text segment in the training sample set to obtain annotated samples containing the boundary markers and semantic type markers of each text unit. Sequence annotation employs at least one of the following methods: manual annotation, model pre-annotation, or expert verification, simultaneously marking the boundary markers and semantic type markers of each text unit.
[0054] A keyword recognition model is obtained by supervised fine-tuning of a pre-trained language model using labeled samples. The pre-trained language model employs a sequence labeling architecture combining deep bidirectional encoding representation and conditional random fields. An end-to-end optimization of the prediction of boundary markers and semantic type markers for each text unit is performed using a joint loss function. During training, adversarial examples from the financial domain are introduced to enhance the model's robustness. Fine-tuning stops when the loss value meets a preset convergence condition, resulting in the keyword recognition model.
[0055] The semantic analysis model in this application can accurately identify keywords and their semantic types in financial texts, providing weighted structured labels for subsequent intelligent highlighting. Compared with general models, it improves the accuracy of financial terminology recognition and the depth of semantic understanding, ensuring that the highlighted content is professional and compliant, and supporting the effective implementation of dynamic rendering and personalized filtering functions.
[0056] S5. Based on the semantic type tag corresponding to each keyword and the hierarchical relationship of the target text node corresponding to the text segment to which the keyword belongs in the structured web page data, calculate the semantic weight value of each keyword. In one embodiment, reference Figure 6 As shown, the step of calculating the semantic weight value of each keyword based on the semantic type tag corresponding to each keyword and the hierarchical relationship of the target text node corresponding to the text segment to which the keyword belongs in the structured web page data includes: S51. Obtain the basic weight value of the semantic type of the keyword from the preset semantic type label-basic weight mapping table; S52. Based on the hierarchical relationship of the target text node corresponding to the text segment to which each keyword belongs in the structured web page data, determine the hierarchical depth value and parent node importance coefficient of the target text node. S53. Based on the basic weight value, the hierarchical depth value, and the parent node importance coefficient, the semantic weight value is calculated.
[0057] The semantic type label-basic weight mapping table is constructed based on business domain knowledge and historical annotation data, reflecting the prior importance of each semantic type label in a preset scenario. For example, keywords of semantic types such as "financial indicators", "risk warnings", and "regulatory penalties" are assigned a first basic weight value, such as a high weight of 0.8–1.0, while auxiliary types such as "navigation labels" and "footer information" are only assigned a second basic weight value, such as a low weight of 0.1–0.3. The first basic weight value is greater than the second basic weight value, ensuring that key financial content is identified first.
[0058] The method for constructing the pre-defined mapping relationship table between semantic types and basic weights includes: obtaining a set of labeled samples in the financial field, wherein the set of labeled samples contains historical web page text fragments and their corresponding manually labeled keyword semantic types and importance scores; calculating the occurrence frequency and average importance score of each semantic type in the set of labeled samples, and calculating the initial basic weight value of each semantic type based on the occurrence frequency and the average importance score; and establishing an initial mapping relationship table between semantic type labels and initial basic weight values.
[0059] In one embodiment, reference Figure 7 As shown, determining the hierarchy depth value and parent node importance coefficient of the target text node based on the hierarchical relationship of the target text node corresponding to the text fragment to which each keyword belongs in the structured web page data includes: S521. Starting from the root node of the document object model tree, calculate the shortest path length from the target node corresponding to each keyword to the root node, and use the shortest path length as the level depth value. S522. Identify the node label type of the direct parent node of the target node corresponding to each keyword; S523. Match the weight coefficient corresponding to the node label type of the direct parent node from the preset node label-importance mapping table, and use the weight coefficient as the importance coefficient of the parent node.
[0060] Hierarchical relationships refer to the topological position of a target text node in the DOM tree. Specifically, it includes two dimensions: first, vertical depth, which is the path length from the node to the root node, reflecting the content nesting level; and second, horizontal semantic attribution, which is the tag type of the direct parent node (such as table, div, etc.), representing the business importance of the container to which the node belongs. Together, these two constitute the DOM structural features used to quantify the contextual weight of keywords.
[0061] When determining the level depth value, the root node of the Document Object Model (DOM) tree is used as the starting point for traversal. A breadth-first search algorithm is employed to traverse downwards level by level, recording the minimum number of edges traversed from the root node to the target text node corresponding to each keyword. This minimum number of edges is taken as the shortest path length and directly assigned as the level depth value. This level depth value objectively reflects the nesting level of the target node in the page structure. The smaller the value, the closer the node is to the main content area of the page, and the higher its semantic significance. The larger the value, the more deeply nested the node is in a container, which may belong to a comment, footnote, or peripheral auxiliary information, and the semantic significance is correspondingly reduced.
[0062] When determining the importance coefficient of a parent node, the direct parent node of the target text node is first obtained, and the node tag type (such as html tag type) of the direct parent node is parsed. Then, the preset node tag-importance mapping relationship table is queried to match the weight coefficient corresponding to the node tag type.
[0063] The tag-importance mapping table is constructed as follows: First, all HTML parent node tag types actually appearing on the target webpage are identified and divided into three categories based on typographical semantics: prominent, regular, and container. Prominent tags include h1 to h6, strong, em, etc., which have explicit emphasis; regular tags include p, li, td, etc., which carry body content; and container tags include div, span, a, etc., which have no semantic meaning or are purely style tags. Then, weight coefficients are assigned to each of the three categories: prominent tags are assigned a gain coefficient greater than 1, such as h1 1.5, h2 1.3, strong 1.2; regular tags are uniformly assigned a value of 1.0; and container tags are assigned a loss coefficient less than 1, such as div 0.9, span 0.8. The specific values of the coefficients can be fine-tuned according to the actual emphasis intensity of the tags in the business scenario, but the monotonic order of prominent > regular > container must be maintained. Finally, the tag types and corresponding weight coefficients are stored in a hash table or configuration file in key-value pairs to obtain the tag-importance mapping table.
[0064] Semantic weight values are calculated using a weighted formula: Semantic weight value = Base weight value × Hierarchical depth value × Parent node importance coefficient × Adjustment factor. The adjustment factor is used to fine-tune extreme cases, such as when a keyword simultaneously hits multiple high-weight semantic types, to avoid weight overflow.
[0065] Existing technologies often rely solely on word frequency or general semantic models to calculate keyword semantic weights, neglecting webpage structure information. This solution integrates semantic type base weights, hierarchical depth, and parent node layout semantics, enabling keyword semantic weight calculations to simultaneously reflect multiple dimensions of business value, page position, and layout. This effectively distinguishes core content from peripheral information, prevents high-frequency, general terms from gaining artificially high weights due to positional advantages, and improves the business accuracy and content relevance of keyword ranking.
[0066] S6. Calculate the pixel distance between the position coordinates of each keyword on the target webpage and the preset reference coordinates in the display area of the target webpage; In one embodiment, reference Figure 8 As shown, calculating the pixel distance between the position coordinates of each keyword on the target webpage and the preset reference coordinates in the display area of the target webpage includes: S61. Obtain the boundary area of the text data corresponding to each keyword in the target webpage; S62. Use the midpoint of the upper boundary of the boundary region as the position coordinates of each keyword; The geometric center point of the display area is used as a preset reference coordinate. S63. Calculate the absolute value of the difference between the position coordinates and the preset reference coordinates in the vertical direction, and use the absolute value of the difference as the pixel distance value.
[0067] The text data in the target text node is parsed, the number of characters is counted, and the associated font metrics (such as font size, font weight, and average character width) are obtained. Based on the number of characters and the font metrics, the actual length and width of the text data in the rendering state are calculated. Using the reference anchor point position of the target text node (such as the top left corner of the node or the starting point of the text baseline) as the spatial reference origin, a rectangular region is expanded in combination with the actual length and width to generate a boundary region that represents the visual occupancy of the text node.
[0068] The reason for selecting the midpoint of the upper boundary of the boundary area as the keyword location coordinate is that when users read web pages, their eyes usually start scanning from the top of the text block, and the midpoint of the upper boundary best represents the temporal characteristics of the keyword entering the visible area.
[0069] The display area of the target webpage refers to the actual visible area of the page on the browser's current screen, that is, the range of content that the user can see directly without scrolling. Its size changes dynamically with the window size, zoom level, and scroll position.
[0070] Setting the geometric center of the display area as the preset reference coordinates is based on the cognitive pattern in the visual attention model that users are most sensitive to the central area of the screen. In other embodiments, the midpoint of the upper or lower boundary of the display area can be used as the preset reference coordinates.
[0071] The absolute value of the vertical difference is used as the pixel distance value because web page content primarily uses vertical scrolling for interaction, and the impact of horizontal offset on reading priority is far less than that of vertical position. This design effectively filters out the interference of horizontal layout differences, allowing the pixel distance value to accurately reflect the visual proximity of keywords on the user's current browsing path, providing a quantitative basis for subsequent hierarchical rendering that conforms to human reading habits.
[0072] Existing technologies often rely on the node order or text position sorting in the document object model tree, failing to reflect the visual salience of keywords in the user's actual viewport. This solution transforms the abstract document structure into a spatial metric directly corresponding to the distribution of human reading attention by calculating pixel distance values. This ensures that rendering priority truly aligns with the user's visual perception patterns, resolving the technical problem of the sorting results being disconnected from the actual reading experience in traditional methods, and improving the intuitiveness and efficiency of information presentation.
[0073] S7. Using the pixel distance value and the semantic weight value as query indexes, query the preset query index and rendering parameter mapping table to obtain the rendering mode and rendering priority of each keyword, and perform rendering on each keyword using the rendering mode and rendering priority of each keyword.
[0074] In one embodiment, the mapping table between the query index and rendering parameters includes a first mapping table between pixel distance values and rendering priorities, and a second mapping table between semantic weight values and rendering modes. The step of using the pixel distance values and semantic weight values as query indexes to query the preset mapping table between the query index and rendering parameters to obtain the rendering mode and rendering priority of each keyword includes: Using the pixel distance value as the first query index, query the first mapping relationship table between the pixel distance value and the rendering priority to obtain the rendering priority of each keyword; Using the semantic weight value as the second query index, query the second mapping table between the semantic weight value and the rendering mode to obtain the rendering mode of each keyword.
[0075] The first mapping table defines the correspondence between pixel distance ranges and rendering priorities. For example, 0-500px is the first priority, 500-1500px is the second priority, and above 1500px is the third priority. During a query, the first mapping table is consulted based on the pixel distance value of each keyword relative to the display area to determine the rendering priority and decide whether the keyword should be rendered immediately, asynchronously delayed, or simply marked without loading.
[0076] For example, the rendering priority is divided into three levels: (1) When the pixel distance value falls into the first distance range (0-500px), the first priority is hit, and the keyword is rendered immediately; (2) When the pixel distance value falls into the second distance range (500-1500px), the second priority is hit, and asynchronous rendering is performed during the browser's idle period; (3) When the pixel distance value falls into the third distance range (above 1500px), the third priority is hit, and only the DOM node position mark is recorded; when the user scrolls and the pixel distance falls into the first two levels, the mapping relationship table is re-queried using the updated pixel distance and semantic weight as the joint index, and the corresponding level of rendering is triggered according to the new result.
[0077] The second mapping table defines the association between semantic weight thresholds and rendering modes. For example, a weight ≥ 0.8 is highlighted in red, 0.5-0.8 is marked with a yellow background, and < 0.5 is simply underlined. Based on the semantic weight value of the keyword, the second mapping table is consulted to match the specific rendering mode. Rendering modes include first to third rendering modes. The first rendering mode includes a first background color, a first font color, and a bold style; the second rendering mode includes a second background color and a second font color; and the third rendering mode includes an underline style. The first background color is different from the second background color, and the visual salience of the first rendering mode is higher than that of the second and third rendering modes.
[0078] First and second mapping tables are established, allowing rendering scheduling and visual performance to be configured and optimized separately. This mechanism ensures that high-value keywords within the visible area are displayed prominently and instantly, while avoiding unnecessary rendering overhead in the non-visible area, balancing user experience and page performance. Furthermore, the mapping rules can be dynamically adjusted through configuration files, adapting to the rendering needs of different business scenarios without modifying the core code.
[0079] The rendering sequence is determined based on the rendering priority of keywords, with higher-priority keywords being rendered first. Visual attributes such as font color, background color, and underline are configured according to the rendering mode. Keywords within the visible area are immediately highlighted with styles, while keywords in adjacent areas are rendered asynchronously according to priority. Keywords in distant areas are delayed until they are scrolled into the viewport before being loaded and rendered, thus achieving a dynamic hierarchical rendering effect that balances responsiveness and visual distinctiveness.
[0080] The mapping table between the query index and rendering parameters is constructed as follows: Based on the preset reference coordinates of the display area, the effective range of pixel distance values is determined; the effective range is divided into multiple distance intervals according to a preset distance division method; each distance interval represents the proximity of the keyword position to the preset reference coordinates; a corresponding rendering priority is configured for each distance interval, and a first mapping table between each distance interval and its corresponding rendering priority is established, wherein the rendering priority decreases as the distance interval increases. The range of semantic weight values is divided into multiple weight level intervals, and a corresponding rendering mode is configured for each weight level interval, establishing a second mapping table between each weight level interval and its corresponding rendering mode, wherein the rendering modes corresponding to different weight level intervals exhibit a gradient change in visual saliency; the first mapping table and the second mapping table are stored as key-value pairs to obtain the mapping table between the query index and rendering parameters.
[0081] This application uses a financial insurance scenario as an example throughout, without making any limitations: Taking a user browsing a listed company's annual report as an example, the system identifies "net profit decreased by 35% year-on-year" as a risk warning keyword, with a weight of 0.92, belonging to the first priority level, and is rendered immediately with a red background and white bold font when the page loads; "revenue from new energy business increased by 18%" is a business analysis keyword, with a weight of 0.65, belonging to the second priority level, and is rendered asynchronously with a blue background and dark font when scrolling into the viewport buffer; "the company was founded in 2005" is a general information keyword, with a weight of 0.3, belonging to the third priority level, and is added in batches with an underline style during the browser's idle time. By jointly mapping the rendering mode and priority through semantic type and weight, and combining an immediate, asynchronous, and idle three-level progressive strategy, the system balances the immediate visibility of risk with page smoothness.
[0082] like Figure 9 The diagram shown is a schematic representation of a webpage keyword rendering device provided in an embodiment of this application.
[0083] The webpage keyword rendering device 100 described in this application can be installed in a device. Depending on the functions implemented, the webpage keyword rendering device 100 may include a processing module 110, an identification module 120, a filtering module 130, an obtaining module 140, and a calculation module 150. The module described in this application can also be called a unit, which refers to a series of computer program segments that can be executed by the device processor and perform a fixed function, and which are stored in the device's memory.
[0084] In this embodiment, the functions of each module / unit are as follows: Processing module 110 is used to obtain the document object model tree of the target webpage, perform structuring processing on the document object model tree, and obtain structured webpage data containing multiple text nodes and text data of each text node. The identification module 120 is used to identify the page area to which the text data of each text node belongs in the target webpage, and select the text node whose page area belongs to the preset target area as the target text node. The filtering module 130 is used to obtain the text fragment filtering rules that match the page type of the target webpage from a preset mapping table of page types and text fragment filtering rules, and use the text fragment filtering rules to filter out candidate text fragments from the text data of the target text node. The module 140 is used to perform keyword recognition on the candidate text fragment using a preset keyword recognition model to obtain multiple keywords labeled with semantic type tags; The calculation module 150 is used to calculate the semantic weight value of each keyword in the structured web page data based on the semantic type tag corresponding to each keyword and the hierarchical relationship of the target text node corresponding to the text segment to which the keyword belongs. The distance module 160 is used to calculate the pixel distance value between the position coordinates of each keyword on the target webpage and the preset reference coordinates in the display area of the target webpage; The rendering module 170 is used to use the pixel distance value and the semantic weight value as query indexes to query a preset mapping table between query indexes and rendering parameters, obtain the rendering mode and rendering priority of each keyword, and perform rendering on each keyword using the rendering mode and rendering priority of each keyword.
[0085] In one embodiment, the processing module 110 is specifically used for: Delete the non-text nodes in the document object model tree to obtain multiple text nodes; Extract the text content of each text node as text data; Associate each text node with its corresponding text data; Each associated text node and its corresponding text data are encapsulated according to a preset standardized field format to generate structured web page data.
[0086] In one embodiment, module 130 is obtained, specifically for: The keyword recognition model is used to perform sequence annotation on the candidate text fragments to obtain an annotation sequence containing the boundary identifiers and semantic type identifiers of each text unit in the candidate text fragments; Keywords are extracted from the candidate text fragments based on the combination relationship between the boundary markers of each text unit in the labeled sequence. The semantic type identifier of the text unit corresponding to each keyword is determined as the semantic type of the keyword.
[0087] In one embodiment, module 130 is obtained, specifically for: Collect historical webpage data of preset business types, parse the structured tags and preset text regions in the historical webpage data, and obtain a training sample set; Sequence annotation is performed on each text unit of each text segment in the training sample set to obtain an annotated sample containing the boundary identifier and the semantic type identifier of each text unit; The pre-trained language model is trained under supervised fine-tuning using the labeled samples to obtain the keyword recognition model.
[0088] In one embodiment, the calculation module 140 is specifically used for: Obtain the basic weight value of the semantic type of the keyword from the preset semantic type label-basic weight mapping table; Based on the hierarchical relationship of the target text node corresponding to the text fragment to which each keyword belongs in the structured web page data, determine the hierarchical depth value and parent node importance coefficient of the target text node; The semantic weight value is calculated based on the basic weight value, the hierarchical depth value, and the parent node importance coefficient.
[0089] In one embodiment, the calculation module 140 is specifically used for: Starting from the root node of the document object model tree, calculate the shortest path length from the target node corresponding to each keyword to the root node, and use the shortest path length as the level depth value; Identify the node label type of the direct parent node of the target node corresponding to each keyword; Match the weight coefficient corresponding to the node label type of the direct parent node from the preset node label-importance mapping table, and use the weight coefficient as the importance coefficient of the parent node.
[0090] In one embodiment, the distance module 150 is specifically used for: Obtain the boundary area of the text data corresponding to each keyword in the target webpage; The midpoint of the upper boundary of the boundary region is used as the position coordinate of each keyword; The geometric center point of the display area is used as a preset reference coordinate. Calculate the absolute value of the difference between the position coordinates and the preset reference coordinates in the vertical direction, and use the absolute value of the difference as the pixel distance value.
[0091] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the functions or steps of a webpage keyword rendering method on the server side.
[0092] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 11 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements client-side functions or steps of a webpage keyword rendering method.
[0093] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: Obtain the document object model tree of the target webpage, perform structuring processing on the document object model tree, and obtain structured webpage data containing multiple text nodes and text data of each text node; Identify the page region to which the text data of each text node belongs in the target webpage, and select the text node whose page region belongs to the preset target region as the target text node; From the preset mapping table of page types and text fragment filtering rules, obtain the text fragment filtering rules that match the page type of the target webpage, and use the text fragment filtering rules to filter candidate text fragments from the text data of the target text node. The candidate text fragments are identified using a preset keyword recognition model to obtain multiple keywords labeled with semantic type tags; Based on the semantic type tag corresponding to each keyword and the hierarchical relationship of the target text node corresponding to the text segment to which the keyword belongs in the structured web page data, the semantic weight value of each keyword is calculated. Calculate the pixel distance between the position coordinates of each keyword on the target webpage and the preset reference coordinates in the display area of the target webpage; Using the pixel distance value and the semantic weight value as query indexes, a preset mapping table between query indexes and rendering parameters is queried to obtain the rendering mode and rendering priority of each keyword. Rendering is then performed on each keyword using the rendering mode and rendering priority of each keyword.
[0094] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0095] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0096] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0097] It should be noted that any AI models, software tools, or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with the knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.
[0098] Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for rendering keywords on a webpage, characterized in that, The method includes: Obtain the document object model tree of the target webpage, perform structuring processing on the document object model tree, and obtain structured webpage data containing multiple text nodes and text data of each text node; Identify the page region to which the text data of each text node belongs in the target webpage, and select the text node whose page region belongs to the preset target region as the target text node; From the preset mapping table of page types and text fragment filtering rules, obtain the text fragment filtering rules that match the page type of the target webpage, and use the text fragment filtering rules to filter candidate text fragments from the text data of the target text node. The candidate text fragments are identified using a preset keyword recognition model to obtain multiple keywords labeled with semantic type tags; Based on the semantic type tag corresponding to each keyword and the hierarchical relationship of the target text node corresponding to the text segment to which the keyword belongs in the structured web page data, the semantic weight value of each keyword is calculated. Calculate the pixel distance between the position coordinates of each keyword on the target webpage and the preset reference coordinates in the display area of the target webpage; Using the pixel distance value and the semantic weight value as query indexes, a preset mapping table between query indexes and rendering parameters is queried to obtain the rendering mode and rendering priority of each keyword. Rendering is then performed on each keyword using the rendering mode and rendering priority of each keyword.
2. The webpage keyword rendering method as described in claim 1, characterized in that, The structuring of the document object model tree to obtain structured webpage data containing multiple text nodes and text data for each text node includes: Delete the non-text nodes in the document object model tree to obtain multiple text nodes; Extract the text content of each text node as text data; Associate each text node with its corresponding text data; Each associated text node and its corresponding text data are encapsulated according to a preset standardized field format to generate structured web page data.
3. The webpage keyword rendering method as described in claim 1, characterized in that, The process involves using a preset keyword recognition model to identify keywords in the candidate text fragments, resulting in multiple keywords labeled with semantic type tags, including: The keyword recognition model is used to perform sequence annotation on the candidate text fragments to obtain an annotation sequence containing the boundary identifiers and semantic type identifiers of each text unit in the candidate text fragments; Keywords are extracted from the candidate text fragments based on the combination relationship between the boundary markers of each text unit in the labeled sequence. The semantic type identifier of the text unit corresponding to each keyword is determined as the semantic type of the keyword.
4. The webpage keyword rendering method as described in claim 1, characterized in that, The keyword recognition model is obtained through the following training methods: Collect historical webpage data of preset business types, parse the structured tags and preset text regions in the historical webpage data, and obtain a training sample set; Sequence annotation is performed on each text unit of each text segment in the training sample set to obtain an annotated sample containing the boundary identifier and the semantic type identifier of each text unit; The pre-trained language model is trained under supervised fine-tuning using the labeled samples to obtain the keyword recognition model.
5. The webpage keyword rendering method as described in claim 1, characterized in that, The step of calculating the semantic weight value of each keyword based on the semantic type tag corresponding to each keyword and the hierarchical relationship of the target text node corresponding to the text segment to which the keyword belongs in the structured web page data includes: Obtain the basic weight value of the semantic type of the keyword from the preset semantic type label-basic weight mapping table; Based on the hierarchical relationship of the target text node corresponding to the text fragment to which each keyword belongs in the structured web page data, determine the hierarchical depth value and parent node importance coefficient of the target text node; The semantic weight value is calculated based on the basic weight value, the hierarchical depth value, and the parent node importance coefficient.
6. The webpage keyword rendering method as described in claim 5, characterized in that, The step of determining the hierarchy depth value and parent node importance coefficient of the target text node based on the hierarchical relationship of the target text node corresponding to the text fragment to which each keyword belongs in the structured web page data includes: Starting from the root node of the document object model tree, calculate the shortest path length from the target node corresponding to each keyword to the root node, and use the shortest path length as the level depth value; Identify the node label type of the direct parent node of the target node corresponding to each keyword; Match the weight coefficient corresponding to the node label type of the direct parent node from the preset node label-importance mapping table, and use the weight coefficient as the importance coefficient of the parent node.
7. The webpage keyword rendering method as described in claim 1, characterized in that, The calculation of the pixel distance between the position coordinates of each keyword on the target webpage and the preset reference coordinates in the display area of the target webpage includes: Obtain the boundary area of the text data corresponding to each keyword in the target webpage; The midpoint of the upper boundary of the boundary region is used as the position coordinate of each keyword; The geometric center point of the display area is used as a preset reference coordinate. Calculate the absolute value of the difference between the position coordinates and the preset reference coordinates in the vertical direction, and use the absolute value of the difference as the pixel distance value.
8. A webpage keyword rendering device, characterized in that, The device includes: The processing module is used to obtain the document object model tree of the target webpage, perform structuring processing on the document object model tree, and obtain structured webpage data containing multiple text nodes and text data of each text node. The identification module is used to identify the page area to which the text data of each text node belongs in the target webpage, and select the text node whose page area belongs to the preset target area as the target text node. The filtering module is used to obtain the text fragment filtering rules that match the page type of the target webpage from a preset mapping table of page types and text fragment filtering rules, and use the text fragment filtering rules to filter out candidate text fragments from the text data of the target text node. The module is used to perform keyword recognition on the candidate text fragment using a preset keyword recognition model to obtain multiple keywords labeled with semantic type tags; The calculation module is used to calculate the semantic weight value of each keyword in the structured web page data based on the semantic type tag corresponding to each keyword and the hierarchical relationship of the target text node corresponding to the text segment to which the keyword belongs. The distance module is used to calculate the pixel distance between the position coordinates of each keyword on the target webpage and the preset reference coordinates in the display area of the target webpage; The rendering module is used to use the pixel distance value and the semantic weight value as query indexes to query a preset mapping table between query indexes and rendering parameters, obtain the rendering mode and rendering priority of each keyword, and perform rendering on each keyword using the rendering mode and rendering priority of each keyword.
9. A computer device, characterized in that, The device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a webpage keyword rendering program that can be executed by the at least one processor, the webpage keyword rendering program being executed by the at least one processor to enable the at least one processor to perform the webpage keyword rendering method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a webpage keyword rendering program, which can be executed by one or more processors to implement the webpage keyword rendering method as described in any one of claims 1 to 7.