Abstract generation method and device, equipment and medium
By determining the processing flow and text extraction based on the type of announcement file, combined with the summary generation model, the problem of low reading efficiency caused by the large content and diverse presentation forms of announcement files is solved, and the generated summary is more readable and concise.
Patent Information
- Application Number
- CN202410446359.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-15
- Publication Date
- 2024-08-30
AI Technical Summary
Announcement documents contain a lot of content and contain special nouns, which results in low user reading efficiency and poor user experience. Especially due to the diverse presentation forms, which mix text and tables, it increases the difficulty of reading.
Determine the target processing process according to the type of announcement file, perform text extraction, and determine whether the text information length exceeds the preset threshold. If it exceeds the preset threshold, summarize the content and call the summary generation model to generate an initial summary. If not, directly call the summary generation model to generate the summary. .
It improves the efficiency and experience of users in obtaining announcement file information, and the generated summary is more readable and the content is more streamlined.
Smart Images

Figure CN118568252A
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and in particular, relates to a summary generation method, device, equipment and medium. Background Art
[0002] In the information age, announcement documents, as important information carriers for providing important information, rules, policies or notices, are increasingly appearing on various information platforms.
[0003] However, on the one hand, due to the limitation of writing standards, announcement documents are often complex and contain many special terms, which makes users less efficient in reading announcement documents. On the other hand, due to the various presentation forms of announcement documents, such as mixed text, tables, etc., users find it difficult to read announcement documents. Therefore, in the related art, users have low efficiency in obtaining information from announcement documents and have poor user experience. Summary of the invention
[0004] The embodiment of the present application provides an implementation scheme different from the related art to solve the technical problems in the related art that users have low efficiency and poor user experience when obtaining information in announcement files.
[0005] In a first aspect, the present application provides a method for generating a summary, comprising:
[0006] Determine a target processing flow based on the announcement file type of the announcement file to be analyzed, wherein different announcement file types correspond to different processing flows;
[0007] Performing text extraction on the announcement file to be analyzed based on the target processing flow to obtain target text information corresponding to the announcement file to be analyzed;
[0008] Determine whether the length of the target text information is greater than a preset length threshold;
[0009] If yes, obtaining an initial summary corresponding to the announcement file to be analyzed according to the target text information, calling a first preset summary generation model to generate a summary of the initial summary, and obtaining a target summary corresponding to the announcement file to be analyzed;
[0010] If not, the first preset summary generation model is called to generate a summary of the target text information to obtain a target summary corresponding to the announcement document to be analyzed.
[0011] In a second aspect, the present application provides a summary generation device, comprising:
[0012] A processing flow determination module, used to determine a target processing flow based on the announcement file type of the announcement file to be analyzed;
[0013] A text extraction module, used to extract text from the announcement file to be analyzed based on the target processing flow to obtain target text information corresponding to the announcement file to be analyzed, wherein different announcement file types correspond to different processing flows;
[0014] A summary generation module is used to determine whether the length of the target text information is greater than a preset length threshold. If so, summarize the content of the target text information to obtain an initial summary corresponding to the target text information, call the first preset summary generation model to generate a summary of the initial summary, and obtain a target summary corresponding to the announcement file to be analyzed; if not, directly call the first preset summary generation model to generate a summary corresponding to the target text information, and obtain a target summary corresponding to the announcement file to be analyzed, wherein the preset length threshold is determined according to the single maximum input length of the first preset summary generation model.
[0015] In a third aspect, the present application provides an electronic device, including:
[0016] Processor; and
[0017] A memory, configured to store executable instructions of the processor;
[0018] The processor is configured to execute the first aspect, or any method in any possible implementation manner of the first aspect, by executing the executable instructions.
[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the computer program implements the first aspect, or any method in any possible implementation manner of the first aspect.
[0020] The present application provides a target processing flow for determining a target processing flow based on the announcement file type of the announcement file to be analyzed, wherein different announcement file types correspond to different processing flows; based on the target processing flow, text extraction is performed on the announcement file to be analyzed to obtain target text information corresponding to the announcement file to be analyzed; it is determined whether the length of the target text information is greater than a preset length threshold; if so, an initial summary corresponding to the announcement file to be analyzed is obtained according to the target text information, and a first preset summary generation model is called to perform summary generation on the initial summary to obtain a target summary corresponding to the announcement file to be analyzed; if not, the first preset summary generation model is called to perform summary generation on the target text information to obtain a target summary corresponding to the announcement file to be analyzed. The solution can perform text extraction on the announcement file to be analyzed according to the file type of the original announcement file to be analyzed to obtain the target text information in the announcement file to be analyzed, and further perform summary generation operation on the target file information to obtain the target summary corresponding to the announcement file to be analyzed for user reading. Compared with the original announcement file to be analyzed, the target summary is more readable and more concise, thereby achieving the technical effect of improving the efficiency and experience of users in obtaining announcement file information. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following is a brief introduction to the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0022] Figure 1 A schematic diagram of a process flow of a summary generation method provided in an embodiment of the present application;
[0023] Figure 2 A schematic diagram of a principle of an initial summary generation method provided in an embodiment of the present application;
[0024] Figure 3 Another schematic diagram of a process flow of a summary generation method provided in one embodiment of the present application;
[0025] Figure 4 A schematic diagram of the structure of a summary generation system provided in an embodiment of the present application;
[0026] Figure 5 A schematic diagram of the structure of a summary generation device provided in an embodiment of the present application;
[0027] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, but cannot be understood as limiting the present application.
[0029] The terms "first" and "second" etc. in the specification, claims and drawings of the embodiments of the present application are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that this scheme is implemented in other orders in addition to the order illustrated or described in the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0030] It is understandable that in the specific implementation of this application, related data such as announcement documents to be analyzed are involved. When the above embodiments of this application are applied to specific products or technologies, user permission, consent or authorization is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0031] First, some terms in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.
[0032] Announcement of listed companies: refers to the notice issued by listed companies when they announce company-related information to the public through designated platforms in accordance with the requirements of the China Securities Regulatory Commission.
[0033] Kafka: An open source stream processing platform developed by the Apache Software Foundation. It is a high-throughput distributed publish-subscribe messaging system that can process all action stream data of consumers on the website.
[0034] Azure Form Recognizer: is a cloud-based application AI service for developers to build solutions for extracting content from documents. Form Recognizer applies advanced machine learning to accurately extract text, key-value pairs, tables, and structured form documents.
[0035] Adobe’s Extract API: This API provides the ability to extract text, images, and table data from PDF documents so that developers can use this data for automated processes in their applications or services.
[0036] Due to the restrictions of writing standards, announcement documents are usually lengthy and contain a lot of fixed content. Key information is scattered in different locations in the announcement, making it difficult and inefficient for users to read the announcement documents.
[0037] In order to solve this technical problem, the present application provides a summary generation method, device, equipment and medium, which are used to solve the technical problems in the related art that users have low efficiency and poor user experience when obtaining information in announcement documents.
[0038] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0039] Figure 1 A schematic flow chart of a summary generation method provided by an exemplary embodiment of the present application, the method may be applicable to a computing device, and the method at least includes the following S11-S14:
[0040] S11, determining a target processing flow based on the announcement file type of the announcement file to be analyzed, wherein different announcement file types correspond to different processing flows;
[0041] The announcement file to be analyzed may be any type of announcement file, including notification announcements, recruitment announcements, etc., for example, it may be a listed company announcement. The present application does not limit the method for obtaining the announcement file to be analyzed, for example, it may be an announcement file directly provided by a user and uploaded to a computing device, or an announcement file stored in a local database, or an announcement file obtained in real time from other devices.
[0042] In some embodiments, the announcement file type of the announcement file to be analyzed is determined according to the display form of the announcement content corresponding to the announcement file to be analyzed. For example, the announcement file type of the announcement file to be analyzed includes a first preset type in which the announcement content is displayed in a table form, a second preset type in which the announcement content is displayed in a financial report form, and a third preset type other than the first preset type and the second preset type.
[0043] More specifically, taking the announcement documents to be analyzed as announcements of listed companies in the U.S. stock market as an example, the announcement documents to be analyzed with the first preset type of announcement document type include but are not limited to: Form4, Form144 and other U.S. stock form-type announcement documents, the announcement documents to be analyzed with the second preset type of announcement document type include but are not limited to: 10-K, 10-Q, 20-F and other U.S. stock financial report-type announcement documents, and the announcement document types of other announcement documents except U.S. stock form-type and U.S. stock financial report-type announcement documents can be used as the third preset type.
[0044] In some embodiments, the announcement file data can be obtained by crawling from institutions that provide announcement file data (such as stock exchanges, futures exchanges, etc.), or purchasing from professional information service companies, and further, the collected announcement file data is stored in the announcement database for subsequent processing and display of the announcement file data. This process can be integrated in the announcement file data acquisition module. Furthermore, before summarizing the announcement file data in the announcement database, it also includes the step of data cleaning of the announcement file data, such as deduplication of the announcement file data, removal of dirty data, removal of invalid links, etc. The above-mentioned announcement file to be analyzed is one of the announcement file data in the announcement database after data cleaning.
[0045] In some embodiments, the method further comprises:
[0046] Obtain metadata corresponding to the announcement file to be analyzed, wherein the metadata includes at least: an announcement link and an announcement file type; and call a summary generation method as described in S11-S14 based on the metadata corresponding to the announcement file to be analyzed.
[0047] In some embodiments, when the summary generation method is called based on the metadata corresponding to the announcement file to be analyzed, the computing device downloads the announcement file to be analyzed and obtains the announcement file type of the announcement file to be analyzed according to the metadata corresponding to the announcement file to be analyzed, and determines the target processing flow based on the announcement file type of the announcement file to be analyzed. Different announcement file types correspond to different processing flows, and the processing flow is used to extract text information from the announcement file to be analyzed.
[0048] S12, extracting text from the announcement file to be analyzed based on the target processing flow to obtain target text information corresponding to the announcement file to be analyzed;
[0049] For announcement files of different types, the display forms of the announcement contents are often different. Therefore, for each type of announcement file, different processing procedures applicable to each type of announcement file need to be formulated to extract the text information in the announcement file to be analyzed, thereby improving the accuracy of the generated target summary.
[0050] For the announcement files to be analyzed whose contents are displayed in a tabular form, since the table is two-dimensional, if the table contents are directly extracted into plain text, the row name and column name corresponding to a certain value in the table may be far away from the position of the value itself. In the subsequent summary generation of the extracted text, errors are likely to occur when aligning the meaning of the value, which ultimately leads to inaccurate summary content. Therefore, the present application provides the following schemes described in S121-S123 to extract text from announcement files whose contents are displayed in a tabular form.
[0051] In some embodiments, if the announcement file type is a first preset type, wherein the announcement content of the announcement file corresponding to the first preset type is displayed in a table form, in S12, the text extraction of the announcement file to be analyzed based on the target processing flow to obtain the target text information corresponding to the announcement file to be analyzed includes the following S121-S123:
[0052] S121, obtaining table structure information of the announcement file to be analyzed, wherein the table structure information includes header information corresponding to each cell in the announcement file to be analyzed;
[0053] Among them, in the announcement file to be analyzed in which the announcement content is displayed in a table form, each part of the announcement content of the announcement file to be analyzed corresponds to the field content corresponding to each cell in the announcement file to be analyzed, and the title of each part of the announcement content corresponds to the header information corresponding to each cell.
[0054] Specifically, the source file of the announcement file to be analyzed in HTML (Hyper Text Markup Language) format can be obtained, and then the different element nodes in the announcement file to be analyzed can be identified through node labels to determine the table in the announcement file to be analyzed and the table structure information of the table; further, the table structure information of the announcement file to be analyzed is obtained, including: based on the node label, from each element node in the announcement file to be analyzed, the element node whose element type is the table type is identified to obtain the table node; then, for each table node, the node label of the child node under the table node can be used to determine the header child node in the table node, and the table structure information is determined by obtaining the character string corresponding to the header child node. It can be understood that the header information corresponding to each cell is the HTML string in the header child node in the announcement file to be analyzed in HTML format, and the content of each part of the announcement is the HTML string in the cell child node.
[0055] In a specific embodiment provided in the present application, the announcement document to be analyzed belongs to an announcement of a listed company, and the first preset type is a form-based announcement, including an internal transaction form announcement (such as the U.S. stock Form 4 form) and / or an announcement of intended sale of securities form (such as the U.S. stock Form 144 form), etc.
[0056] Specifically, when the announcement file type of the announcement file to be analyzed is an internal transaction form announcement (Form 4 for US stocks), the announcement content in the announcement file to be analyzed includes three tables: the first table is the basic information of the reporter, which is used to introduce the relevant information of the reporter, and the corresponding header information includes the reporter's name, reporter's address, earliest transaction date, etc.; the second table is the transaction table of non-derivative securities, which is used to introduce the securities information directly held by the reporter and the transaction log of the reporter's disposal of securities, and the corresponding header information includes the transaction object information, transaction date, transaction type, etc. of non-derivative securities; the third table is the transaction table of derivative securities, which is used to introduce the transaction status of derivative securities, and the corresponding header information includes the transaction object information, transaction date, transaction type, etc. of derivative securities.
[0057] When the announcement document type of the announcement document to be analyzed is the announcement form of intended sale of securities (U.S. Form 144), the announcement content in the announcement document to be analyzed includes four tables, namely: basic information of the reporter, information of the listed company, information of the transaction at the time (including number of shares, stock type, total market value, etc.), and transaction records of the reporter in the past three months.
[0058] After obtaining the internal transaction form announcement (such as US stock Form 4) and / or the intended sale securities form announcement (such as US stock Form 144), for this type of announcement file to be analyzed, based on the node label, in the HTML file corresponding to the announcement file to be analyzed, from each element node in the HTML file corresponding to the announcement file to be analyzed, the element node whose element type is the table type can be identified to obtain the table node; then, for each table node, based on the node label of the sub-node under the table node, the HTML string corresponding to the header sub-node can be located and extracted as the table structure information of the announcement file to be analyzed.
[0059] S122, extracting the cell text content corresponding to each cell based on the header information corresponding to each cell;
[0060] Among them, extracting the cell text content corresponding to each cell based on the header information corresponding to each cell may include: for the header information corresponding to each cell, extracting the cell text content corresponding to the cell, and making the cell text content correspond to the header information.
[0061] In some embodiments, the data format of the extracted cell text content is a data format that is convenient for saving tabular data. Specifically, it can be a two-dimensional tabular data format, wherein the cell text content of the two-dimensional tabular data format includes at least one column of data, each column of data includes all cell text content corresponding to a certain header information, and each column of data uses the header information as the column name. For example, the two-dimensional tabular data format can specifically be pandas.DataFrame.
[0062] In a specific embodiment provided in the present application, when the announcement file type of the announcement file to be analyzed is an internal transaction form announcement or a securities intended to be sold form announcement, S122 specifically includes: for the header information corresponding to each cell, using HTML parsing technology to extract the field content corresponding to each header information from the announcement file to be analyzed, and obtain the cell text content corresponding to each cell.
[0063] More specifically, taking the announcement file type of the announcement file to be analyzed as an internal transaction form announcement (such as US stock Form 4) as an example, for the header information corresponding to the first part of the announcement content: basic information of the reporter, HTML parsing technology is used to extract the cell text content corresponding to the header information, and the corresponding cell text content includes: the reporter's name, address, issuer name and transaction code, the earliest transaction date, and the relationship between the reporter and the stock issuer; for the header information corresponding to the second part of the announcement content: the trading status of non-derivative securities, HTML parsing technology is used to extract the cell text content corresponding to the header information, and the corresponding cell text content includes: securities information directly held by the reporter, including securities type, transaction type, transaction currency and transaction log, and transaction information includes transaction date, transaction code, number of securities, price, etc.; for the header information corresponding to the third part of the announcement content: the trading status of derivative securities, HTML parsing technology is used to extract the cell content corresponding to the header information, and the corresponding cell text content includes the trading status of derivative securities.
[0064] For another example, the announcement file type of the announcement file to be analyzed is a form announcement of intended sale of securities (such as Form 144 for U.S. stocks). For the header information: basic information of the reporter, HTML parsing technology is used to extract the cell text content corresponding to the header information, and the corresponding cell text content includes the name of the issuer, the name of the securities seller, and the relationship with the issuer; for the header information: listed company information, HTML parsing technology is used to extract the cell text content corresponding to the header information, which is the composition or source of the securities to be sold; for the header information: current transaction information, HTML parsing technology is used to extract the cell text content corresponding to the header information, and the corresponding cell text content includes the number of shares, stock type, total market value, etc.; for the header information: reporter's transaction records in the past three months, HTML parsing technology is used to extract the cell text content corresponding to the header information, and the corresponding cell text content includes the total number of securities sold in the past three months, the total gross income in the past three months, and the sales history in the past three months. The sales history in the past three months includes the sales date, sales quantity and total income from sales.
[0065] S123. Merge the cell text contents corresponding to the cells to obtain the target text information corresponding to the announcement file to be analyzed.
[0066] Among them, the data format of the target text information should be a specific data format that is convenient for subsequent summary generation of the target text information. For example, if the target file information is summarized using the first preset summary generation model, the data format of the target file information should be a data format that meets the requirements of the input data of the first preset summary generation model.
[0067] In some embodiments, the data format of the target text information is the JSON data format; specifically, the cell text contents corresponding to the individual cells are merged to obtain the target text information corresponding to the announcement file to be analyzed, including: converting the cell text contents corresponding to the individual cells into sub-text information in the JSON format; merging the sub-text information to obtain a target string in the JSON format, and using the target string as the target text information.
[0068] More specifically, the cell text content in the two-dimensional table data format can be converted into a group of dictionaries through a preset dictionary conversion function to obtain each group of dictionaries corresponding to each cell, and then the each group of dictionaries corresponding to each cell is converted into sub-text information in the data format of a JSON string, where each group of dictionaries corresponds to a row of data in the two-dimensional table data format, the key of each group of dictionaries is the column name in the two-dimensional table data format, that is, the header information, and the value corresponding to the key is the cell text content corresponding to the header information.
[0069] In some embodiments, the preset dictionary conversion function may be: df.to_dict('records') function.
[0070] Financial report announcements that are presented in the form of financial reports are usually long. Some US stock financial report announcements are even more than 200 pages in PDF and contain a lot of irrelevant information. If all the content in the financial report announcement file is directly used as the target text information for summary generation, the accuracy and conciseness of the generated target summary will usually not meet the requirements. Therefore, it is necessary to filter and reduce the content of such announcement files, and only extract the announcement content that users focus on as the target text information and generate a summary, so that the generated target summary is more in line with the accuracy and conciseness requirements.
[0071] Therefore, when generating summaries for financial report announcement documents, the content of the announcement documents should be screened and the selected important content should be extracted based on the content of the announcement documents and the presentation format of the announcement content to obtain the target text information.
[0072] Specifically, financial report announcement documents such as annual financial reports and quarterly financial reports have a fixed format in terms of content layout, and the directory structure of each announcement document is basically the same. Therefore, for such financial report announcement documents, key chapters can be screened, and fixed extraction processes can be used to extract text from the screened key chapters.
[0073] In some embodiments, if the announcement file type is a second preset type, wherein the announcement content of the announcement file corresponding to the second preset type is displayed in the form of a financial report, in S12, the text extraction of the announcement file to be analyzed based on the target processing flow to obtain the target text information corresponding to the announcement file to be analyzed includes the following S124-S127:
[0074] S124, obtaining directory structure information of the announcement file to be analyzed;
[0075] Among them, the announcement content of the second preset type of announcement file to be analyzed is presented in the form of a financial report, for example, it may be an annual financial report (such as 10-K, 20-F), a quarterly financial report (such as 10-Q) and other financial report announcement files. The directory structure information of the announcement file to be analyzed includes the page number information corresponding to each chapter.
[0076] Among them, the directory structure information corresponding to various announcement documents to be analyzed may be different. For example, the directory structure information corresponding to the three announcement documents, 10-K, 10-Q and 20-F, may be different.
[0077] Specifically, the source file of the HTML format of the announcement file to be analyzed can be obtained. Furthermore, based on the node label of the source file of the HTML format corresponding to the announcement file to be analyzed, the element node whose element type is the directory type can be identified from each element node in the announcement file to be analyzed to obtain the directory node; then, for the directory node, all the chapters in the announcement file to be analyzed can be obtained based on the node label of the child node under the target node to obtain the directory structure information.
[0078] S125, locating the target page numbers corresponding to each preset chapter in at least one preset chapter in the announcement file to be analyzed based on the directory structure information, wherein the target page numbers corresponding to the preset chapters include the starting page number and the ending page number corresponding to the preset chapters;
[0079] The preset chapter refers to a chapter with more content information in the announcement file to be analyzed. Different announcement files to be analyzed may correspond to different preset chapters, which can be set in advance. Specifically, after determining the directory structure information of the announcement file to be analyzed, the chapter names of each chapter in the directory structure information can be matched with the chapter names of the preset chapters to locate the target chapter corresponding to the preset chapter, and then determine the corresponding starting page number and ending page number from the HTML code of the target chapter.
[0080] Specifically, the chapter names of each chapter in the directory structure information are matched with the chapter names of the preset chapters, which can be specifically achieved by the following formula:
[0081]
[0082] Among them, m represents the number of single characters that match the chapter names of each chapter in the directory structure information and the chapter names of the preset chapters; l1 represents the number of characters in the chapter names of each chapter in the directory structure information, and l2 represents the number of characters in the chapter names of the preset chapters; t represents the number of single characters that match between the chapter names of each chapter in the directory structure information and the chapter names of the preset chapters, and the number of different positions in the two chapter names.
[0083] S126, extracting text content corresponding to the at least one target page number from the announcement file to be analyzed, and obtaining text content corresponding to each target page number;
[0084] In some embodiments, the text content corresponding to the at least one target page number is extracted from the announcement file to be analyzed to obtain the text content corresponding to each target page number, including: extracting at least one sub-file corresponding to at least one target page number from the announcement file to be analyzed, merging at least one sub-file to obtain the target file corresponding to the announcement file to be analyzed, and performing text extraction on the target file to obtain the text content corresponding to each target page number.
[0085] Specifically, when obtaining at least one sub-file corresponding to the announcement file to be analyzed, the source file in PDF format corresponding to the announcement file to be analyzed can be obtained, and according to the target page numbers corresponding to each preset chapter determined from the source file in HTML format of the announcement file to be analyzed, at least one sub-file corresponding to at least one target page number can be extracted from the source file in PDF format corresponding to the announcement file to be analyzed.
[0086] Furthermore, PDF parsing is performed on each sub-file in the at least one sub-file, and text contents in the parsing result are used as text contents corresponding to each target page number.
[0087] Specifically, the text content of each sub-file can be extracted by using Microsoft Azure form recognizer, calling Adobe's Extract API, using PyPDFLoader or UnstructuredPDFLoader or PyMuPDFLoader provided by langchain, and using LLMsherpa tools to parse the PDF files corresponding to the announcement file to be analyzed.
[0088] Preferably, the text content of the PDF file can be returned in JSON format. In addition, when there is a table in the PDF file, the header information and cell text content of the table data are converted into a standard structured data format to eliminate the subsequent alignment or processing steps, and the JSON format data can be accurately converted into text, which will not lead to misunderstandings when the summary is generated subsequently, thereby improving the accuracy of interpreting at least one sub-file corresponding to the announcement file to be analyzed, thereby improving the accuracy of the subsequent target summary.
[0089] S127. Determine the target text information corresponding to the announcement file to be analyzed based on the text content corresponding to each target page number.
[0090] In some embodiments, determining the target text information corresponding to the announcement file to be analyzed based on the text content corresponding to each target page number includes: merging the text content corresponding to each target page number to obtain the target text information corresponding to the announcement file to be analyzed.
[0091] Except for the above forms (such as Form 4, Form 144) and financial reports (such as 10-K, 10-Q, 20-F), other announcement documents can be extracted through the following embodiments.
[0092] In some embodiments, if the announcement file type is a third preset type, wherein the announcement content of the announcement file corresponding to the third preset type is displayed in a form other than a table or a financial report, the text extraction of the announcement file to be analyzed based on the target processing flow to obtain the target text information corresponding to the announcement file to be analyzed includes the following S128-S1210:
[0093] S128, obtaining the PDF file corresponding to the announcement file to be analyzed;
[0094] Specifically, if the file format of the announcement file to be analyzed is not a PDF file, the announcement file to be analyzed should be converted into a PDF file.
[0095] S129, parsing the PDF file based on PDF parsing technology to obtain data information corresponding to each part of the PDF file;
[0096] If the PDF file contains text information and image information, the parsing result may include the extracted text information and image information, and the data information corresponding to each part may include text information and image information.
[0097] In some embodiments, the PDF file corresponding to the announcement file to be analyzed can be parsed by using Microsoft Azure form recognizer, calling Adobe's Extract API, using PyPDFLoader or UnstructuredPDFLoader or PyMuPDFLoader provided by langchain, and LLMsherpa tool to obtain data information corresponding to each part of the PDF file.
[0098] Preferably, the text information of each part of the PDF file corresponding to the announcement file to be analyzed can be directly returned in JSON format. In addition, when there is a table in the PDF file corresponding to the announcement file to be analyzed, the header information and cell text content of the table data can be converted into a standard structured data format, thereby eliminating the alignment or processing steps, and the JSON format data can be accurately converted into text, which will not lead to misunderstandings during subsequent summary generation, thereby improving the accuracy of interpreting the announcement file to be analyzed.
[0099] S1210. Determine the target text information corresponding to the announcement file to be analyzed based on the data information corresponding to each part.
[0100] Specifically, if the data information only includes text information, the text information corresponding to each part can be merged, and the merged text can be used as the target text information corresponding to the announcement file to be analyzed; if the data information also includes picture information, a picture summary corresponding to the picture information can be generated, and the various text information and the generated picture summary can be merged, and the merged text can be used as the target text information corresponding to the announcement file to be analyzed.
[0101] S13, determining whether the length of the target text information is greater than a preset length threshold;
[0102] The preset length threshold is determined according to the maximum input length of the first preset summary generation model.
[0103] S14: If yes, obtain an initial summary corresponding to the announcement file to be analyzed according to the target text information, call a first preset summary generation model to generate a summary of the initial summary, and obtain a target summary corresponding to the announcement file to be analyzed;
[0104] If not, the first preset summary generation model is called to generate a summary of the target text information to obtain a target summary corresponding to the announcement document to be analyzed.
[0105] The first preset summary generation model is a model that is trained in advance and used to generate summaries corresponding to text information. For example, the first preset summary generation model may be a GPT-4-turbo model, and accordingly, the preset length threshold is the maximum input length of the GPT-4-turbo model.
[0106] In some embodiments, the target summary includes a title and a body.
[0107] Specifically, calling the first preset summary generation model to generate a summary of the target text information to obtain the target summary corresponding to the announcement document to be analyzed may include: obtaining a first prompt text, the first prompt text is used to control the second preset summary generation model to recognize image information to extract corresponding content descriptions from the image information; and generating a first prompt sentence for input into the first preset summary generation model based on the first prompt text and the target text information, and then inputting the first prompt sentence into the first preset summary generation model, and outputting the target summary corresponding to the target text information through the first preset summary generation model.
[0108] For example, the first prompt text is "Please summarize the following text content and output the corresponding summary title and summary text: {}". After obtaining the target text information, the first prompt text and the target text information can generate the first prompt sentence "Please summarize the following text content and output the corresponding summary title and summary text: {target text information}".
[0109] In some embodiments, after the target summary is generated using the first preset summary generation model, the total tokens length of the initial summary or target text information input into the first preset summary generation model for summary generation and the total amount spent can also be returned.
[0110] In some embodiments, the title and body of the target summary, as well as the total tokens length and the total amount spent are returned as one JSON data.
[0111] In some embodiments, in S14, obtaining the initial summary corresponding to the announcement file to be analyzed according to the target text information includes the following S141-S143:
[0112] S141, obtaining a subtext information sequence corresponding to the target text information;
[0113] Specifically, the target text information may be segmented to obtain a sub-text information sequence corresponding to the target text information.
[0114] Figure 2 A schematic diagram of a method for generating an initial summary provided by an exemplary embodiment of the present application is shown in FIG. Figure 2 , the target text information is segmented to obtain a sub-text information sequence corresponding to the target text information, including sub-text information 1 to sub-text information n.
[0115] When segmenting the target text information, the target text information may be segmented evenly or according to the content of the target text information, and this application does not make any specific limitation on this.
[0116] S142, traversing each subtext information in the subtext information sequence in turn, and performing the following operations for the current subtext information: if the current subtext information is the first subtext information in the subtext information sequence, determining a sub-summary corresponding to the current subtext information based on the current subtext information; if the current subtext information is other subtext information other than the first subtext information in the subtext information sequence, determining a sub-summary corresponding to the current subtext information based on the sub-summaries corresponding to the current subtext information and the sub-summary corresponding to the previous subtext information of the current subtext information;
[0117] When determining the sub-summary corresponding to the current sub-text information based on the current sub-text information, any summary generation method can be used to generate the summary, for example, using Figure 2The third preset summary generation model shown in generates a summary for the subtext information. The third preset summary generation model may be the first preset summary generation model, or may be another summary generation model different from the first preset summary generation model, and this application does not limit this.
[0118] The following combination Figure 2 , the above S142 is explained:
[0119] Specifically, each sub-text information in the sub-text information sequence is traversed in turn, the first sub-text information traversed is sub-text information 1, and the sub-summary corresponding to the current sub-text information 1 is determined based on the current sub-text information 1;
[0120] In a specific embodiment provided by the present application, determining a sub-summary corresponding to the current sub-text information 1 based on the current sub-text information 1 specifically includes: inputting the sub-text information 1 into a third preset summary generation model to obtain a sub-summary corresponding to the sub-text information 1, namely, sub-summary 1;
[0121] Continue traversing the subtext information sequence, the second subtext information traversed is subtext information 2, and based on subtext information 2 and the subsummaries corresponding to the previous subtext information of subtext information 2, determine the subsummary corresponding to the current subtext information;
[0122] In a specific embodiment provided by the present application, based on subtext information 2 and a sub-summary corresponding to a previous subtext information of subtext information 2, determining a sub-summary corresponding to the current subtext information includes: merging subtext information 2 with a sub-summary corresponding to a previous subtext information of subtext information 2, that is, sub-summary 1, to obtain merged text information corresponding to subtext information 2, and performing summary generation on the merged text information corresponding to subtext information 2 to obtain sub-summary 2 corresponding to subtext information 2;
[0123] Continue to traverse the subtext information sequence, and for the current subtext information traversed, repeat the step of determining the subsummary corresponding to the current subtext information based on the subsummary corresponding to the current subtext information and the previous subtext information of the current subtext information, which will not be elaborated in this application.
[0124] After completing the traversal of the sub-text information sequence, the sub-summary corresponding to each sub-text information is obtained.
[0125] S143: Use the sub-summary corresponding to the last sub-text information in the sub-text information sequence as the initial summary corresponding to the target text information.
[0126] like Figure 2As shown, the last sub-text information in the sub-text information sequence is sub-text information n, and sub-summary n corresponding to sub-text information n is used as the initial summary corresponding to the target text information.
[0127] By generating an initial summary corresponding to the announcement file to be analyzed, the length of the text input into the first preset summary generation model for summary generation can be reduced, thereby using the first preset summary generation model to generate a target summary corresponding to the announcement file to be analyzed.
[0128] In some embodiments, the method further comprises:
[0129] Obtaining image information in the announcement file to be analyzed;
[0130] Generate a picture summary corresponding to the picture information;
[0131] The picture summary corresponding to the picture information is added to the target text information.
[0132] Among them, the picture summary is used to describe the text content of the picture information; in some embodiments, the announcement file to be analyzed includes picture information in addition to text information, then it is necessary to generate a picture summary corresponding to the picture information, and add the picture summary to the target text information, so that the target text information includes all the information in the announcement file to be analyzed, thereby ensuring the completeness and accuracy of the target summary subsequently generated based on the target text information with the picture information added.
[0133] In some embodiments, generating a picture summary corresponding to the picture information includes:
[0134] A second preset summary generation model is called to generate a picture summary corresponding to the picture information, wherein the second preset summary generation model is used to generate a summary corresponding to the picture information.
[0135] Among them, the second preset summary generation model can be any model used to generate a picture summary corresponding to the picture information. For example, the second preset summary generation model can be a GPT-4-vision model. Calling the second preset summary generation model to generate a picture summary corresponding to the picture information can specifically include: determining a target prompt text from at least one preset second prompt text, wherein the second prompt text is used to control the second preset summary generation model to identify the picture information to extract the corresponding content description from the picture information, and the second prompt text can be pre-set according to the picture type of the picture information; inputting the target prompt text and the picture information into the second preset summary generation model, and outputting the picture summary of the picture information through the second preset summary generation model.
[0136] Furthermore, taking the picture information as a data statistical chart in the announcement file as an example, the picture type of the picture information can be identified, wherein the picture type includes but is not limited to: curve chart, bar chart, pie chart, radar chart, etc.; according to the picture type of the picture information, the target prompt text is determined from at least one preset second prompt text; the legend text in the picture information is identified, and a second prompt sentence is generated according to the legend text and the target prompt text, and then the second prompt sentence and the picture information are input into the second preset summary generation model, and the picture summary of the picture information is output through the second preset summary generation model.
[0137] For example, taking the image information as a curve graph, such as a stock trend chart, its legend text is XX stock, and its corresponding target prompt text is "Describe the trend of {XX} in the picture as {rising, falling, or stable fluctuation}", and the corresponding second prompt sentence generated is "Describe the trend of {XX stock} in the picture as {rising, falling, or stable fluctuation}"; for another example, taking the image information as a bar chart, such as a capital flow chart, its legend text is inflow of funds and outflow of funds, and the second prompt text can be "Describe the changes in the {xx} data in the picture as {rising, falling}", and the corresponding second prompt sentence generated is "Describe the changes in the {inflow of funds} and {outflow of funds} data in the picture as {rising, falling}".
[0138] In some embodiments, the method further includes: reviewing the target summary, and displaying the target summary that has passed the review or has been modified to meet the requirements.
[0139] The present application provides a target processing flow for determining a target processing flow based on the type of announcement file to be analyzed, wherein different announcement file types correspond to different processing flows; based on the target processing flow, text extraction is performed on the announcement file to be analyzed to obtain target text information corresponding to the announcement file to be analyzed; it is determined whether the length of the target text information is greater than a preset length threshold; if so, an initial summary corresponding to the announcement file to be analyzed is obtained according to the target text information, and a first preset summary generation model is called to perform summary generation on the initial summary to obtain a target summary corresponding to the announcement file to be analyzed; if not, the first preset summary generation model is called to perform summary generation on the target text information to obtain a target summary corresponding to the announcement file to be analyzed. The solution can perform text extraction on the announcement file to be analyzed according to the file type of the original announcement file to be analyzed to obtain the target text information in the announcement file to be analyzed, and further perform summary generation operation on the target file information to obtain the target summary corresponding to the announcement file to be analyzed for user reading. Compared with the original announcement file to be analyzed, the target summary is more readable and more concise, thereby achieving the technical effect of improving the efficiency and experience of users in obtaining announcement files.
[0140] Figure 3 Another flowchart of a summary generation method provided by an exemplary embodiment of the present application specifically includes:
[0141] S31. Obtain the announcement file to be analyzed;
[0142] S32, determining the announcement file type of the announcement file to be analyzed, if the announcement file type of the announcement file to be analyzed is the first preset type, executing the following S33, if the announcement file type of the announcement file to be analyzed is the second preset type, executing the following S34, if the announcement file type of the announcement file to be analyzed is the third preset type, executing the following S35;
[0143] Among them, the first preset type of announcement files to be analyzed are announcement files whose announcement contents are displayed in tabular form, such as U.S. stock form type (such as Form4, Form144) announcement files; the second preset type of announcement files to be analyzed are announcement files whose announcement contents are displayed in financial reports, such as U.S. stock financial reports (such as 10-K, 10-Q, 20-F); the third preset type of announcement files to be analyzed are announcement files of other types except the first preset type and the second preset type, such as other U.S. stock announcements or Hong Kong stock announcements except U.S. stock form types and U.S. stock financial reports types.
[0144] Different types of announcement files correspond to different processing flows, and the processing flows are used to obtain text information and image information in the announcement file to be analyzed, and obtain target text information corresponding to the announcement file to be analyzed.
[0145] S33. If the announcement file type of the announcement file to be analyzed is the first preset type, extract the structured text information in the announcement file to be analyzed, obtain the target text information corresponding to the announcement file to be analyzed, and if the announcement file to be analyzed includes picture information, obtain the picture summary corresponding to the picture information, add the picture summary to the target text information, and jump to execute S39;
[0146] S34. If the announcement file type of the announcement file to be analyzed is the second preset type, obtain the target page numbers corresponding to the preset chapters based on the directory structure information of the announcement file to be analyzed, obtain the sub-files in PDF format corresponding to the target page numbers, and jump to execute S38, merge the sub-files, and perform PDF parsing on the merged file, use the text information in the parsing result as the target text information corresponding to the announcement file to be analyzed, if the parsing result includes picture information, obtain the picture summary corresponding to the picture information, add the picture summary to the target text information, and further execute S39;
[0147] S35. If the announcement file type of the announcement file to be analyzed is the third preset type, determine whether the announcement file to be analyzed is a PDF format file;
[0148] If not, execute S36, convert the format of the announcement file to be analyzed into PDF format, and further execute S37, perform PDF parsing on the announcement to be analyzed in PDF format, and use the text information in the parsing result as the target text information corresponding to the announcement file to be analyzed. If the parsing result includes image information, obtain the image summary corresponding to the image information, add the image summary to the target text information, and further execute S39;
[0149] If yes, directly execute S37, and further execute S39;
[0150] S39, determining whether the length of the target text information is greater than a preset length threshold;
[0151] If yes, execute S310, generate a summary of the target text information to obtain an initial summary corresponding to the announcement file to be analyzed, and further execute S312, generate a summary of the initial summary to obtain a target summary corresponding to the announcement file to be analyzed;
[0152] If not, execute S311, generate a summary of the target text information, and obtain a target summary corresponding to the announcement file to be analyzed.
[0153] Figure 4 A schematic diagram of a summary generation system provided for an exemplary embodiment of the present application includes:
[0154] The announcement file collection module 41 is used to collect announcement file data and store the collected announcement file data in the announcement database;
[0155] The summary generation module 44 is used to generate a target summary of the announcement file in the announcement database, and is specifically used to: perform data cleaning on the announcement data in the announcement database, obtain metadata corresponding to the announcement file, and call the summary generation method provided in the above embodiment based on the metadata corresponding to the announcement file to obtain and store the target summary corresponding to the announcement file;
[0156] The summary content operation module 43 is used to review the content of the target summary and edit and modify the target summary with problems after review;
[0157] The summary display module 44 is used to pull out the target summary corresponding to the announcement file viewed by the user and display it in response to the user clicking to view the announcement file.
[0158] Figure 5 A schematic diagram of the structure of a summary generation device provided by an exemplary embodiment of the present application;
[0159] The device comprises:
[0160] A processing flow determination module 51, used to determine a target processing flow based on the announcement file type of the announcement file to be analyzed;
[0161] A text extraction module 52 is used to extract text from the announcement file to be analyzed based on the target processing flow to obtain target text information corresponding to the announcement file to be analyzed, wherein different announcement file types correspond to different processing flows;
[0162] The summary generation module 53 is used to determine whether the length of the target text information is greater than a preset length threshold. If so, summarize the content of the target text information to obtain an initial summary corresponding to the target text information, call the first preset summary generation model to generate a summary of the initial summary, and obtain a target summary corresponding to the announcement file to be analyzed. If not, directly call the first preset summary generation model to generate a summary corresponding to the target text information, and obtain a target summary corresponding to the announcement file to be analyzed, wherein the preset length threshold is determined according to the single maximum input length of the first preset summary generation model.
[0163] In some embodiments, when the device is used to obtain the initial summary corresponding to the announcement file to be analyzed according to the target text information, it is specifically used to:
[0164] Acquire a subtext information sequence corresponding to the target text information;
[0165] Traversing each subtext information in the subtext information sequence in turn, and performing the following operations for the current subtext information: if the current subtext information is the first subtext information in the subtext information sequence, determining the sub-summary corresponding to the current subtext information based on the current subtext information; if the current subtext information is other subtext information other than the first subtext information in the subtext information sequence, determining the sub-summary corresponding to the current subtext information based on the sub-summary corresponding to the current subtext information and the sub-summary corresponding to the previous subtext information of the current subtext information;
[0166] The sub-summary corresponding to the last sub-text information in the sub-text information sequence is used as the initial summary corresponding to the target text information.
[0167] In some embodiments, the device is further used to:
[0168] Obtaining image information in the announcement file to be analyzed;
[0169] Generate a picture summary corresponding to the picture information;
[0170] The picture summary corresponding to the picture information is added to the target text information.
[0171] In some embodiments, when the apparatus is used to generate a picture summary corresponding to the picture information, it is specifically used to:
[0172] A second preset summary generation model is called to generate a picture summary corresponding to the picture information, wherein the second preset summary generation model is used to generate a summary corresponding to the picture information.
[0173] In some embodiments, if the announcement file type is a first preset type, wherein the announcement content of the announcement file corresponding to the first preset type is displayed in a table form, the device is used to extract text from the announcement file to be analyzed based on the target processing flow to obtain target text information corresponding to the announcement file to be analyzed, specifically for:
[0174] Acquire table structure information of the announcement file to be analyzed, wherein the table structure information includes header information corresponding to each cell in the announcement file to be analyzed;
[0175] Extracting the cell text content corresponding to each cell based on the header information corresponding to each cell;
[0176] The cell text contents corresponding to the respective cells are merged to obtain the target text information corresponding to the announcement file to be analyzed.
[0177] In some embodiments, if the announcement file type is a second preset type, wherein the announcement content of the announcement file corresponding to the second preset type is displayed in the form of a financial report, the device is used to extract text from the announcement file to be analyzed based on the target processing flow to obtain target text information corresponding to the announcement file to be analyzed, specifically for:
[0178] Obtaining directory structure information of the announcement file to be analyzed;
[0179] Locating target page numbers corresponding to each preset chapter in at least one preset chapter in the announcement file to be analyzed based on the directory structure information, wherein the target page numbers corresponding to the preset chapters include the starting page number and the ending page number corresponding to the preset chapters;
[0180] Extracting the text content corresponding to the at least one target page number from the announcement file to be analyzed, and obtaining the text content corresponding to each target page number;
[0181] The target text information corresponding to the announcement file to be analyzed is determined based on the text content corresponding to each target page number.
[0182] In some embodiments, if the announcement file type is a third preset type, wherein the announcement content of the announcement file corresponding to the third preset type is displayed in a form other than a table or a financial report, the device is used to extract text from the announcement file to be analyzed based on the target processing flow to obtain target text information corresponding to the announcement file to be analyzed, specifically for:
[0183] Obtain the PDF file corresponding to the announcement file to be analyzed;
[0184] Parsing the PDF file based on PDF parsing technology to obtain data information corresponding to each part of the PDF file;
[0185] The target text information corresponding to the announcement file to be analyzed is determined based on the data information corresponding to each part.
[0186] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, no further description is given here. Specifically, the device may perform the above method embodiment, and the above and other operations and / or functions of each module in the device are the corresponding processes in each method in the above method embodiment, respectively, and no further description is given here for the sake of brevity.
[0187] The above describes the device of the embodiment of the present application from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software modules in the decoding processor to perform. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.
[0188] Figure 6 is a schematic block diagram of an electronic device provided in an embodiment of the present application, and the electronic device may include:
[0189] The memory 601 and the processor 602, the memory 601 is used to store the computer program and transmit the program code to the processor 602. In other words, the processor 602 can call and run the computer program from the memory 601 to implement the method in the embodiment of the present application.
[0190] For example, the processor 602 may be configured to execute the above method embodiments according to instructions in the computer program.
[0191] In some embodiments of the present application, the processor 602 may include but is not limited to:
[0192] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
[0193] In some embodiments of the present application, the memory 601 includes but is not limited to:
[0194] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).
[0195] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 601 and executed by the processor 602 to complete the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.
[0196] like Figure 6 As shown, the electronic device may also include:
[0197] The transceiver 603 may be connected to the processor 602 or the memory 601 .
[0198] The processor 602 may control the transceiver 603 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 603 may include a transmitter and a receiver. The transceiver 603 may further include an antenna, and the number of antennas may be one or more.
[0199] It should be understood that the various components in the electronic device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.
[0200] The present application also provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.
[0201] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.
[0202] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0203] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0204] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0205] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0206] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for generating a summary, characterized in that: include: Determine a target processing flow based on the announcement file type of the announcement file to be analyzed, wherein different announcement file types correspond to different processing flows; Performing text extraction on the announcement file to be analyzed based on the target processing flow to obtain target text information corresponding to the announcement file to be analyzed; Determine whether the length of the target text information is greater than a preset length threshold; If yes, obtaining an initial summary corresponding to the announcement file to be analyzed according to the target text information, calling a first preset summary generation model to generate a summary of the initial summary, and obtaining a target summary corresponding to the announcement file to be analyzed; If not, the first preset summary generation model is called to generate a summary of the target text information to obtain a target summary corresponding to the announcement document to be analyzed.
2. The method according to claim 1, characterized in that The step of obtaining the initial summary corresponding to the announcement file to be analyzed according to the target text information includes: Acquire a subtext information sequence corresponding to the target text information; Traversing each subtext information in the subtext information sequence in turn, and performing the following operations for the current subtext information: if the current subtext information is the first subtext information in the subtext information sequence, determining the sub-summary corresponding to the current subtext information based on the current subtext information; if the current subtext information is other subtext information other than the first subtext information in the subtext information sequence, determining the sub-summary corresponding to the current subtext information based on the sub-summary corresponding to the current subtext information and the sub-summary corresponding to the previous subtext information of the current subtext information; The sub-summary corresponding to the last sub-text information in the sub-text information sequence is used as the initial summary corresponding to the target text information.
3. The method according to claim 1, characterized in that The method further comprises: Obtaining image information in the announcement file to be analyzed; Generate a picture summary corresponding to the picture information; The picture summary corresponding to the picture information is added to the target text information.
4. The method according to claim 3, characterized in that: The generating a picture summary corresponding to the picture information includes: A second preset summary generation model is called to generate a picture summary corresponding to the picture information, wherein the second preset summary generation model is used to generate a summary corresponding to the picture information.
5. The method according to claim 1, characterized in that If the announcement file type is a first preset type, wherein the announcement content of the announcement file corresponding to the first preset type is displayed in a table form, the text extraction of the announcement file to be analyzed based on the target processing flow is performed to obtain the target text information corresponding to the announcement file to be analyzed, including: Acquire table structure information of the announcement file to be analyzed, wherein the table structure information includes header information corresponding to each cell in the announcement file to be analyzed; Extracting the cell text content corresponding to each cell based on the header information corresponding to each cell; The cell text contents corresponding to the respective cells are merged to obtain the target text information corresponding to the announcement file to be analyzed.
6. The method according to claim 1, characterized in that If the announcement file type is the second preset type, wherein the announcement content of the announcement file corresponding to the second preset type is displayed in the form of a financial report, the text extraction of the announcement file to be analyzed based on the target processing flow to obtain the target text information corresponding to the announcement file to be analyzed includes: Obtaining directory structure information of the announcement file to be analyzed; Locating target page numbers corresponding to each preset chapter in at least one preset chapter in the announcement file to be analyzed based on the directory structure information, wherein the target page numbers corresponding to the preset chapters include the starting page number and the ending page number corresponding to the preset chapters; Extracting the text content corresponding to the at least one target page number from the announcement file to be analyzed, and obtaining the text content corresponding to each target page number; The target text information corresponding to the announcement file to be analyzed is determined based on the text content corresponding to each target page number.
7. The method according to claim 1, characterized in that If the announcement file type is the third preset type, wherein the announcement content of the announcement file corresponding to the third preset type is displayed in a form other than a table or a financial report, the target text information corresponding to the announcement file to be analyzed is obtained by performing text extraction on the announcement file to be analyzed based on the target processing flow, including: Obtain the PDF file corresponding to the announcement file to be analyzed; Parsing the PDF file based on PDF parsing technology to obtain data information corresponding to each part of the PDF file; The target text information corresponding to the announcement file to be analyzed is determined based on the data information corresponding to each part.
8. A summary generation device, characterized in that: include: A processing flow determination module, used to determine a target processing flow based on the announcement file type of the announcement file to be analyzed; A text extraction module, used to extract text from the announcement file to be analyzed based on the target processing flow to obtain target text information corresponding to the announcement file to be analyzed, wherein different announcement file types correspond to different processing flows; A summary generation module is used to determine whether the length of the target text information is greater than a preset length threshold. If so, summarize the content of the target text information to obtain an initial summary corresponding to the target text information, call the first preset summary generation model to generate a summary of the initial summary, and obtain a target summary corresponding to the announcement file to be analyzed; if not, directly call the first preset summary generation model to generate a summary corresponding to the target text information, and obtain a target summary corresponding to the announcement file to be analyzed, wherein the preset length threshold is determined according to the single maximum input length of the first preset summary generation model.
9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
