An information generation method and device, electronic equipment and storage medium

CN116662530BActive Publication Date: 2026-08-18启元实验室
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310623392.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-30
Publication Date
2026-08-18
Estimated Expiration
2043-05-30

AI Technical Summary

Technical Problem

[0006]本发明的目的是提供一种信息生成方法、装置、电子设备及存储介质,为解决现有技术中在寻找专业术语或专业领域信息时,需要花费大量的人工去阅读分析并对大量资料进行收集整理而导致的消耗大量的时间的问题

Benefits of technology

[0116]The embodiments of the present invention have at least the following beneficial technical effects: The technical solution of the embodiments of the present invention utilizes user-inputted search terms to extract information, integrate information elements, and perform calculations on articles in a professional field using computer means. It clusters and combines articles in the database that meet the conditions to assist people in information analysis, achieving automated generation of text information. It generates an information text that conforms to reading habits based on articles that meet the conditions; that is, it automatically generates articles for specific search term analysis using existing multi-level headings and a professional field article knowledge base. It can quickly generate short summaries based on known text, greatly shortening the time required for users to read and analyze each article individually and to organize and search large amounts of data. This solves the problem in the prior art where finding professional terms or professional field information requires a large amount of manual reading and analysis and the collection and organization of large amounts of data, resulting in significant time consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116662530B_ABST
    Figure CN116662530B_ABST
Patent Text Reader

Abstract

The information text generation method and device, the electronic equipment and the storage medium provided by the application relate to the technical field of information processing, and solve the problem that a large amount of time is consumed in the prior art because a large amount of manual reading, analysis, collection and arrangement of a large amount of data are required when professional terms or professional field information are searched. The technical scheme adopted is that M articles meeting a first preset condition are selected from a preset article database according to a search word; a first article is determined from the M articles; Y first-level titles related to the search word are determined according to X first-level titles of the first article, the Y first-level titles are used as initial clustering centers, clustering is performed on the M articles as clustering samples by using a clustering algorithm and the Y initial clustering centers, and clustering clusters constituting N-level titles are obtained; and a plurality of article paragraphs under the plurality of N-level titles are combined together to generate an information text generated by the search word.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information processing technology, and in particular to an information generation method, apparatus, electronic device, and storage medium. Background Technology

[0002] In the era of rapid internet development, the speed of information dissemination and updates is getting faster and faster. When users use the internet to search for the information they need, they have to search through a massive amount of information on the internet, which consumes a lot of their time.

[0003] Furthermore, the existing technology of pushing required information based on user keywords matches the content of the current information with the user's required keywords. The more the content of the information matches the keywords, the higher the ranking of the pushed information. This kind of push method has a coarse filtering granularity and cannot obtain accurate information in a specific professional field. Therefore, it requires a lot of time for manual reading and judgment.

[0004] Furthermore, even if users obtain a large amount of information related to keywords, they still need to read and organize the information one by one to form the complete information required by the end user. Therefore, if users need to search for professional terms or professional fields such as "neural network" or "encryption" on the Internet, they need to spend a lot of time reading and analyzing each article and organizing a large amount of information, which consumes a lot of users' time.

[0005] Therefore, when users need to obtain more accurate professional information or professional terms, how to quickly generate recommended materials for users and save users' time in filtering and reading is a technical problem that needs to be solved. Summary of the Invention

[0006] The purpose of this invention is to provide an information generation method, apparatus, electronic device, and storage medium to solve the problem in the prior art that when searching for professional terms or information in a professional field, a lot of time is wasted due to the need for manual reading and analysis and the collection and organization of a large amount of data.

[0007] To address the aforementioned technical problems, in a first aspect, embodiments of the present invention provide a method for generating text information, comprising:

[0008] Based on the search terms, M articles that meet the first preset condition are selected from the preset article database, where M is a positive integer greater than or equal to 1;

[0009] The first article is identified from the M articles.

[0010] The following steps are iteratively executed until a cluster containing N-level headings is obtained: Based on the X first-level headings of the first article, Y first-level headings related to the search term are determined. The Y first-level headings are used as initial cluster centers. Using a clustering algorithm and the Y initial cluster centers, the M articles are used as clustering samples to obtain the clusters constituting the N-level headings, where 1≤Y≤X, and X and Y are both positive integers greater than or equal to 1. The clusters of the N-level headings contain the titles and paragraphs of the M articles.

[0011] The multiple article paragraphs under the obtained multiple Nth level headings are combined together to generate the information text of the search terms;

[0012] Wherein, N is a positive integer greater than or equal to 1, and is the level of the article title.

[0013] In some embodiments, the step of selecting M articles that meet the first preset condition from a preset article database based on the search terms specifically includes:

[0014] Based on the search terms and the first method, calculate the search term scores of the articles contained in the article database; select M articles whose search term scores exceed a first threshold as articles that meet the first preset condition; or,

[0015] Based on the search terms and the first method, calculate the search term scores of the articles contained in the article database; sort the search term scores from high to low, and select the articles corresponding to the top M search term scores in the sorting results as articles that meet the first preset condition; or,

[0016] Based on the search terms and the first method, calculate the search term scores of the articles contained in the article database; sort the search term scores and display a selection box indicating whether the article corresponding to the search term score has been selected, the selection box being used to confirm whether the current article has been selected; and treat the selected articles as articles that meet the first preset conditions.

[0017] In some embodiments, the first method specifically includes:

[0018] Obtain the search terms and the articles for which the search term scores are to be evaluated;

[0019] The search terms are matched with the content of the article. When it is determined that the content of the article contains the search terms, all positions in the current article containing the search terms are identified.

[0020] The weight assigned to the search term is obtained based on its position in the article.

[0021] The following steps are executed iteratively until the scores of all search terms in the article are calculated: the product of the occurrence score corresponding to the search term and the weight is used as the score of the search term at the current position, wherein the occurrence score is preset or determined according to the search term;

[0022] The score obtained by adding up the scores of all the location search terms appearing in the article is used as the search term score of the current article.

[0023] In some embodiments, obtaining the weight assigned to the search term based on its position in the article specifically includes:

[0024] Based on the position of the search term in the article, obtain the pre-set weight of the position, and use the pre-set weight as the weight assigned to the search term; or,

[0025] When the search term is determined to appear in both the article title and the article paragraph, a first weight is assigned to the article title, and a second weight is assigned to the article paragraph, wherein the first weight is greater than the second weight, and the sum of the first weight and the second weight is one; or,

[0026] When it is determined that the search term appears in the article title, different weights are assigned to the search term according to its level in the article title, such that the weights assigned to the search term vary depending on the level of the article title, wherein the sum of the assigned weights is one; or,

[0027] When it is determined that the search term appears in the article title and the article paragraph, different weights are assigned to the search term according to the level of the search term in the article title and the paragraph position, such that the weights assigned to the search term are different weights assigned according to the level of the article title and the paragraph position in which it appears, wherein the sum of the assigned weights is one.

[0028] In some embodiments, assigning different weights to the search terms based on their level in the article title specifically includes:

[0029] The higher the level of the article title within the article, the higher its assigned weight.

[0030] In some embodiments, assigning different weights to the search terms based on their level and paragraph position in the article title specifically includes:

[0031] The higher the level of the article title in the article, the higher the weight assigned to it. The weight assigned to the paragraph position is less than the weight assigned to the article title.

[0032] In some embodiments, determining the first article among the M articles specifically includes:

[0033] The M articles also display selection boxes indicating whether they are selected; these selection boxes are used to confirm whether the current article is selected; the selected article is designated as the first article; or...

[0034] According to the second method, the similarity score of the first-level headings of the M articles is calculated;

[0035] The similarity scores of the first-level headings obtained from the same article are summed up to obtain the total score of the first-level headings of the current article.

[0036] The article with the highest total similarity score among the total scores of the first-level headings is selected as the first article.

[0037] In some embodiments, the second method specifically includes:

[0038] Get the current heading text of the current article or article segment to be calculated;

[0039] The current-level title text and the search terms are semantically vectorized to obtain the current-level title text vector and the search term vector.

[0040] Calculate the similarity score between the current level title text vector and the search term vector based on whether the current level title text has a next level title text.

[0041] The similarity score is used as the similarity score of the current level heading of the current article or article segment.

[0042] In some embodiments, the semantic vectorization process specifically includes:

[0043] Based on the obtained search terms, the corresponding semantic database is retrieved, and the search term vector corresponding to the search terms is obtained from the semantic database;

[0044] or,

[0045] Based on the obtained search terms, semantic vector processing is performed on the search terms to obtain the search term vectors corresponding to the search terms.

[0046] In some embodiments, after calculating the similarity score between the current-level heading text vector and the search term vector, and before using the similarity score as the similarity score of the current-level heading of the current article or article segment, the method further includes:

[0047] When the similarity score is determined to be less than a preset similarity threshold for the current level title, the similarity score is set to zero, or the current level title and the content contained in the current level title are discarded.

[0048] In some embodiments, calculating the similarity score between the current-level title text vector and the search term vector based on whether the current-level title text has a next-level title text specifically includes:

[0049] When it is determined that the current level heading has a next level heading, the text of the next level heading contained in the current level heading is obtained;

[0050] The next-level heading text is semantically vectorized to obtain the next-level heading text vector.

[0051] Calculate the first similarity score between the current level title text vector and the search term vector, and calculate the second similarity score between the next level title text vector and the search term vector;

[0052] Weights are assigned to the first similarity score and the second similarity score to obtain a weighted sum of similarity scores, wherein the sum of the assigned weights is one.

[0053] The weighted summation of the similarity scores is used as the similarity score between the current-level title text vector and the search term vector.

[0054] In some embodiments, assigning weights to the first similarity score and the second similarity score specifically includes:

[0055] The weight assigned to the first similarity score is the third weight, and the weight assigned to the second similarity score is the fourth weight, wherein the third weight is greater than the fourth weight.

[0056] In some embodiments, calculating the similarity score between the current-level title text vector and the search term vector based on whether the current-level title text has a next-level title text specifically includes:

[0057] When it is determined that the current level heading does not have a next level heading, the similarity score between the current level heading text vector and the search term vector is calculated, and the similarity score is used as the similarity score between the current level heading text vector and the search term vector.

[0058] In some embodiments, when it is determined that the number of next-level headings is greater than one, after obtaining the text vector of the next-level headings and before calculating the second similarity score between the text vector of the next-level headings and the search term vector, the method further includes:

[0059] The average vector of the next-level heading text is obtained by averaging the vectors of the next-level heading texts, and this average vector is used as the next-level heading text vector.

[0060] In some embodiments, determining Y first-level headings related to the search term based on X first-level headings of the first article specifically includes:

[0061] According to the second method, the similarity scores of the first-level headings are calculated sequentially;

[0062] If the similarity score of the current first-level title is greater than or equal to a preset similarity threshold, the current first-level title is determined to be related to the search term; otherwise, it is not related.

[0063] The identified first-level headings related to the search terms are accumulated to obtain the Y first-level headings.

[0064] In some embodiments, the step of using the Y first-level headings as initial cluster centers, and using a clustering algorithm and the Y initial cluster centers to cluster the M articles as clustering samples to obtain clusters constituting the N-level headings specifically includes:

[0065] Iteratively perform the following steps until the clusters constituting the N-level headings are obtained:

[0066] Using the current title level on which the cluster center is based as the division granularity, the M articles are split to obtain multiple F-level article fragments, where 1≤F≤N. Each F-level article fragment contains an F-level title and its subheadings and paragraphs, where F is a positive integer greater than or equal to 1.

[0067] Select F-level article fragments related to the search term from multiple F-level article fragments and use them as the current F-level title clustering samples. Determine the initial cluster center of the current F-level title article fragments and perform clustering processing based on the initial cluster centers determined by the F-level article fragments to obtain S clusters of F-level titles, where S≥Y, and S is a positive integer greater than or equal to 1.

[0068] In some embodiments, it also includes:

[0069] If the F+1 level title contained in the F-level cluster cannot be obtained, then the clustering of the F+1 level cluster is stopped.

[0070] In some embodiments, the step of filtering out F-level article fragments related to the search term from a plurality of F-level article fragments specifically includes:

[0071] According to the second method, the similarity score of the F-level headings is calculated;

[0072] If the similarity score of the current F-level title is greater than or equal to the preset F-level similarity threshold, the current F-level article fragment is determined to be related to the search term; otherwise, it is not related.

[0073] In some embodiments, determining the initial cluster center of the current F-level article fragment specifically includes:

[0074] According to the second method, the similarity score of the F-level article fragment is calculated;

[0075] The similarity scores of the F-level article segments of the same article are summed to obtain the total similarity score of the F-level article segments of the same article.

[0076] The F-level titles of the same article that obtain the highest total similarity score are used as the initial cluster centers of the F-level article segments.

[0077] In some embodiments, the step of performing clustering processing based on the initial cluster centers determined by the F-level article fragments to obtain S clusters of F-level titles specifically includes:

[0078] The multiple F-level cluster samples are compared with the currently determined cluster center to determine the cluster to which the current F-level cluster sample belongs;

[0079] If the F-level cluster sample does not belong to any cluster represented by the currently determined cluster center, then the F-level title of the current F-level cluster sample is used as the cluster center to generate a new cluster of F-level titles.

[0080] The number of clusters of the identified F-level titles is accumulated to obtain the S clusters of F-level titles.

[0081] In some embodiments, the step of performing clustering judgment on the plurality of F-level cluster samples and the currently determined cluster centers to determine the cluster to which the current F-level cluster sample belongs specifically includes:

[0082] Obtain the current level title of the cluster center of the current cluster and the next level title to which the current title belongs, and perform semantic vectorization processing on the current level title and the next level title to obtain the current level title vector and the next level title vector;

[0083] Obtain the F-th level title and the F+1 level title of the F-th level title of the F-level cluster sample, and perform semantic vectorization processing on the F-th level title and the F+1 level title to obtain the F-th level title vector and the F+1 level title vector.

[0084] Calculate the similarity between the current level heading vector and the F-th level heading vector to obtain the third similarity; calculate the similarity between the next level heading vector and the F+1-th level heading vector to obtain the fourth similarity.

[0085] Weights are assigned to the third similarity and the fourth similarity to obtain a weighted sum of similarity scores, wherein the sum of the assigned weights is one.

[0086] The weighted similarity score is compared with a preset clustering threshold. If the similarity score is greater than or equal to the clustering threshold, the current F-level cluster sample is determined to belong to the current cluster. Otherwise, the current F-level cluster sample does not belong to the current cluster.

[0087] In some embodiments, assigning weights to the third similarity and the fourth similarity specifically includes:

[0088] The weight assigned to the third similarity is the third weight, and the weight assigned to the fourth similarity is the fourth weight, wherein the third weight is greater than the fourth weight.

[0089] In some embodiments, when it is determined that the number of level F+1 headings to which the level F heading belongs is greater than one, or when it is determined that the number of next-level headings to which the current level heading belongs is greater than one, before calculating the similarity between the next-level heading vector and the level F+1 heading vector, the method further includes:

[0090] The average of multiple next-level heading vectors is used to obtain an average next-level heading vector, which is then used as the next-level heading vector; or...

[0091] The average of the multiple F+1 level heading vectors is used to obtain the F+1 level heading average vector, and the F+1 level heading average vector is used as the F+1 level heading vector.

[0092] In some embodiments, it also includes:

[0093] If the number of F-level cluster samples contained in the current cluster is greater than one, the cluster center of the current cluster is re-determined based on the F-level cluster samples contained in the cluster.

[0094] In some embodiments, the step of re-determining the cluster center of the current cluster based on the F-level cluster samples contained in the cluster specifically includes:

[0095] According to the third method, the score of each F-level cluster sample in the current cluster is calculated;

[0096] The F-level title of the F-level cluster sample that obtains the highest score in the current cluster is used as the cluster center of the current cluster.

[0097] In some embodiments, the third method specifically includes:

[0098] Obtain clustered samples for the scores to be evaluated;

[0099] Based on the title on which the clustering sample is based, determine the title level of the current title in the article to which it belongs, and the level of each title level in the article to which the current title belongs;

[0100] Based on the current heading level and the heading level of each level to which it belongs, the second method is used to determine the similarity score of the current heading level and the similarity score of each level of heading.

[0101] According to the first method, the keyword score of the article to which the title belongs is determined;

[0102] The product of the obtained search term score, the obtained similarity score of each level of title, and the similarity score of the current title level is used as the score of the cluster sample to be evaluated.

[0103] In some embodiments, combining multiple article paragraphs under the obtained clusters of multiple Nth-level headings to generate the text generated by the search terms specifically includes:

[0104] Using the Nth-level cluster as the dividing unit, the article paragraphs belonging to the current cluster are used to generate the summary text of the Nth-level cluster using a summary generation algorithm;

[0105] The generated summary texts of multiple Nth-level clusters are sorted according to the title level and order of the current cluster and combined into an ordered summary text, which is used as the text generated by the search terms.

[0106] In some embodiments, after sorting according to the heading level and order of the current cluster, and before combining them into an ordered summary text, the method further includes:

[0107] Based on the titles represented by the cluster centers of the Nth-level clusters from level 1 to level N-1, and the Nth-level titles represented by the cluster centers of the Nth-level clusters, a text title hierarchy is constructed, and the generated summary text of the Nth-level clusters is used as the content of the Nth-level titles.

[0108] Secondly, embodiments of the present invention also provide an information text generation apparatus, comprising:

[0109] The filtering module is used to filter M articles that meet the first preset condition from a preset article database based on the search terms, wherein the first preset condition is determined based on the articles contained in the article database and the search terms, and M is a positive integer greater than or equal to 1; it is also used to determine the first article from the M articles.

[0110] The generation module is used to iteratively execute the following steps until a cluster containing N-level headings is obtained: Based on the X first-level headings of the first article, Y first-level headings related to the search term are determined; the Y first-level headings are used as initial cluster centers; using a clustering algorithm and the Y initial cluster centers, the M articles are used as clustering samples to obtain clusters constituting the N-level headings, where 1 ≤ Y ≤ X, and X and Y are both positive integers greater than or equal to 1; the clusters of the N-level headings contain the titles and paragraphs of the M articles; and it is also used to combine multiple paragraphs from the multiple clusters of the N-level headings to generate the text generated by the search term.

[0111] Wherein, N is a positive integer greater than or equal to 1, and is the level of the article title.

[0112] Thirdly, embodiments of the present invention also provide an electronic device, comprising:

[0113] Memory, used to store program instructions;

[0114] A processor is configured to invoke program instructions stored in the memory and execute the method described in any of the first aspects according to the obtained program.

[0115] Fourthly, embodiments of the present invention also provide a computer storage medium storing computer-executable instructions for causing the computer to perform the method described in any one of the first aspects.

[0116] The embodiments of the present invention have at least the following beneficial technical effects: The technical solution of the embodiments of the present invention utilizes user-inputted search terms to extract information, integrate information elements, and perform calculations on articles in a professional field using computer means. It clusters and combines articles in the database that meet the conditions to assist people in information analysis, achieving automated generation of text information. It generates an information text that conforms to reading habits based on articles that meet the conditions; that is, it automatically generates articles for specific search term analysis using existing multi-level headings and a professional field article knowledge base. It can quickly generate short summaries based on known text, greatly shortening the time required for users to read and analyze each article individually and to organize and search large amounts of data. This solves the problem in the prior art where finding professional terms or professional field information requires a large amount of manual reading and analysis and the collection and organization of large amounts of data, resulting in significant time consumption. Attached Figure Description

[0117] To more clearly illustrate the technical solutions in the embodiments of the present invention or in the conventional art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0118] Figure 1 This is a schematic diagram of an application environment provided by an embodiment of the present invention;

[0119] Figure 2 This is a flowchart of an information generation method provided in an embodiment of the present invention;

[0120] Figure 3 This is a flowchart of the first method in an information generation method provided in an embodiment of the present invention;

[0121] Figure 4 This is a schematic diagram illustrating the weight allocation of article titles in an information generation method provided by an embodiment of the present invention;

[0122] Figure 5 This is a flowchart of the second method in an information generation method provided in an embodiment of the present invention;

[0123] Figure 6 This is a flowchart of another second method in an information generation method provided by an embodiment of the present invention;

[0124] Figure 7 This is a schematic diagram of the similarity screening process of an information generation method provided in an embodiment of the present invention;

[0125] Figure 8 This is a flowchart illustrating the calculation of similarity scores in an information generation method provided in an embodiment of the present invention;

[0126] Figure 9 This is a flowchart of the first-level heading filtering process in an information generation method provided by an embodiment of the present invention;

[0127] Figure 10 These are schematic frameworks illustrating the semantic architecture of three types of articles provided in this embodiment of the invention;

[0128] Figure 11 This is a schematic diagram of the clustering of first-level headings in an information generation method provided by an embodiment of the present invention;

[0129] Figure 12 This is a schematic diagram of the clustering of secondary headings in an information generation method provided by an embodiment of the present invention;

[0130] Figure 13 This is a schematic diagram of the clustering of three-level headings in an information generation method provided in an embodiment of the present invention;

[0131] Figure 14 This is a flowchart illustrating the process of filtering F-level article fragments related to search terms in an information generation method provided by an embodiment of the present invention.

[0132] Figure 15 This is a schematic diagram of the first-level title clustering in an information generation method provided by an embodiment of the present invention;

[0133] Figure 16 This is a flowchart illustrating the determination of initial cluster centers in an information generation method provided by an embodiment of the present invention;

[0134] Figure 17 This is a flowchart illustrating how an information generation method, according to an embodiment of the present invention, obtains a cluster of S F-level titles.

[0135] Figure 18 This is a flowchart illustrating the process of determining the cluster to which an F-level cluster sample belongs in an information generation method provided in an embodiment of the present invention.

[0136] Figure 19 This is a flowchart of the third method in an information generation method provided in an embodiment of the present invention;

[0137] Figure 20 This is a flowchart of the process for generating summary text for clusters in an information generation method provided in an embodiment of the present invention;

[0138] Figure 21 This is a schematic block diagram of a text generation device provided in an embodiment of the present invention;

[0139] Figure 22 This is a schematic block diagram of an electronic device provided in an embodiment of the present invention.

[0140] in, Figures 1 to 2 The correspondence between the reference numerals and component names in the attached drawings is as follows:

[0141] 101 - User terminal, 102 - Server. Detailed Implementation

[0142] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0143] The terms "first" and "second" in the specification, claims, and accompanying drawings of this application are used to distinguish different objects and not to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product, or apparatus that comprises a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.

[0144] The application scenarios described in the embodiments of this invention are for the purpose of more clearly illustrating the technical solutions of the embodiments of this invention, and do not constitute a limitation on the technical solutions provided by the embodiments of this invention. As those skilled in the art will know, with the emergence of new application scenarios, the technical solutions provided by the embodiments of this invention are also applicable to similar technical problems.

[0145] It should be understood that the accompanying drawings of this invention are only for illustrating relative positional relationships and do not represent actual proportions; the term "and / or" used herein is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0146] The following explanations of some terms used in the embodiments of this application are provided to facilitate understanding by those skilled in the art.

[0147] The information generation device of this application embodiment can be configured in any electronic device with NLP function, such as mobile phone, computer, personal digital assistant, human-computer interaction voice device, intelligent robot, wearable device, etc., and this application embodiment does not limit it.

[0148] NLP stands for Natural Language Processing. NLP is an important field within computer science and artificial intelligence. It studies various theories and methods to enable effective communication between humans and computers using natural language. Natural Language Processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language—the language people use in daily life—and thus it has a close relationship with linguistic research. Natural Language Processing technologies typically include text processing, semantic understanding, machine translation, question answering, and knowledge graphs.

[0149] The solution provided in this application belongs to the field of natural language processing under artificial intelligence. It mainly processes the acquired data to obtain the corresponding information text.

[0150] Semantic vectors: Converting text into a vector representation in a semantic space is a common practice for quantifying and comparing semantics. It can also be understood as representing text using embedding vectors; semantically similar texts will have similar embedding vectors.

[0151] Similarity calculation: This involves calculating the degree of similarity between individuals. The smaller the similarity value, the lower the similarity between individuals; conversely, the larger the similarity value, the greater the differences between individuals. In this embodiment of the invention, text words are mapped to a vector space, forming a mapping relationship between text and vector data. The similarity between texts is calculated by measuring the differences between several or more different vectors.

[0152] To compare the similarity between two vectors, various methods can be used, such as calculating cosine distance or Euclidean distance.

[0153] Euclidean distance considers the distance between vectors and judges the degree of similarity based on the distance between them; the closer the distance, the more similar the vectors. Cosine similarity considers the direction between vectors and judges the degree of similarity based on the size of the angle between them; the smaller the angle, the more similar the vectors.

[0154] Other similarity calculation methods can also be used, such as Manhattan distance and Minkowski distance. Those skilled in the art can make reasonable choices according to actual needs, and no further examples will be given in this embodiment.

[0155] The solutions provided in this application involve technologies such as artificial intelligence text processing, which will be illustrated through the following embodiments.

[0156] The information generation method provided in this embodiment of the invention can be applied to, for example... Figure 1 The application environment shown.

[0157] In this process, user terminal 101 communicates with server 102 via a network. Server 102 receives the search terms sent by terminal 101, executes the information generation method of this application, and sends the generated search term information text to user terminal 101.

[0158] The technical solution of this application can also be executed at the user terminal 101. The user terminal 101 retrieves M articles that meet the first preset conditions from the preset article database of the server 102 according to the search terms, and executes the information generation method of this application.

[0159] In embodiments of this application, there may also be a user terminal 101 and multiple networks and servers 102. For example, the server that obtains the article is server one, and the server that generates information text of search terms based on the obtained article is server two, etc. The user terminal 101 can make reasonable selections and transmit data according to the different content obtained by each server. Therefore, those skilled in the art can reasonably set the execution end according to the actual needs of the application scenario, which does not affect the essence of the technical solution of the embodiments of the present invention.

[0160] The embodiments of the present invention are described using the server 102 as an example. The server 102 obtains the search terms sent by the terminal 101, executes the information generation method of this application, and sends the information text of the generated search terms to the user terminal 101.

[0161] An information generation method, comprising:

[0162] Based on the search terms, select M articles from the preset article database that meet the first preset condition, where M is a positive integer greater than or equal to 1;

[0163] The first article is identified from among M articles;

[0164] The following steps are iteratively executed until a cluster containing N-level headings is obtained: Based on the X first-level headings of the first article, Y first-level headings related to the search terms are determined. These Y first-level headings are used as initial cluster centers. Using the clustering algorithm and the Y initial cluster centers, M articles are used as clustering samples to obtain a cluster constituting N-level headings, where 1≤Y≤X, and X and Y are both positive integers greater than or equal to 1. The cluster containing N-level headings contains the titles and paragraphs of M articles.

[0165] The obtained multiple article paragraphs under multiple Nth level headings are combined together to generate information text for the search terms;

[0166] Where N is a positive integer greater than or equal to 1, and represents the level of the article title.

[0167] The following description uses specific examples; see appendix. Figure 2 .

[0168] S201: Based on the search terms, select M articles from the preset article database that meet the first preset condition, where M is a positive integer greater than or equal to 1.

[0169] Server 102 receives search terms sent from user terminal 101. Search terms can be understood as words sent by the user terminal to represent the user's search purpose. Search terms can be very long, such as a sentence, or very short, such as a simple two-word phrase.

[0170] A preset article database is typically the database required by the user's search target. For example, if a user wants to search for articles related to their search terms in a thesis database, the preset article database is the thesis database used by the user. If a user wants to search for articles related to their search terms in a journal database, the preset article database is the journal database the user is currently searching for. If a user wants to search a knowledge base of articles in a specific professional field, that knowledge base is the preset article database. When a user searches, they have a predetermined search target, that is, which database to search from and what type of documents to retrieve.

[0171] The first preset condition is a condition determined according to actual needs, and is not limited here. As long as the articles that meet the conditions are determined by the first preset condition, it is acceptable. For example, the first preset condition can be some articles specified by the user, or it can be determined which articles belong to the selected conditions according to a custom calculation method. Those skilled in the art can set it freely according to actual needs.

[0172] The number of articles that meet the first preset condition selected from the preset database can be multiple or only one. There is no limitation here, as long as an article can be determined from the preset article database according to the first preset condition. The number of determined articles is greater than or equal to one.

[0173] S202: Identify the first article among M articles.

[0174] Typically, there will be multiple articles that meet the first preset condition when filtering from the preset article database. Therefore, it is necessary to determine the first article from M articles.

[0175] The method for determining the first article from M articles is not limited here. It can be specified by the user, selected according to a preset filtering method, or a combination of filtering and user specification. Those skilled in the art can define various methods to determine the first article from M articles according to actual needs.

[0176] The first article refers to the article selected from M articles.

[0177] S203: Iteratively execute the following steps until a cluster containing N-level headings is obtained: Based on the X first-level headings of the first article, determine Y first-level headings related to the search terms, use the Y first-level headings as initial cluster centers, and use the clustering algorithm and the Y initial cluster centers to cluster M articles as clustering samples to obtain a cluster constituting N-level headings, where 1≤Y≤X, and X and Y are both positive integers greater than or equal to 1; the cluster containing N-level headings contains the titles and paragraphs of M articles.

[0178] Typically, each article has a relatively good semantic structure. When performing clustering, an initial cluster center is needed, and the first article identified is used as the initial cluster center.

[0179] Once the first article is identified, its semantic structure is adopted by default to facilitate the next step.

[0180] Semantic structure can be understood as the architecture of an article. Let the structure of the first article be: it has a first-level heading, which is the highest level heading. Under the first-level heading, there are several second-level headings. Each second-level heading contains several third-level headings. Under the third-level headings, there are several paragraphs. Then, the heading level of the first article is three. For ease of understanding, three can also be understood as the depth of the heading hierarchy.

[0181] For example, the structure of the first article can be as follows:

[0182] I. XXXX

[0183] 1. XXXX

[0184] 1)XXXXXX

[0185] XXXXXXXXXXXXXXXXXXXXX

[0186] 2)XXXXXX

[0187] XXXXXXXXXXXXXXXXXXXXX

[0188] 3)XXXXXX

[0189] XXXXXXXXXXXXXXXXXXXXX

[0190] 2. XXXX

[0191] 1)XXXXXX

[0192] XXXXXXXXXXXXXXXXXXXXX

[0193] 2)XXXXXX

[0194] XXXXXXXXXXXXXXXXXXXXX

[0195] 3)XXXXXX

[0196] XXXXXXXXXXXXXXXXXXXXX

[0197] 3、XXXX

[0198] 1)XXXXXX

[0199] XXXXXXXXXXXXXXXXXXXXX

[0200] 2)XXXXXX

[0201] XXXXXXXXXXXXXXXXXXXXX

[0202] 3)XXXXXX

[0203] XXXXXXXXXXXXXXXXXXXXX Two、XXXX

[0204] 1、XXXX

[0205] 1)XXXXXX

[0206] XXXXXXXXXXXXXXXXXXXXX

[0207] 2)XXXXXX

[0208] XXXXXXXXXXXXXXXXXXXXX

[0209] 3)XXXXXX

[0210] XXXXXXXXXXXXXXXXXXXXX

[0211] 2、XXXX

[0212] 1)XXXXXX

[0213] XXXXXXXXXXXXXXXXXXXXX

[0214] 2)XXXXXX

[0215] XXXXXXXXXXXXXXXXXXXXX

[0216] 3)XXXXXX

[0217] XXXXXXXXXXXXXXXXXXXXX

[0218] 3. XXXX

[0219] 1) XXXXXX

[0220] XXXXXXXXXXXXXXXXXXXXX

[0221] 2) XXXXXX

[0222] XXXXXXXXXXXXXXXXXXXXX

[0223] 3) XXXXXX

[0224] XXXXXXXXXXXXXXXXXXXXX Three. XXXX

[0225] 1. XXXX

[0226] 1) XXXXXX

[0227] XXXXXXXXXXXXXXXXXXXXX

[0228] 2) XXXXXX

[0229] XXXXXXXXXXXXXXXXXXXXX

[0230] 3) XXXXXX

[0231] XXXXXXXXXXXXXXXXXXXXX 2. XXXX

[0232] 1) XXXXXX

[0233] XXXXXXXXXXXXXXXXXXXXX

[0234] 2) XXXXXX

[0235] XXXXXXXXXXXXXXXXXXXXX

[0236] 3) XXXXXX

[0237] XXXXXXXXXXXXXXXXXXXXX

[0238] 3. XXXX

[0239] 1) XXXXXX

[0240] XXXXXXXXXXXXXXXXXXXXX

[0241] 2) XXXXXX

[0242] XXXXXXXXXXXXXXXXXXXXX

[0243] 3)XXXXXX

[0244] XXXXXXXXXXXXXXXXXXXXX

[0245] Based on the above article structure, there are 3 first-level headings (1, 2, 3), 9 second-level headings (1, 2, 3), and 27 third-level headings (1), 2), and 3). The paragraphs are XXXXXXXXXXXXXXXXXXXXX under the third-level headings.

[0246] It is easy to see from the above article structure that there can be one or more first-level headings, second-level headings, and third-level headings, and there can also be headings that are deeper or shallower than third-level headings.

[0247] Once the first article is determined, the semantic structure of its first-level headings is used as the starting point for iteration. The first article, selected from M articles, indicates that the structure of its first-level headings is relatively consistent with the current search term. However, not all first-level headings in the first article are related to the search term. Therefore, it is necessary to determine Y first-level headings related to the search term from the X first-level headings in the first article. These Y first-level headings are used as the initial cluster centers, and clustering is performed using a clustering algorithm and the M articles. Therefore, Y ≤ X.

[0248] The iterative process of clustering can proceed step by step downwards according to the hierarchical headings. For example, first, cluster the first-level headings. After all the first-level headings have been clustered, continue to cluster the second-level headings under the first-level headings one by one. After the second-level headings have been clustered, then cluster the third-level headings under the second-level headings one by one, until all the N-level headings have been clustered.

[0249] The iterative process of clustering can also be to directly cluster all N-level headings based on the first-level headings of the first article. However, this method will disrupt the original heading hierarchy, which is not conducive to reading, but it does not affect the clustering results.

[0250] The iterative process of clustering can also involve alternating between clustering based on the first-level title of the first article and the user's selection confirmation. Other methods can also be used depending on the actual situation. No examples will be given here. As long as the clustering process starts with the first-level title of the first article and obtains clusters that constitute N levels of titles, it is acceptable.

[0251] S204: Combine multiple article paragraphs under the obtained clusters of multiple Nth-level headings to generate information text for the search terms; where N is a positive integer greater than or equal to 1 and is the level of the article heading.

[0252] As described above, the clustering process uses Y first-level headings as initial cluster centers and M articles as cluster samples. Ultimately, it will obtain clusters of N-level headings. Therefore, after obtaining the clusters of N-level headings, there are no more headings under the N-level headings. The N-level headings are the deepest level headings, which contain multiple article paragraphs composed of various articles. For example, under the third-level headings in the above embodiment, there are only article paragraphs.

[0253] Multiple article paragraphs under the obtained Nth-level heading clusters are combined together, and informational text for the search terms is generated using various methods.

[0254] For example, the summary extraction algorithm TextRank can be used to extract a short summary of the combined paragraphs, and this summary can be used as the main text content under the Nth level heading. This main text content is the information text for generating search terms.

[0255] The technical solution of this invention utilizes user-inputted search terms to extract information, integrate information elements, and perform calculations on articles within a professional field using computer means. It clusters and combines articles in the database that meet certain conditions to assist in information analysis and automate text generation. Based on articles that meet the criteria, it generates an information text that conforms to reading habits. Specifically, it automatically generates articles based on specific search terms using existing multi-level headings and a knowledge base of articles in the professional field. It can quickly generate concise summaries based on known text, significantly reducing the time required for users to read and analyze each article individually and to organize and retrieve large amounts of data. This solves the problem in existing technologies where finding professional terms or information in a professional field requires significant manual reading, analysis, and data collection, resulting in substantial time consumption.

[0256] Optionally, as one embodiment, based on search terms, M articles that meet the first preset condition are selected from a preset article database, specifically including:

[0257] Based on the search terms and the first method, calculate the search term scores of the articles contained in the article database; select M articles whose search term scores exceed a first threshold as articles that meet the first preset condition; or,

[0258] Based on the search terms and the first method, calculate the search term scores of the articles contained in the article database; sort the search term scores from high to low, and select the articles corresponding to the top M search term scores in the sorting results as articles that meet the first preset condition; or,

[0259] Based on the search terms and the first method, the search term scores of the articles contained in the article database are calculated; the search term scores are sorted, and a selection box is displayed to confirm whether the article corresponding to the search score is selected; the selected article is regarded as an article that meets the first preset condition.

[0260] The following is an explanation through specific examples.

[0261] The first preset condition can be understood as a condition set by the user according to actual needs. Based on the first preset condition, M articles that meet the requirements can be selected from the corresponding article database.

[0262] The first method can be understood as a set calculation method. The purpose is to determine the search term score between the target article and the search term based on the search term and the set calculation method. The score is a quantitative value, so it can be used for comparison and facilitates various subsequent processing.

[0263] Optionally, the M articles that meet the first preset condition can be: calculating the search term score of the articles contained in the article database based on the search terms and the first method; and taking the M articles whose search term scores exceed the first threshold as articles that meet the first preset condition.

[0264] The first threshold can be a pre-set value or a value that automatically adjusts based on actual conditions; no limitation is made here. According to the first method, a score between the target article and the search terms can be obtained. This score is compared with the first threshold to determine whether it exceeds the first threshold, thereby determining whether the current article meets the first preset condition.

[0265] Optionally, the M articles that meet the first preset condition can be: calculating the search term scores of the articles contained in the article database based on the search terms and the first method; sorting the search term scores from high to low, and taking the articles corresponding to the top M search term scores in the sorting results as the articles that meet the first preset condition.

[0266] As described above, the first method is a set calculation method that determines the search term score between the target article and the search term based on the search term and the set calculation method. Since the scores can be compared, the search term scores can be sorted from high to low. The articles corresponding to the top M search term scores in the sorted results are considered as articles that meet the first preset condition. M can be set by the user or specified internally. For example, if M is set to 50, then the top 50 search term scores are the selected M articles that meet the first preset condition.

[0267] Optionally, the M articles that meet the first preset condition can be: sorted by search term scores, and a selection box is displayed to confirm whether the articles corresponding to the search scores are selected; the selected articles are then considered as articles that meet the first preset condition.

[0268] Continuing with the above embodiment as an example, the first method can obtain the search term score of the current article, but errors may occur. For example, the search term score of the current article may be very high, but it may not match the user's search needs. For instance, the user wants to obtain articles related to "Apple mobile phone," but only uses "apple" as the search term as input information. In this case, the search results may include articles related to "Apple mobile phone" and articles related to the fruit "apple," but the articles related to the fruit "apple" are not what the user needs. For only obtaining the search term "apple," the server 102 cannot determine whether the user only needs articles related to "Apple mobile phone." The system aims to retrieve articles related to the fruit "apple," or both. To prevent missing relevant information, both types of "apple"-related results will be displayed. However, even the top-ranked articles may not be what the user needs. Therefore, a technical solution is adopted: sorting by search term score and displaying a selection box indicating whether the corresponding article has been selected. Users can see articles that meet certain conditions for the current search term score and confirm whether the article has been selected. By filtering by search term score, articles with high relevance to the search term are selected, and based on the user's selection, articles that meet the first preset condition are finally determined.

[0269] The embodiments of the present invention provide multiple solutions for how to filter out M articles that meet the criteria from a database. Those skilled in the art can determine a reasonable technical solution based on the actual situation, which can be applied to various scenarios.

[0270] Optionally, as one embodiment, the first method specifically includes:

[0271] Articles containing search terms and their scores;

[0272] Match search terms with the content of the article, and when it is determined that the content of the article contains the search terms, mark all positions in the current article where the search terms appear;

[0273] The weight assigned to each search term is determined based on its position within the article.

[0274] The following steps are executed iteratively until the scores of all search terms in the article are calculated: the product of the occurrence score and the weight of the search term is used as the score of the search term at the current position, where the occurrence score is preset or determined according to the search term;

[0275] The score obtained by adding up the scores of all the location search terms that appear in the article is used as the search term score for the current article.

[0276] The following description uses specific embodiments, continuing to use the above embodiments as examples, and refers to the appendix. Figure 3 As shown.

[0277] S301: Obtain search terms.

[0278] S302: Articles for which the scores of the search terms to be evaluated are obtained.

[0279] S303: Match the search terms with the content of the article to determine whether the content of the article contains the search terms; if yes, proceed to step S307; if no, proceed to step S302.

[0280] If the article contains the search term, it means that the current article may be the article the user needs, so continue to the next article. If the article does not contain the search term, it means that the current article is not the article the user needs, so continue to search for the next article.

[0281] S304: Identifies all locations in the current article where the search term appears.

[0282] The search terms may appear in more than one place in the current article. Therefore, the locations where the search terms appear in the article will be marked.

[0283] S305: Obtain the weight assigned to the search term based on its position in the article.

[0284] The location of search terms in an article can vary greatly. For example, search terms may appear in the title of the current article, in first-level headings, second-level headings, or in the main body of the article. Different locations can be assigned different weights or have related weights. Therefore, the technical solution of this invention obtains the weight assigned to search terms based on their location in the article.

[0285] S306: Iteratively execute the following steps until the scores of all search terms in the article are calculated: the product of the occurrence score corresponding to the search term and its weight is used as the score of the search term at the current position.

[0286] Based on the assigned weights, calculate the score for each location in the current article where the search term appears.

[0287] S307: The score obtained by adding up the scores of all the location search terms that appear in the article is used as the search term score of the current article.

[0288] The sum of the scores of all the search terms appearing in the article is used as the search term score for the current article.

[0289] Let text_score be the score of the current article's search terms, and 10 be the score for the occurrence of a search term, which is assigned when the search term appears once in the current article. Let text_score be the score for the current article's search terms, which appear once in the article title, three times in the first-level headings, three times in the second-level headings, and six times in the article paragraphs.

[0290] Furthermore, we assume that the weight assigned to the current article title is 0.4, the weight assigned to the first-level heading is 0.3, the weight assigned to the second-level heading is 0.2, and the weight assigned to the article paragraph is 0.1.

[0291] Therefore, based on the above process, the process of obtaining the search term score using the first method can be as follows:

[0292] Article title score: 10 * 0.4 * 1 = 4

[0293] Score for Level 1 heading: 10 * 0.3 * 3 (3 times) = 9

[0294] Second-level heading score: 10 * 0.2 * 3 = 6

[0295] Main text score: 10 * 0.1 * 6 = 6

[0296] The search term score for the current article is: 4+9+6+6=25.

[0297] The weights and scores can be freely adjusted according to actual needs.

[0298] The technical solution of this invention can use a multi-level title weighting calculation method to screen articles. It has the advantage of hierarchical analysis, which can analyze multi-level titles, rather than simply defining the relevance to search terms by the number of matches. It takes into account the position of the search terms and assigns weights according to the position, making the screening of articles more reasonable.

[0299] Optionally, as one embodiment, the weight assigned to the search term is obtained based on its position in the article, specifically including:

[0300] Based on the position of the search term in the article, obtain the pre-set weight of the position, and use the set weight as the weight assigned to the search term; or,

[0301] When it is determined that the search term appears in both the article title and paragraphs, the article title is assigned a first weight, and the article paragraphs are assigned a second weight, where the first weight is greater than the second weight; or,

[0302] When it is determined that a search term appears in an article's level headings, different weights are assigned to the search term based on its level within the heading, so that the weights assigned to the search term vary depending on the level of the article heading; or,

[0303] When determining whether a search term appears in an article title or paragraph, different weights are assigned to the search term based on its level in the article title and its position in the paragraph. This results in the weights assigned to the search term being different based on the level of the article title and the position of the paragraph in which it appears.

[0304] Optionally, as one embodiment, different weights are assigned to search terms based on their level in the article title, specifically including:

[0305] The higher the level of the article title in the article, the higher the weight it is assigned.

[0306] Optionally, as one embodiment, different weights are assigned to search terms based on their level in the article title and their paragraph position, specifically including:

[0307] The higher the level of the article title in the article, the higher the weight it is assigned. The weight assigned to a paragraph position is less than the weight assigned to the article title.

[0308] The following is an explanation through specific examples.

[0309] The above embodiments will continue to be used as examples for further description, and see the appendix. Figure 4 As shown.

[0310] The search terms can appear in various locations within an article. They may appear in the article title, or in any location within the article title and body text.

[0311] Optionally, if the system pre-assigns weights to the positions where the search term appears, the pre-set weights of the positions can be obtained and used as the weights assigned to the search terms.

[0312] For example, when the system is set to give a weight of 0.4 for words appearing in the article title, 0.2 for words appearing in the title, and 0.1 for words appearing in the body text, you only need to follow the weight allocation settings and do not need to consider whether the sum of the weights is one. Compared to simply matching search terms, this fully considers the impact of the position of the search terms on the search score.

[0313] Optionally, when it is determined that the search term appears in the article title and the article paragraph, a first weight is assigned to the article title and a second weight is assigned to the article paragraph, wherein the first weight is greater than the second weight.

[0314] When a search term is determined to appear in the current article, a first weight is assigned to the article title, and a second weight is assigned to the article paragraphs, with the first weight being greater than the second weight. For example, the article title can be assigned a weight of 0.7, and the article paragraphs can be assigned a weight of 0.3.

[0315] The advantage of this technical solution is that it fully considers the importance of the current article title. If the title of the current article contains the search term, it means that all the content of the current article is likely related to the search term. This is more relevant than articles where the search term only appears in a certain title or a certain paragraph of the current article, and is the kind of article that users care about.

[0316] If the paragraph belonging to the current article title is a summary or overview of the content of the current article title, such as a summary of the content described in the article title, the paragraph can be the first paragraph, the last paragraph, or other positions in the article. As long as it can be determined that the summary content of the paragraph is related to a certain article title, then the paragraph can be treated as an article title. That is, although it is an article paragraph, in the subsequent calculation process, the article paragraph is processed according to the level of the article title, such as semantic processing and score calculation.

[0317] Optionally, when determining that a search term appears in an article's level heading, different weights are assigned to the search term based on its level in the article heading, such that the weights assigned to the search term vary depending on the level of the article heading, and the sum of the assigned weights is one.

[0318] The article title, generally understood, refers to the title of the current article. For a structured article, there will also be titles indicating the article's hierarchical structure, such as first-level titles, second-level titles, etc. If it is determined that a search term appears in a level title of the article, different weights are assigned to the search term based on its level in the article title, such as first-level title or second-level title. For example, the weight assigned to first-level titles is greater than that of second-level titles. In this way, the weight assigned to the search term varies depending on the level of the article title.

[0319] Optionally, when determining whether a search term appears in an article's level heading or paragraph, different weights are assigned to the search term based on its level in the article heading and its position in the paragraph, so that the weights assigned to the search term vary depending on the level of the article heading and the position of the paragraph in which it appears.

[0320] Optionally, as one embodiment, different weights are assigned to search terms based on their level in the article title, specifically including:

[0321] The higher the level of the article title in the article, the higher the weight it is assigned.

[0322] As in the above embodiment, the weight assigned to first-level headings is greater than that assigned to second-level headings, and the weight assigned to second-level headings is greater than that assigned to third-level headings.

[0323] Optionally, as one embodiment, different weights are assigned to search terms based on their level in the article title and their paragraph position, specifically including:

[0324] The higher the level of the article title in the article, the higher the weight it is assigned. The weight assigned to a paragraph position is less than the weight assigned to the article title.

[0325] As in the above embodiment, the weight assigned to the first-level heading is greater than that assigned to the second-level heading, the weight assigned to the second-level heading is greater than that assigned to the third-level heading, and if the third-level heading is the depth of the current article's headings, and there are no fourth-level headings below the third-level heading, but rather article paragraphs, then the weight of the third-level heading is greater than that of the article paragraphs.

[0326] The above-mentioned plan can be found in the attached document. Figure 4As shown, suppose an article has n levels of headings, let text_score be the keyword score, weight_text be assigned to the article title, weight_title1 be assigned to the first-level heading, weight_title2 be assigned to the second-level heading, and so on, up to the nth level heading, where the assigned weight is weight_titlen, and weight_context be assigned to the paragraph (the main body of the article). The keyword score can be determined using the following formula:

[0327] The search term score is calculated as follows: text_score = article title * weight_text + first-level heading * weight_title1 + second-level heading * weight_title2 + ... + n-level heading * weight_titlen + body text * weight_context.

[0328] And weight_text>weight_title1>weight_title2>…>weight_title_n>weight_context.

[0329] The technical solutions of the embodiments of the present invention will continue to be illustrated using the above embodiments as examples.

[0330] Let the occurrence score of a search term be 10, which is the score assigned for each occurrence of the search term in the current article. Let the search term appear once in the article title, three times in the first-level headings, three times in the second-level headings, and six times in the paragraphs.

[0331] Furthermore, we assume that the weight assigned to the current article title is 0.4, the weight assigned to the first-level heading is 0.3, the weight assigned to the second-level heading is 0.2, and the weight assigned to the article paragraph is 0.1, i.e., weight_text(article title)>weight_title1(first-level heading)>weight_title2(second-level heading)>weight_context(article paragraph).

[0332] Therefore, based on the above process, the process of obtaining the search term score using the first method can be as follows:

[0333] Article title score: 10 * 0.4 * 1 = 4

[0334] Score for Level 1 heading: 10 * 0.3 * 3 (3 times) = 9

[0335] Second-level heading score: 10 * 0.2 * 3 = 6

[0336] Main text score: 10 * 0.1 * 6 = 6

[0337] The search term score (text_score) is calculated as follows: Article title * weight_text + Level 1 heading * weight_title1 + Level 2 heading * weight_title2 + ... + Level n heading * weight_titlen + Body text * weight_context. Therefore, the search term score for the current article is 4 + 9 + 6 + 6 = 25.

[0338] The weights and scores can be freely adjusted according to actual needs.

[0339] The technical solution of this invention obtains the search term score and the overall article score by weighted summation of scores from different positions. This can also be understood as a relevance score. Articles can be screened by using a multi-level title weighting calculation method, which has the advantages of hierarchical analysis, finer topic granularity, more comprehensive analysis content, and considers the influence of search term position on weight, thus screening out articles that are more similar to the search term.

[0340] Optionally, as one embodiment, a first article is determined from the M articles, specifically including:

[0341] The M articles also display a selection box to indicate whether they are selected. This selection box confirms whether the current article is selected; the selected article is set as the first article; or...

[0342] According to the second method, calculate the similarity score of the first-level headings of the M articles;

[0343] The similarity scores of the first-level headings of the same article are summed up to obtain the total score of the first-level headings of the current article.

[0344] The article with the highest total similarity score among the total scores of the first-level headings is selected as the first article.

[0345] The following is an explanation through specific examples.

[0346] When M articles are identified, it means that at least part of the content of any one of these M articles is related to the search term, and therefore the aforementioned M articles are identified.

[0347] However, determining which of these M articles has the best semantic structure, is most relevant to the search terms, and can be used as the initial cluster center for clustering is a technical problem that needs to be solved.

[0348] To address the aforementioned technical problems, embodiments of the present invention provide several technical solutions.

[0349] Optionally, the M articles also display selection boxes to indicate whether they are selected. These selection boxes are used to confirm whether the current article is selected; the selected article is designated as the first article.

[0350] This technical solution works with the user, who uses reading or other methods to determine which of the M articles is most relevant to the semantic structure of the search terms. The server 102 then determines which of the M articles is selected based on the user's selection box, and the selected article is designated as the first article.

[0351] Optionally, according to the second method, the similarity scores of the first-level headings of M articles are calculated; the similarity scores of the first-level headings of the same article are accumulated to obtain the total score of the first-level headings of the current article; the article corresponding to the highest total similarity score of the first-level headings is determined from the total scores of the first-level headings and is taken as the first article.

[0352] The second method can be understood as a set calculation method. Its purpose is to determine the similarity score between the current level heading of the target article or paragraph and the search term based on the search term and the set calculation method. The similarity score is a quantitative value, so it can be used for comparison and facilitates various subsequent processing.

[0353] The second method can be to calculate the number of matches between the current target article paragraph and its current level heading and the search term; the more matches, the higher the score. Alternatively, the current level heading can be semantically processed, and the search term can also be semantically processed. The similarity score between the semantic vector of the semantically processed current level heading and the semantic vector of the search term can be calculated; the higher the matching degree, the higher the score. Other processing methods are also possible. Those skilled in the art can reasonably set the second method according to actual needs and scenarios to determine the article represented by the semantic structure most relevant or most matching to the search term.

[0354] When the second method can be used to calculate the similarity score between the current level heading and the search term, the article whose semantic structure is most relevant to the search term can be determined based on the similarity score of each level heading.

[0355] Therefore, the similarity scores of the first-level headings of M articles are calculated. After obtaining the similarity scores of the first-level headings, the similarity scores of the first-level headings of the same article are accumulated and used as the total score of the first-level headings of the current article. The article corresponding to the highest total score of the first-level headings similarity scores is determined from the total scores of the first-level headings and is taken as the first article.

[0356] Optionally, as one embodiment, the second method specifically includes:

[0357] Get the current heading text of the current article or article segment to be calculated;

[0358] The current level heading text and search terms are semantically vectorized to obtain the current level heading text vector and the search term vector.

[0359] Calculate the similarity score between the current level heading text vector and the search term vector based on whether the current level heading text has a next level heading text.

[0360] The similarity score is used as the similarity score of the current level heading of the current article or article segment.

[0361] The following description uses specific examples, see appendix. Figure 5 As shown.

[0362] S501: Get the current heading text of the current article or article segment to be calculated.

[0363] The second method can be used for the entire article or for a specific section of the article. However, the section should have a current-level heading. The section is divided by the heading level. As described in the above examples, a section can refer to the following:

[0364] I. XXXX

[0365] 1. XXXX

[0366] 1)XXXXXX

[0367] XXXXXXXXXXXXXXXXXXXXX

[0368] 2)XXXXXX

[0369] XXXXXXXXXXXXXXXXXXXXX

[0370] 3)XXXXXX

[0371] XXXXXXXXXXXXXXXXXXXXX

[0372] The current article may have multiple first-level headings. Therefore, the current article segmentation is based on heading level as the granularity, with the smallest unit being the Nth-level heading, which is the deepest level. Continuing with the above example, the smallest unit for dividing the article paragraph is:

[0373] 1)XXXXXX

[0374] XXXXXXXXXXXXXXXXXXXXX

[0375] In the above embodiments, the third-level heading is the deepest level of heading, and the above content is the smallest unit of division, consisting of both heading and text. Text below the third-level heading, without a third-level heading, cannot be considered a separate paragraph.

[0376] S502: Perform semantic vectorization on the current level heading text and search terms to obtain the current level heading text vector and search term vector.

[0377] The processing method for semantic vectors has been described above and can be considered as prior art; therefore, it will not be described again in this embodiment of the invention.

[0378] S503: Calculate the similarity score between the current level heading text vector and the search term vector based on whether the current level heading text has a next level heading text.

[0379] There are two calculation methods: one is to calculate the similarity score between the current-level heading text vector and the search term vector if the current-level heading text has a sub-level heading text; the other is to calculate the similarity score between the current-level heading text vector and the search term vector if the current-level heading text does not have a sub-level heading text. The specific calculation method can be reasonably set according to actual needs, and is not limited here.

[0380] For example, if the current level heading text has a next level heading text, the semantic similarity between the semantic vector of the current level heading and the search term vector can be calculated, and the semantic similarity between the semantic vector of the next level heading text and the search term vector can also be calculated. The sum of the two semantic similarities is used as the similarity score of the current level heading of the current article or article fragment.

[0381] If the current heading text does not have a next-level heading text, the semantic similarity between the semantic vector of the current heading and the vector of the search term can be calculated, and the current semantic similarity can be used as the similarity score of the current heading of the current article or article segment. Alternatively, the current heading text and the article paragraph to which the current heading belongs can be matched with the search term. The more matches, the higher the similarity score.

[0382] The above schemes are merely used to illustrate several ways that those skilled in the art can calculate the similarity score between the current level heading text vector and the search word vector based on whether the current level heading text has a next level heading text, and should not constitute a limitation on this application.

[0383] S504: Use the similarity score as the similarity score of the current level heading of the current article or article segment.

[0384] If this scheme is applied to electronic devices with computing capabilities, the similarity score can be returned as the result of the second method.

[0385] The technical solution of this invention calculates the similarity score between the current level title text vector and the search term vector based on whether the current level title text has a next level title text. It takes into account various factors that may affect the similarity score, making the determination of the similarity score between the current level title and the search term more reasonable.

[0386] Optionally, in one embodiment, the semantic vectorization processing specifically includes:

[0387] Based on the obtained search terms, retrieve the corresponding semantic database and obtain the search term vectors corresponding to the search terms from the semantic database;

[0388] or,

[0389] Based on the obtained search terms, semantic vector processing is performed on the search terms to obtain the search term vectors corresponding to the search terms.

[0390] The following is an explanation through specific examples.

[0391] Continuing with the above embodiment as an example, the client 101 can obtain search terms in various ways, such as audio or text information. However, the article database information typically stored on the server is in text format. Therefore, after obtaining the search term information, the client 101 converts the search information into information stored in the target database, i.e., text information. After receiving the search term information, the client 101 converts the obtained user search information into the text information required by the server 102 and sends it to the server 102. Therefore, the search terms received by the server 102 at this time are usually text information, which can undergo semantic vectorization processing.

[0392] During the retrieval process, for some commonly used search terms, such as "neural network" and "key", there will be multiple searches by multiple people. Therefore, if semantic vectorization is performed for such commonly used search terms every time, it will consume a lot of conversion time.

[0393] Therefore, the technical solution of this embodiment of the invention can also include a semantic database for storing semantic vectors corresponding to relevant search terms. After receiving a search term, the server 102 retrieves the corresponding semantic database based on the obtained search term and obtains the search term vector corresponding to the search term from the semantic database.

[0394] If the corresponding semantic vector cannot be retrieved from the corresponding semantic database, then the retrieved search terms are processed into semantic vectors to obtain the search term vectors corresponding to the search terms.

[0395] Optionally, after obtaining the semantic vector corresponding to the search term, the following steps are also included:

[0396] Update / store the semantic vectors corresponding to the search terms in the semantic database.

[0397] With this technical solution, when the same search term is encountered again, the semantic vector stored in the database can be read directly without having to perform semantic vectorization processing again, thus speeding up the processing time.

[0398] Optionally, after obtaining the semantic vector corresponding to the search term from the semantic database, the method further includes:

[0399] The semantic database updates the semantic vectors corresponding to the search terms within a predetermined time period.

[0400] Because semantic vectors may change over time, semantic databases need to update the semantic vectors corresponding to search terms within a predetermined period to ensure that the semantic vectors corresponding to search terms are up-to-date.

[0401] Optionally, as one embodiment, after calculating the similarity score between the current-level heading text vector and the search term vector, and before using the similarity score as the similarity score of the current-level heading of the current article or article segment, the method further includes:

[0402] If the similarity score is less than the preset similarity threshold for the current level heading, the similarity score is set to zero, or the current level heading and its contents are discarded.

[0403] The following description uses examples, see attached figures. Figure 6 As shown.

[0404] When an article is obtained, not all of its content is necessarily related to the search terms. For those that are not related to the search terms or have poor relevance, in order not to affect the user's reading experience, it is preferable to delete them or set their similarity score to 0.

[0405] Continuing with the above embodiments as an example, as shown in the appendix Figure 6 As shown, the similarities between the embodiments of the present invention and the above embodiments will not be repeated here; only the differences between them will be described.

[0406] S601: Determine whether the similarity score is greater than the preset similarity threshold for the current level heading. If yes, proceed to step S504; otherwise, proceed to step S602.

[0407] According to the above embodiments, for a title of a certain level, after obtaining the similarity score, if the relevance score is greater than or equal to the preset similarity threshold of the current level title, it is considered that the current title and its content below it are related to the search term and are retained. If it is less than the preset threshold, it is considered that the content of the current level title is not related to the search term and should be set to zero or discarded and no longer retained.

[0408] It should be noted that the thresholds for different levels of headings can be the same or different. Generally, if the heading level is related to the similarity score, then different levels of headings will have different thresholds. Those skilled in the art can set them reasonably according to actual needs.

[0409] S602: Discard the current heading and its contents, or set the similarity score to zero.

[0410] If the similarity score of the current level heading does not reach the preset similarity threshold, it means that the current level heading and its contents are not closely related to the search term. The heading and its contents that are not closely related to the search term can be discarded, or the similarity score can be set to zero to show that it is not related to the search term. In subsequent calculations, this can avoid interference caused by the current heading not being related to the search term participating in the calculation process.

[0411] Preferably, when the current title and its content are irrelevant to the search terms, the current title and its contents are discarded and will not participate in subsequent clustering processes, thus ensuring the accuracy of the subsequent clustering results.

[0412] like Figure 7 As shown, taking the first-level headings of an article as an example, the current article has three first-level headings, each of which has multiple second-level headings and body text. Based on the search terms, the similarity scores of these three first-level headings are determined respectively.

[0413] When comparing the similarity scores of the first-level headings with the preset similarity threshold, both first-level heading 1 and first-level heading 3 are less than the preset similarity threshold, while first-level heading 2 is greater than the preset similarity threshold.

[0414] Based on the comparison results above, we retain Heading 2 and its contents, while discarding the contents of Heading 1 and Heading 3. Figure 7 As shown on the right.

[0415] The technical solution of this invention identifies titles unrelated to the search terms and discards or sets these titles to zero to avoid unnecessary interference from unrelated titles and their associated article paragraphs in subsequent processing, thereby improving the accuracy of the information generation method.

[0416] Optionally, as one embodiment, the similarity score between the current-level heading text vector and the search term vector is calculated based on whether the current-level heading text has a next-level heading text. Specifically, this includes:

[0417] When it is determined that the current level heading has a sub-heading, retrieve the sub-heading text contained in the current level heading;

[0418] The text of the next level heading is semantically vectorized to obtain the text vector of the next level heading.

[0419] Calculate the first similarity score between the current level title text vector and the search term vector, and calculate the second similarity score between the next level title text vector and the search term vector;

[0420] Weights are assigned to the first similarity score and the second similarity score to obtain a weighted sum of the similarity scores, where the sum of the assigned weights is one.

[0421] The weighted sum of similarity scores is used as the similarity score between the current-level title text vector and the search term vector.

[0422] The following specific examples illustrate this, such as Figure 8 As shown.

[0423] S801: When it is determined that the current level heading has a sub-level heading, obtain the sub-level heading text contained in the current level heading.

[0424] The technical solution of this embodiment is for when the current level heading has a next level heading. If the current level heading does not have a next level heading, this embodiment will not be executed.

[0425] S802: Perform semantic vectorization on the next level heading text to obtain the next level heading text vector.

[0426] The current level heading text has already undergone semantic vectorization. Therefore, here we will only perform semantic vectorization on the next level heading text to obtain the next level heading text vector.

[0427] S803: Calculate the first similarity score between the current level title text vector and the search term vector, and calculate the second similarity score between the next level title text vector and the search term vector.

[0428] Calculate the similarity score between the current level title text vector and the search term vector, and the similarity score between the next level title text vector and the search term vector, respectively.

[0429] S804: Assign weights to the first similarity score and the second similarity score to obtain a weighted sum of similarity scores, where the sum of the assigned weights is one.

[0430] The similarity score of the current level heading and the similarity score of the next level heading can have the same or different weights; there is no restriction here. Since it is a weight allocation, the sum of the allocated weights is one.

[0431] S805: Use the weighted sum of similarity scores as the similarity score between the current level title text vector and the search term vector.

[0432] Let chapter_score be the similarity score between the current level title text vector and the search term vector. Calculate the similarity score1 between the second-level title vector subtitles_embedding and the search term vector glossary_embedding, and the similarity score2 between the first-level title vector chapter_embedding and the search term vector glossary_embedding.

[0433] The weight assigned to the first similarity score (score1) is weight_a, and the weight assigned to the second similarity score (score2) is weight_b. The similarity score between the current-level title text vector and the search term vector can be expressed using the following formula:

[0434] chapter_score=score1*weight_a+score2*weight_b

[0435] weight_a + weight_b = 1

[0436] The technical solution of the embodiments of the present invention utilizes a method of combining titles and subheadings to calculate similarity, which can accurately filter out relevant paragraphs, improve the accuracy of filtering article paragraphs, and relatively improve the accuracy of information generation methods.

[0437] Optionally, as one embodiment, weights are assigned to the first similarity score and the second similarity score, specifically including:

[0438] The weight assigned to the first similarity score is the third weight, and the weight assigned to the second similarity score is the fourth weight. The third weight is greater than the fourth weight.

[0439] The following is an explanation through specific examples.

[0440] Continuing with the above embodiment as an example, the weight assigned to the first similarity score is the third weight, that is, weight_a is the third weight, and the weight assigned to the second similarity score is the fourth weight, that is, weight_b is the fourth weight. Then, the above formula also includes the following limiting conditions:

[0441] weight_a>weight_b

[0442] Right now,

[0443] chapter_score=score1*weight_a+score2*weight_b

[0444] weight_a + weight_b = 1

[0445] weight_a>weight_b

[0446] Optionally, as one embodiment, the similarity score between the current-level heading text vector and the search term vector is calculated based on whether the current-level heading text has a next-level heading text. Specifically, this includes:

[0447] When it is determined that the current level heading does not have a next level heading, the similarity score between the current level heading text vector and the search term vector is calculated, and the similarity score is used as the similarity score between the current level heading text vector and the search term vector.

[0448] The following is an explanation through specific examples.

[0449] If the current level heading does not have a next level heading, it means that it is already the Nth level heading, and there are only paragraphs (i.e., body text) below it. It is not possible to obtain the next level heading of the Nth level heading.

[0450] Let chapter_score still be the similarity score between the current level title text vector and the search term vector. Let score1 be the similarity score between the current level title text vector and the search term vector. Then, chapter_score = score1.

[0451] Optionally, as one embodiment, when the number of sub-level headings is determined to be greater than one, after obtaining the sub-level heading text vectors and before calculating the second similarity score between the sub-level heading text vectors and the search term vectors, the method further includes:

[0452] The average vector of the next level heading text is obtained by averaging the vectors of the next level heading texts, and this average vector is used as the next level heading text vector.

[0453] The following examples illustrate this.

[0454] The description of the current level heading in this embodiment of the invention is based on a first-level heading.

[0455] like Figure 7 As shown, under a first-level heading, there may be multiple second-level headings. If there are multiple second-level headings, before calculating the second similarity score between the second-level heading text vector and the search term vector, the second-level heading text vectors are averaged to obtain the average second-level heading text vector, which is then used as the second-level heading text vector.

[0456] Let the first-level heading be chapter, the first-level heading vector be chapter_embedding, and the second-level heading vector be subtitle_embedding. Under the same chapter, there are second-level headings subtitle, namely subtitle1, subtitle2, and subtitle3. Let the process of semantic average vector be average-vector.

[0457] Therefore, the calculation process of averaging the vectors of all second-level headings (subtitle) into a semantic vector (subtitles_embedding) can be represented as follows:

[0458] subtitle_embedding=average-vector(subtitle1, subtitle2, subtitle3);

[0459] Let chapter_score be the similarity score between the current level title text vector and the search term vector to be calculated. Then, first calculate the similarity score1 between the second-level title vector subtitles_embedding and the search term vector glossary_embedding, and the similarity score2 between the first-level title vector chapter_embedding and the search term vector glossary_embedding.

[0460] In the above calculation process, if there are multiple sub-level headings, the text vectors of the sub-level headings are first averaged to obtain the average text vector of the sub-level headings, and then the average text vector of the sub-level headings is used as the text vector of the sub-level headings.

[0461] Then continue with the subsequent calculations.

[0462] The weight assigned to the first similarity score (score1) is weight_a, and the weight assigned to the second similarity score (score2) is weight_b. The similarity score between the current-level title text vector and the search term vector can be expressed using the following formula:

[0463] chapter_score=score1*weight_a+score2*weight_b

[0464] weight_a + weight_b = 1

[0465] Optionally, as one embodiment, based on the X first-level headings of the first article, Y first-level headings related to the search terms are determined, specifically including:

[0466] According to the second method, the similarity scores of the first-level headings are calculated sequentially;

[0467] If the similarity score of the current first-level heading is greater than or equal to the preset similarity threshold for first-level headings, the current first-level heading is determined to be relevant to the search term; otherwise, it is not relevant.

[0468] The identified first-level headings related to the search terms are accumulated to obtain Y first-level headings.

[0469] The following is an explanation through specific examples.

[0470] Continuing with the above embodiment as an example, the second method, as described above, can be understood as a set calculation method. Its purpose is to determine the similarity score between the current level heading of the target article or paragraph and the search term based on the search term and the set calculation method. The similarity score is a quantitative value, so it can be used for comparison, which facilitates various subsequent processing.

[0471] The technical solution used in the second method is the same as that in the above embodiments. For specific implementation methods and processes, please refer to the above embodiments, which will not be repeated here.

[0472] This embodiment uses the second method to calculate the similarity score of the first-level headings.

[0473] The confirmation process and Figure 6 , Figure 7 The process is similar; if the second method is used to determine the first article from M articles, and the following steps are executed... Figure 6 , Figure 7 If the solution in the code is used, the current process can utilize the results of that solution without needing to execute it again. If it has not been used before... Figure 6 , Figure 7 If the steps in the process are repeated, then this process needs to be executed once.

[0474] As Figure 9 shown

[0475] S901: Calculate the similarity score of the first-level headings in sequence according to the second method.

[0476] For the specific implementation process of the second method, refer to the above embodiments, and details are not elaborated here.

[0477] Use the second method to calculate the similarity score of the first-level headings.

[0478] S902: Determine whether the similarity score of the current first-level heading is greater than or equal to the preset similarity threshold of the first-level heading.

[0479] If it is determined that the current first-level heading is relevant to the search term, execute step S903; if not, execute step S904 to determine that the current first-level heading is not relevant to the search term.

[0480] As previously described, the preset thresholds for each level of headings may not be the same. Currently, what needs to be calculated is the similarity score of the current first-level heading with the search term. Therefore, here it is compared with the preset similarity threshold of the first-level heading.

[0481] S903: Retain the current first-level heading.

[0482] If the similarity score of the current first-level heading is greater than or equal to the preset similarity threshold of the first-level heading, it is determined that the current first-level heading is relevant to the search term. Therefore, retain the current first-level heading.

[0483] S904: Discard the current first-level heading.

[0484] If the similarity score of the current first-level heading is less than the preset similarity threshold of the first-level heading, it is determined that the current first-level heading is not relevant to the search term. Therefore, discard the current first-level heading.

[0485] After the above steps, the first-level headings relevant to the search term will be retained, while those not relevant or with poor relevance to the search term will be excluded.

[0486] Count the first-level headings relevant to the search term and determine that there are Y first-level headings.

[0487] And the Y first-level headings are determined from X first-level headings. If all the first-level headings in the current article are relevant to the search term, then Y = X; if some of the first-level headings in the current article are relevant to the search term, then Y < X. Therefore, 1 ≤ Y ≤ X, and both X and Y are positive integers greater than or equal to 1.

[0488] The technical solution of this embodiment has the advantage of hierarchical analysis, which can analyze multi-level headings. Moreover, the hierarchical analysis method can analyze multi-level headings without limiting the depth of heading levels, with finer analysis granularity and comprehensive analysis content. Furthermore, even if only a paragraph of text in the article or a single subheading is related to the search term, important information will not be missed, preventing false negatives.

[0489] Optionally, as one embodiment, Y first-level headings are used as initial cluster centers. Using a clustering algorithm and the Y initial cluster centers, M articles are used as clustering samples to obtain clusters constituting N-level headings. Specifically, this includes:

[0490] Iteratively perform the following steps until the clusters constituting the N-level headings are obtained:

[0491] Using the current title level on which the cluster center is based as the granularity of the division, the M articles are split to obtain multiple F-level article fragments, where 1≤F≤N. An F-level article fragment contains an F-level title and its subheadings and paragraphs, where F is a positive integer greater than or equal to 1.

[0492] Select F-level article fragments related to the search terms from multiple F-level article fragments and use them as the current F-level title clustering samples. Determine the initial cluster center of the current F-level article fragments and perform clustering processing based on the initial cluster centers determined by the F-level article fragments to obtain S clusters of F-level titles, where S≥Y and S is a positive integer greater than or equal to 1.

[0493] The following is a detailed explanation.

[0494] As attached Figure 10 As shown, Figure 10 Here is a structural example of 3 articles (M=1 to 3) out of M articles, to facilitate the explanation of the clustering process. Figure 10 The structure of only 3 articles is shown, and the depth of the articles is set to N=3.

[0495] In practical applications, the structure of the article may not necessarily be as shown in the appendix. Figure 10 As shown, this does not mean that the structure of clustering articles can only be like this. (See attached image.) Figure 10 The article structure examples are only for illustrating the process of the embodiments of the present invention and do not constitute a limitation on the embodiments of the present invention.

[0496] The process of splitting the article structure in this invention is a step-by-step process based on the heading level.

[0497] The following is a description using the example of the first article being M=1, and the iterative process is as follows:

[0498] 1≤F≤N, an F-level article fragment contains an F-level heading and its subheadings and paragraphs, where F is a positive integer greater than or equal to 1.

[0499] Splitting M articles using the current title level on which the cluster center is based as the granularity means splitting the M articles related to the search terms, with the granularity of the split being the title at the current level.

[0500] For example, when F=1, the current process involves splitting the first-level heading and its contained content. Therefore, the splitting process is as follows:

[0501] When M=1, the current level-one article segment includes the level-one heading and its subheadings and paragraphs containing the level-one heading and its subheadings, and F is a positive integer greater than or equal to 1.

[0502] Therefore, the first level-one article segment currently includes the level-one heading "I. XXX", as well as the subheadings and their paragraphs belonging to the level-one heading "I. XXX", and all content up to the second level-one heading "II. XXX".

[0503] The second first-level article segment includes the first-level heading "II. XXX", as well as the subheadings and their paragraphs belonging to the first-level heading "II. XXX", up to all content before the third first-level heading "III. XXX".

[0504] Similarly, the third to the last level-one article segment includes the level-one headings "M, XXX", as well as the subheadings and their paragraphs belonging to the level-one headings "M, XXX". (M refers to the last level-one heading.)

[0505] For the sake of simplicity, the title will be referred to as the current title from now on as the granularity of the division. The current title includes the current title and its subordinate titles and article paragraphs as a division unit to participate in the clustering process.

[0506] If M=1 is the first article, then according to the above embodiment, there will be Y first-level article fragments.

[0507] When M=2, the first level-one article segment includes a level-one heading and its subordinate headings and paragraphs. That is, the level-one article segment includes "1XXXXX" and its subordinate headings and paragraphs. The second to the last level-one article segments are the same as in the above embodiment and will not be listed here.

[0508] When M=3, the first level-one article segment includes a level-one heading and its subordinate headings and paragraphs, i.e., a level-one article segment includes "Chapter 1 XXXXXX" and its subordinate headings and paragraphs. The second to the last level-one article segments are the same as in the above embodiment and will not be listed here.

[0509] At this point, the splitting at F=1 has been completed.

[0510] Selecting F-level article fragments related to the search terms from multiple F-level article fragments and using them as the current F-level title clustering samples can be implemented as follows:

[0511] From multiple first-level article fragments, select the first-level article fragments that are related to the search terms and use them as clustering samples for the current first-level title.

[0512] The specific implementation process for filtering out the first-level article fragments related to the search terms involves identifying the first-level headings related to the search terms from the first-level headings. The specific implementation process can be found in the following examples, and will not be elaborated here.

[0513] In this embodiment of the invention, all current-level headings are set to be related to the search terms.

[0514] As previously described, when M=1, the article is taken as the first article, and the first-level title of the first article is the initial cluster center. Each initial cluster center represents a class.

[0515] Therefore, each first-level heading of the M=2 articles is used as a clustering sample and clustered towards the first-level heading of the first article (the initial cluster center).

[0516] Let the cluster sample of the first-level heading of the M=2 articles, i.e., "1XXXXX", be similar to the cluster center "I. XXX" of the first-level heading of the first article, and thus belong to this cluster. Similarly, let the cluster sample of the second-level heading, i.e., "2XXXXXXX", be similar to the cluster center "II. XXX" of the first-level heading of the first article, and thus belong to this cluster. And so on, using each first-level heading of the M=2 articles as a cluster sample, clustering them towards the first-level heading of the first article (the initial cluster center).

[0517] After the first-level headings related to the search terms for articles with M=2 are clustered, the clustering of each first-level heading for articles with M=3 is then performed.

[0518] Let the cluster sample of the first-level heading of the articles with M=3, i.e., "Chapter 1 XXXXXX", be similar to the cluster center "I. XXX" of the first-level heading of the first article, and thus belong to this cluster. The cluster sample of the second-level heading, i.e., "Chapter 2 XXXXXX", is similar to the cluster center "II. XXX" of the first-level heading of the first article, and thus belongs to this cluster. And so on, using each first-level heading of the articles with M=3 as a cluster sample, clustering them towards the first-level headings of the first article, until the clustering of the first-level headings of all articles with M=3 is complete.

[0519] Once the first-level headings have completed clustering, the clustering process with F=1 ends. (See appendix) Figure 11 As shown, attached Figure 11 This represents the clustering result when F=1, completed according to the above clustering process.

[0520] After the first-level headings are clustered, the next level of clustering is performed, i.e., clustering at F=2 levels.

[0521] This can also be understood as, when F=2, the clustering for F=1 has already been completed.

[0522] Therefore, when F=2, the current clustered samples when F=1 need to be re-divided at the level of F=2.

[0523] The current embodiment does not limit the initial cluster center for F=2. The second-level heading of the first article can be used as the initial cluster center, or the initial cluster center of the second-level heading can be determined according to the rules set between M articles and search terms. Other methods can also be used to determine the initial cluster center of the second-level heading. Those skilled in the art can make reasonable settings according to actual needs.

[0524] Once the first-level headings are clustered, the cluster samples of each first-level heading's cluster center are composed of first-level heading cluster samples related to each article and search term. These cluster samples include cluster samples of subheadings belonging to the first-level heading and their article paragraphs. In other words, the first-level heading cluster samples contain the first-level heading and its second-level headings and their article paragraphs.

[0525] Therefore, when F=2, the cluster samples of the current first-level heading are taken as a cluster, and the second-level heading level is used as the division granularity to further divide the current cluster.

[0526] Taking the above embodiment as an example, the current first-level title cluster sample contains the content of the first-level title "I. XXX" of the article with M=1, the content of the first-level title "1XXXXX" of the article with M=2, and the content of the first-level title "Chapter 1XXXXXX" of the article with M=3.

[0527] Since the articles have already been split in the first-level heading cluster, the cluster samples in the current first-level heading cluster are composed of articles with first-level headings and article fragments belonging to the first-level headings.

[0528] The cluster samples of the first first-level heading are divided. That is, when F=2, the second-level headings contained in the cluster samples belonging to the first first-level heading are used as the division granularity to divide the article fragments of the first first-level heading.

[0529] For the sake of simplicity, this embodiment of the invention sets the cluster center of the second-level headings to the second-level headings of the article with M=1 as the initial cluster center. In actual operation, rules can be set to select or determine suitable initial cluster centers for the second-level headings.

[0530] Using the second-level headings of articles with M=1 as the initial cluster centers, there are at least two initial cluster centers: "1, XXXX" and "2, XXXX". The clustering process for the other P-th second-level headings is similar to the current clustering process, and will not be exemplified here.

[0531] During clustering, article fragments belonging to M=2 are split according to the level of second-level headings, into "1.1XXXXXXX", "1.2XXX", and "1.3XXXX". Article fragments belonging to M=3 are split according to the level of second-level headings, into "Section 1-1XXXXXX" and "Section 1-2XXXXXX". After the division, they are compared with the initial cluster centers "1,XXXX" and "2,XXXX" to confirm whether they belong to the current cluster center. The cluster centers are adjusted according to the actual situation. For example, if they do not belong to the current cluster center, they are discarded or re-clustered as a new cluster center. Those skilled in the art can make reasonable settings according to actual needs, and there are no restrictions here.

[0532] like Figure 12 As shown, this embodiment uses the clustering cluster in the first level heading as an example for illustration.

[0533] Suppose we currently have two initial cluster centers: "1, XXXX" and "2, XXXX". In the first level-one heading cluster, "1.1XXXXXXX" in article M=2 and "Section 1-1XXXXXX" in article M=3 are similar to the cluster center "1, XXXX"; "1.2XXX" in article M=2 and "Section 1-2XXXXXX" in article M=3 are similar to the cluster center "2, XXXX". We can obtain the following... Figure 12 The clustering shown.

[0534] When F=2 and this round of clustering is completed, the clustering of the second-level headings is finished, and then the clustering when F=3 is performed.

[0535] If a secondary cluster center has at least two values, "1, XXXX" and "2, XXXX", then we will use "1, XXXX" as an example of a secondary cluster center.

[0536] We continue to use the third-level headings of articles with M=1 as the initial cluster centers, that is, we have three initial cluster centers: “1)XXXXXX”, “2)XXXXXX”, and “3)XXXXXX”.

[0537] During clustering, the article fragments belonging to M=2 are split according to the level of the tertiary headings in the current second-level heading cluster. Let the heading "1.1XXXXXXX" belong to the current second-level heading cluster. Then, the cluster sample is split into two tertiary headings, "1.1.1XXX" and "1.1.2XXX". The results are compared with the three initial cluster centers "1)XXXXXX", "2)XXXXXX", and "3)XXXXXX" to determine the corresponding cluster center. The cluster centers may be adjusted as needed.

[0538] After clustering the tertiary headings of the M=2 article fragments, cluster the M=3 article fragments. For each M=3 article fragment, the level of the tertiary heading within the current tertiary heading cluster is split. Let the heading in the current tertiary heading cluster be “Section 1-1 XXXXXX”. Then, this cluster sample is split into two tertiary headings: “Section 1-1-1 XXXXXX” and “Section 1-1-2 XXXXXX”. These are then compared with the three initial cluster centers: “1) XXXXXX”, “2) XXXXXX”, and “3) XXXXXX” to determine the correct cluster center. The appropriate cluster centers may be adjusted as needed.

[0539] When F=3, it means that the deepest level of the current article has been reached, i.e., F=N, and the current iteration process is complete.

[0540] The final illustrative results after clustering can be seen in the appendix. Figure 13 As shown.

[0541] During the clustering process, it can be seen that there are initially Y cluster centers. However, as the second-level and third-level headings are clustered, more cluster centers can be generated. Therefore, there are at least Y cluster centers. But as the second-level and third-level headings are further clustered, the number of cluster centers will increase. Therefore, as the clustering process proceeds down the headings layer by layer, there will be more than Y cluster centers. Therefore, here we set there to be S clusters of F-level headings, where S is a positive integer greater than or equal to 1.

[0542] In the technical solution of this invention embodiment, the clustering algorithm initializes the cluster center for first-level title clustering as the first-level title of the article most relevant to the term; when clustering n-level titles, the initial cluster center is the n-level title under the cluster center within the same cluster of n-1 level titles. When determining whether an n-level title belongs to an existing cluster, the similarity is calculated by assigning weights to the n-level title and its subtitles and the cluster center title and its subtitles. This custom clustering algorithm makes the generated analysis articles more accurate and reasonable.

[0543] Optionally, as one embodiment, if the F+1 level title contained in the F-level cluster cannot be obtained, then the clustering of the F+1 level cluster is stopped.

[0544] The following is a detailed explanation.

[0545] If the final title depth of the current article is not always based on the structure of the first article, but rather the semantic structure most relevant to the search terms is re-determined according to rules after each level of title clustering is completed, and the structure of the title of a certain article among M articles is dynamically determined to determine the cluster center, then the title depth of the information text to be generated cannot be determined at the beginning.

[0546] Furthermore, the depth of headings at the same level can vary even within the same article. For example, the first level heading of an article with M=1 may have a depth of 3, but the depth of the second level heading may be 2. In other words, the depth of headings at the same level may not be the same.

[0547] Therefore, if the F+1 level headings contained in the F-level cluster cannot be obtained, the clustering of the F+1 level cluster is stopped.

[0548] That is, if the F+1 level title cannot be obtained, it means that the F level has reached the deepest level of the current title. It is only necessary to cluster the current F level, and there is no need to continue to the next level for clustering. Therefore, the clustering of the F+1 level cluster is stopped.

[0549] Optionally, as one embodiment, F-level article fragments related to the search term are selected from multiple F-level article fragments, specifically including:

[0550] According to the second method, the similarity score of the F-level headings is calculated;

[0551] If the similarity score of the current F-level title is greater than or equal to the preset F-level similarity threshold, the current F-level article fragment is determined to be relevant to the search term; otherwise, it is not relevant.

[0552] The following examples illustrate this.

[0553] like Figure 14 As shown.

[0554] S1401: Calculate the similarity score of the F-level headings according to the second method.

[0555] The calculation method for the second method can be found in the above embodiments. The second method can calculate the similarity score between any article and the search term.

[0556] S1402: Determine whether the similarity score of the current F-level title is greater than or equal to the preset F-level similarity threshold.

[0557] If yes, proceed to step S1403; otherwise, proceed to step S1404.

[0558] The preset F-level similarity threshold can be the same as or different from that used in the second method in the aforementioned embodiments. The second method is mainly used to calculate the similarity score between each title and the search term. During the calculation process, the second method can also add an additional step: if it is determined that the similarity score is unrelated to the search term, the similarity score can be set to zero, or the current level title and the content contained in the current level title can be discarded. If the second method used in the current technical solution has not been executed, then the current technical solution needs to execute the solution, that is, determine whether the similarity score of the current F-level title is greater than or equal to the preset F-level similarity threshold. If the solution has already been executed in the second method, it is not necessary to execute it again; the information can be determined using the results of the previous execution.

[0559] S1403: Determine that the current F-level article fragment is related to the search term, and retain the current F-level article fragment.

[0560] If the current F-level article fragment is related to the search term, retain the current F-level article fragment and wait for subsequent clustering processing.

[0561] S1404: It has been determined that the current F-level article fragment is not relevant to the search terms.

[0562] If the current F-level article fragment is not relevant to the search terms, it does not need to be processed and subsequent clustering is not required. It can also be discarded. Those skilled in the art can process it according to actual needs.

[0563] Optionally, as one embodiment, determining the initial cluster center of the current F-level article fragment specifically includes:

[0564] Calculate the similarity score of the F-level article fragments according to the second rule method;

[0565] The similarity scores of F-level article segments of the same article are summed to obtain the total similarity score of F-level article segments of the same article.

[0566] The F-level titles of the same article that receive the highest total similarity score will be used as the initial cluster centers for the F-level article segments.

[0567] The following is an explanation through specific examples.

[0568] When determining the F-level article fragments related to the search term, the current F-level cluster sample contains F-level article fragments of each article. Each article fragment has its own semantic structure, and the article fragment with the best semantic structure is used as the initial cluster center for clustering.

[0569] It should be noted that during the clustering process, the cluster centers may be adjusted, such as changing the cluster centers from the F-level headings of one article fragment to the F-level headings of another article fragment; cluster centers may also be added. Specific adjustments and changes will be explained in later examples. Here, we only consider how to determine the initial cluster centers in the article fragments.

[0570] Let F = 2, and with Figure 12 Let's take an example to illustrate.

[0571] Figure 12 This invention describes how to obtain the final clustering result when clustering at F=2, based on the clustering samples of the first-level heading cluster (I) with F=1. Figure 12 The clustering results.

[0572] After clustering with F=1 is completed, the results will be as follows: Figure 15 The cluster shown has not yet undergone the clustering process with F=2.

[0573] After the F=1 clustering was completed, the clustered samples of the first-level heading cluster (I) were subjected to F=2 clustering again. First, the article fragments were split as required, and the results are shown in the attached figure. Figure 15 The article excerpt is shown; secondly, suitable initial cluster centers are determined; finally, clustering is performed.

[0574] Therefore, the process in this embodiment of the invention is how to determine the initial cluster centers after obtaining the article fragments that meet the requirements.

[0575] S1601: Calculate the similarity score of the F-level article fragment according to the second rule method;

[0576] The calculation method for the second rule is the same as described in the above embodiment. It is used to calculate the similarity score between the article or article fragment and the search term. Therefore, according to the second rule method, the similarity score of the F-level article fragment is calculated.

[0577] S1602: Accumulate the similarity scores of F-level article segments of the same article to obtain the total similarity score of F-level article segments of the same article.

[0578] Once the similarity score for each F-level article fragment is obtained, it is also possible to trace which article and which position the current F-level article fragment belongs to. The similarity scores of F-level article fragments belonging to the same article are accumulated.

[0579] For ease of explanation, this invention sets the similarity score between 0 and 1. The higher the score, the closer the similarity is to the search term being compared. 0 represents that the similarity is completely dissimilar to the search term, and 1 represents that the similarity is completely similar to the search term.

[0580] like Figure 15 As shown, the search term score for the article fragment "1、XXX" is 0.7, and the search term score for the article fragment "2、XXX" is 0.65.

[0581] The two article excerpts above belong to the same article. Therefore, the total similarity score of the current article is 0.7 + 0.65 = 1.35.

[0582] Let the search term score for the article fragment “1.1XXXXXXX” be 0.6, and the search term score for the article fragment “1.2,XXXXXXX” be 0.4.

[0583] The two article excerpts above belong to the same article. Therefore, the total similarity score of the current article is 0.6 + 0.4 = 1.

[0584] Let the search term score for the article fragment “Section 1-1 XXXXXXX” be 0.7, and the search term score for the article fragment “Section 1-2 XXXXXXX” be 0.4.

[0585] The two article excerpts above belong to the same article. Therefore, the total similarity score of the current article is 0.7 + 0.4 = 1.1.

[0586] S1603: The F-level titles of the same article that obtain the highest total similarity score are used as the initial cluster centers of the F-level article fragments.

[0587] Based on the above calculation process, the articles belonging to "1.XXX" and "2.XXX" have the highest total score, 1.35. Therefore, the two second-level headings "1.XXX" and "2.XXX" are used as the initial cluster centers for the second-level article segments (at this time, F=2) for clustering processing to obtain the final cluster centers. Figure 12 The result.

[0588] Optionally, as one embodiment, clustering is performed based on the initial cluster centers determined from the F-level article fragments to obtain S clusters of F-level titles, specifically including:

[0589] Clustering is performed between multiple F-level cluster samples and the currently determined cluster centers to determine the cluster to which the current F-level cluster sample belongs;

[0590] If an F-level cluster sample does not belong to any cluster represented by the currently determined cluster center, then the F-level title of the current F-level cluster sample is used as the cluster center to generate a new cluster of F-level titles.

[0591] The number of clusters for the identified F-level headings is accumulated to obtain S clusters for the F-level headings.

[0592] The following is an explanation through specific examples.

[0593] See appendix Figure 17 .

[0594] The process of determining the cluster to which the current F-level cluster sample belongs by performing clustering judgment on multiple F-level cluster samples with the currently determined cluster centers can be as follows:

[0595] S1701: Perform clustering judgment between the current F-level cluster sample and the current cluster center to determine whether the current F-level cluster sample belongs to the current cluster;

[0596] If yes, it belongs to the current cluster and proceeds to step S1702; otherwise, it is compared with the next cluster center and proceeds to step S1703.

[0597] S1702: Belongs to the current cluster.

[0598] S1703: Determine whether the current F-level cluster sample belongs to the second cluster. If yes, it belongs to the second cluster and proceeds to step S1704. If no, it is compared with the next cluster center.

[0599] S1704: Belongs to the second cluster.

[0600] Suppose there are Z clusters, where Z is a positive integer greater than or equal to three. Then, this process needs to make a judgment with at most the Zth cluster.

[0601] Since the intermediate steps are the same as steps S1701 and S1702, they will not be exemplified here. Let Z be the last cluster, and the current step is executed up to S1711.

[0602] S1711: Determine whether the current F-level cluster sample belongs to the Z-th cluster. If yes, it belongs to the N-th cluster and proceed to step S1712. If no, it does not belong to any cluster.

[0603] S1712: Belongs to the Zth cluster.

[0604] S1713: Does not belong to any cluster.

[0605] Through the above process, it is possible to determine the cluster to which the current cluster sample belongs.

[0606] If an F-level cluster sample does not belong to any cluster represented by the currently determined cluster center, then the F-level title of the current F-level cluster sample is used as the cluster center to generate a new cluster of F-level titles.

[0607] That is, if the above process still does not have a belonging cluster when it reaches step S1713, a new cluster of F-level titles is generated with the F-level title of the current F-level cluster sample as the cluster center. That is, the current F-level title is used as a new cluster center, and the current cluster center has only one F-level title as a member. At this time, the number of clusters is Z+1.

[0608] The number of clusters for the identified F-level headings is accumulated to obtain S clusters for the F-level headings.

[0609] That is, based on the above process, the number of clusters of the current F-level headings is determined. The number of clusters is determined according to the actual situation, that is, there are S clusters of F-level headings, S≥Y, and S is a positive integer greater than or equal to 1.

[0610] Optionally, as one embodiment, multiple F-level cluster samples are compared with the currently determined cluster centers to determine the cluster to which the current F-level cluster sample belongs, specifically including:

[0611] Get the current level title of the cluster center of the current cluster and the next level title to which the current title belongs, and perform semantic vectorization processing on the current level title and the next level title to obtain the current level title vector and the next level title vector;

[0612] Obtain the F-th level title and the F+1 level title of the F-th level title of the F-th level cluster sample, and perform semantic vectorization processing on the F-th level title and the F+1 level title to obtain the F-th level title vector and the F+1 level title vector.

[0613] Calculate the similarity between the current level heading vector and the F-th level heading vector to obtain the third similarity; calculate the similarity between the next level heading vector and the F+1-th level heading vector to obtain the fourth similarity.

[0614] Weights are assigned to the third and fourth similarities to obtain a weighted sum of similarity scores, where the sum of the assigned weights is one.

[0615] The weighted similarity score is compared with the preset clustering threshold. If the similarity score is greater than or equal to the clustering threshold, the current F-level cluster sample is determined to belong to the current cluster. Otherwise, the current F-level cluster sample does not belong to the current cluster.

[0616] The following description uses specific examples. Figure 18 As shown.

[0617] S1801: Obtain the current level title of the cluster center of the current cluster and the next level title to which the current title belongs, and perform semantic vectorization processing on the current level title and the next level title to obtain the current level title vector and the next level title vector;

[0618] The purpose of this step is to vectorize the title text to facilitate the next step of similarity comparison.

[0619] As mentioned earlier, the cluster centers are the current level titles of each article. If the title has undergone the second method or similar operations in the preceding steps, it has already been vectorized. That is, if the text vectorization operation has been performed in the preceding steps, this step can directly obtain the vectorized result. If the text vectorization operation has not been performed, semantic vectorization processing is performed on the current level title and the next level title to obtain the current level title vector and the next level title vector.

[0620] S1802: Obtain the F-th level title of the F-level cluster sample and the F+1 level title of the F-th level title, and perform semantic vectorization processing on the F-th level title and the F+1 level title to obtain the F-th level title vector and the F+1 level title vector.

[0621] Similar to the steps above, if the title has undergone the second method or other operations in the aforementioned steps and has already been vectorized, that is, if the aforementioned text vectorization operation has been performed, then this step can directly obtain the vectorized result. If the text vectorization operation has not been performed, then semantic vectorization processing is performed on the F-level title and the F+1-level title to obtain the F-level title vector and the F+1-level title vector.

[0622] Steps S1801 and S1802 are as follows Figure 18 As shown, the order is not limited.

[0623] S1803: Calculate the similarity between the current level heading vector and the F-th level heading vector to obtain the third similarity; calculate the similarity between the next level heading vector and the F+1-th level heading vector to obtain the fourth similarity.

[0624] Both the current level heading vector and the F-level heading vector are text vectors, and their similarity can be compared. The method of similarity comparison is as described above, and this invention is not limited thereto.

[0625] The similarity score is obtained by comparing the current level title vector of the cluster center with the F level title vector of the target cluster center to determine whether it belongs to the current cluster center.

[0626] The fourth similarity score is obtained by comparing the next level title vector of the current level title vector of the cluster center with the next level title vector of the F-th level title vector (i.e., the F+1-th level title vector) that is to be determined to belong to the current cluster center.

[0627] S1804: Assign weights to the third and fourth similarities to obtain a weighted sum of similarity scores, where the sum of the assigned weights is one.

[0628] The third similarity is the similarity value between the title text vector of the cluster center and the text vector of the current title to be classified. The fourth similarity is the similarity value between the title text vector of the next level of the cluster center and the text vector of the next level of the title to be classified.

[0629] Weights are assigned to the third and fourth similarities, and the sum of the assigned weights is one, which will eventually yield a reasonable similarity value between 0 and 1.

[0630] S1805: Compare the weighted summed similarity score with the preset clustering threshold. If the similarity score is greater than or equal to the clustering threshold, determine that the current F-level cluster sample belongs to the current cluster. Otherwise, the current F-level cluster sample does not belong to the current cluster.

[0631] As previously described, weights are assigned to the third and fourth similarities, and the sum of the assigned weights is one. This will eventually yield a reasonable similarity value between 0 and 1. Therefore, the weighted summed similarity score is also a similarity value between 0 and 1. This value is compared with a preset clustering threshold. If it is greater than or equal to the clustering threshold, it is determined that the current F-level cluster sample belongs to the current cluster. Otherwise, it does not belong to the current cluster and needs to be compared with the next cluster center to determine the cluster to which it belongs.

[0632] For the process of determining the cluster to which an F-level cluster sample belongs, please refer to the appendix. Figure 17 As shown.

[0633] To further illustrate the embodiments of the present invention, let chaper be the first-level title to be determined, and center be the cluster center of the current first-level title.

[0634] Because the cluster center of each class is actually a certain chapter, which also contains subtitles.

[0635] Chaper also has subtitles.

[0636] Semantic vectorization allows for semantic comparison, obtaining the similarity between two semantic units. The process of semantic vectorization will not be described here; chapter is vectorized to obtain chapter_embedding, and center is vectorized to obtain center_embedding.

[0637] The subtitles of the chapter are semantically vectorized to obtain chapter_subtitles_embedding, and the subtitles of the center are center_subtitles_embedding.

[0638] Let score1 be the similarity between the two subtitle vectors (chapter_subtitles_embedding and center_subtitles_embedding).

[0639] The similarity score is calculated as score2 for the two chapter title vectors (chapter_embedding and center_embedding).

[0640] Assign a fourth weight b to the similarity score1, and a third weight a to the similarity score2.

[0641] That is, the numerical score of the similarity calculation formula between the current first-level heading (chaper) and the cluster center (center) can be expressed by the following formula:

[0642] score = score1 * b + score2 * a

[0643] And, a + b = 1

[0644] The score is compared with the clustering threshold. If the similarity score is greater than or equal to the clustering threshold, the current F-level cluster sample is determined to belong to the current cluster. Otherwise, the current F-level cluster sample does not belong to the current cluster and is compared with the next cluster center.

[0645] Optionally, as one embodiment, weights are assigned to the third and fourth similarities, specifically including:

[0646] The weight assigned to the third similarity is the third weight, and the weight assigned to the fourth similarity is the fourth weight. The third weight is greater than the fourth weight.

[0647] The following specific examples illustrate this.

[0648] Referring again to the above embodiments, it can be seen that: score = score1*b + score2*a, and a + b = 1.

[0649] The third similarity is the similarity value between the title text vector of the cluster center and the text vector of the current title to be classified. The fourth similarity is the similarity value between the title text vector of the next level of the cluster center and the text vector of the next level of the title to be classified. The proportion of the similarity value between the title text vector of the cluster center and the text vector of the current title to be classified is higher than that between the title text vector of the next level of the cluster center and the text vector of the next level of the title to be classified. This can more reasonably obtain a more reasonable score. That is, the impact of each level of title on the similarity is different. The impact of the similarity value between the title text vector of the cluster center and the text vector of the current title to be classified is greater than that between the title text vector of the next level of the cluster center and the text vector of the next level of the title to be classified.

[0650] Optionally, as one embodiment, when it is determined that the number of level F+1 headings to which the level F heading belongs is greater than one, or when it is determined that the number of next-level headings to which the current level heading belongs is greater than one, before calculating the similarity between the next-level heading vector and the level F+1 heading vector, the method further includes:

[0651] Average the vectors of multiple sub-level headings to obtain the average sub-level heading vector, and use this average sub-level heading vector as the next-level heading vector; or...

[0652] The average of multiple F+1 level heading vectors is used to obtain the F+1 level heading average vector, which is then used as the F+1 level heading vector.

[0653] The following is an explanation through specific examples.

[0654] The above embodiments will continue to be used as examples for further description.

[0655] If the number of F+1 level headings to which the F-level heading belongs is greater than one, it means that the chaper has more than one second-level heading subtitle. If the number of the next level heading to which the current level heading belongs is greater than one, it means that the cluster center has more than one second-level heading subtitle. However, the number of second-level heading subtitles of the chaper and the center may not be equal. Therefore, direct comparison may change the similarity result due to the unequal number of subtitles.

[0656] To overcome the influence of quantity on similarity results, if the number of F+1 level headings to which the F level heading belongs is greater than one, the multiple F+1 heading vectors are averaged to obtain the average F+1 level heading vector, and then the similarity between the next level heading vector and the F+1 level heading vector is calculated.

[0657] Right now,

[0658] Calculate the average vector of all subtitles under a chapter: chapter_subtitles_embedding_i.

[0659] The chapter_subtitles_embedding_i is used as chapter_subtitles_embedding in subsequent calculations.

[0660] Calculate the average vector center_subtitles_embedding_i of all subtitles under center, and use it as center_subtitles_embedding in subsequent calculations.

[0661] Optionally, as one embodiment, when it is determined that the number of F-level cluster samples contained in the current cluster is greater than one, the cluster center of the current cluster is re-determined based on the F-level cluster samples contained in the cluster.

[0662] The following is an explanation through specific examples.

[0663] like Figure 15As shown, once the initial cluster centers of a cluster are determined, clustering begins.

[0664] Let the initial cluster centers be “1, XXXX” and “2, XXXX”.

[0665] During clustering, the cluster sample "1.1XXXXXX" is first compared with the cluster center "1, XXXX". If, according to the above scheme, it is determined that the cluster sample "1.1XXXXXX" belongs to the cluster center "1, XXXX", then the cluster contains the cluster center "1, XXXX" and the cluster sample "1.1XXXXXX", and there are already two cluster samples. At this time, based on the F-level cluster samples contained in the cluster, the cluster center of the current cluster is re-determined. That is, it is necessary to determine which of the two cluster samples "1.1XXXXXX" and "1, XXXX" in this cluster is more reasonable as the cluster center of the current cluster. This can also be understood as comparing the search terms to determine which cluster sample is more suitable as the cluster center.

[0666] The technical solution of this invention continuously updates the cluster center during each clustering process, selecting the title within the cluster that is most similar to the relevant term. This ensures that the cluster center and the search term are always the most relevant, preventing any shift in the center of gravity during the clustering process, resulting in accurate clustering results and improving the accuracy of the information generation method.

[0667] Optionally, as one embodiment, the cluster center of the current cluster is re-determined based on the F-level cluster samples contained in the cluster, specifically including:

[0668] According to the third method, calculate the score of each F-level cluster sample in the current cluster;

[0669] The F-level title of the F-level cluster sample that obtains the highest score in the current cluster is used as the cluster center of the current cluster.

[0670] The third method specifically includes:

[0671] Obtain clustered samples for the scores to be evaluated;

[0672] Based on the titles on which the clustering samples are based, determine the title level of the current title in the article to which it belongs, and the level of each title level in the article to which the current title belongs;

[0673] Based on the current heading level and the heading level of each level to which it belongs, the second method is used to determine the similarity score of the current heading level and the similarity score of each level of heading.

[0674] Based on the first method, determine the keyword score of the article to which the title belongs;

[0675] The product of the obtained search term score, the obtained similarity score of each level of heading, and the similarity score of the current heading level is used as the score of the cluster sample to be evaluated.

[0676] The following is a detailed explanation.

[0677] The third method can be understood as a set method for calculating the score of each F-level cluster sample in the pre-cluster. The calculation method can be set by those skilled in the art according to actual needs.

[0678] The system scores each F-level cluster sample in the cluster based on its calculation method. The score is a quantified value that can be compared in magnitude.

[0679] After obtaining the score of each cluster sample, the F-level title of the F-level cluster sample with the highest score in the current cluster is taken as the cluster center of the current cluster.

[0680] To better illustrate the embodiments of the present invention, the present invention provides a calculation method for a third method, as shown in the appendix. Figure 19 As shown.

[0681] S1901: Obtain cluster samples for the scores to be evaluated;

[0682] Clustering samples are article paragraphs with titles, such as Figure 11 Clustered samples in the first-level heading cluster, such as Figure 12 Cluster samples in the clusters of the second-level headings.

[0683] S1902: Based on the titles used for clustering samples, determine the title level of the current title in the article to which it belongs, and the level of each title level in the article to which the current title belongs;

[0684] Once the cluster samples are determined, the level of the title on which the current cluster sample is based can be determined, for example, Figure 11 The clustered samples are the first-level headings of the current article, meaning the current heading's level is one. Figure 12 The clustered samples are the second-level headings of the current article, meaning the current heading level is two.

[0685] S1903: Based on the current heading level and the heading level of each level to which it belongs, use the second method to determine the similarity score of the current heading level and the similarity score of each level of heading.

[0686] by Figure 12Taking a second-level heading as an example, if the heading level of the clustered sample for scoring is two, and the second-level heading is a second-level heading under the first-level heading, the second method is used to determine the similarity score of the current heading level and the similarity score of each level of heading. That is, the second method is used to determine the similarity score of the second-level heading and the similarity score of the first-level heading to which it belongs.

[0687] Let the first-level heading, which belongs to the second-level heading, have a similarity score of title1_score obtained according to the second method, and the second-level heading has a similarity score of title2_score obtained according to the second method.

[0688] If the second method in the foregoing embodiments is also implemented when implementing the embodiments of the present invention, the results produced by the second method can be used directly. If the second method is not implemented, the steps in the embodiments of the present invention need to perform the calculations of the second method and obtain the results produced by the second method.

[0689] S1904: Determine the keyword score of the article to which the title belongs, based on the first method;

[0690] Each cluster sample is a paragraph from a certain article. For example, the cluster samples of the second-level headings shown in 12 are all split from a certain article, and the search term scores of the article to which the current heading belongs can be obtained.

[0691] Continuing with the above embodiment as an example, let's assume that, according to the first method, the search term score of the article to which the title belongs is text_score.

[0692] S1905: The product of the obtained search term score, the obtained similarity score of each level of heading, and the similarity score of the current heading level is used as the score of the cluster sample to be evaluated.

[0693] Let score be the score of the clustered sample to be evaluated.

[0694] Continuing with the above embodiment as an example, that is,

[0695] score=text_score*title1_score*title2_score

[0696] If the level of the title of the cluster sample to be scored is n, that is,

[0697] score=text_score*title1_score*title2_score*title(n)_score.

[0698] Optionally, as one embodiment, multiple article paragraphs under the obtained clusters of multiple Nth-level headings are combined to generate the text generated by the search terms, specifically including:

[0699] Using the Nth-level cluster as the dividing unit, the article paragraphs belonging to the current cluster are used to generate summary text for the Nth-level cluster using a summary generation algorithm;

[0700] The generated summary texts of multiple Nth-level clusters are sorted according to the heading level and order of the current cluster, and combined into an ordered summary text, which is used as the text for generating search terms.

[0701] The following is an explanation through specific examples.

[0702] Continuing with the above embodiments as an example, and referring to... Figure 11 , Figure 12 , Figure 13 As shown.

[0703] The text generation process involves generating text step by step based on the semantic structure of an article, starting with generating first-level headings. Figure 11 First, generate the first-level heading, then generate the second-level heading. Figure 12 ), then generate a third-level heading after the second-level heading ( Figure 13 Therefore, the structure of the generated text is gradually generated based on the existing article structure and by adjusting the cluster centers according to the clustering algorithm. The cluster center is essentially a title of an article.

[0704] Therefore, the generated article structure also conforms to the objective semantic architecture of the search terms. Within the same cluster, article paragraphs with the same properties and similar content are grouped together and serve as the current cluster center.

[0705] As mentioned above, the N-level heading is the deepest level of heading, and there are no further headings below it. In other words, the paragraphs are located below the N-level heading.

[0706] See Figure 20 As shown.

[0707] S2001: Using the Nth-level cluster as the dividing unit, the article paragraphs belonging to the current cluster are used to generate summary text for the Nth-level cluster using a summary generation algorithm.

[0708] The Nth-level cluster, the deepest level cluster, no longer contains headings but is composed of paragraphs. The Nth-level cluster serves as the unit of division, i.e., as shown below... Figure 13 The clusters of the smallest partitioning units shown are used to generate summary texts for the Nth level clusters of the article paragraphs belonging to the current cluster using a summary generation algorithm.

[0709] like Figure 13 As shown, the article paragraphs belonging to the current cluster are the article paragraph content under the title. The summary generation algorithm can be understood as an existing technology algorithm, such as the summary extraction algorithm TextRank, etc., which is not limited here.

[0710] In the current cluster, all the text paragraphs have the same properties and similar content. This can also be understood as text paragraphs with similar meanings from different articles. Therefore, the title of the current cluster can be the title of the cluster center. Titles of non-cluster centers do not participate in the generation process of the abstract text.

[0711] S2002: The generated summary texts of multiple Nth-level clusters are sorted according to the title level and order of the current cluster and combined into an ordered summary text, which is used as the text for generating search terms.

[0712] For an article, there are often multiple Nth-level clusters. After generating the summary text of the Nth-level cluster, the current cluster has a title for the cluster center. The title of the cluster center of the current cluster can be used as the title of the summary text of the generated Nth-level cluster.

[0713] During the process of generating summary text, the current cluster has a title level and order. The current cluster is sorted according to its title level and order, and combined into an ordered summary text, which is used as the text generated by the search terms.

[0714] The technical solution of this invention generates a summary as the main text by merging the main text paragraphs under the same category of the lowest-level headings. This method of generating the main text makes the generated analysis article concise and non-redundant, easy for users to read. Furthermore, this technical solution retains paragraphs from the corresponding articles within the clusters. When generating the summary, these paragraphs can be matched with the corresponding paragraphs in the clusters, allowing the user to trace back to the corresponding position in the article and obtain the source of the current summary. When a user determines that a certain part of the summary is needed, they can trace back to the corresponding article to obtain first-hand information, saving time spent on filtering and reading.

[0715] Optionally, as one embodiment, after sorting according to the heading level and order of the current cluster, and before combining them into an ordered summary text, the method further includes:

[0716] Based on the titles represented by the cluster centers of the Nth-level clusters from level 1 to N-1, and the Nth-level titles represented by the cluster centers of the Nth-level clusters, a text title hierarchy is constructed, and the generated summary text of the Nth-level clusters is used as the content of the Nth-level titles.

[0717] The following is a detailed explanation.

[0718] After generating the abstract text, the main text content has been presented in the form of an abstract. However, the previous hierarchical structure of the article, such as the original first-level headings and second-level headings, should also be reflected. Therefore, after sorting according to the heading level and order of the current cluster, and before combining them into an ordered abstract text, the text heading hierarchy is structured according to the headings represented by the cluster centers of the 1 to N-1 level clusters to which the N-level cluster belongs, and the N-level headings represented by the cluster centers of the N-level cluster. The generated abstract text of the N-level cluster is then used as the content of the N-level headings.

[0719] This invention also provides an information text generation device 2100, such as... Figure 21 As shown, it includes:

[0720] The filtering module 2101 is used to filter M articles that meet the first preset condition from a preset article database based on the search terms, wherein the first preset condition is determined based on the articles contained in the article database and the search terms, and M is a positive integer greater than or equal to 1; it is also used to determine the first article among the M articles.

[0721] The generation module 2102 is used to iteratively execute the following steps until a cluster containing N-level headings is obtained: Based on the X first-level headings of the first article, Y first-level headings related to the search terms are determined. The Y first-level headings are used as initial cluster centers. Using a clustering algorithm and the Y initial cluster centers, M articles are used as clustering samples to obtain clusters constituting N-level headings, where 1≤Y≤X, and X and Y are both positive integers greater than or equal to 1. The clusters of N-level headings contain the titles and paragraphs of M articles. It is also used to combine multiple article paragraphs under the obtained clusters of multiple N-level headings to generate the text generated by the search terms.

[0722] Where N is a positive integer greater than or equal to 1, and represents the level of the article title.

[0723] According to embodiments of the present invention, an electronic device 2200 is also provided, such as... Figure 22 As shown, it includes:

[0724] Memory 2201 is used to store program instructions;

[0725] Processor 2202 is configured to call program instructions stored in memory and execute any of the methods in the above embodiments according to the obtained program.

[0726] According to embodiments of the present invention, a computer storage medium is also provided, which stores computer-executable instructions for causing a computer to perform any of the methods described in the above embodiments.

[0727] It should be understood that the specific embodiments described above are merely illustrative or explanatory of the principles of the invention and do not constitute a limitation thereof. Therefore, any modifications, equivalent substitutions, improvements, etc., made without departing from the spirit and scope of the invention should be included within the protection scope of the invention. Furthermore, the appended claims are intended to cover all variations and modifications falling within the scope and boundaries of the appended claims, or equivalent forms of such scope and boundaries.

Claims

1. A method for generating information text, characterized in that, include: Based on the search terms, M articles that meet the first preset condition are selected from the preset article database, where M is a positive integer greater than or equal to 1; The first article is identified from the M articles. The following steps are iteratively executed until a cluster containing N-level headings is obtained: Based on the X first-level headings of the first article, Y first-level headings related to the search term are determined. The Y first-level headings are used as initial cluster centers. Using a clustering algorithm and the Y initial cluster centers, the M articles are used as clustering samples to obtain the clusters constituting the N-level headings, where 1≤Y≤X, and X and Y are both positive integers greater than or equal to 1. The clusters of the N-level headings contain the titles and paragraphs of the M articles. The multiple article paragraphs under the obtained multiple Nth level headings are combined together to generate the information text of the search terms; Wherein, N is a positive integer greater than or equal to 1, and is the level of the article title; Among the M articles, identifying the first article includes: The M articles also display selection boxes indicating whether they are selected; these selection boxes are used to confirm whether the current article is selected; the selected article is designated as the first article; or... Calculate the similarity score of the first-level headings of the M articles; The similarity scores of the first-level headings obtained from the same article are summed up to obtain the total score of the first-level headings of the current article. The article with the highest total similarity score among the total scores of the first-level headings is selected as the first article. The calculation of the similarity score of the first-level headings of the M articles includes: Get the current heading text of the current article or article segment to be calculated; The current-level title text and the search terms are semantically vectorized to obtain the current-level title text vector and the search term vector. Calculate the similarity score between the current level title text vector and the search term vector based on whether the current level title text has a next level title text. The similarity score is used as the similarity score of the current level heading of the current article or article segment; Specifically, the step of using the Y first-level headings as initial cluster centers, and employing a clustering algorithm with the Y initial cluster centers to cluster the M articles as clustering samples to obtain the clusters constituting the N-level headings includes: Iteratively perform the following steps until the clusters constituting the N-level headings are obtained: Using the current title level on which the cluster center is based as the division granularity, the M articles are split to obtain multiple F-level article fragments, where 1≤F≤N. Each F-level article fragment contains an F-level title and its subheadings and paragraphs, where F is a positive integer greater than or equal to 1. Select F-level article fragments related to the search term from multiple F-level article fragments and use them as the current F-level title clustering samples. Determine the initial cluster center of the current F-level title article fragments and perform clustering processing based on the initial cluster centers determined by the F-level article fragments to obtain S clusters of F-level titles, where S≥Y, and S is a positive integer greater than or equal to 1.

2. The method according to claim 1, characterized in that, The step of selecting M articles from a preset article database that meet the first preset condition based on the search terms specifically includes: Calculate the keyword scores of the articles contained in the article database; identify M articles whose keyword scores exceed a first threshold as articles that meet a first preset condition; or, Calculate the keyword scores of the articles contained in the article database; sort the keyword scores from highest to lowest, and select the articles corresponding to the top M keyword scores in the sorting results as articles that meet the first preset condition; or, Calculate the search term scores of the articles contained in the article database; sort the search term scores and display a selection box indicating whether the article corresponding to the search term score has been selected, the selection box being used to confirm whether the current article has been selected; the selected article is considered as an article that meets the first preset condition.

3. The method according to claim 2, characterized in that, The calculation of the keyword scores for the articles contained in the article database specifically includes: Obtain the search terms and the articles for which the search term scores are to be evaluated; The search terms are matched with the content of the article. When it is determined that the content of the article contains the search terms, all positions in the current article containing the search terms are identified. The weight assigned to the search term is obtained based on its position in the article. The following steps are executed iteratively until the scores of all search terms in the article are calculated: the product of the occurrence score corresponding to the search term and the weight is used as the score of the search term at the current position, wherein the occurrence score is preset or determined according to the search term; The score obtained by adding up the scores of all the location search terms appearing in the article is used as the search term score of the current article.

4. The method according to claim 3, characterized in that, The step of obtaining the weight assigned to the search term based on its position in the article specifically includes: Based on the position of the search term in the article, obtain the pre-set weight of the position, and use the pre-set weight as the weight assigned to the search term; or, When the search term is determined to appear in both the article title and the article paragraph, a first weight is assigned to the article title, and a second weight is assigned to the article paragraph, wherein the first weight is greater than the second weight, and the sum of the first weight and the second weight is one; or, When it is determined that the search term appears in the article title, different weights are assigned to the search term according to its level in the article title, such that the weights assigned to the search term vary depending on the level of the article title, wherein the sum of the assigned weights is one; or, When it is determined that the search term appears in the article title and the article paragraph, different weights are assigned to the search term according to the level of the search term in the article title and the paragraph position, such that the weights assigned to the search term are different weights assigned according to the level of the article title and the paragraph position in which it appears, wherein the sum of the assigned weights is one.

5. The method according to claim 4, characterized in that, The step of assigning different weights to the search terms based on their level in the article title specifically includes: The higher the level of the article title within the article, the higher its assigned weight.

6. The method according to claim 4, characterized in that, The method of assigning different weights to the search terms based on their level and paragraph position in the article title specifically includes: The higher the level of the article title in the article, the higher the weight assigned to it. The weight assigned to the paragraph position is less than the weight assigned to the article title.

7. The method according to claim 1, characterized in that, The semantic vectorization process specifically includes: Based on the obtained search terms, the corresponding semantic database is retrieved, and the search term vector corresponding to the search terms is obtained from the semantic database; or, Based on the obtained search terms, semantic vector processing is performed on the search terms to obtain the search term vectors corresponding to the search terms.

8. The method according to claim 1, characterized in that, After calculating the similarity score between the current-level heading text vector and the search term vector, and before using the similarity score as the similarity score for the current-level heading of the current article or article segment, the method further includes: When the similarity score is determined to be less than a preset similarity threshold for the current level title, the similarity score is set to zero, or the current level title and the content contained in the current level title are discarded.

9. The method according to claim 1, characterized in that, The step of calculating the similarity score between the current-level title text vector and the search term vector based on whether the current-level title text has a next-level title text specifically includes: When it is determined that the current level heading has a next level heading, the text of the next level heading contained in the current level heading is obtained; The next-level heading text is semantically vectorized to obtain the next-level heading text vector. Calculate the first similarity score between the current level title text vector and the search term vector, and calculate the second similarity score between the next level title text vector and the search term vector; Weights are assigned to the first similarity score and the second similarity score to obtain a weighted sum of similarity scores, wherein the sum of the assigned weights is one. The weighted summation of the similarity scores is used as the similarity score between the current-level title text vector and the search term vector.

10. The method according to claim 9, characterized in that, The process of assigning weights to the first similarity score and the second similarity score specifically includes: The weight assigned to the first similarity score is the third weight, and the weight assigned to the second similarity score is the fourth weight, wherein the third weight is greater than the fourth weight.

11. The method according to claim 7, characterized in that, The step of calculating the similarity score between the current-level title text vector and the search term vector based on whether the current-level title text has a next-level title text specifically includes: When it is determined that the current level heading does not have a next level heading, the similarity score between the current level heading text vector and the search term vector is calculated, and the similarity score is used as the similarity score between the current level heading text vector and the search term vector.

12. The method according to claim 9, characterized in that, When it is determined that the number of the next-level headings is greater than one, after obtaining the text vector of the next-level headings and before calculating the second similarity score between the text vector of the next-level headings and the search term vector, the method further includes: The average vector of the next-level heading text is obtained by averaging the vectors of the next-level heading texts, and this average vector is used as the next-level heading text vector.

13. The method according to claim 1, characterized in that, The step of determining Y first-level headings related to the search term based on X first-level headings of the first article specifically includes: The similarity scores of the first-level headings are calculated sequentially; If the similarity score of the current first-level title is greater than or equal to a preset similarity threshold, the current first-level title is determined to be related to the search term; otherwise, it is not related. The identified first-level headings related to the search terms are accumulated to obtain the Y first-level headings.

14. The method according to claim 1, characterized in that, Also includes: If the F+1 level title contained in the F-level cluster cannot be obtained, then the clustering of the F+1 level cluster is stopped.

15. The method according to claim 1, characterized in that, The step of filtering out F-level article fragments related to the search term from multiple F-level article fragments specifically includes: Calculate the similarity score of the F-level headings; If the similarity score of the current F-level title is greater than or equal to the preset F-level similarity threshold, the current F-level article fragment is determined to be related to the search term; otherwise, it is not related.

16. The method according to claim 1, characterized in that, Determining the initial cluster center of the current F-level article fragment specifically includes: Calculate the similarity score of the F-level article fragment; The similarity scores of the F-level article segments of the same article are summed to obtain the total similarity score of the F-level article segments of the same article. The F-level titles of the same article that obtain the highest total similarity score are used as the initial cluster centers of the F-level article segments.

17. The method according to claim 1, characterized in that, The step of clustering based on the initial cluster centers determined from the F-level article fragments to obtain S clusters of F-level titles specifically includes: The multiple F-level cluster samples are compared with the currently determined cluster center to determine the cluster to which the current F-level cluster sample belongs; If the F-level cluster sample does not belong to any cluster represented by the currently determined cluster center, then the F-level title of the current F-level cluster sample is used as the cluster center to generate a new cluster of F-level titles. The number of clusters of the identified F-level titles is accumulated to obtain the S clusters of F-level titles.

18. The method according to claim 17, characterized in that, The step of performing clustering judgment on multiple F-level cluster samples and the currently determined cluster centers to determine the cluster to which the current F-level cluster sample belongs specifically includes: Obtain the current level title of the cluster center of the current cluster and the next level title to which the current title belongs, and perform semantic vectorization processing on the current level title and the next level title to obtain the current level title vector and the next level title vector; Obtain the F-th level title and the F+1 level title of the F-th level title of the F-level cluster sample, and perform semantic vectorization processing on the F-th level title and the F+1 level title to obtain the F-th level title vector and the F+1 level title vector. Calculate the similarity between the current level heading vector and the F-th level heading vector to obtain the third similarity; calculate the similarity between the next level heading vector and the F+1-th level heading vector to obtain the fourth similarity. Weights are assigned to the third similarity and the fourth similarity to obtain a weighted sum of similarity scores, wherein the sum of the assigned weights is one. The weighted similarity score is compared with a preset clustering threshold. If the similarity score is greater than or equal to the clustering threshold, the current F-level cluster sample is determined to belong to the current cluster. Otherwise, the current F-level cluster sample does not belong to the current cluster.

19. The method according to claim 18, characterized in that, The assignment of weights to the third similarity and the fourth similarity specifically includes: The weight assigned to the third similarity is the third weight, and the weight assigned to the fourth similarity is the fourth weight, wherein the third weight is greater than the fourth weight.

20. The method according to claim 18, characterized in that, When it is determined that the number of level F+1 headings to which the level F heading belongs is greater than one, or when it is determined that the number of the next-level headings to which the current level heading belongs is greater than one, before calculating the similarity between the next-level heading vector and the level F+1 heading vector, the method further includes: The average of multiple next-level heading vectors is used to obtain an average next-level heading vector, which is then used as the next-level heading vector; or... The average of the multiple F+1 level heading vectors is used to obtain the F+1 level heading average vector, and the F+1 level heading average vector is used as the F+1 level heading vector.

21. The method according to claim 17, characterized in that, Also includes: If the number of F-level cluster samples contained in the current cluster is greater than one, the cluster center of the current cluster is re-determined based on the F-level cluster samples contained in the cluster.

22. The method according to claim 21, wherein the step of re-determining the cluster center of the current cluster based on the F-level cluster samples contained in the cluster cluster specifically includes: Calculate the score of each of the F-level cluster samples in the current cluster; The F-level title of the F-level cluster sample that obtains the highest score in the current cluster is used as the cluster center of the current cluster.

23. The method according to claim 22, characterized in that, The calculation of the score for each F-level cluster sample in the current cluster specifically includes: Obtain clustered samples for the scores to be evaluated; Based on the title on which the clustering sample is based, determine the title level of the current title in the article to which it belongs, and the level of each title level in the article to which the current title belongs; Based on the current heading level and the heading level of each heading level to which it belongs, determine the similarity score of the current heading level and the similarity score of each heading level. Determine the keyword score of the article to which the title belongs; The product of the obtained search term score, the obtained similarity score of each level of title, and the similarity score of the current title level is used as the score of the cluster sample to be evaluated.

24. The method according to claim 1, characterized in that, The step of combining multiple article paragraphs under the obtained multiple Nth-level heading clusters to generate the text generated by the search terms specifically includes: Using the Nth-level cluster as the dividing unit, the article paragraphs belonging to the current cluster are used to generate the summary text of the Nth-level cluster using a summary generation algorithm; The generated summary texts of multiple Nth-level clusters are sorted according to the title level and order of the current cluster and combined into an ordered summary text, which is used as the text generated by the search terms.

25. The method according to claim 24, characterized in that, After sorting according to the heading level and order of the currently described clusters, and before combining them into an ordered summary text, the process also includes: Based on the titles represented by the cluster centers of the Nth-level clusters from level 1 to level N-1, and the Nth-level titles represented by the cluster centers of the Nth-level clusters, a text title hierarchy is constructed, and the generated summary text of the Nth-level clusters is used as the content of the Nth-level titles.

26. An information text generation device, characterized in that, include: The filtering module is used to filter M articles that meet the first preset condition from a preset article database based on the search terms, wherein the first preset condition is determined based on the articles contained in the article database and the search terms, and M is a positive integer greater than or equal to 1; it is also used to determine the first article from the M articles. The generation module is used to iteratively execute the following steps until a cluster containing N-level headings is obtained: Based on the X first-level headings of the first article, Y first-level headings related to the search term are determined; the Y first-level headings are used as initial cluster centers; using a clustering algorithm and the Y initial cluster centers, the M articles are used as clustering samples to obtain clusters constituting the N-level headings, where 1 ≤ Y ≤ X, and X and Y are both positive integers greater than or equal to 1; the clusters of the N-level headings contain the titles and paragraphs of the M articles; and it is also used to combine multiple paragraphs from the multiple clusters of the N-level headings to generate the text generated by the search term. Wherein, N is a positive integer greater than or equal to 1, and is the level of the article title; Specifically, the filtering module is used for: The M articles also display selection boxes indicating whether they are selected; these selection boxes are used to confirm whether the current article is selected; the selected article is designated as the first article; or... Calculate the similarity score of the first-level headings of the M articles; The similarity scores of the first-level headings obtained from the same article are summed up to obtain the total score of the first-level headings of the current article. The article with the highest total similarity score among the total scores of the first-level headings is selected as the first article. The calculation of the similarity score of the first-level headings of the M articles includes: Get the current heading text of the current article or article segment to be calculated; The current-level title text and the search terms are semantically vectorized to obtain the current-level title text vector and the search term vector. Calculate the similarity score between the current level title text vector and the search term vector based on whether the current level title text has a next level title text. The similarity score is used as the similarity score of the current level heading of the current article or article segment; Specifically, the step of using the Y first-level headings as initial cluster centers, and employing a clustering algorithm with the Y initial cluster centers to cluster the M articles as clustering samples to obtain the clusters constituting the N-level headings includes: Iteratively perform the following steps until the clusters constituting the N-level headings are obtained: Using the current title level on which the cluster center is based as the division granularity, the M articles are split to obtain multiple F-level article fragments, where 1≤F≤N. Each F-level article fragment contains an F-level title and its subheadings and paragraphs, where F is a positive integer greater than or equal to 1. Select F-level article fragments related to the search term from multiple F-level article fragments and use them as the current F-level title clustering samples. Determine the initial cluster center of the current F-level title article fragments and perform clustering processing based on the initial cluster centers determined by the F-level article fragments to obtain S clusters of F-level titles, where S≥Y, and S is a positive integer greater than or equal to 1.

27. An electronic device, characterized in that, include: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the method according to any one of claims 1 to 25.

28. A computer storage medium, characterized in that, The computer storage medium stores computer-executable instructions for causing the computer to perform the method according to any one of claims 1 to 25.

Citation Information

Patent Citations

  • Research report generation method and system and computer storage medium

    CN115270738A