Method, system and equipment for translating foreign language areas in webpage and medium
By automatically detecting the web page language in the browser and providing user-defined translation options, the problems of inaccurate translation of non-English web pages in the prior art are solved, and flexibility and user experience are improved.
Patent Information
- Application Number
- CN202411504728.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-26
- Publication Date
- 2025-03-04
AI Technical Summary
Existing web page translation tools lack selective translation and user customization options when dealing with part-all English web pages, resulting in inaccurate translation and affecting user reading experience.
Automatically detect web language types through browser plug-ins or built-in functions, identify and mark non-Chinese content, provide translation options for users to choose, and customize translations based on user selection, keeping unselected content displayed as it is.
It realizes automatic language detection and selective translation when users browse web pages, provides user-defined translation options, and improves the flexibility and user experience of web page translation.
Smart Images

Figure CN119558328A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer information processing technology, and in particular to a method, system, device and medium for translating foreign language areas in a web page. Background Art
[0002] With the acceleration of globalization and the popularization of the Internet, the internationalization of web content has become the norm. However, for non-native users, reading non-Chinese web content is still a big challenge. Most existing web translation tools adopt a holistic translation strategy, which translates all English web pages and non-English web pages containing multiple languages. This may not only lead to inaccurate translation, but also affect the fluency of users in reading the Chinese part. In addition, when translating non-English web pages, existing tools lack the option of user-defined translation, so that the translation results often cannot meet the personalized needs of users. Summary of the invention
[0003] The object of the present invention is to provide a method, system, device and medium for translating foreign language areas in a web page, thereby solving all or one of the above problems existing in the prior art.
[0004] In order to solve the above technical problems, the specific technical solutions of the present invention are as follows: In one aspect, the present invention provides a method for translating a foreign language region in a web page, comprising the following steps: When users browse web pages, the language type of the web page is automatically detected through browser plug-ins or built-in functions; If the webpage is in English, the entire content of the webpage will be translated; If the webpage is not in full English, identify and mark the non-Chinese content in the webpage; List translation options for non-Chinese content for users to select for custom translation; According to the user's selection, the selected non-Chinese content will be translated, and the unselected content will be displayed as is; The translation results are displayed in real time, and users are allowed to switch back to the original text or reselect the translation at any time.
[0005] In one embodiment, the automatic detection of the language type of a web page through a browser plug-in or a built-in function includes: analyzing the content of the web page through natural language processing technology to determine the main language type of the web page.
[0006] In one embodiment, the identifying and marking non-Chinese content in the web page includes: using a text matching algorithm and a semantic analysis technology to identify and mark the non-Chinese content in the web page, and highlighting the non-Chinese text.
[0007] In one implementation manner, the translation options include: automatic translation mode and manual translation mode.
[0008] In one embodiment, the translating of the selected non-Chinese content according to the user's selection and keeping the unselected content displayed as it is includes: In automatic translation mode, the corresponding translation engine is called for translation according to the language type of the webpage content; In manual translation mode, the translation is performed based on the custom translation results entered by the user or the translation suggestions provided by the system.
[0009] In one embodiment, it also includes: Make translation corrections based on user evaluation of the translation results.
[0010] On the other hand, the present invention also provides a translation system for foreign language areas in a web page, comprising: A web page language detection module is used to detect the language type of a web page; Content identification and marking module, used to identify and mark non-Chinese content in web pages; A translation option providing module is used to list translation options for non-Chinese content and receive user selections; The translation execution module translates non-Chinese content according to user selection; The real-time display module is used to display the translation results in real time and allow the user to switch back to the original text or reselect the translation content at any time.
[0011] In one embodiment, it further includes: a user feedback module; The user feedback module is used to receive users' evaluation and correction suggestions on the translation results, and feed this information back to the translation engine for optimization.
[0012] On the other hand, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method for translating a foreign language area in the web page are implemented.
[0013] On the other hand, the present invention further provides a computer device, comprising 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; wherein: The memory is used to store computer programs; The processor is used to execute the steps of the method for translating a foreign language area in the web page by running the program stored in the memory.
[0014] The beneficial effects of the technical solution of the present invention are: The present invention can automatically identify the language type of a web page when a user browses the web page, perform overall translation of an all-English web page, selectively translate non-Chinese content in a non-all-English web page, and provide a user-defined translation option, thereby greatly improving the flexibility of web page translation and user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 It is a flowchart of the method for translating a foreign language area in a web page according to Embodiment 1 of the present invention; Figure 2 It is a schematic diagram of the architecture of the translation system for the foreign language area of a web page according to Embodiment 2 of the present invention; Figure 3 is a schematic diagram of the structure of the computer device described in Example 4 of the present invention; The symbols in the accompanying drawings are explained as follows: 1501, processor; 1502, communication interface; 1503, memory; 1504, communication bus. DETAILED DESCRIPTION
[0017] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer and more definite definition of the protection scope of the present invention.
[0018] In the description of the present invention, it should be noted that the embodiments described in the present invention are only part of the embodiments of the present invention, rather than all of the embodiments; based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention.
[0019] The terms "first", "second", etc. in the specification and claims of this article and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of this article described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment. Example 1
[0020] This embodiment provides a method for translating foreign language areas in a web page. Figure 1 As shown, the following steps are included: In a typical web browsing scenario, the method and system of the present invention for automatically selecting a foreign language region for translation during web browsing is implemented by the following steps: Furthermore, the user visits a web page containing multiple languages through a browser installed with the plug-in of the present invention.
[0021] Furthermore, the webpage language detection module automatically analyzes the webpage content to determine the main language type of the webpage. If the webpage is in English, the overall translation process will be entered; if the webpage is not in English, the next step will be entered.
[0022] Furthermore, the content recognition and marking module recognizes and marks non-Chinese content in the web page, such as English, French, Japanese, etc., and makes these non-Chinese content easy to identify by means of text highlighting or border marking.
[0023] Furthermore, the translation option providing module lists translation options for non-Chinese content, including two modes: automatic translation and manual translation. Users can choose whether to translate a non-Chinese region and select a translation mode as needed.
[0024] Furthermore, if the user selects the automatic translation mode, the translation execution module calls the corresponding translation engine for translation according to the language type of the web page content; if the user selects the manual translation mode, the user can enter a customized translation result or select the translation suggestion provided by the system.
[0025] Furthermore, the real-time display module displays the translation results in real time, and the user can switch back to the original text or reselect the translation content at any time to meet personalized reading needs.
[0026] Furthermore, the user feedback module allows users to evaluate and correct the translation results, such as pointing out translation errors, making suggestions for improvement, etc. This information will be fed back to the translation engine to optimize the translation quality and accuracy.
[0027] Furthermore, through the above technical solution, the present invention not only realizes the function of automatically selecting foreign language areas for translation when browsing web pages, but also provides user-defined translation options and real-time feedback mechanisms, which greatly improves the flexibility and accuracy of web page translation and provides users with a more convenient and efficient web page reading experience. It should be noted that the examples herein are only for explaining the present invention and are not intended to limit the protection scope of the present invention. Example 2
[0028] This embodiment is based on the same inventive concept as the method for translating foreign language regions in a web page described in Embodiment 1, and provides a translation system for foreign language regions in a web page, such as Figure 2 As shown, including: A web page language detection module is used to detect the language type of a web page; Content identification and marking module, used to identify and mark non-Chinese content in web pages; A translation option providing module is used to list translation options for non-Chinese content and receive user selections; The translation execution module translates non-Chinese content according to user selection; The real-time display module is used to display the translation results in real time and allow the user to switch back to the original text or reselect the translation content at any time.
[0029] In one embodiment, it further includes: a user feedback module; The user feedback module is used to receive users' evaluation and correction suggestions on the translation results, and feed this information back to the translation engine for optimization. Example 3
[0030] This embodiment provides a computer-readable storage medium, including: The storage medium is used to store computer software instructions used to implement the method for translating foreign-language areas in a web page described in the above-mentioned embodiment 1, which includes a program for executing the above-mentioned method for translating foreign-language areas in a web page; specifically, the executable program can be built into the translation system for foreign-language areas in a web page described in embodiment 2, so that the translation system for foreign-language areas in a web page can implement the method for translating foreign-language areas in a web page described in embodiment 1 by executing the built-in executable program.
[0031] In addition, the computer-readable storage medium of this embodiment may adopt any combination of one or more computer-readable storage media, wherein the computer-readable storage medium includes electrical, optical, electromagnetic, infrared or semiconductor systems, devices or components, or any combination thereof. Example 4
[0032] This embodiment provides an electronic device, such as Figure 3 As shown, the electronic device may include: a processor 1501 , a communication interface 1502 , a memory 1503 and a communication bus 1504 , wherein the processor 1501 , the communication interface 1502 , and the memory 1503 communicate with each other via the communication bus 1504 .
[0033] Memory 1503, used for storing computer programs; The processor 1501 is used to implement the steps of the method for translating a foreign language area in a web page described in the first embodiment when executing the computer program stored in the memory 1503 .
[0034] As an embodiment of the present invention, the communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0035] As an implementation mode of the present invention, the communication interface is used for communication between the above-mentioned terminal and other devices.
[0036] As an embodiment of the present invention, the memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0037] As an embodiment of the present invention, 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 gates or transistor logic devices, discrete hardware components.
[0038] It should be understood that in the various embodiments of this document, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this document.
[0039] It should also be understood that in the embodiments of this document, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this document generally indicates that the associated objects before and after are in an "or" relationship.
[0040] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this article.
[0041] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0042] In the several embodiments provided herein, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or can be electrical, mechanical or other forms of connection.
[0043] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of this article.
[0044] In addition, each functional unit in each embodiment of this invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional unit.
[0045] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this article is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of this article. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0046] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for translating foreign language areas in a web page, characterized in that: The following steps are involved: When users browse web pages, the language type of the web page is automatically detected through browser plug-ins or built-in functions; If the webpage is in English, the entire content of the webpage will be translated; If the webpage is not in full English, identify and mark the non-Chinese content in the webpage; List translation options for non-Chinese content for users to select for custom translation; According to the user's selection, the selected non-Chinese content will be translated, and the unselected content will be displayed as is; The translation results are displayed in real time, and users are allowed to switch back to the original text or reselect the translation at any time.
2. The method for translating a foreign language area in a web page according to claim 1, characterized in that: The automatic detection of the language type of a web page through a browser plug-in or a built-in function includes: analyzing the content of the web page through natural language processing technology to determine the main language type of the web page.
3. The method for translating foreign language areas in a web page according to claim 1, characterized in that: The identifying and marking of non-Chinese content in the web page includes: using a text matching algorithm and a semantic analysis technology to identify and mark the non-Chinese content in the web page, and highlighting the non-Chinese text.
4. The method for translating a foreign language area in a web page according to claim 1, characterized in that: The translation options include: automatic translation mode and manual translation mode.
5. The method for translating a foreign language area in a web page according to claim 4, characterized in that: The method of translating the selected non-Chinese content according to the user's selection and keeping the unselected content displayed as it is includes: In automatic translation mode, the corresponding translation engine is called for translation according to the language type of the webpage content; In manual translation mode, the translation is performed based on the custom translation results entered by the user or the translation suggestions provided by the system.
6. The method for translating foreign language areas in a web page according to claim 1, characterized in that: Also includes: Make translation corrections based on user evaluation of the translation results.
7. A translation system for Chinese and foreign language areas of a web page, characterized in that: include: A web page language detection module is used to detect the language type of a web page; Content identification and marking module, used to identify and mark non-Chinese content in web pages; A translation option providing module is used to list translation options for non-Chinese content and receive user selections; The translation execution module translates non-Chinese content according to user selection; The real-time display module is used to display the translation results in real time and allow the user to switch back to the original text or reselect the translation content at any time.
8. The system for translating foreign language areas in web pages according to claim 7, characterized in that: Also includes: user feedback module; The user feedback module is used to receive users' evaluation and correction suggestions on the translation results, and feed this information back to the translation engine for optimization.
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 steps of the method for translating a foreign language area in a web page according to any one of claims 1 to 6 are implemented.
10. A computer device, characterized in that: It 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 through the communication bus; wherein: The memory is used to store computer programs; The processor is used to execute the steps of the method for translating a foreign language area in a web page according to any one of claims 1 to 6 by running the program stored in the memory.