Translation method, device, storage medium and electronic device
By using the character division results on the terminal device to predict the area selected by the user, the area to be recognized is automatically determined and translated, which solves the tedious translation process caused by the user having to frame the areas one by one, and improves the convenience and efficiency of translation.
Patent Information
- Application Number
- CN202111372240.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-18
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-11-18
AI Technical Summary
In the existing technology, users need to frame the areas to be identified one by one when translating on a terminal device, which makes the translation process cumbersome, time-consuming, and lacks convenience.
By determining the character division results of the displayed page, it predicts the area that the user may select, thereby automatically determining the area to be recognized and obtaining its translation results, reducing the user's area selection operations.
It achieves rapid translation without requiring the user to fully frame the area to be identified, shortens the regional operation path during the translation process, and improves the convenience and efficiency of translation.
Smart Images

Figure CN113934501B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a translation method, device, storage medium and electronic device. Background Art
[0002] With the development of communication technology, more and more users begin to use terminals for audio and video entertainment. In the process of daily use of terminals, when users browse the information on the terminal display interface, such as encountering information that is difficult to read or understand, the process of translating this information is usually involved. Summary of the invention
[0003] The present application provides a translation method, device, storage medium and electronic device, and the technical solution is as follows:
[0004] In a first aspect, an embodiment of the present application provides a translation method, the method comprising:
[0005] Determine at least one area in a display page, wherein the at least one area is determined based on a result of dividing the characters of the display page;
[0006] Determine a to-be-recognized area from the at least one area, and obtain a translation result of a to-be-recognized character set in the to-be-recognized area;
[0007] The translation result of the character set to be recognized in the area to be recognized is displayed.
[0008] In a second aspect, an embodiment of the present application provides a translation device, the device comprising:
[0009] An area determination module, used to determine at least one area in a display page, wherein the at least one area is determined based on a result of dividing the characters of the display page;
[0010] A result acquisition module, used to determine a to-be-recognized area from the at least one area, and acquire a translation result of a to-be-recognized character set in the to-be-recognized area;
[0011] A result display module is used to display the translation result of the character set to be recognized in the area to be recognized.
[0012] In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.
[0013] In a fourth aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.
[0014] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least:
[0015] In one or more embodiments of the present application, the terminal first determines at least one area in the display page, usually the at least one area is determined based on the character division result of the display page, then determines the area to be identified from the at least one area, obtains the translation result of the character set to be identified in the area to be identified, and finally displays the translation result. The entire translation process does not require the user to frame the area to be identified one by one throughout the whole process. By predicting the area to be identified that the user may want to select from at least one area, it is possible to achieve fast translation without the user framing the translation area, which can shorten the area operation path in the translation process, save area selection time, and improve the convenience of translation. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 It is a flowchart of a translation method provided in an embodiment of the present application;
[0018] Figure 2a It is a flowchart of a translation method provided in an embodiment of the present application;
[0019] Figure 2b is a schematic diagram of a terminal display interface provided in an embodiment of the present application;
[0020] Figure 3 This is a schematic diagram of an interface for dividing regions by text paragraphs provided in an embodiment of the present application;
[0021] Figure 4 It is a flowchart of another translation method provided in an embodiment of the present application;
[0022] Figure 5 is a schematic diagram of an interface for determining a region provided in an embodiment of the present application;
[0023] Figure 6 This is a schematic diagram of an interface of an initial identification area provided in an embodiment of the present application;
[0024] Figure 7 It is a flowchart of another translation method provided in an embodiment of the present application;
[0025] Figure 8 This is a schematic diagram of an interface of a region to be identified provided in an embodiment of the present application;
[0026] Fig. 9 This is a schematic diagram of an interface for displaying translation results on a terminal provided in an embodiment of the present application;
[0027] Fig.10 is a structural schematic diagram of a translation device provided in an embodiment of the present application;
[0028] Fig.11 is a structural diagram of a region determination module provided in an embodiment of the present application;
[0029] Fig.12 is a structural diagram of a second determination unit provided in an embodiment of the present application;
[0030] Fig.13 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;
[0031] Fig.14 It is a schematic diagram of the structure of the operating system and user space provided in the embodiment of the present application;
[0032] Fig.15 yes Fig.13 The architecture diagram of the Android operating system;
[0033] Fig.16 yes Fig.13 Architecture diagram of the IOS operating system. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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 in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0035] In the description of the present application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In the description of the present application, it should be noted that, unless otherwise clearly specified and limited, "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood in specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are a kind of "or" relationship.
[0036] The present application is described in detail below with reference to specific embodiments.
[0037] In one embodiment, Figure 1 As shown, a translation method is proposed, which can be implemented by a computer program and can be run on a translation device based on the von Neumann system. The computer program can be integrated in an application or run as an independent tool application. The translation device can be a terminal, including but not limited to: a personal computer, a tablet computer, a handheld device, a vehicle-mounted device, a wearable device, a computing device or other processing device connected to a wireless modem. In different networks, terminal devices can be called different names, such as: user equipment, access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user device, cellular phone, cordless phone, 5G network or terminal in future evolution network, etc.
[0038] Specifically, the translation method includes:
[0039] S001: Determine at least one area in a display page, wherein the at least one area is determined based on a result of dividing characters of the display page.
[0040] In some scenarios, the user translates the characters in the area to be recognized in the display interface, and the area to be recognized needs to be selected by the user himself throughout the process. It can be understood that the device requires the user to accurately input the operation for selecting the area to be recognized. For example, taking the user inputting the sliding operation as an example, the user needs to maintain the sliding operation from the sliding starting point to the sliding end point, so as to complete the selection of the area to be recognized corresponding to the sliding starting point to the sliding end point. During the whole process, the user needs to accurately frame the entire area, and the operation path for selecting the corresponding translation area is too long, the area selection time is also long, and the translation process is cumbersome;
[0041] In one or more embodiments, at least one area in the display page may be pre-set when the display page is generated, and these areas are determined by the character division result of the display page. The character division result can be understood as the reference character set to be recognized set when the display page is generated, such as the reference character set to be recognized can be a reference sentence, reference paragraph, reference word, etc. in the display page. These reference character sets to be recognized are the reference character sets to be recognized that the user may select when browsing the display page after pre-recognition of character display information or understanding of character display information of the display page, so that the reference character set to be recognized is used as the character division result, and the display position of the character division result on the display interface is also the area. It can be understood that when the user triggers the translation function, the terminal obtains the area corresponding to at least one character division result based on at least one character division result set for the display page; in a specific implementation, the user can input a first trigger operation for the display page to trigger the translation function, and the terminal can respond to the first trigger operation for the display page, and then obtain at least one area in the display page, that is, based on at least one character division result set for the display page, obtain the area corresponding to at least one character division result.
[0042] .In one or more embodiments, at least one area in the display page can also be determined in real time. It can be understood that when the user triggers the translation function, the terminal determines at least one area based on the character division result of the display page; for example, the terminal recognizes or understands the character display information of the display page, and determines the reference character set to be recognized that the user may select when browsing the display page, thereby using the reference character set to be recognized as the character division result, and the display position of the character division result on the display interface is also the said area.
[0043] S002: Determine a region to be recognized from the at least one region, and obtain a translation result of a character set to be recognized in the region to be recognized.
[0044] It is understandable that the terminal can determine at least one area in the displayed page before the user triggers the translation function (or translation service) and the user has not selected or is about to select the area to be recognized, so as to predict the area to be recognized that the user may select during translation (that is, the area that the user expects to translate), and the area to be recognized can be determined from at least one area in combination with the input operation after the user triggers the translation function, and the character set to be recognized in the area to be recognized can be translated. For example, the area closest to the area to be recognized can be determined as the area to be recognized based on the operation displacement position of the user input operation after the translation function is triggered, which can save the user's time in framing the area to be recognized and save the user's time in area selection.
[0045] In some embodiments, after the user triggers the translation function (or translation service) to determine at least one area, the terminal determines the area to be identified based on the user's input operation. The user's operation of triggering the translation function and the subsequent user's input operation can be a continuous translation input operation, that is, the translation input operation corresponds to two operation processes within the operation time: one is the operation process of triggering the translation function, and the other is the process of selecting or selecting the area to be identified.
[0046] It can be understood that for the entire translation process, the user selects a certain area to be recognized for translation, and usually selects the area at a specific position in the display interface. The specific position is usually a key position of the desired recognition area, such as the initial position, the end position, the middle position, etc. In some embodiments, after the terminal detects the trigger operation of the translation function, it also obtains the operation displacement position indicated by the trigger operation.
[0047] For example, a user drags a control for translation to a specific position to be recognized and then manually selects an area to be recognized at the specific position. In this process, the user generally selects an area in the interface starting from the specific position as the area to be recognized.
[0048] In this process, by executing the translation method of the present application, the process of "manually selecting the area to be identified" by the user can be shortened. When the user triggers the translation control, the terminal determines at least one area and monitors the operation displacement position of the user's input operation at the same time (the acquisition of the operation displacement position can be the position indicated by the operation when the operation characteristic parameter falls within the reference parameter range, such as the operation force is greater than a certain force threshold, the operation dwell time is greater than a certain time threshold, the operation end position, etc.), and the terminal can determine the area closest to the operation displacement position as the area to be identified. For the user, the area to be identified usually has a high probability of covering the expected identification area that the user will manually select in the next step. It can be understood that the user can avoid selecting the expected identification area throughout the whole process, saving the user operation path of the translation and improving the efficiency of the translation.
[0049] In some embodiments, the terminal may use "the target area determined from at least one area based on the operation displacement position" as the initial recognition area, and perform a selection display process on the initial recognition area, that is, select and render the initial recognition area in a preset selection display mode, such as selecting the background of the initial recognition area, loading a selection box on the information in the initial recognition area, and so on. It can be understood that at this time, the initial recognition area usually displayed by the terminal is likely to be the area that the user expects to select and recognize. The user does not need to select the area at this time. The terminal has already predicted and displayed the recognition area expected by the user. When the user confirms the initial recognition area, the initial recognition area is the area to be recognized; further, the user can also make fine adjustments on the initial recognition area to obtain the adjusted area to be recognized. The entire process does not need to start from a specific position to select the recognition end position of the interface area as the area to be recognized.
[0050] It can be understood that the terminal determines the area to be recognized from the at least one area, obtains all characters in the area to be recognized as a character set to be recognized, and then translates the character set to be recognized to obtain a translation result.
[0051] Optionally, after the terminal determines the area to be recognized, it obtains the character set to be recognized in the area to be recognized (such as all the text as the character set to be recognized), and can call the installed translation software or corresponding translation service through the preset recognition software interface to translate and recognize the obtained character set to be recognized, wherein the corresponding recognition software interface can be a certain recognition software that is set, and the recognition software can be a recognition application installed locally on the terminal, such as Kingsoft Dictionary, Youdao Recognition, Baidu Recognition, etc., and can also be a recognition network interface of the recognition software service provided in the network, such as Google Network Recognition, Baidu Network Recognition, etc., so as to obtain the translation result.
[0052] S003: Display the translation result of the character set to be recognized in the area to be recognized.
[0053] It is understandable that the translation result can be displayed by popping up a display box in the current display interface of the terminal or in a specific display area, for example, displaying the translation result in an area around the area to be identified.
[0054] In an embodiment of the present application, the terminal first determines at least one area in the display page, usually the at least one area is determined based on the character division result of the display page, then determines the area to be identified from the at least one area, obtains the translation result of the character set to be identified in the area to be identified, and finally displays the translation result. The entire translation process does not require the user to frame the area to be identified one by one throughout the whole process. By predicting the area to be identified that the user may want to select from at least one area, it is possible to achieve fast translation without the user framing the translation area, which can shorten the area operation path in the translation process, save area selection time, and improve the convenience of translation.
[0055] See also Figure 2a , Figure 2a This is a flowchart of another embodiment of a translation method proposed in this application. Specifically:
[0056] S101: In response to a first trigger operation on a display page, divide the display page into at least one area.
[0057] It can be understood that the user can input a first trigger operation on the display page to trigger the translation function, and the terminal can respond to the first trigger operation on the display page, determine at least one character division result in the character set of the display page, and then determine the area where the character division result is located.
[0058] The first trigger operation can be understood as an identification trigger operation for the translation process, which is used to trigger the translation function of the terminal. During the input process of the first trigger operation, the user usually only needs to trigger the corresponding function control or terminal button, and the operation input time is usually shorter than the time of the aforementioned instruction for area selection. The first trigger operation can be understood as the user does not need to select the target area to be identified. In the present application, after monitoring the first trigger operation input for triggering the translation, the terminal preliminarily determines at least one area, which can be understood as the terminal predicts at least one area of the display interface that may be expected to be selected by the user based on the character display information corresponding to the character set on the display interface.
[0059] It can be understood that the area is where the terminal determines at least one character division result for the character set on the display interface based on the character display information on the display interface. The character division result corresponds to an area on the display interface, and the character division result can be understood as the predicted characters that the user may choose. The area where the character division result is located may contain character information of the current user that is unfamiliar or unfamiliar with the language predicted by the terminal, etc. For example, taking the display interface displaying an article as an example, the character set may be all or part of the characters of the article. At least one character division result is determined by the character display information corresponding to the character set (which may be character display format features, character semantic features, character paragraph features, character word and sentence features, etc.), and the character division result corresponds to an area on the display interface.
[0060] It can be understood that after the terminal detects that the user inputs the first trigger operation on the display interface, that is, responds to the first trigger operation on the display page, it then determines at least one area that the user may select for translation recognition based on the character display information in the display page.
[0061] The first trigger operation can be input on the display interface of the terminal, such as sliding, clicking, double-clicking or long pressing a certain area or a set information translation control, pressing a preset translation button, shaking the terminal to input the first trigger operation in a gesture-based manner, and so on.
[0062] In a specific implementation scenario, the terminal may have a touch screen, which may be a touch screen capable of realizing a single touch function, such as a capacitive touch screen, an electromagnetic touch screen, or a touch screen capable of realizing capacitive sensing, electromagnetic sensing, and infrared sensing at the same time. Figure 2b As shown, Figure 2b It is a schematic diagram of a terminal display interface, where the current display interface of the terminal is a "reading interface" display interface, which contains English text information, and the user can read English on the current display interface. There is a translation control for translation on the current display interface, and the translation control is displayed in a circular shape with a specified image on the display interface of the terminal's "reading interface". Schematically, if the user needs to recognize English in an area that is not understood in the display interface, the user can input a click operation on the translation control by finger touch, and the click operation can be a single click on the icon of the translation control and activate the translation function of the translation control. The understandable click operation is also the first trigger operation input by the user.
[0063] In a feasible implementation manner, the terminal determines at least one area corresponding to the character display information in the display page, which may be a semantic recognition process for the character display information corresponding to the character set in the display page, and determines at least one of the areas where the key information such as key fields, key segments, key sentences, character display formats, etc. in the character display information is located after the semantic recognition process, and determines at least one character division result based on the character display information, and takes the display position (range) of the character division result in the display interface as the area. It can be understood that the terminal determines the area where the key character information (that is, the character division result) in the character display information is located by performing semantic extraction and semantic understanding on the character display information. Usually, the display position where the character division result is located can be used as the predicted area. The number of areas can be multiple. Usually, the area where the character division result is located is often the area that the user expects to select and identify with a high probability. When the user triggers the translation function or service, the terminal determines the aforementioned at least one area, which can avoid the user from boxing the expected identification area throughout the process, saving the user operation path of the translation and improving the efficiency of the translation.
[0064] In a feasible implementation manner, the terminal determines at least one area corresponding to the character display information in the display page by identifying the paragraph features of the character display information in the display page, that is, identifying each text paragraph in the character display information, and taking the paragraph display position (range) of each text paragraph as the area.
[0065] like Figure 3 As shown, Figure 3 This is a schematic diagram of an interface for dividing regions by text paragraphs involved in this application. Figure 3 In the interface shown, the terminal improves the recognition of paragraph features of character display information in the display page to determine multiple natural paragraphs in the "reading page", and uses each natural paragraph as an area, such as area 1 corresponding to the first natural paragraph in the reading page, area 2 corresponding to the second natural paragraph...
[0066] Optionally, when determining at least one area, the terminal may display at least one area on a display interface to present the area determination process to the user in a visual form, or may not display it on the display interface.
[0067] S102: Determine a region to be identified from the at least one region.
[0068] It is understandable that the first trigger operation usually has a certain operation duration, that is, the first trigger operation, such as the user triggers the translation control and continues to drag the translation control to a certain display position. The terminal can continue to monitor the first trigger operation when the first trigger operation input is detected, and further determine at least one area based on the operation displacement position of the first trigger operation, and determine the area to be identified from at least one area based on the operation displacement position (such as the operation end position). In this way, the regional operation path is also shorter, the regional selection time can be saved, and the user does not need to accurately frame the entire regional information during the whole process; in addition, at this time, the initial recognition area determined based on the area can cover the area that the user expects to identify, if the initial recognition area has a high probability of containing the information that the user expects to identify, such as certain word segments in the initial recognition area.
[0069] S103: Determine an initial recognition area from the at least one area, and select and display the initial recognition area.
[0070] It can be understood that the aforementioned at least one area is usually determined from the character display information of the display interface. In the present application, when the user inputs the first trigger operation for triggering the translation function, the terminal can quickly determine the at least one area;
[0071] In some embodiments, after determining at least one area, the terminal determines the initial recognition area based on the operation indication position of the first trigger operation. It can be understood that when a user selects a certain area for translation, the area is usually selected at a specific position in the display interface (the specific position is also the aforementioned operation indication position). The operation indication position is usually a key position of the desired recognition area, such as the initial position, the end position, the middle position, etc. In the present application, after the terminal detects the first trigger operation, it also obtains the operation indication position of the first trigger operation. For example: the user drags the control for translation to the specific position to be identified, and then the user generally starts to select the interface area from the specific position as the area to be identified. In this process, the specific position to be identified is also the operation displacement position of the first trigger operation obtained by the terminal (the operation displacement position can be the position indicated by the operation when the operation characteristic parameter falls within the reference parameter range, such as the operation force is greater than a certain force threshold, and the operation stay time is greater than a certain time threshold). The terminal can determine the area closest to the operation indication position as the initial recognition area, and select and display the initial recognition area. The selected display processing is to select and render the initial recognition area in a preset selected display mode, such as background selection of the initial recognition area, loading a selection box for the information in the initial recognition area, etc. It can be understood that at this time, the initial recognition area displayed by the terminal is usually with a high probability the area that the user expects to select for recognition. The user does not need to select the area at this time. The terminal has already predicted and displayed the recognition area that the user expects. For example, there is no need to start from a specific position to select the recognition end position of the interface area as the area to be recognized.
[0072] In some embodiments, the terminal may display at least one area in the display interface, and determine an initial recognition area from each area. This can be understood as determining the area with the highest confidence as an initial recognition area. On the one hand, the initial recognition area is the area that the terminal predicts the user expects to select, and is displayed to the user, which can save the user from tedious operations to select the appropriate recognition area and save the operation recognition path; on the other hand, the user can directly use the displayed areas as a reference. When the initial recognition area is not the expected recognition area, other areas can be selected as the area to be recognized to improve the recognition error tolerance rate. On the one hand, the user can use the initial recognition area as a reference to adjust the area of the initial recognition area (such as fine-tuning the area) to obtain the adjusted area to be recognized.
[0073] S104: In response to a second trigger operation on the initial recognition area, determining a to-be-recognized area corresponding to the second trigger operation.
[0074] The second trigger operation can be understood as an area determination operation or an area adjustment operation for the initial recognition area predicted by the terminal. In some embodiments, the first trigger operation and the second trigger operation can be regarded as a translation operation. The first trigger operation and the second trigger operation are related, and can be understood as the translation operation input by the user including two sub-operations, the first trigger operation and the second trigger operation. For example, the first trigger operation is that the user moves the translation control to the corresponding position, and the terminal displays the initial recognition area. The second trigger operation is an area confirmation operation for the initial recognition area to confirm that the initial recognition area is the area to be recognized; or, the second trigger operation is an area adjustment operation for the initial recognition area to adjust the initial recognition area so as to accurately frame the area to be recognized.
[0075] It can be understood that the response to the second trigger operation on the initial recognition area can be understood as the user's confirmation operation on the initial recognition area predicted and displayed by the terminal, that is, confirming that the initial recognition area is the area that the user expects to recognize. At this time, the terminal determines the area to be recognized corresponding to the second trigger operation. In some embodiments, the detection of the second trigger operation can be: the terminal detects that the user has not input any human-computer interaction operation within a preset time, which can be understood as the user defaults the initial recognition area to be recognized and does not input any operation.
[0076] It can be understood that the response to the second trigger operation on the initial recognition area can also be understood as the user's area adjustment operation on the initial recognition area predicted and displayed by the terminal, such as correcting and adjusting the specifications of the area based on the initial recognition area, such as expanding or reducing the recognition range of the initial recognition area. Usually, the second trigger operation can often be understood as fine-tuning the initial recognition area. The initial recognition area can usually cover the recognition content expected by the user with a high probability. The user can make fine adjustments on this basis with a shorter area operation path. Compared with "the user inputs the recognition starting position to the recognition end position to determine the area to be recognized", the recognition operation path is greatly shortened, saving translation efficiency.
[0077] S105: Obtain translation results of the character set to be recognized in the area to be recognized, and display translation results of the character set to be recognized in the area to be recognized.
[0078] For details, please refer to the method steps of other embodiments involved in this application, which will not be repeated here.
[0079] In an embodiment of the present application, the terminal determines at least one area in the display page in response to a first trigger operation on the display page, then determines the initial recognition area corresponding to the first trigger operation in at least one area, and selects and displays the initial recognition area; then responds to a second trigger operation on the initial recognition area, and then translates and displays the character set to be recognized in the area to be recognized corresponding to the second trigger operation. The entire translation process does not require the user to frame the areas to be recognized one by one throughout the entire process. By predicting the initial recognition area that the user may want to select from at least one area and displaying it, the final area to be recognized can be determined based on the user's operation input based on the initial recognition area, which can shorten the area operation path in the recognition process, save area selection time, and improve the convenience of translation.
[0080] See also Figure 4 , Figure 4 This is a flowchart of another embodiment of a translation method proposed in this application. Specifically:
[0081] S201: Responding to a first trigger operation on a displayed page.
[0082] For details, please refer to S101, which will not be repeated here.
[0083] S202: Acquire character display information in the display page.
[0084] It can be understood that the terminal extracts character display information from all display areas of the display page.
[0085] The character display information is used by the terminal to predict the area that the user may select. In some embodiments, if the current display interface of the terminal contains information that is difficult for the user to understand or does not understand, it will involve processes such as the user translating the character display information in the terminal display interface, such as the need to identify the character set to be identified in the area to be identified that the user expects in the display interface. The character set to be identified may be sentences, paragraphs, words and other characters.
[0086] It can be understood that the terminal can use the information corresponding to the character content of all display areas of the display interface as character display information. In a specific implementation, the terminal extracts character display information from the current display page and from all display areas of the display page. In this way, the terminal uses all display content in the display interface as the character information source to predict at least one area of the display interface that may be selected by the user.
[0087] S203: Determine a target display area on the display page based on the operation displacement position of the first trigger operation, and obtain character display information in the target display area.
[0088] The size of the target display area is usually smaller than the size of the display interface. It is understandable that the terminal uses the information content in the partial display area of the display interface, that is, the target display area, as a data source to predict at least one area of the display interface that the user may want to select. In some embodiments, the amount of information processing can be saved, the time for determining the area can be saved, and the translation efficiency can be improved.
[0089] It can be understood that the terminal determines the target display area in the display page by acquiring the operation displacement characteristic parameters of the first trigger operation and determining the target display area according to the operation displacement characteristic parameters.
[0090] The operation displacement characteristic parameters include at least one of the characteristic parameters such as operation displacement position, touch force characteristic, touch direction characteristic, touch duration characteristic, touch point quantity characteristic, etc. Based on the operation displacement characteristic parameters, the target display area of the required reference information content can be accurately predicted. For example, when the touch force characteristic feedback indicates that the touch force is large, the position of the operation displacement position characteristic feedback can be used as a reference point to include most of the surrounding information content for reference, thereby determining the target display area; when the touch force characteristic feedback indicates that the touch force is large, the position of the operation displacement position characteristic feedback can be used as a reference point to include most of the surrounding information content for reference, which can be understood as setting a target area specification, for example: using the operation displacement position as a reference point to determine the target display area indicated by the target area specification; when the touch direction characteristic feedback specifies the touch direction, the position of the operation displacement position characteristic feedback can be used as a reference point to include the information content indicated by the specified touch direction for reference, which can be understood as determining a target area specification based on the reference point to determine the target display area; and so on.
[0091] In a feasible implementation, a region specification model may be trained to obtain the operation displacement characteristic parameters of the first trigger operation, input the operation displacement characteristic parameters into the trained region specification model, and output the target region specifications corresponding to the operation displacement characteristic parameters, wherein the target region specifications include region size, region shape, etc. Then, the operation displacement position is used as a reference point to determine the target display region indicated by the target region specification. It can be understood that the operation displacement position is used as a reference point, and the target region specification may indicate a target display region with reference to the reference point, such as using the reference point as the center point of the region to determine the target display region corresponding to the target region specification.
[0092] Specifically, in practical applications, the regional specification model can be a scene analysis algorithm based on deep learning, such as a convolutional neural network (CNN) model, a deep neural network (DNN) model, a recurrent neural network (RNN) model, an embedding model, a gradient boosting decision tree (GBDT) model, a logistic regression (LR) model, etc. The error back propagation algorithm is introduced on the basis of the existing neural network model for optimization, which can improve the output accuracy of the regional specification model based on the neural network model. In practical applications, an initial regional specification model can be created based on the neural network model CNN. The regional specification model is composed of a dense interconnection configuration of simple nonlinear simulation processing elements of each node in many nodes, and is a system model that imitates biological neurons. The neural network model is formed by connecting the input of at least one node with the output of each node, which is similar to the synaptic connection of a real neuron. Each neuron expresses a specific output function, the activation function, and the connection between each two neurons contains a connection strength, which is a weighted value acting on the signal passing through the connection.
[0093] In an embodiment of the present application, a large amount of sample data containing the operation displacement features (operation displacement position features, touch force features, touch direction features, touch duration features, touch point quantity features and other sample features) can be acquired in advance, the sample data can be preprocessed, the operation features in the sample data can be extracted, and based on the sample area specifications that have been marked for the sample data, the operation features can be input into the initial area specifications for training to obtain a trained area specification model, which has the ability to extract semantic features, summarize semantic feature knowledge, and learn and remember. Usually, the information or knowledge learned by the area specification model is stored in the connection matrix between each unit node.
[0094] It should be noted that the above-mentioned training process of the regional specification model can be performed on the terminal or on a server that establishes a communication connection with the terminal. For example, the server can pre-train the initial regional specification model to generate a trained regional specification model, and then push the installation package corresponding to the regional specification model to the terminal. The terminal only needs to install the installation package to obtain the trained regional specification model. No specific limitation is made here.
[0095] In an optional implementation scenario: after obtaining the operation characteristic parameters corresponding to the first trigger operation, the terminal can extract the operation displacement position in the operation characteristic parameters, and the target area specification can also be preset, that is, a region size for determination is preset, and after determining the operation displacement position, the corresponding target display area is determined based on the target area specification, and all display contents such as pictures, animations, tables, etc. are extracted from the target display area to obtain the character display information in the target display area. Thus, the character display information in the target display area is taken into reference to determine at least one target display area.
[0096] It should be noted that if the first trigger operation lasts for a period of time, the operation displacement positions usually correspond to multiple ones, and the target display area determined based on the operation displacement positions is usually updated in real time as the position of the first trigger operation changes.
[0097] S204: extracting information semantic features of the character display information, determining at least one character division result in the display page based on the information semantic features, and determining regions corresponding to the at least one character division result.
[0098] The information semantic features can be understood as the semantic attributes unique to unstructured data expressed in natural language. Taking a paper as an example, the semantic features include semantic elements such as the author's creative intent, data theme description, and underlying feature meaning. Information semantic features are multiple features that can express the semantics of the object itself and its semantics in the environment. Taking character display information as an example, information semantic features can be the order of constituent elements, sentence and field features, word order, word sentiment information, mutual information, character display format features, etc.
[0099] Among them, the constituent elements can be understood as the smallest constituent unit of a paragraph. Taking language as an example, the smallest constituent unit is the pronunciation of each word.
[0100] The word order refers to the order of words that make up a sentence (one meaning) during a call.
[0101] The emotional information of a word is the emotional meaning expressed by the word in this sentence during the call. The emotional meaning can be understood as whether the word in the sentence is high or low, commendatory or derogatory, happy or sad, etc.
[0102] Mutual information refers to the statistical independence relationship between a word or character and a category. Mutual information is often used to measure the mutuality between two objects.
[0103] Segment and field features can be understood as field or segment division features, which can provide feedback on the segment or field division position.
[0104] Character display format features can be understood as character font, character display color, character spacing, character indentation format, and the like.
[0105] It can be understood that in actual applications, the terminal performs semantic extraction and semantic understanding on the character display information, and predicts at least one character division result in the character set of the display page based on the semantics of the information, so as to determine the display position range of the character division result as the area, such as the character division result can be a keyword, a key word, a key sentence, a key paragraph, etc. The division process of the character division result at least covers the key information dimension, the word, phrase, and segment feature dimension, the grammatical feature dimension, the word frequency distribution dimension, the character display format dimension, etc. The division process of the character division result is more accurate, so as to determine the accurate area. The area where the character division result is located is often the area that the user expects to select and identify with a high probability. When the user triggers the translation function or service, the terminal determines at least one of the aforementioned areas, which can avoid the user from selecting the desired identification area throughout the process, saving the user operation path of the translation and improving the efficiency of the translation.
[0106] In actual implementation, the terminal can train the character segmentation model, pre-acquire sample feature data containing sample semantic features, pre-label the sample feature data with sample area labels, and train the initial character segmentation model based on the sample feature data with labeled sample area labels to obtain a trained character segmentation model.
[0107] The character segmentation model can be a neural network model, which is composed of a densely interconnected configuration of simple nonlinear analog processing elements of each node in many nodes, and is a system model that imitates biological neurons. The neural network model is formed by connecting the input of at least one node with the output of each node, which is similar to the synaptic connection of real neurons. Each neuron expresses a specific output function, namely the excitation function, and the connection between each two neurons contains a connection strength, namely the weighted value acting on the signal passing through the connection. In this embodiment, the sample data is input into the neural network model for training, and a trained character segmentation model can be obtained. The character segmentation model has the ability to extract key information features, summarize semantic knowledge, and learn and remember during the translation process. Usually, the information or knowledge learned by the neural network model is stored in the connection matrix between each unit node. For example, the character segmentation model can be implemented by fitting one or more models such as a Convolutional Neural Network (CNN) model, a Deep Neural Network (DNN) model, a Recurrent Neural Networks (RNN) model, an embedding model, a Gradient Boosting Decision Tree (GBDT) model, and a Logistic Regression (LR) model.
[0108] In implementation, after extracting the information semantic features of the character display information, the terminal inputs the information semantic features into the character segmentation model and outputs at least one character segmentation result for the display page, so as to determine the regions corresponding to the at least one character segmentation result.
[0109] In a feasible implementation manner, at least one reference character segment is determined in the character set of the display page based on the information semantic feature, and the area corresponding to each of the at least one reference character segment is determined, that is, the display position range of each of the reference character segments is taken as the area;
[0110] The reference character segment may be a reference sentence and / or a reference paragraph consisting of at least one character.
[0111] Optionally, the terminal can determine the reference sentences and / or reference paragraphs in the character display information based on the sentence features and field features in the semantic features of the information. It can be understood that the reference sentences and / or reference paragraphs are the aforementioned character division results, and then the display position range of each reference sentence and / or reference paragraph is used as the area.
[0112] Optionally, the terminal may also input the information semantic features into the character segmentation model, and the character segmentation model may realize the determination of the reference sentence and / or reference paragraph in the character display information, and use the reference sentence and / or reference paragraph as the region, that is, based on the character segmentation model, at least one reference sentence and / or reference paragraph in the display page may be output, so as to determine the region corresponding to the at least one reference sentence and / or reference paragraph.
[0113] like Figure 5 As shown, Figure 5 is a schematic diagram of an interface for determining a region involved in this application. Figure 5 In the interface shown, the terminal extracts information semantic features of the character display information in the display page to determine multiple reference sentences and / or reference paragraphs in the "reading page", and uses each "reference sentence and / or reference paragraph" in the character display information as a region, such as region 1 corresponding to the second sentence of the first paragraph in the reading page, region 2 corresponding to the last sentence of the second paragraph, etc.
[0114] In an optional embodiment, the terminal can determine at least one reference character word in the character set of the display page (a set of all or part of the characters in the display page) based on the semantic features of the information. The reference character word, as key information in the character display information, can be a keyword field, a word indicated by word frequency distribution information, an entity information field at the grammatical level, a subject field at the semantic level, etc.
[0115] The reference character word can be understood as a reference word composed of characters.
[0116] The terminal can also input the information semantic features into the character segmentation model. The character segmentation model can realize the recognition of the reference character words in the character display information and use the area where the reference character words are located as the area. That is, based on the character segmentation model, the display position range of at least one reference character word in the display page can be output as the area.
[0117] In a feasible implementation manner, the terminal may determine a historical display page that matches the display page, thereby obtaining a historical translation record of the historical display page;
[0118] The historical translation record includes translation data of at least one user terminal on a historical display page. In some embodiments, the display page browsed by the current user of the terminal may contain historical display pages that other users have browsed, or historical display pages of the same type as the display page; when these users browse the historical display pages, there may be a situation where the historical translation character set of a certain area is translated. Based on this, when determining the area, the present application can refer to the historical translation character set of at least one user terminal on the historical display page to determine the character division result; for example, there is a situation where multiple user terminals translate information in multiple areas on the historical display page, which usually corresponds to multiple historical translation character sets (such as historically translated words, sentences, paragraphs, etc.), then the terminal can directly use the historical translation character set as the character division result of this display page.
[0119] It can be understood that the terminal can use information semantic features (such as keywords, titles, etc.) as page identifiers for display pages. It can be understood that the terminal can request at least one historical translation record of a user visiting a historical display page from the server based on the information semantic features. The content of the historical display page and the display page can be the same or of the same type; in some embodiments, the historical display page and the display page display the same content, the difference lies in the time dimension, the historical display page is the interface of the previously displayed content, and the display interface is the interface of the current time.
[0120] After the terminal obtains the historical translation record, it obtains one or more historical translation character sets that have been historically recognized by the user terminal, and then directly uses the historical translation character set as the character division result of the current display page, thereby determining the position range of the character division result as the aforementioned area, such as determining the area where the historically translated words, historically translated sentences, historically translated paragraphs, etc. are located on the current display page.
[0121] It should be noted that the first trigger operation can be a continuous operation, that is, the first trigger operation is maintained for a period of time. During the operation time corresponding to the first trigger operation, since its operation displacement position is constantly changing, at least one area determined based on its operation displacement position can change accordingly, that is, at least one determined area moves with the operation of the first trigger operation, and each area is continuously updated.
[0122] S205: determining, in the at least one region, an initial recognition region corresponding to the first trigger operation, and performing a selection and display process on the initial recognition region;
[0123] According to some embodiments, after determining at least one area, the terminal determines the initial identification area based on the first trigger operation. In the present application, after detecting the first trigger operation, the terminal also obtains the operation displacement position indicated by the first trigger operation. It should be understood that the first trigger operation usually corresponds to multiple positions from the start of the operation to the end of the operation. In the present application, it is necessary to determine the operation displacement position with reference value, such as the specific position of the first trigger operation. The specific position can usually feedback the position of the area that the user expects to identify. The operation displacement position selection can set the reference parameter range based on the operation characteristic parameter. When the operation characteristic parameter at the position corresponding to the first trigger operation at a certain moment falls within the reference parameter range, the operation displacement position can be determined.
[0124] For example: the user drags the control for translation to a specific position to be identified. The specific position may be the position indicated by the operation when the operation characteristic parameters fall within the reference parameter range, such as the operation force is greater than a certain force threshold, the operation residence time is greater than a certain time threshold, and so on. The aforementioned "certain force threshold" and "certain time threshold" correspond to a reference parameter range.
[0125] During the translation process, the user generally starts to select an interface area from a specific position as the area to be identified. In this process, the specific position to be identified is also the operation displacement position of the first trigger operation obtained by the terminal. The terminal can determine the area closest to the operation displacement position as the initial identification area. Specifically, each area corresponds to a set of area coordinates (which can be the coordinates of the center point of the area), and the distance between the coordinates of the operation displacement position and the area coordinates indicated by each area is calculated, so that the area closest to the operation displacement position can be determined as the initial identification area.
[0126] like Figure 6 As shown, Figure 6 This is a schematic diagram of an initial identification area interface involved in this application. Figure 5 Further judgment is made on areas 1-3 in the image, and it is determined that the initial recognition area corresponding to the first trigger operation is area 2, and then the initial recognition area is selected and displayed, and the selected display processing is used for the terminal to display the predicted area to be recognized to the user.
[0127] It is understandable that the terminal performs a selection display process on the initial recognition area, and the selection display process is to select and render the initial recognition area in a preset selection display mode, such as selecting the background of the initial recognition area, loading a selection box on the information in the initial recognition area, etc. It is understandable that at this time, the initial recognition area usually displayed by the terminal is likely to be the area that the user expects to select and recognize, and the user does not need to select the area at this time, because the terminal has already predicted and displayed the recognition area that the user expects.
[0128] S206: In response to a second trigger operation on the initial recognition area, determining a to-be-recognized area corresponding to the second trigger operation.
[0129] For details, please refer to the method steps of other embodiments of the present application, which will not be repeated here.
[0130] S207: Obtain the translation result of the character set to be recognized in the area to be recognized, and display the translation result of the character set to be recognized in the area to be recognized.
[0131] For details, please refer to the method steps of other embodiments of the present application, which will not be repeated here.
[0132] In an embodiment of the present application, the entire translation process does not require the user to frame the areas to be recognized one by one throughout the entire translation process. By determining the initial recognition area from at least one area that the user is predicted to expect to select for selection and display, the final area to be recognized can be determined based on the user's recognition operation input based on the initial recognition area. This can shorten the area operation path in the recognition process, save area selection time, and improve the convenience of translation; and, means such as determining the target display area based on operation feature parameters can be adopted, thereby saving information processing volume, saving time in determining the area, and improving translation efficiency; and determining the area based on the information semantics of the character display information can achieve accurate prediction of the area to be recognized expected by the user, thereby improving translation efficiency.
[0133] See also Figure 7 , Figure 7 This is a flowchart of another embodiment of a translation method proposed in this application. Specifically:
[0134] S301: In response to a first trigger operation input to a first translation control on a display page, determining at least one area on the display page.
[0135] The control can be understood as the "encapsulation of data and methods" corresponding to the display content used to develop and build the terminal user display interface (i.e., UI interface). Certain method functions can be implemented through the control, such as providing the functions of interface elements such as windows, text boxes, buttons, and drop-down menus. Generally, controls can be divided into four types:
[0136] Imperative control: used to start a specific function. Common command controls include button controls, icon controls, hyperlink controls, etc.
[0137] Selection control: used to select options or data. Common selection controls include check box controls, list box controls, list controls, text edit controls, etc.
[0138] Entry control: used for data input. Common entry controls include spinner controls, dial controls, slider controls, etc.;
[0139] Display control: used to control "how" and "where" an application displays specific data. Commonly used display controls include text controls for displaying text and image controls for displaying images.
[0140] In the embodiments of the present application, the first translation control can be understood as a control used to implement the translation function for specified entries, texts, words, and images. Generally, the first translation control can be a command control used to start the translation function. In actual applications, the first translation control is usually displayed on the display interface of the terminal in a certain specified image (such as a circle, triangle). When the user inputs a first trigger operation on the terminal for the first translation control, the translation function of the control can be triggered, such as double-clicking, single-clicking, or long-pressing the first translation control.
[0141] In a specific implementation scenario, the first translation control of the terminal is usually displayed at a certain position on the display page, such as Figure 2b shown. In the Figure 2b shown reading page, the first translation control is the circular "Recognize" character button control. When the user needs to translate the text on the reading page, the user can input a first trigger operation on the current display page for the "circular 'Recognize' character button control", such as touching the "circular 'Recognize' character button control". The terminal responds to the first trigger operation and determines at least one area corresponding to the character display information in the display page according to the first trigger operation.
[0142] For example, when the user is reading an English text on the Figure 2b shown display interface and encounters unfamiliar words or sentences, the user can input a click operation on the first translation control by touching it with a finger. The click operation can be a single click on the icon of the first translation control to activate the first translation control, and then determine at least one area corresponding to the character display information in the display page according to the first trigger operation. For example, when the user continuously inputs the first trigger operation on the first translation control in a way of dragging the control, during the dragging process, the terminal can at least quickly determine at least one area corresponding to the character display information in the display page based on the operation touch position of the first trigger operation, and determine the initial recognition area corresponding to the first trigger operation based on the specific operation displacement position of the first trigger operation. It should be noted that during the operation of the first trigger operation, the user does not actively select or select an area as the area to be recognized throughout the process.
[0143] The immediate first trigger operation can be understood as the user triggering the first translation control, and by triggering the first translation control to a certain operation position, the intention is to select and identify the area around this position. In order to save the time of the user's next input operation to accurately select the surrounding area or shorten the identification operation path, after the first trigger operation is detected, the application determines at least one possible selected area, and after monitoring the specific operation position indicated by the first trigger operation, such as the end position of the first trigger operation, immediately determines an initial identification area with a high probability of being selected from at least one area.
[0144] S302: Determine an initial recognition area from the at least one area, and select and display the initial recognition area.
[0145] It can be understood that if the user of the terminal continues to input the first trigger operation, such as continuously inputting the first trigger operation by sliding, continuous clicking, continuous touching, etc., the first translation control will move to the position corresponding to the corresponding first trigger operation. In this process, since the position of the first trigger operation is constantly changing, the position of the first translation control is also constantly changing. Based on this, the terminal determines that at least one area based on the first trigger operation is also constantly changing. After the user completes the input of the first trigger operation, such as dragging the first translation control to a certain operation displacement position, intending to determine the area around the certain operation displacement position for translation in the next step, at this time, the terminal determines the initial recognition area corresponding to the first trigger operation from at least one area determined during the input process of the first trigger operation according to the operation displacement position indicated by the first recognition super.
[0146] S303: Controlling the second translation control to select and display the initial recognition area, and in response to a second trigger operation on the second translation control, associating the first translation control with the second translation control.
[0147] The second translation control is used to select the initial recognition area, thereby prompting the user with the area to be recognized predicted by the terminal, so that the user can determine whether the initial recognition area is accurate. Usually, the first translation control is associated with the second translation control. In some embodiments, the second translation control is used to select the information to be recognized in the initial recognition area. Figure 6 As shown, Figure 6 This is a schematic diagram of the interface of a translation control involved in this application. Figure 6 In the interface shown, a second translation control is displayed. The terminal controls the second translation control to select and display the initial recognition area. After the initial recognition area is selected and displayed, the background is gray and the border of the initial recognition area is presented in dotted line form.
[0148] In a specific implementation scenario, the terminal controls the second translation control to select and display the initial recognition area, which may be loading the second translation control corresponding to the first translation control, controlling the control display area of the second translation control to cover the initial recognition area, so as to select and display the initial recognition area, and the display area range of the second translation control is larger than the display area range of the first translation control. For example: the control display area of the second translation control may be Figure 6 The initial recognition area shown in . Loading the second translation control is mainly used to better display the area to be recognized predicted by the terminal to the user, and displaying it to the user can save the user from tedious operations to select a suitable recognition area, saving the operation recognition path.
[0149] S304: Determine the area to be recognized corresponding to the second trigger operation, and obtain the translation result of the character set to be recognized in the area to be recognized;
[0150] S305: Display the translation result of the character set to be recognized in the area to be recognized.
[0151] According to some embodiments, the second trigger operation can be understood as a confirmation operation of the user for the initial recognition area predicted and displayed by the terminal, that is, confirming that the initial recognition area is the area that the user expects to recognize. At this time, the terminal determines the area to be recognized corresponding to the second trigger operation. In some embodiments, the detection of the second trigger operation can be: the terminal detects that the user has not input any human-computer interaction operation within a preset time, which can be understood as the user defaults the initial recognition area to be recognized and does not input any operation.
[0152] According to some embodiments, the second trigger operation can be understood as a user's area correction operation for the initial recognition area predicted and displayed by the terminal, such as correcting the specifications of the area based on the initial recognition area, such as expanding or reducing the recognition range of the initial recognition area, such as Figure 8 As shown, Figure 8 This is a schematic diagram of an interface of a region to be identified involved in this application. The current user of the terminal can Figure 6 The recognition range of the initial recognition area is further narrowed based on the initial recognition area shown. Usually, the area correction operation can be understood as fine-tuning the initial recognition area. The initial recognition area can usually cover the recognition content expected by the user with a high probability. The final area to be recognized is as follows Figure 8 In the area shown in the dotted box, the user can make fine adjustments based on this initial recognition area with a shorter recognition operation path. Compared with "the user inputs the entire recognition starting position to the recognition end position to determine the area to be recognized", the recognition operation path is greatly shortened, saving translation efficiency.
[0153] It can be understood that the terminal determines the area to be recognized corresponding to the second trigger operation, and translates the character set to be recognized in the area to be recognized to obtain a translation result.
[0154] Furthermore, the acquisition of the character set to be recognized in the area to be recognized can be a text recognition method based on optical character recognition (OCR), and optical character recognition is performed on the display element information (such as text, images, icons) covered by the second translation control, that is, the character set to be recognized in the area to be recognized, and its recognition method is to obtain the display image indicated in the area to be recognized, detect the dark and light patterns of the display image to determine its character shape, and then use the character recognition method to translate the shape into computer text; that is, for the characters in the area to be recognized, use an optical method to convert the text on the area to be recognized into a black and white dot matrix image file, and use a text recognition method based on optical character recognition (OCR) to convert the text in the image into a text format (such as in the form of a character string), so as to obtain the recognized information, and then translate it, and then display the translation result. For example, in Fig. 9 middle, Fig. 9 The present invention is a schematic diagram of an interface for displaying translation results in a terminal. The terminal finds the translation result of the English information "in a certain army hospital in England". At this time, the translation is completed, the terminal cancels the icon corresponding to the loading of the translation, loads a translation result display box on the translation control, and displays the translation result "England's Army Hospital" corresponding to the English text "in a certain army hospital in England" in the translation result display box.
[0155] In an embodiment of the present application, the entire translation process does not require the user to frame the area to be recognized one by one throughout the entire translation process. By determining the initial recognition area from at least one area that the user is predicted to expect to select for selection and display, the final area to be recognized can be determined based on the user's recognition operation input based on the initial recognition area. This can shorten the area operation path in the recognition process, save area selection time, and improve the convenience of translation. In addition, translation through the visualized first translation control and the second translation control can improve the intelligence of translation, and can more intuitively display the area to be recognized predicted by the terminal, thereby improving the user experience of translation.
[0156] The following will be combined Fig.10 , the translation device provided in the embodiment of the present application is introduced in detail. It should be noted that, Fig.10 The translation device shown is used to execute the present application Figure 1 to Figure 9 For the convenience of explanation, only the part related to the embodiment of the present application is shown. For the specific technical details not disclosed, please refer to the present application. Figure 1 to Figure 9 The embodiment shown.
[0157] See also Fig.10 , which shows a schematic diagram of the structure of the translation device of the embodiment of the present application. The translation device 1 can be implemented as all or part of the user terminal through software, hardware or a combination of both. According to some embodiments, the translation device 1 includes a region determination module 11, a result acquisition module 12 and a result display module 13, which are specifically used to:
[0158] An area determination module 11, used to determine at least one area in a display page, wherein the at least one area is determined based on a result of dividing the characters of the display page;
[0159] A result acquisition module 12, configured to determine a region to be recognized from the at least one region, and to acquire a translation result of a character set to be recognized in the region to be recognized;
[0160] The result display module 13 is used to display the translation result of the character set to be recognized in the area to be recognized.
[0161] Optional, such as Fig.11 As shown, the area determination module 11 includes:
[0162] A first determining unit 111 is configured to obtain at least one area in a displayed page in response to a first triggering operation on the displayed page, and determine a to-be-identified area from the at least one area;
[0163] The second determining unit 112 is configured to divide the displayed page into at least one area in response to the first triggering operation on the displayed page, and determine the area to be identified from the at least one area.
[0164] Optionally, the second determining unit 112 is specifically configured to:
[0165] Acquire character display information in the display page; divide the display page into at least one area based on the character display information, and determine a to-be-identified area from the at least one area based on an operation end point of the first trigger operation; or
[0166] Based on the operation displacement position of the first trigger operation, a target display area is determined on the display page, and character display information in the target display area is obtained; based on the character display information, the display page is divided into at least one area, and based on the operation end point of the first trigger operation, a target to be identified is determined from the at least one area.
[0167] Optionally, the second determining unit 112 is specifically configured to:
[0168] An operation displacement position of a first trigger operation is acquired, and a target display area indicated by a target area specification is determined with the operation displacement position as a reference point.
[0169] Optional, such as Fig.12 As shown, the second determining unit 112 includes:
[0170] A feature determination subunit 1121 is used to extract information semantic features of the character display information;
[0171] The region determination subunit 1112 is configured to determine at least one character division result in the display page based on the information semantic feature, and determine regions corresponding to the at least one character division result.
[0172] Optionally, the area determination subunit 1112 is specifically configured to:
[0173] Determine at least one reference character segment in the character set of the display page based on the information semantic feature, and determine the area corresponding to each of the at least one reference character segment; and / or,
[0174] At least one reference character word is determined in the character set of the display page based on the information semantic feature, and the regions corresponding to the at least one reference character word are determined.
[0175] Optionally, the area determination subunit 1112 is specifically configured to:
[0176] acquiring a historical translation record of a historical display page based on the information semantic feature, the historical display page being associated with the display page;
[0177] At least one character division result for the display page is determined based on at least one historical translation character set in the historical translation record.
[0178] Optionally, it is characterized in that the result acquisition module 12 is specifically used to:
[0179] Determining an initial recognition area from the at least one area, and performing a selection and display process on the initial recognition area;
[0180] In response to a second trigger operation on the initial recognition area, a to-be-recognized area corresponding to the second trigger operation is determined.
[0181] Optionally, it is characterized in that the result acquisition module 12 is specifically used to:
[0182] In response to a first trigger operation input to a first translation control on the display page, determining at least one area in the display page;
[0183] The selecting and displaying the initial recognition area, in response to a second triggering operation on the initial recognition area, determining the area to be recognized corresponding to the second triggering operation, includes:
[0184] The second translation control is controlled to select and display the initial recognition area, and in response to a second trigger operation on the second translation control, the first translation control is associated with the second translation control.
[0185] Optionally, it is characterized in that the result acquisition module 12 is specifically used to:
[0186] A second translation control corresponding to the first translation control is loaded, and a control display area of the second translation control is controlled to cover the initial recognition area so as to select and display the initial recognition area, wherein the display area range of the second translation control is larger than the display area range of the first translation control.
[0187] It should be noted that the translation device provided in the above embodiment only uses the division of the above functional modules as an example when executing the translation method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the translation device provided in the above embodiment and the translation method embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0188] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0189] The present application also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figure 1 to Figure 9 The translation method of the embodiment shown in the figure can be specifically executed by referring to Figure 1 to Figure 9 The specific description of the illustrated embodiment will not be repeated here.
[0190] The present application also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor as described above. Figure 1 to Figure 9 The translation method of the embodiment shown in the figure can be specifically executed by referring to Figure 1 to Figure 9 The specific description of the illustrated embodiment will not be repeated here.
[0191] Please refer to Fig.13, which shows a block diagram of the structure of an electronic device provided by an exemplary embodiment of the present application. The electronic device in the present application may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected via the bus 150.
[0192] The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 110 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.
[0193] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable storage medium. The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The operating system may be an Android system, including a system deeply developed based on the Android system, an IOS system developed by Apple, including a system deeply developed based on the IOS system or other systems. The data storage area may also store data created by the electronic device during use, such as a phone book, audio and video data, chat record data, etc.
[0194] See also Fig.14 As shown, the memory 120 can be divided into an operating system space and a user space. The operating system runs in the operating system space, and native and third-party applications run in the user space. In order to ensure that different third-party applications can achieve good operating results, the operating system allocates corresponding system resources to different third-party applications. However, different application scenarios in the same third-party application also have different requirements for system resources. For example, in the local resource loading scenario, the third-party application has higher requirements for disk reading speed; in the animation rendering scenario, the third-party application has higher requirements for GPU performance. The operating system and third-party applications are independent of each other, and the operating system often cannot perceive the current application scenario of the third-party application in a timely manner, resulting in the operating system being unable to perform targeted system resource adaptation according to the specific application scenario of the third-party application.
[0195] In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to open up data communication between third-party applications and the operating system so that the operating system can obtain the current scenario information of third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.
[0196] Taking the Android operating system as an example, the programs and data stored in the memory 120 are as follows: Fig.15As shown, the memory 120 may store a Linux kernel layer 320, a system runtime library layer 340, an application framework layer 360 and an application layer 380, wherein the Linux kernel layer 320, the system runtime library layer 340 and the application framework layer 360 belong to the operating system space, and the application layer 380 belongs to the user space. The Linux kernel layer 320 provides underlying drivers for various hardware of electronic devices, such as display drivers, audio drivers, camera drivers, Bluetooth drivers, Wi-Fi drivers, power management, etc. The system runtime library layer 340 provides the main feature support for the Android system through some C / C++ libraries. For example, the SQLite library provides database support, the OpenGL / ES library provides 3D drawing support, and the Webkit library provides browser kernel support, etc. The Android runtime library (Android runtime) is also provided in the system runtime library layer 340, which mainly provides some core libraries that allow developers to use the Java language to write Android applications. The application framework layer 360 provides various APIs that may be used when building applications. Developers can also use these APIs to build their own applications, such as activity management, window management, view management, notification management, content provider, package management, call management, resource management, and location management. At least one application runs in the application layer 380. These applications can be native applications that come with the operating system, such as contact applications, text messaging applications, clock applications, camera applications, etc.; they can also be third-party applications developed by third-party developers, such as game applications, instant messaging applications, photo beautification applications, etc.
[0197] Taking the operating system as an IOS system as an example, the programs and data stored in the memory 120 are as follows: Fig.16As shown, the IOS system includes: a core operating system layer 420 (Core OS layer), a core service layer 440 (Core Services layer), a media layer 460 (Media layer), and a touchable layer 480 (Cocoa Touch Layer). The core operating system layer 420 includes the operating system kernel, drivers, and underlying program frameworks. These underlying program frameworks provide functions closer to the hardware for use by the program frameworks located in the core service layer 440. The core service layer 440 provides system services and / or program frameworks required by applications, such as the foundation framework, account framework, advertising framework, data storage framework, network connection framework, geographic location framework, motion framework, etc. The media layer 460 provides audio-visual interfaces for applications, such as graphics and image-related interfaces, audio technology-related interfaces, video technology-related interfaces, and wireless playback (AirPlay) interfaces for audio and video transmission technologies. The touchable layer 480 provides various commonly used interface-related frameworks for application development, and the touchable layer 480 is responsible for the user's touch interaction operations on electronic devices. For example, local notification service, remote push service, advertising framework, game tool framework, message user interface (UI) framework, user interface UIKit framework, map framework, etc.
[0198] exist Fig.16 Among the frameworks shown, the frameworks related to most applications include but are not limited to: the basic framework in the core service layer 440 and the UIKit framework in the touchable layer 480. The basic framework provides many basic object classes and data types, provides the most basic system services for all applications, and has nothing to do with UI. The classes provided by the UIKit framework are basic UI class libraries for creating touch-based user interfaces. iOS applications can provide UIs based on the UIKit framework, so it provides the basic architecture of applications for building user interfaces, drawing, processing and user interaction events, responding to gestures, etc.
[0199] Among them, the method and principle of implementing data communication between third-party applications and the operating system in the IOS system can be referred to the Android system, and this application will not go into details here.
[0200] Among them, the input device 130 is used to receive input instructions or data, and the input device 130 includes but is not limited to a keyboard, a mouse, a camera, a microphone or a touch device. The output device 140 is used to output instructions or data, and the output device 140 includes but is not limited to a display device and a speaker. In one example, the input device 130 and the output device 140 can be combined, and the input device 130 and the output device 140 are touch screen displays, which are used to receive touch operations on or near the user using any suitable object such as a finger or a touch pen, and to display the user interface of each application. The touch screen display is usually set on the front panel of the electronic device. The touch screen display can be designed as a full screen, a curved screen or a special-shaped screen. The touch screen display can also be designed as a combination of a full screen and a curved screen, or a combination of a special-shaped screen and a curved screen, which is not limited in the embodiments of the present application.
[0201] In addition, those skilled in the art will understand that the structure of the electronic device shown in the above drawings does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown, or combine certain components, or arrange the components differently. For example, the electronic device also includes radio frequency circuits, input units, sensors, audio circuits, wireless fidelity (WiFi) modules, power supplies, Bluetooth modules and other components, which will not be described in detail here.
[0202] In the embodiment of the present application, the execution subject of each step may be the electronic device described above. Optionally, the execution subject of each step is the operating system of the electronic device. The operating system may be an Android system, an IOS system, or other operating systems, which is not limited in the embodiment of the present application.
[0203] The electronic device of the embodiment of the present application may also be equipped with a display device, which may be any device capable of realizing a display function, such as a cathode ray tube display (CR), a light-emitting diode display (LED), an electronic ink screen, a liquid crystal display (LCD), a plasma display panel (PDP), etc. The user may use the display device on the electronic device 101 to view displayed text, images, videos and other information. The electronic device may be a smart phone, a tablet computer, a gaming device, an AR (Augmented Reality) device, a car, a data storage device, an audio playback device, a video playback device, a notebook, a desktop computing device, a wearable device such as an electronic watch, an electronic glasses, an electronic helmet, an electronic bracelet, an electronic necklace, electronic clothing and other devices.
[0204] exist Fig.13 In the electronic device shown, where the electronic device may be a terminal, the processor 110 may be used to call an application stored in the memory 120 and specifically perform the following operations:
[0205] Determine at least one area in a display page, wherein the at least one area is determined based on a result of dividing the characters of the display page;
[0206] Determine a to-be-recognized area from the at least one area, and obtain a translation result of a to-be-recognized character set in the to-be-recognized area;
[0207] The translation result of the character set to be recognized in the area to be recognized is displayed.
[0208] In one embodiment, when the processor 1001 performs the step of determining at least one area in the display page, the processor 1001 specifically performs the following operations:
[0209] In response to a first trigger operation on a display page, obtaining at least one area in the display page, and determining a to-be-identified area from the at least one area; or,
[0210] In response to a first trigger operation on a display page, the display page is divided into at least one area, and a to-be-identified area is determined from the at least one area.
[0211] In one embodiment, when the processor 1001 divides the display page into at least one area and determines the area to be identified from the at least one area, the processor 1001 specifically performs the following operations:
[0212] Acquire character display information in the display page; divide the display page into at least one area based on the character display information, and determine the area to be identified from the at least one area based on the operation end point of the first trigger operation; or,
[0213] Based on the operation displacement position of the first trigger operation, a target display area is determined on the display page, and character display information in the target display area is obtained; based on the character display information, the display page is divided into at least one area, and based on the operation end point of the first trigger operation, an area to be identified is determined from the at least one area.
[0214] In an embodiment, when the processor 1001 determines the target display area on the display page based on the operation displacement position of the first trigger operation, the processor 1001 specifically performs the following operations:
[0215] An operation displacement position of a first trigger operation is acquired, and a target display area indicated by a target area specification is determined with the operation displacement position as a reference point.
[0216] In one embodiment, when the processor 1001 divides the display page into at least one area based on the character display information, the processor 1001 specifically performs the following operations:
[0217] The information semantic feature of the character display information is extracted, at least one character division result in the display page is determined based on the information semantic feature, and the areas respectively corresponding to the at least one character division result are determined.
[0218] In one embodiment, when the processor 1001 determines at least one character division result in the display page based on the information semantic feature and determines the areas corresponding to the at least one character division result, the processor 1001 specifically performs the following operations:
[0219] Determine at least one reference character segment in the character set of the display page based on the information semantic feature, and determine the area corresponding to each of the at least one reference character segment; and / or,
[0220] At least one reference character word is determined in the character set of the display page based on the information semantic feature, and the regions corresponding to the at least one reference character word are determined.
[0221] In one embodiment, when the processor 1001 determines at least one character segmentation result in the displayed page based on the information semantic feature, the processor 1001 specifically performs the following operations:
[0222] acquiring a historical translation record of a historical display page based on the information semantic feature, the historical display page being associated with the display page;
[0223] At least one character division result for the display page is determined based on at least one historical translation character set in the historical translation record.
[0224] In an embodiment, when the processor 1001 performs the step of determining the area to be identified from the at least one area, the processor 1001 specifically performs the following operations:
[0225] Determining an initial recognition area from the at least one area, and performing a selection and display process on the initial recognition area;
[0226] In response to a second trigger operation on the initial recognition area, a to-be-recognized area corresponding to the second trigger operation is determined.
[0227] In one embodiment, when the processor 1001 executes the step of determining at least one area in the display page, the processor 1001 specifically performs the following operations:
[0228] In response to a first trigger operation input to a first translation control on the display page, determining at least one area in the display page;
[0229] The selecting and displaying the initial recognition area, in response to a second triggering operation on the initial recognition area, determining the area to be recognized corresponding to the second triggering operation, includes:
[0230] The second translation control is controlled to select and display the initial recognition area, and in response to a second trigger operation on the second translation control, the first translation control is associated with the second translation control.
[0231] In one embodiment, when the processor 1001 executes the process of controlling the second translation control to select and display the initial recognition area, the processor 1001 specifically performs the following operations:
[0232] A second translation control corresponding to the first translation control is loaded, and a control display area of the second translation control is controlled to cover the initial recognition area so as to select and display the initial recognition area, wherein the display area range of the second translation control is larger than the display area range of the first translation control.
[0233] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0234] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A translation method, characterized in that: The method comprises: Before the user triggers the translation function and the user does not select the area to be recognized, determining at least one area in the display page, wherein the at least one area is a pre-set area determined based on the character segmentation result of the display page or the at least one area is an area that the user expects to select and recognize when the user triggers the translation function based on the character segmentation result of the display page; Determine the area to be recognized selected by the user from the at least one area, and obtain the translation result of the character set to be recognized in the area to be recognized; Displaying the translation result of the character set to be recognized in the area to be recognized; Before determining the area to be recognized selected by the user from the at least one area, the method further includes: determining an initial recognition area that the user wishes to select from the at least one area, and performing selection and display processing on the initial recognition area.
2. The method according to claim 1, characterized in that The step of determining at least one area in the display page and determining the area to be identified selected by the user from the at least one area includes: In response to a first trigger operation on a displayed page, obtaining at least one area in the displayed page, and determining the area to be identified selected by the user from the at least one area; or, In response to a first trigger operation on a displayed page, the displayed page is divided into at least one area, and a to-be-identified area selected by a user is determined from the at least one area.
3. The method according to claim 2, characterized in that The step of dividing the displayed page into at least one area and determining the area to be identified selected by the user from the at least one area includes: Acquire character display information in the display page; divide the display page into at least one area based on the character display information, and determine the area to be identified selected by the user from the at least one area based on the operation end point of the first trigger operation; or, Based on the operation displacement position of the first trigger operation, a target display area is determined on the display page, and character display information in the target display area is obtained; based on the character display information, the display page is divided into at least one area, and based on the operation end point of the first trigger operation, the area to be identified selected by the user is determined from the at least one area.
4. The method according to claim 3, characterized in that The determining of the target display area on the display page based on the operation displacement position of the first trigger operation includes: An operation displacement position of a first trigger operation is acquired, and a target display area indicated by a target area specification is determined with the operation displacement position as a reference point.
5. The method according to claim 3, characterized in that: The dividing the display page into at least one area based on the character display information comprises: The information semantic feature of the character display information is extracted, at least one character division result in the display page is determined based on the information semantic feature, and the areas respectively corresponding to the at least one character division result are determined.
6. The method according to claim 5, characterized in that The determining at least one character division result in the display page based on the information semantic feature, and determining the areas corresponding to the at least one character division result respectively, comprises: Determine at least one reference character segment in the character set of the display page based on the information semantic feature, and determine the area corresponding to each of the at least one reference character segment; and / or, At least one reference character word is determined in the character set of the display page based on the information semantic feature, and the regions corresponding to the at least one reference character word are determined.
7. The method according to claim 5, characterized in that The determining at least one character division result in the displayed page based on the information semantic feature includes: acquiring a historical translation record of a historical display page based on the information semantic feature, the historical display page being associated with the display page; At least one character division result for the display page is determined based on at least one historical translation character set in the historical translation record.
8. The method according to claim 1, characterized in that The step of determining the area to be identified selected by the user from the at least one area includes: In response to a second trigger operation on the initial recognition area, a user-selected area to be recognized corresponding to the second trigger operation is determined.
9. The method according to claim 8, characterized in that The determining at least one area in the display page includes: determining at least one area in the display page in response to a first trigger operation input to a first translation control on the display page; The selecting and displaying the initial recognition area includes: controlling the second translation control to select and display the initial recognition area; In response to a second trigger operation on the initial recognition area, determining the area to be recognized selected by the user corresponding to the second trigger operation includes: in response to a second trigger operation on the second translation control, determining the area to be recognized selected by the user corresponding to the second trigger operation, and the first translation control is associated with the second translation control.
10. The method according to claim 9, characterized in that The controlling the second translation control to select and display the initial recognition area includes: A second translation control corresponding to the first translation control is loaded, and a control display area of the second translation control is controlled to cover the initial recognition area so as to select and display the initial recognition area, wherein the display area range of the second translation control is larger than the display area range of the first translation control.
11. A translation device, characterized in that: The device comprises: A region determination module, used for determining at least one region in a display page before a user triggers a translation function and the user does not select a region to be identified, wherein the at least one region is a pre-set region determined based on a result of character segmentation of the display page or the at least one region is a region that the user expects to select and identify when the user triggers the translation function based on a predicted result of character segmentation of the display page; A result acquisition module, used to determine the to-be-recognized area selected by the user from the at least one area, and acquire the translation result of the to-be-recognized character set in the to-be-recognized area; A result display module, used for displaying the translation result of the character set to be recognized in the area to be recognized; Before determining the area to be identified from the at least one area, the result acquisition module is further used to: determine an initial identification area that the user wants to select from the at least one area, and perform selection and display processing on the initial identification area.
12. A computer storage medium, characterized in that: The computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method steps as claimed in any one of claims 1 to 10.
13. An electronic device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps as claimed in any one of claims 1 to 10.
