Method and device for previewing translation of email attachments

Through the translation preview method of email attachments, the preview level is automatically determined according to user behavior and attachment characteristics, and preset algorithms and strategies are used for translation, which solves the problem of obtaining language information in email attachments and realizes efficient and accurate translation display and translation.

CN120509422BActive Publication Date: 2025-09-19SHUYI NETWORK TECH (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511007543.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-09-19
Estimated Expiration
2045-07-22

AI Technical Summary

Technical Problem

The email attachment contains information in multiple languages, and the recipient cannot effectively obtain the information.

Method used

A method for previewing translated text for email attachments is provided. This method extracts attachment data in response to user operations and implements previews of translated text at different levels based on the preset content extraction algorithm and translation strategy for the current preview level. The preview level cache is used to store translated terms and rules, allowing for flexible display of translated content.

Benefits of technology

It enables efficient and accurate preview of translated email attachments, improves user processing efficiency, ensures translation accuracy and consistency, and supports real-time user interaction and level switching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120509422B_ABST
    Figure CN120509422B_ABST
Patent Text Reader

Abstract

The present application relates to the field of natural language processing technology, and provides a method and device for previewing the translation of an email attachment. The method extracts the attachment data of the email attachment in response to a user's preview operation on the translation of the email attachment in the preview interface; determines the current preview level based on the attachment data; uses a preset content extraction algorithm corresponding to the current preview level to extract the content to be translated from the email attachment; uses a preset translation strategy corresponding to the current preview level and a configured preview level cache library to translate the content to be translated, obtain the translated content to be previewed, and store the translated content to be previewed in the preview level cache library as the level translation result of the current preview level; based on the current preview level and the attachment type, displays the content to be previewed to the user in the preview interface. This method improves the user's processing efficiency of email attachments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of natural language processing technology, and in particular to a method and device for previewing the translation of an email attachment. Background Art

[0002] With the acceleration of globalization and the increasing frequency of cross-border communication, the demand for communication via email is growing. However, email attachments often contain information in multiple languages. For recipients who do not understand the language of the attachment, they cannot effectively obtain the information. Summary of the Invention

[0003] The purpose of the embodiments of the present application is to provide a method and device for previewing the translated text of an email attachment, so as to solve the above-mentioned problems existing in the prior art and improve the user's efficiency in processing attachments.

[0004] In a first aspect, a method for previewing a translation of an email attachment is provided. The method may include: extracting attachment data of the email attachment in response to a user performing a translation preview operation on the email attachment on a preview interface; the attachment data includes the attachment type, attachment size, the user's historical user behavior on the attachment type, and content keywords; and determining a current preview level based on the attachment data; the current preview level is a summary level, a paragraph level, or a full-text level; extracting content to be translated from the email attachment using a preset content extraction algorithm corresponding to the current preview level; translating the content to be translated using a preset translation strategy corresponding to the current preview level and a configured preview level cache to obtain translated content to be previewed, and storing the translated content to be previewed as a level translation result for the current preview level in the preview level cache; wherein the preview level cache is used to store translated terms, reusable level translation results, and translation rules for the same attachment type; and displaying the content to be previewed to the user on the preview interface based on the current preview level and the attachment type.

[0005] In one possible implementation, the preview interface includes: a level switching control for switching between different preview levels; after determining the current preview level, the method further includes: in response to a user triggering operation on the level switching control, displaying an indicator box including a level switching direction, the level switching direction including an option to switch the current preview level to a different target preview level, the target preview level being any other preview level except the current preview level; in response to a user selecting an option to select a target option, determining to switch the current preview level to a target preview level corresponding to the target option, and determining the target preview level as the new current preview level.

[0006] In one possible implementation, based on the attachment data, the current preview level is determined, including: when the attachment size is not greater than a preset value, and / or the user's historical behavior includes high-frequency viewing behavior, determining that the current preview level is a paragraph level; when the attachment size is greater than a preset value, and / or the attachment type is identified as the user's first contact type, determining that the current preview level is a summary level, and generating a content loading control and function prompt information of the corresponding control on the preview interface; when the content keyword contains a preset sensitive keyword, determining that the current preview level is a summary level.

[0007] In one possible implementation, after the preview interface displays the content to be previewed to the user, the method further includes: when the content keywords include preset sensitive keywords and the current preview level is the summary level, scanning the content to be previewed through a natural language processing engine, performing masking processing on the sensitive fields identified in the content to be previewed in real time, generating a current summary, and displaying a prompt at the top of the preview interface: the current summary contains sensitive content, and loading is required to view details; in response to the user triggering the content loading control and confirming that the user has access qualifications to paragraph level L2 or full text level L3, unmasking the content in the current summary, displaying loading progress indication information for loading paragraph level L2 or full text level L3 content on the preview interface, and displaying the loaded content marked with highlighting in real time.

[0008] In one possible implementation, a preset content extraction algorithm corresponding to the preview level is used to extract the content to be translated from the email attachment, including: for the summary level, using a corresponding preset NLP summary model to extract a summary of the email attachment to obtain summary information of the email attachment; for the paragraph level, using a corresponding preset text clustering algorithm to extract core paragraphs of the email attachment to obtain paragraph information of the email attachment; for the full-text level, using a corresponding preset parsing engine to extract the full text of the email attachment to obtain full-text information of the email attachment.

[0009] In one possible implementation, the preset translation strategy corresponding to the current preview level and the configured preview level cache library are used to perform content translation on the content to be translated to obtain the translated content to be previewed, including: selecting a corresponding preset translation strategy according to the current preview level; querying the content to be translated based on the preview level cache library to determine a match result between the content to be translated and translated terms, reusable level translation results, and / or translation rules of the same attachment type stored in the preview level cache library; and performing content translation on the content to be translated based on the matching result and the attachment type to obtain the translated content to be previewed.

[0010] In one possible implementation, based on the current preview level and the attachment type, presenting the content to be previewed to the user on the preview interface includes:

[0011] (1) In the case where the attachment type is a document type: if the current preview level is the summary level, the content to be previewed includes the attachment translation title and translation key data, and the attachment translation title and translation key data are displayed to the user in a card-style display on the preview interface; if the current preview level is the paragraph level, the content to be previewed includes the translation paragraph data and the original paragraph data, and the translation paragraph data and the original paragraph data are displayed to the user in a column-style display on the preview interface; if the current preview level is the full text level, the content to be previewed includes the translation paragraph data and the original paragraph data. The full content of the translation and the full content of the original text are displayed to the user in a column-by-column display manner in the original format on the preview interface, and identical sentences in the translation and the full content of the original text are assigned the same sentence-level index mark; thereafter, in response to a user selecting the full content of the original text, the sentence-level index mark associated with the selected area corresponding to the selection operation is determined; the selection operation includes clicking a sentence or framing consecutive sentences; based on the sentence-level index mark associated with the selected area, the sentence content in the corresponding area of ​​the translation is triggered to be highlighted and displayed;

[0012] (2) In the case where the attachment type is a table type: if the current preview level is the summary level, the content to be previewed includes the translation header and the first preset number of translation row data in the table, and the translation header and translation row data are displayed to the user on the preview interface; if the current preview level is the paragraph level, the content to be previewed includes the translation key column data, and the translation key column data is displayed to the user in a highlighted manner on the preview interface; if the current preview level is the full text level, the content to be previewed includes all the translation data in the table, and the translation key column data is displayed to the user in a highlighted manner on the preview interface. A filtering operation control is provided on the screen to display all the translated data and all the original data to the user through filtering and column display, and table data at the same table position in all the translated data and all the original data are set to have the same position ID; then, in response to the user selecting a table of all the original data, the position ID of the selected area corresponding to the selection operation is determined; the selection operation includes clicking a table position or framing consecutive table positions; based on the position ID of the selected area, the table data of the corresponding area in the entire translated data is triggered to be highlighted and displayed;

[0013] (3) In the case where the attachment type is a picture type: if the current preview level is the summary level, the content to be previewed is a text translation summary, and the text translation summary is displayed to the user on the preview interface; if the current preview level is the paragraph level, the content to be previewed includes translated paragraph data, and the translated paragraph data is displayed to the user on the preview interface in the form of a clickable translation floating layer superimposed on the picture; if the current preview level is the full text level, the content to be previewed is all translated data, and a picture annotated with all original text data and all translated data is displayed on the preview interface.

[0014] In a second aspect, a device for previewing a translated text of an email attachment is provided, which may include:

[0015] An extraction unit, configured to extract attachment data of the email attachment in response to a user's translation preview operation on the email attachment in the preview interface; the attachment data includes attachment type, attachment size, the user's historical behavior on the attachment type, and content keywords;

[0016] a determining unit, configured to determine a current preview level based on the attachment data; the current preview level being a summary level, a paragraph level, or a full text level;

[0017] The extraction unit is further configured to extract the content to be translated from the email attachment using a preset content extraction algorithm corresponding to the current preview level;

[0018] A translation unit, configured to translate the content to be translated using a preset translation strategy corresponding to the current preview level and a configured preview level cache library, to obtain translated content to be previewed;

[0019] A storage unit, configured to store the translated content to be previewed as a level translation result of the current preview level in the preview level cache; wherein the preview level cache is configured to store translated terms, reusable level translation results, and translation rules for the same attachment type;

[0020] A display unit is used to display the content to be previewed to the user on the preview interface based on the current preview level and the attachment type.

[0021] In a third aspect, an electronic device is provided, the electronic device including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0022] Memory for storing computer programs;

[0023] The processor is configured to implement any of the method steps described in the first aspect when executing a program stored in the memory.

[0024] In a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any of the method steps described in the first aspect is implemented.

[0025] The present application provides a method and device for previewing the translation of an email attachment. The method extracts the attachment data of the email attachment in response to the user's preview operation on the translation of the email attachment in the preview interface; the attachment data includes the attachment type, the attachment size, the user's historical behavior on the attachment type and the content keywords; and, based on the attachment data, determines the current preview level; the current preview level is the summary level, the paragraph level or the full text level; adopts the preset content extraction algorithm corresponding to the current preview level to extract the content to be translated in the email attachment; adopts the preset translation strategy corresponding to the current preview level and the configured preview level cache library to translate the content to be translated, obtain the translated content to be previewed, and store the translated content to be previewed as the level translation result of the current preview level in the preview level cache library; the preview level cache library is used to store translated terms, reusable level translation results and translation rules of the same attachment type; based on the current preview level and the attachment type, displays the content to be previewed to the user in the preview interface. The method realizes efficient and accurate preview of the translation of the email attachment, significantly improving the user's processing efficiency of the email attachment. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.

[0027] Figure 1 A flowchart of a method for previewing the translation of an email attachment provided in an embodiment of the present application;

[0028] Figure 2 A schematic diagram of the structure of a translated text preview device for an email attachment provided in an embodiment of the present application;

[0029] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. Unless otherwise defined, the technical terms or scientific terms used in this application should be the common meanings understood by people with ordinary skills in the field to which the invention belongs. "Include" or "comprising" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect", "couple" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.

[0031] The translated text preview method for email attachments provided in the embodiments of the present application can be applied to a server or terminal. The server can be a physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal can be a user equipment (UE) such as a mobile phone, smartphone, laptop, digital broadcast receiver, personal digital assistant (PDA), tablet computer (PAD), handheld device, vehicle-mounted device, wearable device, computing device, or other processing device connected to a wireless modem, mobile station (MS), mobile terminal, etc. The terminal and server can be connected directly or indirectly via wired or wireless communication methods, which is not limited in this application.

[0032] This application's translated email attachment preview method is user-centric. Starting with a user-triggered preview action, it proceeds step-by-step through initial decision-making, content extraction, translation, caching, and visualization output. This process follows the sequential principle of "decision-first, processing second, interaction third," and divides the preview hierarchy into three levels, covering the entire user journey from "quick judgment" to "in-depth usage." These three levels include: Summary Level (L1): Loads within 5 seconds and displays a translated summary of the attachment's core information (title, key data, and conclusion); Paragraph Level (L2): Loads within 10 seconds and displays a comparison of the original and translated text for key sections / paragraphs; and Full Text Level (L3): Asynchronously loads the entire content, supporting full-text translation, format restoration, and in-depth operations (such as searching and exporting). Simultaneously, it emphasizes efficiency (e.g., L1 loading ≤ 5 seconds) and resource optimization (e.g., asynchronous loading of L3). The step design is based on feature integration to avoid redundant computation and supports real-time user interaction (e.g., switching between levels). This improves attachment processing efficiency while delivering a highly effective user experience.

[0033] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application can be combined with each other if there is no conflict.

[0034] Figure 1 A flowchart of a method for previewing the translation of an email attachment provided in an embodiment of the present application. Figure 1 As shown, the method may include:

[0035] Step S110 : In response to the user's translation preview operation on the email attachment in the preview interface, extract the attachment data of the email attachment.

[0036] In a specific implementation, the preview operation of the user on the email attachment in the email on the preview interface of the terminal is detected, such as clicking the attachment icon or clicking the attachment preview control, to extract the attachment data of the email attachment. The attachment data may include the attachment ID, attachment type (such as PDF, Word, Excel, PNG, etc.), attachment size (such as the unit can be MB), the user's historical behavior for the attachment type (such as high-frequency viewing behavior: TXT / Markdown), attachment content and content keywords (such as "contract" or "report", marking sensitive files), etc.

[0037] Step S120: Determine the current preview level based on the attachment data.

[0038] The current preview level may be a summary level, a paragraph level, or a full text level.

[0039] In a specific implementation, when the attachment size is not greater than a preset value (e.g., 5MB), and / or the user's historical behavior includes high-frequency viewing behavior, the current preview level is determined to be paragraph level L2;

[0040] When the size of the attachment is larger than a preset value, and / or the attachment type is identified as the first time the user has seen it, the current preview level is determined to be summary level L1, and a content loading control and corresponding function prompt information (such as "click to load more") are generated on the preview interface;

[0041] When the content keyword includes a preset sensitive keyword, the current preview level is determined to be summary level L1.

[0042] Furthermore, when the content keywords include preset sensitive keywords and the current preview level is the summary level, the natural language processing engine is used to scan the content to be previewed, and the sensitive fields identified in the preview content are masked in real time to generate the current summary, and a prompt is displayed at the top of the preview interface: "The current summary contains sensitive content, and details need to be loaded"; the masking process can be a text replacement process that replaces sensitive words with placeholders (such as [****]), or inserting a semi-transparent mask to cover the sensitive area in the web page preview interface to prevent the injection of directly copied DOM nodes.

[0043] In response to a user triggering a content loading control and confirming that the user has access to paragraph-level L2 or full-text level L3, the content that has been masked in the current summary is unmasked, and loading progress information (such as a loading progress percentage) for the paragraph-level L2 or full-text level L3 content is displayed on the preview interface, and the loaded content is displayed in real time using a highlighted display. Confirming that the user has access to paragraph-level L2 or full-text level L3 can be done by confirming whether the user is a frequent user of the terminal, or whether the user has historically accessed full-text email attachments of the same attachment type on the terminal. If so, it is determined that the user has access to paragraph-level L2 or full-text level L3.

[0044] Step S130: Using a preset content extraction algorithm corresponding to the current preview level, extract the content to be translated from the email attachment.

[0045] For summary level L1, the corresponding preset NLP summary model (such as BART) is used to extract the summary of the email attachment to obtain the summary information of the email attachment, that is, a concise summary (200-500 words) focusing on the first 10% of the key information of the original text (title, key data and conclusion).

[0046] For paragraph level L2, the core paragraphs of the email attachment are extracted through the corresponding preset text clustering algorithm (such as K-means) to obtain the paragraph information of the email attachment, that is, 30%-40% of the original content, including paragraph titles, charts and conclusion sentences.

[0047] For full-text level L3, the full text of the email attachment is extracted through the corresponding preset parsing engine (such as Apache POI parsing Word and Tabula parsing PDF tables) to obtain the full text information of the email attachment.

[0048] Step S140: Using the preset translation strategy corresponding to the current preview level and the configured preview level cache library, the content to be translated is translated to obtain the translated content to be previewed, and the translated content to be previewed is stored in the preview level cache library as the level translation result of the current preview level.

[0049] Select the corresponding preset translation strategy based on the current preview level;

[0050] Based on the preview level cache, the content to be translated is queried to determine if it matches the translated terms, reusable level translation results, and / or translation rules for the same attachment type stored in the preview level cache. The preview level cache is used to store translated terms, reusable level translation results, and translation rules for the same attachment type. To ensure translation consistency, the preview level cache has a three-level (lexical, paragraph, and file) caching mechanism, where:

[0051] Vocabulary-level caching: stores translated terms (e.g., "API" → "API", "Sales" → "Sales") to avoid different translations of the same word;

[0052] Paragraph-level cache: stores L1 / L2 translation results, which are directly reused when the user switches to L3, reducing repeated calculations;

[0053] File-level caching: For processed attachments of the same type (such as template contracts), the translation rules are cached to speed up the next loading.

[0054] After that, based on the matching results and attachment types, content translation is performed on the content to be translated to obtain the content to be previewed after translation, including: for L1 level, a lightweight translation model (such as the T5 small model) is used to translate keywords (such as "experimental results" → "Experimental results"), and the response time ≤ 2 seconds; for L2 level, a domain adaptation model is called (such as a professional API for technical documents and a legal term library for contracts) to perform paragraph translation and retain the original format (such as retaining the bold headings and table border formats in the original text); for L3 level, a context-related translation model is enabled (such as translating "this system" as "Thissystem" when it first appears, and reusing it later to avoid ambiguity) and user term library customization is supported (users can upload an industry glossary). That is to say, the content to be previewed after translation can be an abstract translation (including the translated attachment title and translated key data), a paragraph-by-paragraph comparison translation (the translated attachment paragraph data and the original paragraph data), or a full-text translation.

[0055] Step S150: Based on the current preview level and attachment type, display the content to be previewed to the user on the preview interface.

[0056] In specific implementation, this application supports multi-mode联动 preview: optimize the level display for different attachment types (document type, table type, and picture type).

[0057] (1) In the case where the attachment type is a document type:

[0058] If the current preview level is the abstract level, the content to be previewed (i.e., the abstract translation) includes the translated attachment title and the translated key data, and the translated attachment title and the translated key data are displayed to the user in a card-style display on the preview interface;

[0059] If the current preview level is the paragraph level, the content to be previewed (i.e., the paragraph-by-paragraph comparison translation) is the translated paragraph data and the original paragraph data, and the translated attachment paragraph data and the original paragraph data are displayed to the user in a columnar display on the preview interface;

[0060] If the current preview level is the full-text level, the content to be previewed (i.e., the full-text translation) is the full content of the translation, and the full content of the translation and the full content of the original text are displayed to the user in a columnar display that restores the original format (including fonts, indents, and charts), and the same sentence content in the full content of the translation and the full content of the original text is set with the same sentence-level index mark;

[0061] After that, in response to the user's selection operation on the full content of the original text, determine the sentence-level index mark involved in the selected area corresponding to the selection operation; the selection operation can include an operation of clicking on a sentence or selecting a continuous sentence by dragging a box;

[0062] According to the sentence-level index tags involved in the selection, the sentence content in the corresponding area in the full translation is triggered to be highlighted and displayed.

[0063] (2) When the attachment type is a table:

[0064] If the current preview level is the summary level, the content to be previewed includes the translation header and the first preset number of translation rows (header + first 5 rows) in the table. The translation header and translation row data are displayed to the user on the preview interface;

[0065] If the current preview level is paragraph level, the content to be previewed includes the key column data of the translation, which is displayed to the user in a highlighted manner on the preview interface;

[0066] If the current preview level is the full-text level, the content to be previewed includes all translated data in the table. Filter controls are provided on the preview interface to display all translated data (for example, only rows with "Profit > 1000") and all original data to the user through filtering and column display. Table data in the same table position in all translated data and all original data is assigned the same position ID.

[0067] Then, in response to a user selecting a table of all original text data, determining a location ID of a selected area corresponding to the selection operation; the selection operation may include clicking a table location or selecting consecutive table locations;

[0068] According to the position ID involved in the selected area, the table data of the corresponding area in the entire translation data is triggered to be highlighted and rendered and displayed.

[0069] (3) When the attachment type is a picture:

[0070] If the current preview level is the summary level, the content to be previewed is a text translation summary, and the text translation summary is displayed to the user on the preview interface;

[0071] If the current preview level is the paragraph level, the content to be previewed includes translated paragraph data, and the translated paragraph data is displayed to the user in the preview interface by superimposing a clickable translated floating layer on the image;

[0072] If the current preview level is the full text level, the content to be previewed is the entire translated text data, and an image with all the original text data and all the translated text data marked on it is displayed on the preview interface (for example, the original text is gray and the translated text is colored).

[0073] In other words: Documents (Word / PDF): Level 1 uses a card-style summary (title + key data); Level 2 uses a column display (original paragraph on the left, translated paragraph on the right); Level 3 restores the original document formatting (including fonts, indents, and charts). Tables (Excel): Level 1 displays the table header and the first five rows of translation (e.g., "Date Sales" → "Date Sales"); Level 2 highlights key columns (e.g., "Profit") and translates the cells; Level 3 supports filtering (only displaying translated rows where "Profit > 1000"). Images (PNG / JPG): Level 1 uses OCR to extract text and generate a translated summary; Level 2 overlays the translated text on the original image (clicking on the text area displays the translation); Level 3 exports annotated images with the translated text.

[0074] In some embodiments, the preview interface may include: a level switching control for switching between different preview levels;

[0075] After the current preview level is determined in step S120, the preview level can be adjusted according to the level switching control on the preview interface. Specifically:

[0076] In response to the user's triggering operation on the level switching control, an indicator box containing the level switching direction is displayed. The level switching direction may include an option to switch the current preview level to a different target preview level, where the target preview level is any other preview level except the current preview level; for example, the current preview level is L1, and the target preview level may be L2 and L3, that is, the level switching direction at this time may include the level switching direction from L1 to L2 and the level switching direction from L1 to L3. For another example, the current preview level is L2, and the target preview level may also be L1 and L3, that is, the level switching direction at this time may include the level switching direction from L2 to L1 and the level switching direction from L2 to L3, that is, the level switching direction may be bidirectional.

[0077] In response to a user's selection operation on a target selection item, it is determined that a current preview level is switched to a target preview level corresponding to the target selection item, and the target preview level is determined as a new current preview level.

[0078] Afterwards, the preset content extraction algorithm corresponding to the new current preview level is used to extract the content to be translated from the email attachment.

[0079] In some embodiments, after the current preview level is determined in step S120, the preview level may be adjusted based on the user's behavior. Specifically:

[0080] Based on the user's past viewing behavior for email attachments of the same or similar types (such as viewing time and key focus), recent operation records (such as whether they have just viewed a contract document and deeply examined specific clauses), and other data, a configured prediction model is used to predict the user's demand for the content of the current email attachment.

[0081] The preview level is dynamically adjusted based on the predicted content demand level. Specifically, if the predicted content demand level indicates that the user may need more detailed content, the current preview level is automatically upgraded by one level (e.g., from L1 to L2).

[0082] Furthermore, if the predicted content demand level indicates that the user is particularly interested in a specific part (such as the test results part in a technical document), the preview content of that part can be loaded in advance and highlighted.

[0083] Furthermore, the user's operational behaviors during the preview process (such as clicking to load more, switching levels, and staying in an area for a long time) will be recorded and fed back to the intelligent prediction module for further optimization of the prediction model.

[0084] In some cases, traditional translation previews focus on a single attachment, ignoring the relevance of multiple attachments in email scenarios. This application addresses cross-attachment reference resolution (e.g., "this contract" refers to multiple files), breaking through the limitations of single-attachment translation. It also identifies semantic relevance across multiple attachments within the same email thread (e.g., the main contract text and supplementary agreements), achieving cross-attachment terminology uniformity.

[0085] In specific implementation, when an email contains multiple associated attachments, the content to be translated of the first attachment is translated based on the preset translation strategy corresponding to the current preview level and the configured preview level cache library. After obtaining the translated content to be previewed, the preview level cache library is updated for the content to be previewed of the first attachment. Subsequent associated attachments use the updated preview level cache library and display the changed terms marked with highlighting.

[0086] Extract the attachment content of all email attachments in the current email; by checking the naming similarity (such as "Contract_V1.pdf" and "Contract_V2.pdf") and the overlap of content keywords (such as the "Party A and Party B" clause), establish a mapping relationship between different terms (such as "Party A") and the attachment ID of the associated attachment;

[0087] Execute steps S120 - S140 on the first attachment, and cache the translated terms involved in the first attachment (such as "Party A on the first side → Party A") and the mapping relationship between different terms (such as "Party A on the first side") and the attachment IDs of associated attachments in the preview - level cache library; then, in combination with the preview - level cache library at this time, execute steps S120 - S140 on each associated attachment, where the terms of the first attachment are automatically inherited (to avoid translating "Party A on the first side" as "First Party" in the supplementary agreement).

[0088] If the terms of an associated attachment change (such as changing "Party A on the first side" to "Lessor"), prompt the user to confirm on the preview interface.

[0089] In some embodiments, during the execution of step S140, for format differences in different languages (such as no capitalization of the first letter in Chinese paragraphs and different place - holders of Arabic numerals in Chinese and English), the traditional solution only restores the surface format, while this application can achieve deep alignment through the intelligent alignment technology of cross - language format semantics. Among them, the intelligent alignment technology of cross - language format semantics can include:

[0090] (1) Establish a mapping relationship between language and format features, such as the mapping relationship between the format of "bold + full stop" indicating a strong conclusion in English and "【】+ exclamation mark" in Chinese;

[0091] (2) Adaptive word - length change of tables across languages. For example, when the column width of an English table changes after translating into Chinese (such as "description" being translated as "描述" and the column width shortening), the optimal column width can be predicted through machine - learning algorithms (prediction based on historical change data and / or adjustment data of similar tables) to avoid line - wrapping of table content;

[0092] (3) Intelligent replacement of punctuation marks in multiple languages. For example, convert the English "-" (connector) to "——" (dash) in the Chinese context while retaining the original format's indentation distance to ensure visual consistency.

[0093] During the content translation process of step S140, based on the matching result, attachment type, and the intelligent alignment technology of cross - language format semantics, perform content translation on the content to be translated to obtain the content to be previewed after translation.

[0094] [[ID=二十一]]The above - mentioned implementation method breaks through the mindset of "format restoration = pixel - level replication" and regards format as part of semantics for cross - language adaptation.

[0095] In some embodiments, for the issue of tracing the responsibility for the translation accuracy of sensitive documents (such as contracts and legal instruments), blockchain technology is introduced to achieve full - link evidence storage of the translation process:

[0096] After L2 / L3 translation is completed, a translation hash value is automatically generated, including the original text segment, translation, operation timestamp, and other information, and uploaded to the consortium chain (such as Hyperledger Fabric);

[0097] When a user modifies an L2 / L3 translation, the difference between the modification and the modification is recorded (e.g., manually correcting the translation of "liquidated damages" from "penalty" to "liquidated damages"). At the same time, a new translation hash value is generated for the modified translation and associated with the original translation hash value to form an unalterable version chain. The version chain, the new translation hash value, and the modification difference are then uploaded to the consortium chain.

[0098] This implementation generates a series of interconnected hash values ​​over time, with each hash value dependent on the previous version's hash value. If someone attempts to tamper with any version of the data in the chain, all subsequent hash values ​​will become invalid. This forms a secure, transparent, and tamper-proof version chain, ensuring data integrity and authenticity.

[0099] In some embodiments, for mixed-type attachments containing text, tables, and images (e.g., a PDF containing both product descriptions, specification tables, and circuit diagrams), traditional solutions treat each modal content in isolation. This application can use cross-level association technology for multimodal attachments. This technology breaks down the modal barriers of text, tables, and images and builds a unified knowledge association network. Specifically:

[0100] After extracting the content to be translated from the email attachment in step S130, multimodal association detection can be performed on the email attachment based on the configured cross-level association technology for multimodal attachments to obtain multimodal association information, and the extracted content to be translated can be expanded based on the multimodal association information.

[0101] Specifically, at level 2, an entity recognition model (such as BERT-BiLSTM) is used to extract "parameter value" entities from tables (e.g., "voltage: 220V") and "component names" from images (e.g., "resistor R1" in a circuit diagram using optical character recognition). These entities are then associated with relevant descriptions in the text (e.g., "device power" corresponds to the "power" column in the table), thereby generating multimodal association information.

[0102] At level L3, "cross-modal search" is supported: the user enters "power parameters of resistor R1" and simultaneously searches for descriptions in the text, values ​​in the table, and annotations in the picture to obtain multi-modal related information (such as "text: R1 is a core component; table: power 5W; picture: location in the upper left corner of the circuit diagram").

[0103] This application provides a method for previewing the translation of email attachments, which enables efficient and accurate preview of the translated email attachments and significantly improves the efficiency of users in processing email attachments. Specifically,

[0104] (1) The most suitable preview level (summary level, paragraph level, or full text level) can be automatically determined based on the user's historical behavior, content keywords, and the characteristics of the attachment itself (such as type and size). This personalized preview method improves the user experience and enables users to quickly obtain the information they need.

[0105] (2) We use corresponding preset content extraction algorithms and translation strategies for different preview levels to ensure the accuracy and efficiency of translation. In this way, we can provide users with translation results that are more in line with their needs while also saving resource consumption.

[0106] (3) Using the preview level cache library to store translated terms, reusable level translation results, and translation rules for the same attachment type not only improves translation speed but also ensures consistency in terms and expressions.

[0107] (4) It can flexibly display the content to be previewed based on the current preview level and attachment type, and can self-adjust and optimize as user usage habits change.

[0108] Corresponding to the above method, the embodiment of the present application also provides a translation preview device for email attachments, such as Figure 2 As shown, the device includes:

[0109] The extraction unit 210 is configured to extract attachment data of the email attachment in response to a user's translation preview operation on the email attachment in the preview interface; the attachment data includes the attachment type, the attachment size, the user's historical behavior on the attachment type, and content keywords;

[0110] A determining unit 220 is configured to determine a current preview level based on the attachment data; the current preview level is a summary level, a paragraph level, or a full text level;

[0111] The extraction unit 210 is further configured to extract the content to be translated from the email attachment using a preset content extraction algorithm corresponding to the current preview level;

[0112] The translation unit 230 is configured to translate the content to be translated using a preset translation strategy corresponding to the current preview level and a configured preview level cache library to obtain translated content to be previewed;

[0113] The storage unit 240 is configured to store the translated content to be previewed as the level translation result of the current preview level in the preview level cache; wherein the preview level cache is configured to store translated terms, reusable level translation results, and translation rules for the same attachment type;

[0114] The display unit 250 is configured to display the content to be previewed to the user on the preview interface based on the current preview level and the attachment type.

[0115] The functions of the various functional units of the apparatus for previewing the translated text of an email attachment provided in the above-mentioned embodiment of the present application can be implemented through the above-mentioned method steps. Therefore, the specific working process and beneficial effects of the various units in the apparatus for previewing the translated text of an email attachment provided in the embodiment of the present application are not described in detail here.

[0116] The present application also provides an electronic device, such as Figure 3 As shown, it includes a processor 310 , a communication interface 320 , a memory 330 and a communication bus 340 , wherein the processor 310 , the communication interface 320 , and the memory 330 communicate with each other via the communication bus 340 .

[0117] Memory 330, for storing computer programs;

[0118] The processor 310 is configured to execute the program stored in the memory 330 by performing the following steps:

[0119] In response to a user performing a translation preview operation on an email attachment in a preview interface, extracting attachment data of the email attachment; the attachment data including the attachment type, the attachment size, the user's historical user behavior for the attachment type, and content keywords; and determining a current preview level based on the attachment data; the current preview level being a summary level, a paragraph level, or a full text level;

[0120] extracting the content to be translated from the email attachment using a preset content extraction algorithm corresponding to the current preview level;

[0121] Using the preset translation strategy and the configured preview-level cache library corresponding to the current preview level, the content to be translated is translated to obtain the translated content to be previewed, and the translated content to be previewed is stored in the preview-level cache library as the level translation result of the current preview level; wherein the preview-level cache library is used to store translated terms, reusable level translation results, and translation rules for the same attachment type;

[0122] Based on the current preview level and the attachment type, the content to be previewed is displayed to the user on the preview interface.

[0123] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into address buses, data buses, and control buses. For ease of illustration, the figure uses only one thick line, but this does not mean that there is only one bus or only one type of bus.

[0124] The communication interface is used for communication between the above electronic device and other devices.

[0125] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.

[0126] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0127] The implementation methods and beneficial effects of the various components of the electronic device in the above embodiments to solve the problems can be found in Figure 1 The various steps in the embodiment shown are implemented, therefore, the specific working process and beneficial effects of the electronic device provided by the embodiment of the present application are not repeated here.

[0128] In another embodiment provided by the present application, a computer-readable storage medium is further provided, in which instructions are stored. When the computer-readable storage medium is executed, the computer executes the method for previewing the translation of the email attachment described in any of the above embodiments.

[0129] In another embodiment provided by the present application, a computer program product including instructions is further provided, which, when executed on a computer, enables the computer to execute the method for previewing the translation of an email attachment described in any one of the above embodiments.

[0130] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the embodiments of the present application may take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware. Furthermore, the embodiments of the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0131] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0132] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0133] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.

[0134] Although preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0135] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims and their equivalents, the embodiments of the present application are also intended to include these modifications and variations.

Claims

1. A method for previewing the translation of an email attachment, characterized in that: The method comprises: In response to a user's translation preview operation on an email attachment on a preview interface, attachment data of the email attachment is extracted; the attachment data includes the attachment type, attachment size, the user's historical behavior on the attachment type, and content keywords; and based on the attachment data, a current preview level is determined, including: when the attachment size is not greater than a preset value and / or the user's historical behavior includes high-frequency viewing behavior, the current preview level is determined to be a paragraph level; when the attachment size is greater than a preset value and / or the attachment type is identified as a first-time user, the current preview level is determined to be a summary level, and a content loading control and function prompt information of the corresponding control are generated on the preview interface; when the content keywords include preset sensitive keywords, the current preview level is determined to be a summary level; The preset content extraction algorithm corresponding to the current preview level is used to extract the content to be translated from the email attachment. The preset translation strategy corresponding to the current preview level and the configured preview level cache library are used to translate the content to be translated, obtaining the translated content to be previewed, and storing the translated content to be previewed as the level translation result of the current preview level in the preview level cache library. The preview level cache library is used to store translated terms, reusable level translation results, and translation rules for the same attachment type. Based on the current preview level and the attachment type, the content to be previewed is displayed to the user on the preview interface, including: When the attachment type is a document type: If the current preview level is the summary level, the content to be previewed includes the translated title and key translated data of the attachment, and is displayed to the user in a card-style display on the preview interface. If the current preview level is the paragraph level, the content to be previewed includes the translated paragraph data and the original paragraph data, and is displayed to the user in a column-based display on the preview interface. If the current preview level is the full text level, the content to be previewed is the entire translated content, and is displayed to the user in a column-based display on the preview interface, restoring the original format. When the attachment type is a table: If the current preview level is the summary level, the content to be previewed includes the translation header and the first preset number of translation rows in the table, and this content is displayed to the user on the preview interface. If the current preview level is the paragraph level, the content to be previewed includes the translation key column data, and this content is displayed to the user in a highlighted manner on the preview interface. If the current preview level is the full text level, the content to be previewed includes all translation data in the table, and a filtering control is provided on the preview interface to display all translation data and all original text data to the user through filtering and column display. When the attachment type is an image: if the current preview level is the summary level, the content to be previewed is the text translation summary, which is displayed to the user on the preview interface; if the current preview level is the paragraph level, the content to be previewed is the translated paragraph data, which is displayed to the user on the preview interface by superimposing a clickable translation float on the image; if the current preview level is the full text level, the content to be previewed is the entire translated text data, and an image labeled with all the original text data and all the translated data is displayed on the preview interface.

2. The method according to claim 1, wherein The preview interface includes: a level switching control for switching between different preview levels; after determining the current preview level, the method further includes: In response to a user triggering operation on the level switching control, an indicator box including a level switching direction is displayed, wherein the level switching direction includes an option to switch the current preview level to a different target preview level, where the target preview level is any other preview level except the current preview level; In response to a user's selection operation on a target selection item, it is determined to switch the current preview level to a target preview level corresponding to the target selection item, and the target preview level is determined as a new current preview level.

3. The method according to claim 1, wherein After the preview interface displays the content to be previewed to the user, the method further includes: When the content keywords contain preset sensitive keywords and the current preview level is the summary level, the content to be previewed is scanned by the natural language processing engine, and the sensitive fields identified in the content to be previewed are masked in real time to generate a current summary, and a prompt is displayed at the top of the preview interface: The current summary contains sensitive content and needs to be loaded to view details; In response to the user triggering the content loading control and confirming that the user has paragraph-level or full-text level access qualifications, the content that has been masked in the current summary is released, and the loading progress indication information of the paragraph-level or full-text level content is displayed on the preview interface, and the loaded content marked with highlighting is displayed in real time.

4. The method according to claim 1, wherein Using a preset content extraction algorithm corresponding to the preview level to extract the content to be translated from the email attachment includes: For the summary level, extracting a summary of the email attachment using a corresponding preset NLP summary model to obtain summary information of the email attachment; At the paragraph level, core paragraphs of the email attachment are extracted using a corresponding preset text clustering algorithm to obtain paragraph information of the email attachment; For the full-text level, the full-text of the email attachment is extracted through a corresponding preset parsing engine to obtain the full-text information of the email attachment.

5. The method according to claim 1, wherein The preset translation strategy corresponding to the current preview level and the configured preview level cache library are used to translate the content to be translated to obtain the translated content to be previewed, including: Select a corresponding preset translation strategy according to the current preview level; Based on the preview level cache library, querying the content to be translated, and determining a match result between the content to be translated and translated terms, reusable level translation results, and / or translation rules of the same attachment type stored in the preview level cache library; Based on the matching result and the attachment type, the content to be translated is translated to obtain translated content to be previewed.

6. The method according to claim 1, wherein Based on the current preview level and the attachment type, displaying the content to be previewed to the user on the preview interface includes: When the attachment type is a document type: If the current preview level is the full-text level, setting the same sentence-level index mark for the same sentence content in the full translation content and the full original content; then, in response to a user selecting the full original content, determining the sentence-level index mark associated with the selected area corresponding to the selection operation; the selection operation includes single-clicking a sentence or framing consecutive sentences; triggering, based on the sentence-level index mark associated with the selected area, highlighting and displaying the sentence content in the corresponding area of ​​the full translation content; When the attachment type is a table type: If the current preview level is the full-text level, the table data at the same table position in all the translated data and all the original data are set to have the same position ID; thereafter, in response to a user selecting a table of all the original data, the position ID associated with the selected area corresponding to the selection operation is determined; the selection operation includes single-clicking a table position or framing consecutive table positions; based on the position ID associated with the selected area, the table data in the corresponding area in the entire translated data is triggered to be highlighted and displayed.

7. A translation preview device for an email attachment, characterized in that: The device comprises: An extraction unit, configured to extract attachment data of the email attachment in response to a user's translation preview operation on the email attachment in the preview interface; the attachment data includes attachment type, attachment size, the user's historical behavior on the attachment type, and content keywords; A determination unit is configured to determine a current preview level based on the attachment data, specifically: when the attachment size is not greater than a preset value and / or the user's historical behavior includes high-frequency viewing behavior, determine the current preview level to be a paragraph level; when the attachment size is greater than a preset value and / or the attachment type is identified as a first-time user experience type, determine the current preview level to be a summary level, and generate a content loading control and function prompt information of the corresponding control on the preview interface; when the content keyword includes a preset sensitive keyword, determine the current preview level to be a summary level; The extraction unit is further configured to extract the content to be translated from the email attachment using a preset content extraction algorithm corresponding to the current preview level; A translation unit, configured to translate the content to be translated using a preset translation strategy corresponding to the current preview level and a configured preview level cache library, to obtain translated content to be previewed; A storage unit, configured to store the translated content to be previewed as a level translation result of the current preview level in the preview level cache; wherein the preview level cache is configured to store translated terms, reusable level translation results, and translation rules for the same attachment type; The display unit is used to display the content to be previewed to the user in the preview interface based on the current preview level and the attachment type. Specifically: when the attachment type is a document type: if the current preview level is the summary level, the content to be previewed includes the attachment translation title and translation key data, and the content to be previewed is displayed to the user in a card-like display manner on the preview interface; if the current preview level is the paragraph level, the content to be previewed includes the translation paragraph data and the original paragraph data, and the content to be previewed is displayed to the user in a column display manner on the preview interface; if the current preview level is the full-text level, the content to be previewed is the full translation content, and the full translation content and the full original content are displayed to the user in a column display manner that restores the original format on the preview interface; when the attachment type is a table type: if the current preview level is the summary level, the content to be previewed includes the translation table header and the first preset number of translation row data in the table, and the content to be previewed is displayed to the user in the preview interface. content; if the current preview level is paragraph level, the content to be previewed includes the key column data of the translation, and the content to be previewed is displayed to the user in a highlighted manner on the preview interface; if the current preview level is full-text level, the content to be previewed includes all the translation data in the table, and a filtering operation control is provided on the preview interface to display all the translation data and all the original data to the user through filtering and column display; when the attachment type is an image type: if the current preview level is summary level, the content to be previewed is the text translation summary, and the text translation summary is displayed to the user on the preview interface; if the current preview level is paragraph level, the content to be previewed is the translation paragraph data, and the translation paragraph data is displayed to the user on the preview interface in a clickable translation floating layer superimposed on the image; if the current preview level is full-text level, the content to be previewed is all the translation data, and an image marked with all the original data and all the translation data is displayed on the preview interface.

8. An electronic device, characterized in that: The electronic device includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory for storing computer programs; A processor, configured to implement the method according to any one of claims 1 to 6 when executing a program stored in a memory.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Translation method and device of e-mail and computer equipment

    CN113743131A

  • Display device and method for importing photo

    CN118870096A