Content generation method and device
By identifying and retaining the key and structural information of the input information, clearing the value information, and generating the target content information, the problem of users having to manually adjust the data processing results in the prior art is solved, thus achieving efficient data reuse and improved user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-07
AI Technical Summary
Existing office tools and systems cannot adapt to user needs during data copying and pasting, requiring users to manually adjust the processing results, which affects the user experience.
By acquiring input information, identifying its content structure, retaining key and structural information, clearing value information, and generating target content information, the system adapts to user operation needs and improves processing efficiency.
Users can reuse the original table structure directly without having to redraw the table or enter field names, thus improving data processing efficiency and user experience.
Smart Images

Figure CN121809430A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a content generation method and apparatus. Background Technology
[0002] With the rapid development of computer technology, various office-related tools and systems are widely used, covering office software, editing and reading tools, instant messaging tools, mobile applications or mini-programs for scanning and filling out forms, enterprise OA (Office Automation) systems, approval process systems, information collection and reporting systems, and business systems. These tools and systems support users in creating spreadsheets, various documents, and standardized document templates, and can also transfer table data, image data, and document data. For purposes such as data transfer, template reuse, image information reuse, or content adaptation, it is necessary to copy this table data, image data, and document data to new documents / pages, or to directly perform specific content processing, to meet users' diverse office needs.
[0003] The data copy and paste functions provided by the tools and systems in related technologies can only maintain the original content of the data for transmission or reuse, and cannot adapt to user needs for data processing. Furthermore, the processing results require additional manual adjustments by the user, which affects the user experience. Summary of the Invention
[0004] This application provides a content generation method and apparatus that solves the problem that the data processing functions provided by tools and systems in related technologies cannot adapt to user needs for data processing, and that the processing results require additional manual adjustments by the user, affecting the user experience. It can detect input information in response to operation instructions to locate relevant information of key-value pair structure, and by retaining the structural information and key information in the input information, it can eliminate value information according to user needs without requiring additional user operation, thereby improving user experience and processing efficiency.
[0005] In a first aspect, embodiments of this application provide a content generation method, the method comprising: Obtain input information; Receive operation instructions that act on the input information; In response to the operation instruction, the input information is detected to obtain the content structure of the input information, wherein the content structure includes: key information, value information and structure information, and the structure information is used to represent the layout of the key information and value information in the input information; The structural information and key information in the input information are retained to obtain the target content information.
[0006] Secondly, embodiments of this application also provide a content generation apparatus, including: The acquisition module is configured to acquire input information. The instruction receiving module is configured to receive operation instructions applied to the input information; An information detection module is configured to detect the input information in response to the operation command, and obtain the content structure of the input information, wherein the content structure includes: key information, value information and structure information, and the structure information is used to represent the layout of the key information and value information in the input information; The content generation module is configured to retain the structural information and key information in the input information to obtain the target content information.
[0007] Thirdly, embodiments of this application also provide an electronic device, the device comprising: One or more processors; Storage device, configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the content generation method described in the embodiments of this application.
[0008] Fourthly, embodiments of this application also provide a non-volatile storage medium for storing computer-executable instructions, which, when executed by a computer processor, are configured to perform the content generation method described in embodiments of this application.
[0009] In this embodiment, input information is acquired and operation instructions applied to the input information are received. This allows for data processing adapted to user operations, aligning with actual user needs. Then, in response to the operation instructions, the input information is detected to obtain its content structure. This distinguishes between key and value information, providing a reference for clearing entered content. Furthermore, structural information is extracted, providing a basis for subsequent layout reconstruction. Finally, the structural and key information in the input information is retained to obtain the target content information. This allows for the reuse of the input information's content structure, such as existing tables, table-like structures, or document templates, while retaining crucial key information. This eliminates the need for users to redraw tables, reorganize document templates, or enter field names, thus improving processing efficiency. Attached Figure Description
[0010] Figure 1 A flowchart illustrating a content generation method provided in an embodiment of this application; Figure 2 A flowchart illustrating a content generation method that includes a document-related output process, provided as an embodiment of this application; Figure 3A flowchart illustrating a content generation method including an output process related to a session window, provided as an embodiment of this application; Figure 4 A flowchart of a content generation method including a process for detecting content structure is provided in an embodiment of this application; Figure 5 A flowchart illustrating a content generation method including a process for generating target content information, provided in an embodiment of this application; Figure 6 A flowchart illustrating a content generation method, including a process of generating target content information using a table template, is provided as an embodiment of this application. Figure 7 A structural block diagram of a content generation apparatus provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0011] The embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of this application and are not intended to limit the scope of the embodiments. Furthermore, it should be noted that, for ease of description, only the parts relevant to the embodiments of this application are shown in the accompanying drawings, not the entire structure.
[0012] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0013] The content generation method provided in this application can be executed by a computer device, which refers to any electronic device with data computing, processing, and storage capabilities, such as mobile phones, PCs (Personal Computers), tablets, and other terminal devices. This application does not limit this. This content generation method can be applied to, but is not limited to, office software (such as word processing software, spreadsheet editing software, online document collaboration platforms, etc.), PDF (Portable Document Format) editing and reading tools (such as PDF applications that support region copying, screenshot copying, and image export), instant messaging tools (such as applications that support embedded documents and image copying and pasting), scanning and form-filling mobile applications or mini-programs (such as applications or mini-programs that have functions such as digitizing paper forms and reusing blank forms), enterprise OA (Office Automation) systems, approval process systems, low-code or no-code platforms (such as systems or platforms that have functions such as converting filled forms into OA forms or component configurations), information collection and reporting systems in industries such as government, education, healthcare, and finance, as well as various enterprise internal management systems and business systems that require a large number of repetitive form fillings.
[0014] Figure 1 A flowchart of a content generation method provided in an embodiment of this application, such as... Figure 1 As shown, the content generation method includes the following steps: Step S101: Obtain input information.
[0015] Input information can originate from the clipboard, document object model, local files, or network requests. Depending on the format, it can be categorized into structured spreadsheets, image-based tables, and document content with existing templates. For example, input information can be structured spreadsheets, such as employee information registration forms or expense reimbursement forms, which have clearly defined row and column nodes and editable text. Input information can also be image-based tables, such as scanned documents, photographed tables, or screenshot tables, whose image content contains table or table-like information. Table information possesses clear physical table characteristics, with explicit or implicit table borders, or clearly defined cell divisions through content layout, and text content is confined within corresponding cells. Table-like information, on the other hand, lacks clear physical table characteristics; it lacks visible gridlines and cell borders, but its layout presents a row-and-column similarity, or relies on separators (such as ":", "|") to separate field names and entered content. For example, the input information can be document content created based on a document template, such as a weekly report template or a regular report template, which has a fixed page layout, style, and fillable areas.
[0016] Step S102: Receive the operation command applied to the input information.
[0017] The operation instructions can be interactive signals selected by the user based on actual needs, used to indicate the specific processing target of the input information. Specifically, when the input information includes structured spreadsheets or image-based tables, the operation instructions can be to paste, send, or save the input information as an empty table; or to paste, send, or save the input information as a form; or to paste, send, or save the input information as a blank template. When the input information is text content with an existing document template, the instructions can be to paste, send, or save the input information as a blank template.
[0018] Step S103: In response to the operation command, the input information is detected to obtain the content structure of the input information. The content structure includes key information, value information and structure information. The structure information is used to represent the layout of key information and value information in the input information.
[0019] Specifically, the detection of input information can be performed from at least one of the dimensions such as structural level and semantic level, in order to determine the content structure of the input information.
[0020] When the input information includes tables or table-like structures, the structural detection can be the parsing of the physical form and layout rules of the tables or table-like structures in the input information. For example, the parsing of the row and column structure and the recognition of style attributes in a structured spreadsheet, or the recognition, location and extraction of table areas or table-like areas in an image-like table.
[0021] When the input information is document content with an existing document template, this structural level detection can involve parsing the physical form and layout rules of the document template. For example, it can involve the structural elements and layout of document content created based on a document template. Structural elements can include titles, tables for filling content, and underlined text. Layout involves setting the relative positions of these structural elements, such as setting columns and alignment.
[0022] This semantic-level detection can involve semantic parsing of the input information to identify key information, value information, and structural information determined by the layout of the key and value information within the input information. For tables or table-like structures, such as semantic recognition of cell text in structured spreadsheets, or OCR recognition of image-based tables to identify and semantically recognize the text in the table or table-like areas; or multimodal semantic recognition of image-based tables. The semantic recognition process involves identifying the header and content areas within the table area, using the cell content in the header area as the key and the cell content in the content area as the value.
[0023] For document content with a document template, semantic parsing of the document content is performed to determine the template in the document content as key information, and the content used to populate the template as value information.
[0024] Furthermore, this content structure can be table information, table-like information, or template information from the input information. Table information and table-like information are used to distinguish fields from data and preserve table formatting, while template information is used to distinguish templates from fill-in content and preserve template formatting. Key information can be the names of key fields in table information, table-like information, or template information. It can be used to identify the meaning of data and define the dimensions to be filled in, forming a correspondence with the value information. Specifically, key information has a clear classification or descriptive meaning in the semantic dimension. Its position in the table, table-like information, or template information is relatively fixed or has a special style. For example, it may be located in the header row or left column of a table, or distinguished by bold font, background color, etc., or it may be located to the left of a specific separator, such as the colon ":". Correspondingly, value information can be the specific content data corresponding to the key information in the table information, table-like information, or template information, and needs to be filled in according to the requirements of the key information.
[0025] Structural information can represent the layout of key and value information within the input information. Specifically, it refers to the position, arrangement, and visual style of key and value information within table-like, table-like, or template-like information. It is the core basis for maintaining table layout consistency and achieving page redesign. Examples include the row and column layout, border styles, row height, and column width of key or value information within table-like information. Another example is the positional distribution and style attributes of key or value information within table-like information. Yet another example is the positional distribution and style attributes of key or value information within template-like information.
[0026] Step S104: Retain the structural information and key information in the input information to obtain the target content information.
[0027] In this context, key information is the core information that users need to retain, and it forms the basis of the table's logical structure or template structure. Furthermore, structural information is the core basis for maintaining table layout consistency and achieving page reconfiguration. Value information, on the other hand, is the specific content data corresponding to the key information. Therefore, in order to reuse input information for filling in new information, it is necessary to select and retain structural and key information while clearing value information to obtain the target content information. This target content information can be an empty table, a form, or a blank template, etc., and this application does not impose any limitations on this.
[0028] Optionally, the structural and key information in the input information is retained to obtain the target content information, including: Delete the value information in the input information to obtain the target content information; or, convert the value information in the input information into a placeholder object to obtain the target content information; or, generate the target content information based on the structure information and key information.
[0029] After obtaining the key, value, and structural information, different processing methods can be selected to adapt to the reuse requirements of different application scenarios. Method 1: Delete the value information from the input information. Specifically, this can involve clearing all content data identified as "value information" from the input information, thereby preserving the "structural information" and "key information." For structured spreadsheets, deleting the value information from the input information can empty the text in the corresponding cells. For image-based tables, a mask information of the pixel region where the value information is located can be generated using a semantic segmentation model. Based on this mask information, methods such as diffusion models, image restoration, or simple whitewashing can be used to erase the pixel region corresponding to the value information, restoring the cell background. Alternatively, it can be converted into an editable table after restoration. For document content created based on a document template, the document content corresponding to the value information can be directly cleared. After deleting the value information from the input information, the resulting target content information has the same carrier format as the input information, and its table structure or table-like structure is also consistent with the input information. Only the key information is retained, and the area corresponding to the value information is blank. Method 2: Convert the value information in the input information into placeholder objects. Specifically, instead of directly deleting the value information, replace the original value information with a preset placeholder object, while fully preserving the structural and key information. Placeholder objects can be placeholders or controls used to insert specified types of content, replacing the value information and providing prompts for filling in the information. For example, a placeholder object can be a text placeholder for inserting specific text. Alternatively, a placeholder object can be an image placeholder for inserting an image, or an image inserted after clicking. Another example is a field code in a document. After converting the value information in the input information into placeholder objects, the resulting target content information can provide guidance for filling in the information, clearly defining the filling requirements for the cell or the area containing the original value information. Method 3: Generate target content information based on structural and key information. Specifically, this can be independent of the original format of the input information, extracting the core structural and key information to reconstruct new target content information. For structured spreadsheets, reconstructing new target content information can involve applying the same or optimized table structure as the input information, with its value information either directly cleared or replaced by placeholder objects. For image-based tables, reconstructing the target content information can involve converting the table or table-like information in the image into an editable table format or an editable text format with a consistent layout. The specific choice can be made according to the needs of the actual application scenario. For document content created based on a document template, reconstructing the target content information can involve applying the same field layout and style as the input information, and the value information can be either cleared or replaced with placeholder objects.
[0030] The above-described process involves acquiring input information and receiving operation instructions applied to it. This allows for data processing tailored to user actions and meets actual user needs. Then, in response to the operation instructions, the input information is analyzed to determine its content structure. This allows for the differentiation of key and value information within the input, providing a reference for clearing entered content. Furthermore, the extracted structural information provides a basis for subsequent layout reconstruction. Finally, the structural and key information from the input information is retained to obtain the target content information. This allows for the reuse of existing tables, table-like structures, or document templates, while preserving crucial key information. Users are not required to redraw tables or re-enter field names, thus improving processing efficiency.
[0031] Figure 2 A flowchart of a content generation method including a document-related output process is provided for embodiments of this application, such as... Figure 2 As shown, the content generation method includes the following steps: Step S201: Obtain input information, wherein the input information is the information entered into the document.
[0032] In this embodiment, the input information can be information entered into a document, which includes, but is not limited to, office software documents, PDF documents, online collaborative documents, documents embedded in instant messaging tools, etc., and is not limited in this application.
[0033] Step S202: Receive the operation command applied to the input information.
[0034] Step S203: In response to the operation command, the input information is detected to obtain the content structure of the input information. The content structure includes key information, value information and structure information. The structure information is used to represent the layout of key information and value information in the input information.
[0035] Step S204: Retain the structural information and key information in the input information to obtain the target content information.
[0036] Step S205: Input the target content information into the document; or, create a new document based on the target content information.
[0037] The target content can be input into a document, specifically inserted after existing input information or replaced by existing input information. The appropriate input method must be chosen to suit the specific requirements of the operation instructions, and this application does not impose any limitations on this. For example, if a user opens a completed "Employee Information Registration Form" in software, selects the entire form, and copies it, the obtained input information can be the "Employee Information Registration Form." After obtaining the target content information corresponding to the "Employee Information Registration Form," the user can choose to place the cursor at the original location of the "Employee Information Registration Form" and paste it, thus overwriting the original form. Alternatively, the user can place the cursor at a target location after the original "Employee Information Registration Form" and paste it, thus inserting the target content information at that target location. The user can also place the cursor at other specific locations and paste it, thus adding the target content information to that specific location. Furthermore, after obtaining the target content information, a new document can be created based on this target content information and stored as an independent template, facilitating user saving, distribution, or secondary editing. For example, a user opens a scanned paper "Hospitalization Registration Form" in a PDF reader. The form is embedded in the PDF as an image. The user can use tools provided by the reader, such as "select and copy" or "copy as image," to select the entire form area and perform the copy operation. The input information obtained can be the "Hospitalization Registration Form." Correspondingly, after obtaining the target content information corresponding to the "Hospitalization Registration Form," the user can create a new document in another document editor to paste into the new document or save it as a new template file.
[0038] Therefore, it can accommodate multiple document carriers and flexibly choose the output method of the target content information, adapting to different reuse scenarios by replacing content, inserting into the original document, or creating a new independent template.
[0039] Figure 3 A flowchart illustrating a content generation method including an output process related to a session window, provided as an embodiment of this application, is shown below. Figure 3 As shown, the content generation method includes the following steps: Step S301: Obtain input information, wherein the input information is the information entered into the session window.
[0040] The input information can be information entered into the conversation window for conversational communication, emphasizing lightweight transmission and not requiring prior storage as a separate document. This conversation window can be an instant messaging tool, a chat interface embedded in a collaboration platform, etc., serving as a medium for users to send or receive information and conduct real-time communication, supporting interactive formats such as text, images, files, and copy-paste. The input information can be obtained from the clipboard after the user copies a received table image or fragment into the conversation window; it can also be obtained after the user uploads an image or file; or it can be obtained by automatically recognizing information containing table features in the conversation window; this application does not limit the scope of the input information.
[0041] Step S302: Receive the operation instruction applied to the input information.
[0042] Step S303: In response to the operation command, the input information is detected to obtain the content structure of the input information. The content structure includes key information, value information and structure information. The structure information is used to represent the layout of key information and value information in the input information.
[0043] Step S304: Retain the structural information and key information in the input information to obtain the target content information.
[0044] Step S305: Input the target content information into the session window.
[0045] The target content information can be in lightweight forms such as editable table fragments, visual empty table images, or online form links, adapted for display and sharing in the chat window. Inputting the target content information into the chat window can be done in several ways: directly sending the target content information to the current chat window for all members to view or copy; displaying a pop-up control option for the user to select and confirm before sending; or embedding the target content information into the current chat context. This application does not impose any limitations on this. For example, if a user receives a screenshot of a completed "business trip application form" in a chat tool and copies the screenshot, the screenshot could contain the input information. Correspondingly, after obtaining the target content information corresponding to the screenshot, it can be sent in response to the user's paste and send operation in the chat window to share it with other users. For example, a user receives a screenshot of a completed "business trip application form" in a chat tool. This screenshot can be the obtained input information. In response to the user performing a forwarding operation on the screenshot in the chat window, after processing and obtaining the target content information corresponding to the screenshot, the target content information is shared with the user specified in the forwarding operation.
[0046] Optionally, the input information may include a table. The target content information may include a form and a target table with empty content. The target content information is entered into the session window, including: Enter the form into the chat window; collect information based on the form and fill it into the target form.
[0047] The form can be any form input into the conversation window, such as a screenshot, a copied spreadsheet fragment, or a photograph of the form; this application does not limit this. The target content information can include a form and a corresponding empty target table. The form can be an interactive information collection tool generated based on the key information of the aforementioned form, containing various input controls corresponding to field names, adapted to the characteristics of conversation window propagation, and supporting online completion by multiple users. The empty target table can be a structured empty table that retains the input table structure and key information, but clears only the value information. It can be used to summarize all content data collected by the form, and its row and column layout and field names are completely consistent with the form, ensuring that the data is formatted neatly after being entered. Inputting the form into the conversation window can be done in a lightweight form and sent to the current conversation window for conversation members to view and fill out. Specifically, it can be an online expression link, an embedded form fragment, or a form QR code, etc.; this application does not limit this. After conversation members fill in the relevant content data through the form, information can be collected based on the form to obtain the aforementioned relevant content data. After collecting relevant data, it can be filled into the target table according to the field correspondence principle, eliminating the need for manual entry or organization and supporting real-time data updates. For example, the input information can be a screenshot of a completed "Business Trip Application Form." By recognizing the table structure and extracting information from the screenshot, key information such as "Traveler's Name," "Reason for Travel," "Travel Dates," and "Approving Supervisor's Signature," as well as corresponding value information, such as handwritten or printed content, can be obtained. Based on the field semantics, the required form control type can be inferred and mapped to obtain a form that can be filled in. For example, "Travel Dates" can be mapped to a date range control, "Approving Supervisor's Signature" to an electronic signature control, and "Travel Reason" to a multi-line text box.
[0048] Therefore, it can be adapted to the conversation window scenario, directly feeding back the target content information to the conversation window, which facilitates instant sharing and reuse, and improves the efficiency of content delivery and reuse.
[0049] Figure 4 A flowchart of a content generation method including a process for detecting content structure is provided for an embodiment of this application, such as... Figure 4 As shown, the content generation method includes the following steps: Step S401: Obtain input information.
[0050] Step S402: Receive the operation command applied to the input information.
[0051] Step S403: In response to the operation command, the input information is identified to obtain multiple content blocks.
[0052] Here, a content block can be the smallest data unit with independent semantics or a clearly defined layout boundary after the input information has been identified and segmented. Since different types of input information require different recognition processes, it is necessary to first determine the specific data type of the input information and then select an appropriate recognition scheme to ensure accurate segmentation of the content blocks. Specifically, the input information is identified to obtain multiple content blocks, including: Identify the data type of the input information; based on the data type, identify the input information to obtain multiple content blocks.
[0053] The data type can be a structured spreadsheet, an image-based table, etc., and this application does not limit this. The structured spreadsheet type has native row and column nodes, allowing for direct data parsing. The image-based table type stores data in pixel format, with table information or table-like information embedded within the image. Based on this data type, differential recognition logic can be used to obtain content blocks. In one embodiment, taking a structured spreadsheet as the input information, the native information of the table, including row information, column information, and border information, can be read based on the document tree structure corresponding to the input information. Units are then split based on independent cells, and the content in each cell can be considered a content block. In one embodiment, taking the input information as an image-like table, the input information can be preprocessed (e.g., denoising, binarization, skew correction, etc.). Then, a table detection model based on CNN (Convolutional Neural Network) (e.g., TableNet or a detector based on Detectron2) or a detection algorithm based on line detection, Hough transform, morphological operations, etc., can be used to detect the table region. If the table region is located, the pixel region corresponding to each cell can be further segmented, and OCR (Optical Character Recognition) detection can be performed on each pixel region. The extracted text content can be regarded as a content block. If the table region cannot be located, separators (e.g., ":", "|", etc.) or specific alignment layouts can be detected to determine the pixel region related to the key-value pair structure and split it into multiple relatively independent pixel sub-regions. These pixel sub-regions can contain handwritten content or printed content. By performing OCR detection on each pixel region, the extracted text content can be regarded as a content block.
[0054] Step S404: Determine the content structure based on the attribute information corresponding to the multiple content blocks. The content structure includes key information, value information, and structure information. The structure information is used to represent the layout of key information and value information in the input information.
[0055] Attribute information can be the core feature data of each content block, serving as a crucial basis for distinguishing key, value, and structural information. Specifically, attribute information can include positional attributes, semantic attributes, and style attributes. Positional attributes can include the content block's coordinates within the input information, its row and column affiliation, and its positional relationship with adjacent content blocks, such as being in the first row and first column, or located in the left column. Semantic attributes can be the specific text content of the content block. Style attributes can be the visual features of the content block, such as bold font, background color, border style, and text alignment. For positional attributes, distinguishing between key and value information can be based on their specific location within the table or their position relative to a specific separator. For example, content blocks located in the top 1-2 rows and left 1-2 columns of the table can be marked as candidate key information, while content blocks far from the header area, located in the middle or right of the table, can be marked as candidate value information. Similarly, content blocks to the left of a specific separator ":" can be marked as candidate key information, while content blocks to the right of a specific separator ":" can be marked as candidate value information. For style attributes, the specific style of the content block can be considered. For example, content blocks with bold fonts and prominent backgrounds can be used to help identify candidate key information. Similarly, content blocks corresponding to handwritten text can be used to help identify candidate value information. For semantic attributes, the specific semantic content of the content block can be considered. For example, a field name dictionary can be used to compare the text of the content block; if a match is found, it can be marked as key information. Another example is using a semantic classification model to categorize the content block as either key or value information. Of course, in practice, one or more of the aforementioned attributes can be used to distinguish between key and value information; this application does not limit this approach. In one embodiment, the input information can be a completed "Employee Information Registration Form," which may contain fields such as "Name," "Gender," "Department," "Contact Number," and "Date of Employment," as well as multiple rows of employee data. Specifically, the text in each cell of the "Employee Information Registration Form" is traversed, and the header field name corresponding to each cell in the first row is identified as key information. Based on the header position and the nature of each column field, the text content of the corresponding column in subsequent rows is identified as value information. In particular, for the text content of certain merged cells, value information can be confirmed through a combination of position and semantics. In another embodiment, the input information can be a scanned paper "Hospitalization Registration Form." A table detection module can locate the table area and segment the cells, and an OCR module can perform text recognition on each cell in the table area to obtain field names including "Name," "Gender," "Hospitalization Number," "Department," and "Date of Admission," as well as the filled-in patient information. Based on the row and column structure, punctuation marks, and a common field dictionary, key and value information can be identified.
[0056] Step S405: Retain the structural information and key information in the input information to obtain the target content information.
[0057] Therefore, attribute information can be used to accurately distinguish key information and value information, providing a basis for the generation of subsequent target content information, and meeting the user's information reuse needs to clear value information while retaining structural and key information.
[0058] Figure 5 A flowchart of a content generation method, including a process for generating target content information, is provided for embodiments of this application. Figure 5 As shown, the content generation method includes the following steps: Step S501: Obtain input information.
[0059] Step S502: Receive the operation command applied to the input information.
[0060] Step S503: In response to the operation command, the input information is detected to obtain the content structure of the input information. The content structure includes key information, value information and structure information. The structure information is used to represent the layout of key information and value information in the input information.
[0061] Step S504: Construct a blank table based on the structural information.
[0062] The structural information provides the layout of key and value information within the input information. Therefore, based on this structural information, a completely blank table can be recreated, retaining only the layout rules but without any key or value information. Specifically, the structural information can provide information such as the total number of rows, total number of columns, border style, row height, column width, and cell alignment. Thus, a blank table with the same structure as the original input table can be constructed based on this structural information, and the construction of this blank table is compatible with the current application platform, such as PC, mobile, and web.
[0063] Step S505: Fill in the key information into the blank table to obtain the target content information.
[0064] The process involves filling the key information into the corresponding cells of a blank table, ensuring that the field names are consistent with the original table in terms of position and style. This results in a target table containing the key information, i.e., the target content information, suitable for the need to repeatedly fill in forms. Optionally, since the blank table has the same structure as the original input table, retaining only the key information may lead to formatting issues, such as excessively wide columns, uneven row heights, or blurred border lines. Therefore, it is possible to fill the key information into the blank table and then adjust the formatting. Specifically, filling the key information into the blank table yields the target content information, including: Fill the key information into the blank table to obtain the target table; optimize and adjust the layout of the target table to obtain the target content information.
[0065] By filling in the key information into a blank table, a target table can be obtained. This target table can then be adjusted and optimized for layout. For example, the target table can be size-adapted by appropriately compressing row height and column width to avoid blank rows taking up too much space, or consecutive blank rows can be merged to eliminate abnormal cell heights. Another example is style optimization, using consistent border styles and alignment to improve visual harmony. Thus, while preserving the core layout of the original table, layout defects can be optimized, improving the visual effect.
[0066] Figure 6 A flowchart illustrating a content generation method, including a process of generating target content information using a table template, is provided as an embodiment of this application. Figure 6 As shown, the content generation method includes the following steps: Step S601: Obtain input information.
[0067] Step S602: Receive the operation command applied to the input information.
[0068] Step S603: In response to the operation command, the input information is detected to obtain the content structure of the input information. The content structure includes key information, value information and structure information. The structure information is used to represent the layout of key information and value information in the input information.
[0069] Step S604: Extract features based on structural and key information to obtain feature encoding information.
[0070] Feature extraction involves extracting core features that uniquely identify the table type from structural and key information using models or encoding rules, forming a "table fingerprint" that can be used for template matching. This process is independent of value information or non-key styles. Structural features related to structural information may include the total number of rows and columns, the distribution of merging relationships, and the field sorting order. Key-related features may include field name text, field semantic category, and field relative position. The feature encoding information can be obtained by mapping the aforementioned feature information into a high-dimensional vector, used to quickly calculate the similarity with a preset template.
[0071] Step S605: Determine the target table template that matches the feature encoding information from the multiple preset table templates.
[0072] The preset table template can be a pre-configured standardized table framework stored in a template library. Each preset table template can be set with corresponding template encoding information. By calculating the similarity between the feature encoding information and the template encoding information, it can be determined whether the input information matches the preset table template. For example, if the similarity exceeds a preset threshold, it is determined to be a match. Thus, a target table template that matches the input information can be selected from multiple preset table templates.
[0073] Step S606: Fill in the key information into the target table template to obtain the target content information.
[0074] Therefore, standardized templates can be reused to quickly filter templates that match the input information, thereby improving the efficiency of table reconstruction.
[0075] Figure 7 This is a structural block diagram of a content generation apparatus provided in an embodiment of this application. The apparatus is configured to execute the content generation method provided in the above embodiments, and possesses corresponding functional modules and beneficial effects for executing the method. For example... Figure 7 As shown, the device specifically includes: Module 701 is configured to acquire input information; The instruction receiving module 702 is configured to receive operation instructions that act on input information; The information detection module 703 is configured to detect input information in response to operation instructions and obtain the content structure of the input information. The content structure includes key information, value information and structure information. The structure information is used to represent the layout of key information and value information in the input information. The content generation module 704 is configured to retain the structural and key information in the input information to obtain the target content information.
[0076] As described above, the system acquires input information and receives operation instructions applied to it, enabling data processing tailored to user actions and meeting actual user needs. Then, in response to the operation instructions, it detects the input information to obtain its content structure, distinguishing between key and value information. This provides a reference for clearing entered content, and the system extracts structural information, providing a basis for subsequent layout reconstruction. Finally, it retains the structural and key information from the input information to obtain the target content information. This allows for the reuse of existing table or table-like structures while preserving crucial key information, eliminating the need for users to redraw tables or re-enter field names, thus improving processing efficiency.
[0077] In one possible embodiment, the content generation module 704 is further configured to: Delete the value information from the input information to obtain the target content information; or, Convert the input values into placeholder objects to obtain the target content information; or... Target content information is generated based on structural and key information.
[0078] In one possible embodiment, the input information is information entered into a document; It also includes document output templates, configured as follows: Enter the target content information into the document; or, Create a new document based on the target content information.
[0079] In one possible embodiment, the input information is the information entered into the session window; It also includes a session output template, configured as follows: Enter the target content information into the chat window.
[0080] In one possible embodiment, when the input information includes a table, the target content information includes: the form and the target table whose content is empty. The session output template is also configured as follows: Enter the form into the chat window; Information is collected based on forms and then filled into the target form.
[0081] In one possible embodiment, the information detection module 703 is further configured as follows: The input information is identified to obtain multiple content blocks; The content structure is determined based on the attribute information corresponding to each of the multiple content blocks.
[0082] In one possible embodiment, the information detection module 703 is further configured as follows: Identify the data type of the input information; Multiple content blocks are obtained by identifying the input information based on the data type.
[0083] In one possible embodiment, when the input information includes a table, the content generation module 704 is further configured to: Construct a blank table based on structural information; Fill in the key information into the blank table to obtain the target content information.
[0084] In one possible embodiment, the content generation module 704 is further configured to: Fill the key information into the blank table to obtain the target table; The target table is formatted and optimized to obtain the target content information.
[0085] In one possible embodiment, the content generation module 704 is further configured to: Feature encoding information is obtained by extracting features based on structural and key information; Select the target table template that matches the feature encoding information from among several preset table templates; Fill the key information into the target form template to obtain the target content information.
[0086] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 8 As shown, the device includes a processor 801, a memory 802, an input device 803, and an output device 804; the number of processors 801 in the device can be one or more. Figure 8 Taking a processor 801 as an example; the processor 801, memory 802, input device 803, and output device 804 in the device can be connected via a bus or other means. Figure 8 Taking a bus connection as an example, the memory 802, as a computer-readable storage medium, can be configured to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the content generation method in this embodiment. The processor 801 executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory 802, thereby implementing the aforementioned content generation method. The input device 803 can be configured to receive input digital or character information and generate key signal inputs related to user settings and function control of the device. The output device 804 may include a display screen or other display device.
[0087] The electronic device provided above can be used to execute the content generation method provided in any of the above embodiments, and has corresponding functions and beneficial effects.
[0088] This application also provides a non-volatile storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are configured to perform a content generation method described in the above embodiments, comprising: acquiring input information; receiving an operation instruction acting on the input information; responding to the operation instruction, detecting the input information to obtain a content structure of the input information, wherein the content structure includes: key information, value information, and structure information, the structure information being used to represent the layout of the key information and value information in the input information; and retaining the structure information and key information in the input information to obtain target content information.
[0089] Storage medium – any type of memory device or storage device. The term “storage medium” is intended to include: mounting media, such as CD-ROMs, floppy disks, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media, optical storage; registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. Furthermore, storage media may reside in a first computer system in which the program is executed, or may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term “storage medium” can include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). Storage media may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.
[0090] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the content generation method described above, but can also perform related operations in the content generation method provided in any embodiment of this application.
[0091] It should be noted that the numbering of each step in this solution is only used to describe the overall design framework of this solution and does not indicate a necessary sequential relationship between the steps. As long as the overall implementation process conforms to the overall design framework of this solution, it falls within the protection scope of this solution. The literal order in the description is not an exclusive limitation on the specific implementation process of this solution. Those skilled in the art should understand that the embodiments of this application can be provided as methods, systems, or computer program products. In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-persistent memory in computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0092] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0093] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A content generation method, characterized in that, include: Obtain input information; Receive operation instructions that act on the input information; In response to the operation instruction, the input information is detected to obtain the content structure of the input information, wherein the content structure includes: key information, value information and structure information, and the structure information is used to represent the layout of the key information and value information in the input information; The structural information and key information in the input information are retained to obtain the target content information.
2. The content generation method according to claim 1, characterized in that, The process of retaining the structural information and key information from the input information to obtain target content information includes: Delete the value information from the input information to obtain the target content information; or, The value information in the input information is converted into a placeholder object to obtain the target content information; or... The target content information is generated based on the structural information and the key information.
3. The content generation method according to claim 1, characterized in that, The input information is the information entered into the document; After obtaining the target content information by retaining the structural information and key information from the input information, the method further includes: Input the target content information into the document; or, Create a new document based on the target content information.
4. The content generation method according to claim 1, characterized in that, The input information is the information entered into the session window; After obtaining the target content information by retaining the structural information and key information from the input information, the method further includes: Enter the target content information into the session window.
5. The content generation method according to claim 4, characterized in that, When the input information includes a table, the target content information includes: a form and a target table with empty content corresponding to the form. Inputting the target content information into the session window includes: Enter the form into the session window; Information is collected based on the form and filled into the target form.
6. The content generation method according to claim 1, characterized in that, The step of detecting the input information to obtain the content structure of the input information includes: The input information is identified to obtain multiple content blocks; The content structure is determined based on the attribute information corresponding to each of the multiple content blocks.
7. The content generation method according to claim 6, characterized in that, The process of identifying the input information yields multiple content blocks, including: Identify the data type of the input information; Based on the data type, the input information is identified to obtain multiple content blocks.
8. The content generation method according to claim 2, characterized in that, When the input information includes a table, generating the target content information based on the structure information and the key information includes: Construct a blank table based on the structural information; Fill the blank table with the key information to obtain the target content information.
9. The content generation method according to claim 8, characterized in that, The step of filling the key information into the blank table to obtain the target content information includes: Fill the blank table with the key information to obtain the target table; The target table is then formatted and optimized to obtain the target content information.
10. The content generation method according to claim 2, characterized in that, The process of generating the target content information based on the structural information and the key information includes: Feature encoding information is obtained by extracting features based on the structural information and the key information; A target table template that matches the feature encoding information is determined from a plurality of preset table templates; The key information is filled into the target table template to obtain the target content information.
11. A content generation apparatus, characterized in that, include: The acquisition module is configured to acquire input information. The instruction receiving module is configured to receive operation instructions applied to the input information; An information detection module is configured to detect the input information in response to the operation command, and obtain the content structure of the input information, wherein the content structure includes: key information, value information and structure information, and the structure information is used to represent the layout of the key information and value information in the input information; The content generation module is configured to retain the structural information and key information in the input information to obtain the target content information.