Translation previewing method and device for mail attachments
Through the translation preview method of email attachments, the preview hierarchical cache library and content extraction algorithm are used to solve the efficient translation problem of multilingual information in email attachments, achieving efficient and accurate translation display and personalized user experience.
Patent Information
- Application Number
- CN202511007543.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-07-22
AI Technical Summary
The email attachment contains information in multiple languages, and the recipient cannot obtain information effectively, and the existing technology cannot efficiently translate and preview it.
It provides a translation preview method for email attachments. By extracting attachment data, based on the preset content extraction algorithm and translation strategy of the current preview level, it uses the preview level cache library to translate and display content, and supports switching and efficient translation at different levels.
It realizes efficient and accurate preview of email attachments, improves users' processing efficiency of attachments, ensures the accuracy and consistency of translations, and supports personalized preview hierarchy adjustments and the associated display of multimodal content.
Smart Images

Figure CN120509422A_ABST
Abstract
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: (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; (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; (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.
[0011] In a second aspect, a device for previewing a translated text of an email attachment is provided, which may include: 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 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; 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; 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.
[0012] 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; Memory for storing computer programs; The processor is configured to implement any of the method steps described in the first aspect when executing a program stored in the memory.
[0013] 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.
[0014] 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
[0015] 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.
[0016] Figure 1 A flowchart of a method for previewing the translation of an email attachment provided in an embodiment of the present application; 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; Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0017] 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.
[0018] 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.
[0019] 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.
[0020] 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.
[0021] 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: 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.
[0022] 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.
[0023] Step S120: Determine the current preview level based on the attachment data.
[0024] The current preview level may be a summary level, a paragraph level, or a full text level.
[0025] 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; 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; When the content keyword includes a preset sensitive keyword, the current preview level is determined to be summary level L1.
[0026] 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.
[0027] 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.
[0028] Step S130: Using a preset content extraction algorithm corresponding to the current preview level, extract the content to be translated from the email attachment.
[0029] 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).
[0030] 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.
[0031] For full-text level L3, the full text of the email attachment is extracted through the corresponding preset parsing engine (such as Apache POI for parsing Word and Tabula for parsing PDF tables) to obtain the full text information of the email attachment.
[0032] Step S140: Use the preset translation strategy corresponding to the current preview level and the configured preview level cache library to perform content translation on the content to be translated, obtain the content to be previewed after translation, and store the content to be previewed after translation as the translation result of the current preview level in the preview level cache library.
[0033] Select the corresponding preset translation strategy according to the current preview level; Based on the preview level cache library, query the content to be translated, and determine the matching results of the content to be translated with the translated terms, reusable translation results at the preview level, and / or translation rules of the same attachment type stored in the preview level cache library. The preview level cache library is used to store translated terms, reusable translation results at the preview level, and translation rules of the same attachment type. This preview level cache library is set up to ensure the consistency of translation, and it has a three-level (vocabulary level, paragraph level, and file level) cache mechanism, where: Vocabulary level cache: Store translated terms (such as "API" → "API", "Sales volume" → "Sales"), to avoid different translations for the same word; Paragraph level cache: Store the translation results at L1 / L2 levels. When the user switches to L3 level, they can be directly reused to reduce repeated calculations; File level cache: For the same type of attachments that have been processed (such as the same template contract), cache the translation rules to accelerate the loading next time.
[0034] After that, based on the matching results and the attachment type, perform content translation on the content to be translated to obtain the content to be previewed after translation, including: for L1 level, use a lightweight translation model (such as the T5 small model) to perform keyword translation (such as "Experimental results" → "Experimental results"), with a response time ≤ 2 seconds; for L2 level, call the domain adaptation model (such as professional APIs for technical documents and legal term libraries for contracts) to perform paragraph translation and retain the original format (such as retaining the bold headings and table borders in the original text); for L3 level, enable the context-related translation model (such as translating "This system" as "Thissystem" for the first time and reusing it later to avoid ambiguity) and support user-defined term libraries (users can upload industry glossaries). That is to say, the content to be previewed after translation can be an abstract translation (including the translated title of the attachment and the translated key data), a paragraph-by-paragraph comparison translation (the translated paragraph data of the attachment and the original paragraph data), or a full-text translation.
[0035] Step S150: Based on the current preview level and attachment type, the content to be previewed is displayed to the user on the preview interface.
[0036] In specific implementation, this application supports multi-mode linkage preview: optimizing hierarchical display for different attachment types (documents, tables, and pictures).
[0037] (1) When the attachment type is a document type: If the current preview level is the summary level, the content to be previewed (i.e., the summary translation) includes the attachment translation title and translation key data, which are displayed to the user in a card-like manner on the preview interface; If the current preview level is the paragraph level, the content to be previewed (i.e., the paragraph translation) is the translated paragraph data and the original paragraph data. The translated attachment paragraph data and the original paragraph data are displayed to the user in separate columns on the preview interface. If the current preview level is the full-text level, the content to be previewed (i.e., the full translation) is the entire translated content. The preview interface displays the translated content and the original content in columns, restoring the original format (including fonts, indents, and charts). Identical sentences in the translated content and the original content are marked with the same sentence-level index. Then, in response to the user selecting the entire original text, determining the sentence-level index mark involved in the selected area corresponding to the selection operation; the selection operation may include clicking a sentence or selecting consecutive sentences; According to the sentence-level index tags involved in the selection, the sentence content in the corresponding area of the full translation is triggered to be highlighted and displayed.
[0038] (2) 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 (header + first 5 rows) in the table. The translation header and translation row data are displayed to the user on the preview interface; 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; 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. 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; 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.
[0039] (3) When the attachment type is a picture: 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 in the preview interface by superimposing a clickable translated floating layer 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 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).
[0040] 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.
[0041] In some embodiments, the preview interface may include: a level switching control for switching between different preview levels; 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: 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.
[0042] 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.
[0043] 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.
[0044] 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: 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. 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).
[0045] 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.
[0046] 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.
[0047] 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.
[0048] 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.
[0049] 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; Execute steps S120-S140 for the first attachment, and cache the translated terms involved in the first attachment (e.g., "Party A→Party A") and the mapping relationship between different terms (e.g., "Party A") and the attachment IDs of the associated attachments in the preview-level cache library. Then, based on the preview-level cache library at this time, execute steps S120-S140 for each associated attachment, automatically inheriting the terms of the first attachment (to avoid "Party A" being translated as "First Party" in the supplementary agreement).
[0050] If the terminology of the associated attachment is changed (such as "Party A" is changed to "Lessor"), the user will be prompted to confirm on the preview interface.
[0051] In some embodiments, during the execution of step S140, in view of the format differences between different languages (such as the lack of capitalization of the first letter of a Chinese paragraph and the different position of Arabic numerals in Chinese and English), traditional solutions only restore the surface format. However, the present application can achieve deep alignment through the configured cross-language format semantics intelligent alignment technology. The cross-language format semantics intelligent alignment technology may include: (1) Establishing a mapping relationship between language and format features, such as the mapping relationship between the “bold + period” format that indicates a strong conclusion in English and the “[ ] + exclamation mark” format in Chinese; (2)Adaptive word length change for tables across languages. For example, when the column width of an English table changes after translation into Chinese (e.g., "description" is translated as "描述" and the column width shortens), 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 breaks in table content; (3)Intelligent replacement of multi-language punctuation marks. For example, convert the English "-" (hyphen) to "——" (em dash) in the Chinese context, but retain the original indentation distance of the format to ensure visual consistency.
[0052] During the content translation process in step S140, based on the intelligent alignment technology of matching results, attachment types, and cross-language format semantics, the content to be translated is translated to obtain the translated content to be previewed.
[0053] The above embodiments break through the mindset of "format restoration = pixel-level replication" and regard the format as part of the semantics for cross-language adaptation.
[0054] In some embodiments, for the issue of tracing the responsibility for the translation accuracy of sensitive documents (such as contracts and legal documents), blockchain technology is introduced to achieve full-chain evidence storage of the translation process: After the L2 / L3 level translation is completed, a translation hash value is automatically generated: including information such as original text fragments, translations, operation timestamps, etc., and uploaded to the consortium blockchain (such as Hyperledger Fabric); When the user modifies the L2 / L3 level translation, record the modification differences before and after (such as manually correcting the translation of "违约金" from "penalty" to "liquidated damages"). At the same time, generate a new translation hash value for the modified translation, associate it with the original translation hash value, form an immutable version chain, and upload the version chain, the new translation hash value, and the modification differences to the consortium blockchain.
[0055] As time goes by and versions are updated, this embodiment will obtain a series of interrelated hash values, and each hash value depends on the hash value of the previous version. If someone attempts to tamper with the data of any version in the middle of the chain, all subsequent hash values will become invalid, which forms a secure, transparent, and immutable version chain, ensuring the integrity and authenticity of the data.
[0056] In some embodiments, for mixed-type attachments containing text, tables, and pictures (such as a PDF that contains both product description text, specification tables, and circuit diagrams), traditional solutions handle each modality content in isolation. This application can use cross-level association technology for multi-modal attachments. This technology breaks down the modality barriers between text, tables, and pictures and constructs a unified knowledge association network. Specifically: 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.
[0057] 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. 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").
[0058] 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, (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.
[0059] (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.
[0060] (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.
[0061] (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.
[0062] Corresponding to the above method, the embodiment of the present application also provides a translation preview device for an email attachment, such as Figure 2 As shown, the device includes: 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; The 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; 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; 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; 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; 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.
[0063] 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.
[0064] 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 .
[0065] Memory 330, for storing computer programs; The processor 310 is configured to execute the program stored in the memory 330 by performing the following steps: 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; extracting the content to be translated from the email attachment using a preset content extraction algorithm corresponding to the current preview level; 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; Based on the current preview level and the attachment type, the content to be previewed is displayed to the user on the preview interface.
[0066] 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.
[0067] The communication interface is used for communication between the above electronic device and other devices.
[0068] 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.
[0069] 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.
[0070] 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 1The 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.
[0071] 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.
[0072] 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.
[0073] 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.
[0074] 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.
[0075] 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.
[0076] 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 A step that specifies a function in one or more boxes.
[0077] 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.
[0078] 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 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; extracting the content to be translated from the email attachment using a preset content extraction algorithm corresponding to the current preview level; 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; Based on the current preview level and the attachment type, the content to be previewed is displayed to the user 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 Based on the attachment data, determining a current preview level includes: When the size of the attachment 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 size of the attachment is larger than a preset value, and / or the attachment type is identified as a first-time encounter type for the user, determining the current preview level to be 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 includes a preset sensitive keyword, the current preview level is determined to be a summary level.
4. The method according to claim 3, 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.
5. 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.
6. 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.
7. 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 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 is the translated paragraph data and the original paragraph data, and the translated paragraph data and the original paragraph data are displayed to the user in a column-by-column manner on the preview interface; If the current preview level is the full-text level, the content to be previewed is the full content of the translation. 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 that restores the original format on the preview interface, and identical sentence contents in the full content of the translation and the full content of the original text are set to have the same sentence-level index mark. Thereafter, in response to the user selecting the full content of the original text, the sentence-level index mark involved in the selection corresponding to the selection operation is determined. The selection operation includes clicking a sentence or framing consecutive sentences. According to the sentence-level index mark involved in the selection area, the sentence content in the corresponding area of the full content of the translation is triggered to be highlighted and displayed. When the attachment type is a table type: If the current preview level is the summary level, the content to be previewed includes a translation header and a preset number of translation row data in a 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 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 translated data in the table. A filtering operation control is provided on the preview interface to display all translated data and all original data to the user through filtering and column display, and table data at the same table position in all translated data and all original data are set to have the same position ID. Thereafter, in response to a user selecting a table of all 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 in the corresponding area of the all translated data is triggered to be highlighted and displayed. When the attachment type is a picture: 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 in the preview interface by superimposing a clickable translated floating layer on the image; 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 data and all translated data is displayed on the preview interface.
8. 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 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; 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; 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.
9. 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 7 when executing a program stored in a memory.
10. 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 7 is implemented.
Citation Information
Patent Citations
Translation method and device of e-mail and computer equipment
CN113743131A
Document translation method and document translation platform
CN117010418A
Mail analysis method and system and readable storage medium
CN117993878A
Display device and method for importing photo
CN118870096A
Systems and methods for protecting contents and accounts
US20190020687A1