WO2021052458A1 - 机器翻译的方法和电子设备 - Google Patents

机器翻译的方法和电子设备 Download PDF

Info

Publication number
WO2021052458A1
WO2021052458A1 PCT/CN2020/116128 CN2020116128W WO2021052458A1 WO 2021052458 A1 WO2021052458 A1 WO 2021052458A1 CN 2020116128 W CN2020116128 W CN 2020116128W WO 2021052458 A1 WO2021052458 A1 WO 2021052458A1
Authority
WO
WIPO (PCT)
Prior art keywords
content
user
translation
user interface
picture
Prior art date
Application number
PCT/CN2020/116128
Other languages
English (en)
French (fr)
Inventor
陆文俊
柯尊伟
兀玉洁
彭勇
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP20864367.6A priority Critical patent/EP4033394A4/en
Priority to CN202080066200.0A priority patent/CN114503116A/zh
Priority to US17/762,169 priority patent/US11847314B2/en
Priority to JP2022517924A priority patent/JP2022549236A/ja
Priority to BR112022005108A priority patent/BR112022005108A2/pt
Publication of WO2021052458A1 publication Critical patent/WO2021052458A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • G06F3/04883Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures for inputting data by handwriting, e.g. gesture or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0485Scrolling or panning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0482Interaction with lists of selectable items, e.g. menus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0483Interaction with page-structured environments, e.g. book metaphor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/42Data-driven translation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/58Use of machine translation, e.g. for multi-lingual retrieval, for server-side translation for client devices or for real-time translation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • G06F9/454Multi-language systems; Localisation; Internationalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2203/00Indexing scheme relating to G06F3/00 - G06F3/048
    • G06F2203/048Indexing scheme relating to G06F3/048
    • G06F2203/04808Several contacts: gestures triggering a specific function, e.g. scrolling, zooming, right-click, when the user establishes several contacts with the surface simultaneously; e.g. using several fingers or a combination of fingers and pen
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Definitions

  • This application relates to the field of artificial intelligence, and more specifically, to a method and electronic device for machine translation.
  • Text translation is currently widely used in many types of electronic devices such as mobile phones, tablet computers, and personal computers (PC), providing users with convenient translation services.
  • the text translation includes a translation method based on a single picture.
  • a translation method based on a single picture.
  • the user takes a photo of a page of a foreign language book or wants to translate the content of the current page while watching a foreign language news application (application, APP)
  • the user needs to Take a screenshot of the page content, and then enter the picture obtained after the screenshot in the translation APP to obtain the translation result.
  • the user is watching a relatively long news post, the user is required to continuously take screenshots in the news app, and then switch to the translation app to input the corresponding picture to get the translation result. Only by repeating this procedure can you complete the reading of a foreign news post. This method will bring users cumbersome operations, poor user experience, and low efficiency.
  • This application provides a method and electronic device for machine translation, involving the fields of artificial intelligence, natural language processing, and machine translation, and helps to improve the intelligence and user experience of electronic devices.
  • a machine translation method is provided.
  • the method is applied to an electronic device with a touch screen.
  • the method includes: the electronic device displays a first user interface on the touch screen, the first user interface including first content, and The language of the first content is the first language; the electronic device detects a first operation on the first user interface, and the first operation includes a user operation triggered by the user to perform scrolling translation; the electronic device responds to the first operation from the The first position of the first user interface starts to scroll the screenshot; in the process of scrolling the screenshot, when the second operation of the user is detected on the second user interface, or when the second user interface is scrolled to the end position , Stop scrolling the screenshot at the second position of the second user interface, the electronic device obtains the first picture, the first picture is the picture corresponding to the second content, and the second content includes the image from the first position to the second position Content, the language of the second content is the first language; the electronic device automatically obtains the translation result of the second content according to the first picture, and the language of the
  • the user when the user wants to view the translated content corresponding to the original content on the electronic device, he can trigger the scrolling translation user operation to cause the electronic device to perform a scrolling screenshot, and then obtain the translated content corresponding to the original content obtained by the scrolling screenshot.
  • This can avoid the user’s cumbersome operation when viewing the translation, and one scrolling translation can get multi-screen translation content, which is convenient for users to browse, which helps to improve the intelligence of electronic equipment, and also helps users to view the translation. Time user experience.
  • the method further includes: the electronic device detects a third operation on a fourth user interface, the fourth user interface including the end of the translation result of the second content Part, the third operation includes a user operation triggered by the user to perform scrolling translation; in response to the third operation, the electronic device automatically displays the fifth user interface, and scrolls the screenshot from the third position of the fifth user interface, the fifth The user interface includes third content, the third location is associated with the first picture, and the language of the third content is the first language; during the process of scrolling the screenshot, when the user’s first position is detected on the sixth user interface During the fourth operation, or when scrolling to the end position, stop scrolling the screenshot at the fourth position of the sixth user interface, and the electronic device obtains the second picture, which is the picture corresponding to the fourth content, and the fourth content It includes content from the third position to the fourth position, and the language of the fourth content is the first language; the electronic device automatically obtains the translation result of the fourth content according to the second
  • the method further includes: the electronic device detects a fifth operation on an eighth user interface, the eighth user interface including the end of the translation result of the second content
  • the fifth operation includes a user operation triggered by the user to continue translation; the electronic device automatically obtains the translation result of the fifth content in response to the fifth operation, and the fifth content includes all content corresponding to the first language except for the first language.
  • the language of the translation result of the fifth content is the second language; after automatically acquiring part or all of the translation result of the fifth content, the electronic device automatically displays the ninth user interface Or, after receiving the sliding operation of the user, a ninth user interface is displayed, and the ninth user interface includes part or all of the translation result of the fifth content.
  • the user when the user wants to view more translation content after scrolling translation for the first time, then the user can trigger to continue the translation, and the electronic device can jump to the original interface to automatically obtain more original content for translation to get more It is also possible that the electronic device does not need to jump to the original interface, but automatically loads more translated content in the background, so as to display more translated content to the user, which is convenient for the user to browse.
  • the method further includes: in response to the fifth operation, automatically taking a screenshot to obtain a third picture, where the third picture is a picture corresponding to the fifth content.
  • the automatic screenshot may be a screenshot or a scrolling screenshot.
  • the automatically acquiring the translation result of the fifth content includes: the electronic device sends the third picture or a picture corresponding to a part of the third picture to the server; the electronic device Receiving the translation result of the third picture or the picture corresponding to a part of the third picture returned by the server.
  • the electronic device after acquiring the third picture, sends the third picture to the server, or sends a part of the corresponding picture in the third picture to the server, and the server will either send the original content displayed on the third picture or
  • the server translates the original content displayed on the picture corresponding to a part of the third picture to obtain the translation result; the server may send the translation result to the electronic device, so that the electronic device displays the translation result to the user.
  • the third picture or a part of the corresponding pictures in the third picture may include multi-screen pictures. Compared with the prior art, which can only send one screen of pictures at a time, the efficiency of translation can be improved, thereby improving the user experience. User experience when browsing translations.
  • the automatic screenshot to obtain the third picture includes automatic screenshot of one or more screens of content to obtain the third picture, and the automatic screenshot process is visible or invisible to the user.
  • the electronic device can take a screenshot of the content of a screen by taking a screenshot.
  • the electronic device can also take screenshots of multi-screen content by scrolling the screenshot.
  • the automatic screenshot process may not be visible to the user.
  • the user obtains the translation through full-screen translation or scrolling translation for the first time, if he wants to continue to view more translations, he can directly trigger the continued translation to obtain more translations. There is no need to jump to the process of displaying screenshots of the original text or scrolling the screenshots. You can view more translations directly on the basis of the previous translation, which can further improve the user experience of the user when browsing the translation.
  • the method before the automatic acquisition of the translation result of the second content, the method further includes: the electronic device automatically divides the first picture into multiple pictures; wherein, The third position is related to a specific position in the last picture of the plurality of pictures, and the specific position is: the start position or the end position or the middle position of the last picture or the position of a predetermined ratio; or, the last picture The starting position of the last paragraph or the starting position of the last n lines in a picture, n is a positive integer, and n is greater than or equal to 1.
  • the electronic device starts a long screen capture on the page currently displaying the first language (also called the original text) and automatically scrolls down. During the period, the electronic device stops the long screen capture when the user can tap the screen; The page displays the text data that has been translated into the second language (also called the translation), and the user can swipe up and down to view; then, the user can directly choose to continue to view the following content on the translation page (a scrolling translation button is provided on this page for the user Click).
  • the first language also called the original text
  • the electronic device stops the long screen capture when the user can tap the screen;
  • the page displays the text data that has been translated into the second language (also called the translation), and the user can swipe up and down to view; then, the user can directly choose to continue to view the following content on the translation page (a scrolling translation button is provided on this page for the user Click).
  • the user After the user clicks the scrolling translation button again, the user will jump to the original page and jump to the place where the original text stopped the long screenshot last time (the electronic device has memorized this position), and the electronic device can stop from the last time Near the location of the long screenshot (or the first few lines of the location, by retaining some redundancy of the content, so that the user can recall where they were last read), start the scrolling screenshot and translate again.
  • This method is not limited to web-based browser client translation, but can also be used in non-browser scenarios such as third-party information APPs, which greatly expands the applicable scenarios and also ensures the continuity of the user's reading experience.
  • the automatically obtaining the translation result of the second content includes: the electronic device sends the plurality of pictures to the server; the electronic device receives the server for each of the plurality of pictures The translation result of a picture; the electronic device composes the translation result of some pictures in the multiple pictures as part of the translation result of the second content, or composes the translation result of all the pictures in the multiple pictures as part of the second content Translation results.
  • the first picture after the electronic device obtains the first picture, the first picture can be divided into multiple pictures and sent to the server for translation; the server can send the translation results of the multiple pictures to the electronic device, thereby The electronic device displays the translation result to the user.
  • the first picture may include multiple pictures. Compared with the prior art, which can only send one screen of pictures at a time, the efficiency of translation can be improved, thereby improving the user experience of the user when browsing the translated text.
  • associating the third position with the first picture includes: the third position is related to a specific position in the first picture, and the specific position is: The end position or the middle position or the predetermined ratio of the first picture; or, the start position of the last segment or the start position of the last n lines in the first picture, n is a positive integer, and n is greater than or equal to 1.
  • the electronic device may segment the first picture, or may not switch the first picture.
  • the starting position of the second scrolling screenshot may be related to the first picture.
  • associating the third position with the first picture includes: the third position is related to the second content, wherein the third position is related to the second content The end position or the middle position of the content or a predetermined proportion of the position is related; or, the third position is related to the start position of the last paragraph or the start position of the last n lines in the second content, n is a positive integer, n is greater than or Equal to 1.
  • the electronic device may segment the first picture, or may not switch the first picture.
  • the starting position of the second scrolling screenshot may be related to the second content displayed on the first picture.
  • the automatically obtaining the translation result of the second content includes: sending the first picture or a picture corresponding to a part of the first picture to a server; receiving the The translation result of the first picture or the picture corresponding to a part of the first picture returned by the server.
  • the translation result of the second content includes that the text content obtained after the first picture is subjected to OCR text recognition is performed from the first language to the The content obtained after translation in the second language.
  • the electronic device can determine whether to cut the text or picture through OCR. If the mobile phone determines that the text or picture will be cut at the segmentation position, the segmentation position can be moved up to the blank line position.
  • the electronic device sends the text content obtained through OCR to the server, and the server can translate the corresponding text content.
  • the automatically acquiring the translation result of the second content includes: the electronic device sends the first picture or the picture corresponding to a part of the first picture to the server; The electronic device receives the translation result of the first picture or the picture corresponding to a part of the first picture returned by the server.
  • the translation result of the second content includes that the text content obtained after the first picture is subjected to OCR text recognition is performed from the first language to the The content obtained after translation in the second language.
  • the electronic device can determine whether to cut the text or picture through OCR. If the mobile phone determines that the text or picture will be cut at the segmentation position, the segmentation position can be moved up to the blank line position.
  • OCR text recognition can be performed by an electronic device, and text translation can be performed by a server; alternatively, OCR text recognition and text translation can be performed by a server; alternatively, OCR text recognition and text translation can also be performed by the server. It can be done by the same or different servers together.
  • the method further includes: displaying first prompt information at or near the third position, the first prompt information being used to prompt the user to scroll the screenshot And/or, displaying second prompt information at or near the second position, and the second prompt information is used to prompt the user to read the second position last time.
  • the user can become familiar with the content of the original text in the second scrolling screenshot before reading the translated text of the second scrolling screenshot, which will remind the user and assist in the continuity.
  • the role of reading is the case familiar with the content of the original text in the second scrolling screenshot before reading the translated text of the second scrolling screenshot, which will remind the user and assist in the continuity. The role of reading.
  • the first operation includes the user clicking the first control that can trigger the scrolling translation function or the user inputting a voice command that can trigger the scrolling translation function.
  • the third operation includes the user clicking the first control that can trigger the scrolling translation function or the user inputting a voice command that can trigger the scrolling translation function.
  • the method further includes: after receiving a user's sliding operation on the third user interface, displaying a tenth user interface, the tenth user interface including and The subsequent translation result associated with the translation result included on the third user interface.
  • the method further includes: before the detection of the third operation, the method further includes: displaying on the fourth user interface a screen that can trigger scrolling translation Control.
  • the method further includes: before the detection of the fifth operation, the method further includes: displaying a control that can trigger continued translation on the eighth user interface .
  • the method further includes: detecting a first operation on the first user interface, including: detecting a user's multi-finger on the first user interface After the pressing operation, a plurality of functional controls are displayed, the plurality of functional controls include a first control that can trigger a scrolling translation; it is detected that the user clicks on the first control or the user inputs a voice command that can trigger the scrolling translation function.
  • the second content includes a part or all of the first content and all content corresponding to the first language other than the first content.
  • the third content includes a part of all content corresponding to the first language other than the second content
  • the fourth content includes the first Part or all of the content corresponding to the language other than the second content.
  • the method further includes: after receiving a user's sliding operation on the ninth user interface, displaying the eleventh user interface, and the eleventh user interface is displayed on the eleventh user interface.
  • the subsequent translation result associated with the translation result included on the ninth user interface is included.
  • a machine translation method is provided.
  • the method is applied to an electronic device with a touch screen.
  • the method includes: the electronic device displays a first user interface on the touch screen, and the first user interface includes first content, The language of the first content is the first language; the electronic device detects a user's first operation on the first user interface, and the first operation includes a user operation that the user triggers a full-screen translation; the electronic device responds to the first operation, Obtain the first picture obtained by taking a screenshot of the first user interface; the electronic device automatically obtains the translation result of the first content according to the first picture, and the language of the translation result of the first content is the second language; the electronic device is in After automatically acquiring the translation result of the first content, the second user interface is automatically displayed, and the second user interface includes part or all of the translation result of the first content; the electronic device detects the user's first content on the second user interface Second operation, the second operation includes a user operation triggered by the user to perform scrolling translation; in response to the second operation,
  • a process of performing full-screen translation first and then scrolling translation is provided.
  • the user can perform full-screen translation first, and the scrolling translation controls can be displayed on the translation interface of the full-screen translation, and then the user can perform scrolling translation.
  • users can first determine whether they are interested in the original content after performing full-screen translation. If they are interested, they can perform scrolling translation to view more translated content; if they are not interested in the original content, the user can stop reading the current content. The original text, and then find the original text you are interested in.
  • the second content and the first content may be the same; or, the second content includes a part of the first content.
  • the method before the automatic acquisition of the translation result of the third content, the method further includes: the electronic device automatically divides the second picture into multiple pictures; the electronic device Send the multiple pictures to the server; the electronic device receives the server's translation result of each of the multiple pictures; the electronic device composes the translation results of some of the multiple pictures into a part of the translation result of the third content, Or, the translation results of all the pictures in the multiple pictures constitute the translation result of the third content.
  • the translation result of the third content includes that the text content obtained after the second picture is subjected to OCR text recognition is performed from the first language to the second language The content obtained after translation.
  • the electronic device can determine whether to cut the text or picture through OCR. If the mobile phone determines that the text or picture will be cut at the segmentation position, the segmentation position can be moved up to the blank line position.
  • the electronic device sends the text content obtained through OCR to the server, and the server can translate the corresponding text content.
  • the method further includes: the electronic device displays first prompt information at or near the first position, and the first prompt information is used to prompt the user Scroll the starting position of the screenshot; and/or, the electronic device displays second prompt information at the end position of the first picture, and the second prompt information is used to prompt the user to read the end position last time.
  • the user can be familiar with the content of the original text in the second scrolling screenshot before reading the translation of the second scrolling screenshot, which is useful to the user Certain memory evokes and assists continuous reading.
  • the second operation includes the user clicking on the first control that can trigger the scrolling translation function or the user inputting a voice command that can trigger the scrolling translation function.
  • the first position is associated with the first picture, including: the first position is related to a specific position in the first picture, wherein the specific position Is: the end position or the middle position of the first picture or the position of a predetermined proportion; or, the start position of the last paragraph or the start position of the last n lines in the first picture, n is a positive integer, n is greater than or equal to 1 .
  • the first position is associated with the first picture, including: the first position and the end position or the middle position of the first content or the position of a predetermined ratio Related; or, the first position is related to the starting position of the last paragraph or the starting position of the last n lines in the first content, n is a positive integer, and n is greater than or equal to 1.
  • the electronic device can take a certain position (or several lines before that position) on the first picture obtained from the last screenshot, and by retaining some redundancy of content, the user can recall where he read the last time.
  • Start scrolling screenshots and translate This method is not limited to web-based browser client translation, but can also be used in non-browser scenarios such as third-party information APPs, which greatly expands the applicable scenarios and also ensures the continuity of the user's reading experience.
  • the method further includes: after receiving a user's sliding operation on the fifth user interface, the electronic device displays a sixth user interface, and the sixth user interface is displayed on the sixth user interface.
  • the subsequent translation result associated with the translation result included on the fifth user interface is included.
  • the method before the second operation of the user is detected on the second user interface, the method further includes: the electronic device displays on the second user interface that can trigger Controls for scrolling translation.
  • the detecting the first operation of the user on the first user interface includes: the electronic device detects the user's multi-finger pressing on the first user interface After the operation, multiple functional controls are displayed.
  • the multiple functional controls include a first control that can trigger a full-screen translation; the electronic device detects that the user clicks on the first control or the user inputs a voice command that can trigger the full-screen translation function.
  • the automatically acquiring the translation result of the second content includes: the electronic device sends the second picture or the picture corresponding to a part of the second picture to the server; The electronic device receives the translation result of the second picture or the picture corresponding to a part of the second picture returned by the server.
  • a machine translation method is provided, the method is applied to an electronic device with a touch screen, the method includes: the electronic device displays a first user interface on the touch screen, and the first user interface includes first content, The language of the first content is the first language; the electronic device detects a user's first operation on the first user interface, and the first operation includes a user operation that the user triggers a full-screen translation; the electronic device responds to the first operation, Take a screenshot of the first user interface to obtain the first picture; the electronic device automatically obtains the translation result of the first content according to the first picture, and the language of the translation result of the first content is the second language; the electronic device is automatically acquiring After the translation result of the first content, a second user interface is automatically displayed, and the second user interface includes part or all of the translation result of the first content; the electronic device detects the user's second operation on the second user interface , The second operation includes a user operation triggered by the user to continue translation; in response to the second operation, the translation result of the
  • the electronic device can provide the user with a control to continue translation.
  • the electronic device detects that the user clicks the control to continue translation, it can directly load the translation corresponding to the remaining original text in the background All or part of. In this way, there is no need for the electronic device to jump to the original interface for scrolling screenshots, which can further enhance the user experience of the user when reading the translated text.
  • the method further includes: in response to the second operation, automatically taking a screenshot to obtain a second picture, the second picture being a picture corresponding to the second content; the automatic Obtaining the translation result of the second content includes: automatically acquiring the translation result of the second content according to the second picture.
  • the automatically acquiring the translation result of the second content includes: the electronic device sends the second picture or a picture corresponding to a part of the second picture to the server; the electronic device Receive the translation result of the second picture or the picture corresponding to a part of the second picture returned by the server.
  • the automatic screenshot to obtain the second picture includes: the electronic device automatically captures the content of one or more screens to obtain the second picture, and the automatic screenshot process is visible or visible to the user. Invisible.
  • the electronic device may not jump to the original text interface to take the screenshot, but may automatically load part or all of the translations corresponding to the remaining original texts in the background, avoiding the difference between the original text and the translated text. The impact of inter-jumping on users.
  • the automatic acquisition of the translation result of the second content includes: the electronic device automatically divides the second picture into multiple pictures; the electronic device sends the multiple pictures to the server The electronic device receives the translation result of each of the multiple pictures by the server; the electronic device composes the translation results of some of the multiple pictures into a part of the translation result of the second content, or the multiple pictures The translation result of all pictures in the picture constitutes the translation result of the second content.
  • the second operation includes the user clicking on the first control that can trigger the continued translation function or the user inputting a voice command that can trigger the continued translation function.
  • the method further includes: after receiving a user's sliding operation on the third user interface, the electronic device displays a fourth user interface, and the fourth user interface is displayed on the fourth user interface.
  • the subsequent translation result associated with the translation result included on the third user interface is included.
  • the method before the first operation of the user is detected on the first user interface, the method further includes: displaying on the first user interface that the electronic device can trigger Controls for full-screen translation.
  • the method before the second operation of the user is detected on the second user interface, the method further includes: displaying on the second user interface that it can trigger continued translation Controls.
  • detecting the first operation of the user on the first user interface includes: after detecting the user's multi-finger pressing operation on the first user interface, A plurality of functional controls are displayed, the plurality of functional controls include a first control that can trigger a full-screen translation; it is detected that the user clicks on the first control or the user inputs a voice command that can trigger the full-screen translation function.
  • a device in a fourth aspect, is provided, the device is included in an electronic device, and the device has the function of realizing the above aspects and the behavior of the electronic device in the possible implementation manners of the above aspects.
  • the function can be realized by hardware, or the corresponding software can be executed by hardware.
  • the hardware or software includes one or more modules or units corresponding to the above-mentioned functions.
  • an electronic device including: a touch screen; one or more processors; a memory; and one or more computer programs.
  • one or more computer programs are stored in the memory, and the one or more computer programs include instructions.
  • the electronic device is caused to execute the machine translation method in any one of the possible implementations of the first aspect, the second aspect, or the third aspect.
  • the present technical solution provides a computer storage medium, including computer instructions, which when the computer instructions run on an electronic device, cause the electronic device to execute the machine translation method in any one of the possible implementations of any of the foregoing aspects.
  • the present technical solution provides a computer program product, which when the computer program product runs on an electronic device, causes the electronic device to execute any one of the above-mentioned methods for machine translation in a possible design.
  • the present technical solution provides a chip system that includes at least one processor, and when program instructions are executed in the at least one processor, any possible method in the first aspect can be used in an electronic device The above functions are realized.
  • Fig. 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • Fig. 2 is a block diagram of the software structure of an electronic device provided by an embodiment of the present application.
  • Figure 3 is a set of GUIs provided by an embodiment of the present application.
  • Figure 4 is another set of GUIs provided by an embodiment of the present application.
  • Figure 5 is another set of GUIs provided by an embodiment of the present application.
  • Fig. 6 is another set of GUI provided by an embodiment of the present application.
  • Fig. 7 is another set of GUI provided by an embodiment of the present application.
  • Fig. 8 is another set of GUIs provided by an embodiment of the present application.
  • Figure 9 is another set of GUIs provided by an embodiment of the present application.
  • Fig. 10 is another set of GUIs provided by an embodiment of the present application.
  • FIG. 11 is a schematic flowchart of a machine translation method provided by an embodiment of the present application.
  • Fig. 12 is a schematic flowchart of a machine translation method provided by an embodiment of the present application.
  • FIG. 13 is a schematic flowchart of a machine translation method provided by an embodiment of the present application.
  • FIG. 14 is a schematic flowchart of a machine translation method provided by an embodiment of the present application.
  • references described in this specification to "one embodiment” or “some embodiments”, etc. mean that one or more embodiments of the present application include a specific feature, structure, or characteristic described in conjunction with the embodiment. Therefore, the sentences “in one embodiment”, “in some embodiments”, “in some other embodiments”, “in some other embodiments”, etc. appearing in different places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless it is specifically emphasized otherwise.
  • the terms “including”, “including”, “having” and their variations all mean “including but not limited to”, unless otherwise specifically emphasized.
  • the electronic device may be a portable electronic device that also contains other functions such as a personal digital assistant and/or a music player function, such as a mobile phone, a tablet computer, and a wearable electronic device with wireless communication function (such as a smart watch) Wait.
  • portable electronic devices include, but are not limited to, carrying Or portable electronic devices with other operating systems.
  • the above-mentioned portable electronic device may also be other portable electronic devices, such as a laptop computer (Laptop) and the like. It should also be understood that, in some other embodiments, the above-mentioned electronic device may not be a portable electronic device, but a desktop computer.
  • FIG. 1 shows a schematic structural diagram of an electronic device 100.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2.
  • Mobile communication module 150 wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone interface 170D, sensor module 180, compass 190, motor 191, indicator 192, camera 193, display screen 194, and user Identification module (subscriber identification module, SIM) card interface 195, etc.
  • SIM subscriber identification module
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100.
  • the electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc.
  • different processing units may be independent components, or may be integrated in one or more processors.
  • the electronic device 101 may also include one or more processors 110.
  • the controller can generate operation control signals according to the instruction operation code and timing signals, and complete the control of fetching instructions and executing instructions.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in the processor 110 may be a cache memory.
  • the memory can store instructions or data that the processor 110 has just used or used cyclically. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. In this way, repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the electronic device 101 in processing data or executing instructions is improved.
  • the processor 110 may include one or more interfaces.
  • the interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, and a universal asynchronous transceiver (universal asynchronous transceiver) interface.
  • asynchronous receiver/transmitter, UART) interface mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, SIM card interface and/or USB interface, etc.
  • the USB interface 130 is an interface that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 101, and can also be used to transfer data between the electronic device 101 and peripheral devices.
  • the USB interface 130 can also be used to connect earphones and play audio through the earphones.
  • the interface connection relationship between the modules illustrated in the embodiment of the present application is merely a schematic description, and does not constitute a structural limitation of the electronic device 100.
  • the electronic device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 140 may receive the charging input of the wired charger through the USB interface 130.
  • the charging management module 140 may receive the wireless charging input through the wireless charging coil of the electronic device 100. While the charging management module 140 charges the battery 142, it can also supply power to the electronic device through the power management module 141.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 141 may also be provided in the processor 110.
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
  • the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 150 can provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the electronic device 100.
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
  • the mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic wave radiation via the antenna 1.
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110.
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
  • the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellites.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication technology
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110.
  • the wireless communication module 160 may also receive the signal to be sent from the processor 110, perform frequency modulation, amplify it, and convert it into electromagnetic waves to radiate through the antenna 2.
  • the electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is a microprocessor for image processing, connected to the display 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, and the like.
  • the display screen 194 includes a display panel.
  • the display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the electronic device 100 may include one or more display screens 194.
  • the display screen 194 in FIG. 1 may be bent.
  • the above-mentioned display screen 194 can be bent means that the display screen can be bent to any angle at any position, and can be maintained at that angle.
  • the display screen 194 can be folded in half from the center. You can also fold up and down from the middle.
  • the display screen 194 of the electronic device 100 may be a flexible screen.
  • the flexible screen has attracted much attention due to its unique characteristics and great potential.
  • flexible screens have the characteristics of strong flexibility and bendability, and can provide users with new interactive methods based on bendable characteristics, which can meet users' more needs for electronic devices.
  • the foldable display screen on the electronic device can be switched between a small screen in a folded configuration and a large screen in an unfolded configuration at any time. Therefore, users use the split screen function on electronic devices equipped with foldable display screens more and more frequently.
  • the electronic device 100 can realize a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
  • the ISP is used to process the data fed back by the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing and is converted into an image visible to the naked eye.
  • ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and is projected to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the electronic device 100 may include one or more cameras 193.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • MPEG2 MPEG2, MPEG3, MPEG4, and so on.
  • NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, and so on.
  • the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
  • the internal memory 121 may be used to store one or more computer programs, and the one or more computer programs include instructions.
  • the processor 110 can execute the above-mentioned instructions stored in the internal memory 121 to enable the electronic device 101 to execute the machine translation methods provided in some embodiments of the present application, as well as various applications and data processing.
  • the internal memory 121 may include a storage program area and a storage data area. Among them, the storage program area can store the operating system; the storage program area can also store one or more applications (such as photo galleries, contacts, etc.) and so on.
  • the data storage area can store data (such as photos, contacts, etc.) created during the use of the electronic device 101.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage components, flash memory components, universal flash storage (UFS), and the like.
  • the processor 110 may execute the instructions stored in the internal memory 121 and/or the instructions stored in the memory provided in the processor 110 to cause the electronic device 101 to execute the instructions provided in the embodiments of the present application. Methods of machine translation, as well as other applications and data processing.
  • the electronic device 100 may implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and an application processor. For example, music playback, recording, etc.
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and an ambient light sensor 180L, bone conduction sensor 180M, etc.
  • the pressure sensor 180A is used to sense a pressure signal, and can convert the pressure signal into an electrical signal.
  • the pressure sensor 180A may be provided on the display screen 194.
  • the capacitive pressure sensor may include at least two parallel plates with conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes.
  • the electronic device 100 determines the intensity of the pressure according to the change in capacitance.
  • the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations that act on the same touch position but have different touch operation strengths may correspond to different operation instructions. For example, when a touch operation whose intensity of the touch operation is less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
  • the gyro sensor 180B may be used to determine the movement posture of the electronic device 100.
  • the angular velocity of the electronic device 100 around three axes ie, X, Y, and Z axes
  • the gyro sensor 180B can be used for image stabilization.
  • the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shake of the electronic device 100 through reverse movement to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenes.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices, and apply to applications such as horizontal and vertical screen switching, pedometers and so on.
  • the ambient light sensor 180L is used to sense the brightness of the ambient light.
  • the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket to prevent accidental touch.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
  • the temperature sensor 180J is used to detect temperature.
  • the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection.
  • the electronic device 100 when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature.
  • the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • Touch sensor 180K also called “touch panel”.
  • the touch sensor 180K may be disposed on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”.
  • the touch sensor 180K is used to detect touch operations acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the visual output related to the touch operation can be provided through the display screen 194.
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194.
  • FIG. 2 is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface.
  • the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
  • the application layer can include a series of application packages.
  • the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some pre-defined functions.
  • the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, and a notification manager.
  • the window manager is used to manage window programs.
  • the window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc.
  • the content provider is used to store and retrieve data and make these data accessible to applications.
  • the data may include video, image, audio, phone calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls that display text, controls that display pictures, and so on.
  • the view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
  • the phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call status (including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can disappear automatically after a short stay without user interaction.
  • the notification manager is used to notify download completion, message reminders, and so on.
  • the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or a scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window.
  • the status bar prompts text messages, sounds prompts, electronic devices vibrate, and indicator lights flash.
  • the system library can include multiple functional modules. For example: surface manager (surface manager), media library (media libraries), 3D graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
  • surface manager surface manager
  • media library media libraries
  • 3D graphics processing library for example: OpenGL ES
  • 2D graphics engine for example: SGL
  • the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG and PNG.
  • the 3D graphics processing library is used to realize 3D graphics drawing, image rendering, synthesis and layer processing.
  • the 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.
  • Full-screen screenshot/full-screen screenshot Perform a "snapshot" operation on the content displayed on the current electronic device to form a picture with the same length and width as the screen and the same content. For example, in the iPhone, use the Home button and the power button at the same time to make a full-screen screenshot, or use the volume up button and the power button at the same time to trigger a short-press on the model without the Home button. For another example, on a Huawei mobile phone, it can be triggered by tapping the screen twice with a knuckle. Other manufacturers can also have other ways to start full-screen screenshots.
  • Long screenshot/long screenshot A picture that is longer than the height of the screen is generated after the content displayed by the electronic device is triggered by an interactive method.
  • the content is a long picture that is more than one screen of continuous content from the current display position. .
  • the knuckles draw an "S" on the screen to start, and click to stop.
  • Other manufacturers can also have other ways to start long screenshots.
  • Figure 3 shows a set of graphical user interfaces (GUI) of the mobile phone, in which, from Figure 3 (a) to Figure 3 (m) shows that the user performs full-screen translation and scrolling translation process.
  • GUI graphical user interfaces
  • FIG. 3 is the desktop of the mobile phone.
  • the desktop of the mobile phone includes three desktop pages, and each desktop page includes one or more application (Application, APP) icons.
  • APP Application
  • the current mobile phone’s desktop displays the second desktop page 301.
  • This desktop page includes the Alipay icon, the task card store icon, the Weibo icon, the English reading icon 302, the WeChat icon, and the card package icon. , Set icons and camera icons.
  • the GUI as shown in (b) of FIG. 3 can be displayed.
  • FIG. 3 is the display interface of the English reading APP.
  • the display interface includes multiple English essays. Including the English short article 303 with the title "A family of four was on a camping trip in Canada.Then a wolf attacked while they were sleeping", and the English short article with the title "Draft law seeks strict action against against throwing objects from buildings" It is an English short text of "71-Year-Old Grandma Sets New Half Marathon World Record in Ohio”.
  • the mobile phone detects that the user clicks on the English short text 303, it can display the GUI as shown in (c) in FIG. 3.
  • FIG. 3 is a display interface of the English short text 303.
  • the user can read the original text of the English essay by sliding up and down on the screen.
  • the mobile phone when the mobile phone detects the user's two-finger pressing operation on the interface, the mobile phone can display the GUI as shown in (d) in FIG.
  • the reminder box 304 can be the display interface of the smart screen.
  • the mobile phone can automatically recognize the word segmentation in the English short text, for example, " Participles such as wolf”, “It”, “was”, “Something", “out” and "a”.
  • the reminder box 304 may also include controls such as search, copy, map, share, and full-screen translation.
  • the mobile phone detects that the user clicks on the control 305, it can display the GUI as shown in (e) in FIG. 3.
  • the mobile phone may have a smart screen recognition function.
  • the smart screen recognition function can include that after the mobile phone detects the two-finger pressing text, the mobile phone can automatically extract the text content of the pressed area, analyze keywords, etc.; it can also include the mobile phone extracts the pressed area after the two-finger presses the picture. Picture content and analyze the items in the picture.
  • full-screen translation can also be understood as translating the original text displayed on the current screen, or translating a screen of content displayed after taking a screenshot of the current screen or a screenshot operation.
  • the mobile phone detects that the user clicks on the control 305, the mobile phone can automatically translate the original text on the screen as shown in (c) in FIG. 3.
  • the mobile phone will translate the English of the current screen into Chinese by default.
  • the mobile phone can automatically display the GUI as shown in (f) in Figure 3.
  • the mobile phone translates the English short text shown on (c) in Figure 3 into the corresponding Chinese.
  • the user can also click on the translation language on the translation interface. For example, when the user clicks "Chinese", multiple other foreign languages can be displayed, and the user can select other translation languages.
  • the translation interface also includes a control 306 for scrolling translation and a control for copying the translation. When the mobile phone detects that the user has clicked on the control 306, it can display the GUI as shown in (g) in FIG. 3.
  • the scrolling translation may also be referred to as a long screenshot translation.
  • the difference with full-screen translation is that scrolling translation can be a mobile phone taking a long screenshot of the content of the original text, and then it can automatically translate the content on the long screenshot (which can be multi-screen content), while the full-screen translation can only be for example Figure 3
  • the content displayed in the current original text (the content of one screen) shown in (c) is translated.
  • the scrolling display interface of the long screenshot may include a reminder box 307.
  • the reminder box 307 can remind the user by text that "the screen is being scrolled.. Click the scroll area to complete the screen capture".
  • the phone can automatically scroll down the screen.
  • FIG. 3 to (h) in FIG. 3 and then to (i) in FIG. 3 are all the processes of the mobile phone automatically scrolling down.
  • the mobile phone when the mobile phone scrolls to the bottom of the English short text (or the end of the English short text) in the scrolling screenshot, the mobile phone can automatically complete the automatic screenshot, at this time the start of the long screenshot
  • the position can be the beginning of the English short text as shown in (c) in FIG. 3
  • the end position of the long screenshot can be the end of the English short text.
  • the mobile phone can automatically display the interface shown in Figure 3 (j).
  • FIG. 3 is a loading interface for scrolling translation.
  • the phone can translate the English on the long screenshot into the corresponding Chinese.
  • the mobile phone can automatically display the GUI as shown in (k) in Figure 3.
  • FIG. 3 is a translation interface for scrolling translation.
  • the mobile phone translates the short English text on the long screenshot into the corresponding Chinese.
  • the mobile phone detects the user's upward sliding operation on the screen, the mobile phone can scroll to display the translated content.
  • a scroll bar 308 may also appear on the translation interface of the scrolling translation.
  • the scroll bar 308 can also correspondingly slide down.
  • the position of the scroll bar 308 may correspond to the position of the translation on the current interface in the entire translation.
  • the mobile phone Scrolls to display the change process of the translated content.
  • the user can swipe up or down to view the corresponding translation.
  • the original text interface may be displayed.
  • the original text interface may be the original content display interface when the electronic device starts to scroll the screen.
  • the mobile phone detects that the user clicks on the control 309, it may display the GUI as shown in (c) in FIG. 3.
  • control 306 for scrolling translation may continue to be displayed on the translation interface in (k) to (i) in FIG. 3 above. It may also be that after the mobile phone determines that the entire content of the English short text has been translated (or the mobile phone determines that the long screen shot is automatically stopped by scrolling to the end of the English short text), the scrolling translation control 306 may not be displayed on the translation interface.
  • FIG. 4 is a display interface for smart screen recognition.
  • the user can read the original text of the English essay by sliding up and down on the screen.
  • Fig. 4(a) when the mobile phone detects the user's two-finger pressing operation on the interface, the mobile phone can display the GUI as shown in Fig. 4(b).
  • the smart screen recognition interface in Figure 4 (b) includes two controls, full-screen translation and scrolling translation. Users can choose full-screen translation, that is, to translate the original content (one-screen content) on the interface shown in Figure 4 (a); they can also choose scrolling translation, that is, they can take a long screenshot first, and then display the content on the long screenshot. The original content (which can be multi-screen content) is translated. When the mobile phone detects the user's operation of clicking the control 401, the GUI shown in (c) of FIG. 4 is displayed.
  • the scrolling display interface of the long screenshot may include a reminder box 402.
  • text can be used to remind the user that the user is scrolling to take a screenshot. Click the scroll area to complete the screenshot.
  • the phone can automatically scroll down the screen.
  • Exemplarily, from (c) in FIG. 4 to (d) in FIG. 4 are all the automatic scrolling processes of English short texts.
  • FIG. 4 is another display interface for scrolling long screen shots.
  • the mobile phone detects the user's click action on the screen, the mobile phone can complete the long screen capture operation.
  • the mobile phone can automatically display the GUI shown in Figure 4(e).
  • FIG. 4 is a loading interface for scrolling translation.
  • the phone can translate the English on the long screenshot into the corresponding Chinese.
  • the mobile phone can automatically display the GUI as shown in (f) in Figure 4.
  • the mobile phone translates the short English text on the long screenshot into the corresponding Chinese.
  • the mobile phone detects the user's sliding up or down operation on the screen, the mobile phone can scroll to display the translated content.
  • the change process of the GUI shown from (f) in FIG. 4 to (g) in FIG. 4 is a process in which the user views the translation corresponding to the multi-screen content obtained in the first long screen capture. After the user has finished viewing, if he wants to continue to view the translation corresponding to the remaining original text, he can click the scrolling translation control 403. When the mobile phone detects that the user clicks on the control 403, it can display the GUI as shown in (h) in FIG. 4.
  • FIG. 4 is another display interface for scrolling screenshots.
  • the mobile phone can start a long screenshot from "Fee said he immediately...rocks at it" (the last paragraph of the first long screenshot).
  • the starting point of the next long screenshot may be the last paragraph of the last long screenshot, as shown in (h) in Figure 4, the starting point of the second long screenshot may be the first The last paragraph of a long screenshot.
  • the starting point of the next long screenshot may be the last two paragraphs of the previous long screenshot, and so on.
  • the mobile phone can also start a long screenshot from "The screams were so...situation,"...in the back hip area" (the penultimate paragraph of the first long screenshot).
  • the starting point of the next long screenshot may be the last screen content of the last long screenshot.
  • the mobile phone can divide the content of the long screenshot into multi-screen content.
  • the mobile phone can segment the long image generated by the long screenshot according to the relationship between the height of the image and the height of the mobile phone screen, and use optical character recognition (OCR) at the segmented position to determine whether the text will be truncated Or pictures. If the mobile phone determines that the text or picture will be cut off at the segmentation point, you can move the segmentation position up to the blank line position to get several pictures with a height slightly less than or equal to the height of the screen. Then in the next scrolling translation, the long screenshot can be taken from the last picture (or the content of the last screen) among the multiple pictures (or multi-screen content) obtained in the last long screenshot. Alternatively, the mobile phone can also analyze the last picture (or the content of the last screen) obtained from the last long screen capture, and extract the last paragraph or the last few paragraphs of the content in the last picture as the next scrolling translation The starting point for the duration screenshot.
  • OCR optical character recognition
  • the advantage of this is that the user’s reading experience starts from the last few paragraphs of the last picture (or the content of the last screen) or the last picture (or the content of the last screen) of the last translation. Said that there is a certain memory to evoke and assist continuous reading.
  • the GUI shown in (j) in FIG. 4 when the mobile phone detects the user's click operation on the screen, the GUI shown in (j) in FIG. 4 can be automatically displayed.
  • the phone can translate the English on the long screenshot into the corresponding Chinese.
  • the mobile phone can automatically display the GUI as shown in (k) in Figure 4.
  • the mobile phone translates the short English text on the long screenshot into the corresponding Chinese.
  • the mobile phone detects the user's sliding up or down operation on the screen, the mobile phone can scroll to display the translated content.
  • the change process of the GUI shown from (k) in FIG. 4 to (1) in FIG. 4 is a process in which the user views the translation corresponding to the multi-screen content obtained by the second long screen capture. After the user has finished viewing, if he wants to continue to view the translation corresponding to the remaining original text, he can click on the scrolling translation control 403, and the mobile phone can perform the third scrolling translation.
  • the process of the third scrolling translation can refer to the process of the second scrolling translation mentioned above. For the sake of brevity, I will not repeat it here.
  • the embodiment of the application provides a machine translation method.
  • the mobile phone starts a long screen capture on the page currently displaying the first language (also called the original text), and automatically scrolls down. During the period, the mobile phone detects that the user can tap the screen and stops the long screen. Screenshot; secondly, the text data that has been translated into the second language (also called the translation) is displayed on the new page, and the user can swipe up and down to view; then, the user can directly choose to continue to view the following content on the translation page (the page provides The scrolling translation button is for the user to click).
  • the electronic device when the user triggers the operation of translating the original text, the electronic device can display the entry of full-screen translation and scrolling translation, providing users with multiple translation methods, making it convenient for users to choose, and improving the user’s ability to understand the original text. User experience when translating.
  • a long screen capture is triggered after the scrolling translation control is clicked, and then one or more pictures obtained from the long screen capture are translated.
  • the following describes the process of first performing a long screenshot operation and triggering the translation of the long screenshot picture on the processing interface for obtaining the long screenshot picture in conjunction with FIG. 5.
  • Figure 5 shows another set of GUIs provided by an embodiment of the present application.
  • FIG. 5 is a display interface of the English short text 303.
  • the mobile phone detects that the user draws "S" with the knuckles on the interface, the mobile phone can start the operation of taking a long screen and automatically display the GUI as shown in Figure 5(b).
  • the scrolling display interface of the long screen shot may include a reminder box 501.
  • text can be used to remind the user that “the screenshot is being scrolled. Click the scroll area to complete the screenshot”.
  • the phone can automatically scroll down the screen.
  • Exemplarily, from (b) in FIG. 5 to (c) in FIG. 5 are all the automatic scrolling processes of English short texts.
  • FIG. 5 is another display interface for scrolling long screen shots.
  • the mobile phone detects the user's click action on the screen, the mobile phone can complete the long screen capture operation.
  • the mobile phone can automatically display the GUI as shown in (d) in Figure 5.
  • the processing interface includes processing methods for the pictures obtained from the long screenshot, wherein the processing methods include sharing, editing, deleting, and translation.
  • the user can share the picture obtained from the long screenshot by clicking Share to other users; the user can also edit the picture obtained from the long screenshot by clicking Edit. For example, the picture can be edited for brightness, exposure, and cropping; The user can also delete the picture obtained from the long screenshot by clicking Delete.
  • the mobile phone detects that the user clicks the operation of the control 502 corresponding to the translation, the mobile phone can display the GUI as shown in (e) in FIG. 5.
  • FIG. 5 is a translation loading interface of a picture obtained by a long screenshot.
  • the mobile phone can translate the English on the picture obtained by the long screen capture into the corresponding Chinese.
  • the mobile phone can automatically display the GUI as shown in (f) in Figure 5.
  • FIG. 5 is a translation interface of a picture obtained by a long screenshot.
  • the mobile phone translates the short English text on the picture obtained from the long screen capture into the corresponding Chinese.
  • the mobile phone detects the user's sliding up or down operation on the screen, the mobile phone can scroll to display the translated content.
  • the user wants to continue to view the translation corresponding to the remaining content of the English essay, he can click the scrolling translation control 503 shown in (f) in Figure 5, and the mobile phone can continue the scrolling translation process.
  • the scrolling translation Refer to the GUI in Figure 3 or Figure 4 above for the process.
  • Fig. 6 shows another set of GUIs provided by an embodiment of the present application.
  • FIG. 6 is a display interface of the English short text 303.
  • the mobile phone detects the user's pressing operation on the word "family" on the interface, it can automatically display the GUI as shown in (b) in FIG. 6.
  • a reminder box 601 can automatically pop up on the display interface.
  • the reminder box 601 includes copy, share, select all, web search, search, and controls 602.
  • a reminder box 603 can automatically pop up, where the reminder box 603 includes scrolling translation and full-screen translation.
  • Fig. 7 shows another set of GUIs provided by an embodiment of the present application.
  • FIG. 7 is a display interface of the English short text 303.
  • the mobile phone detects the user's pressing operation on the word "family" on the interface, it can automatically display the GUI as shown in (b) in FIG. 7.
  • the mobile phone can automatically select the word "family” and automatically pop up a reminder box 701.
  • the reminder box 701 includes copy, share, select all, web search, search and so on.
  • the mobile phone detects that the user clicks the cursor 701 and slides to the right, the mobile phone can select more words and display the GUI as shown in (c) in FIG. 7.
  • the mobile phone can automatically select multiple words "family was fast asleep" according to the user's sliding operation, and automatically add a scrolling translation function option in the reminder box 701.
  • the mobile phone may also add prompts on the starting position of the screenshot and the position read last time on the GUI when performing the next scrolling translation (or long screenshot translation).
  • Fig. 8 shows another set of GUIs provided by an embodiment of the present application.
  • the mobile phone translates the short English text on the picture obtained from the first long screenshot into the corresponding Chinese.
  • the mobile phone detects the user's sliding up or down operation on the screen, the mobile phone can scroll to display the translated content.
  • the mobile phone detects the user's operation of clicking the control 801 on the translation interface, it can display the GUI as shown in (b) in FIG. 8.
  • the display interface can include two reminder messages to the user.
  • One reminder message is before the paragraph "Fee said he immediately...rocks at it”.
  • the mobile phone can remind the user of "the starting position of this screenshot”. After a while, remind the user to "last read here”.
  • FIG. 8 is another display interface of the second scrolling screenshot.
  • the mobile phone detects the user's click operation on the screen, the mobile phone can complete the second scrolling screenshot and display the GUI as shown in (d) in FIG. 8.
  • the GUI scrolls the translation loading interface of the screenshot for the second time.
  • the above-mentioned reminder information can also be displayed on the loading interface, so that the user can also check the starting point of the scrolling screenshot and the position of the original text read last time before reading the translation of the second scrolling screenshot.
  • the advantage of this is that Before reading the translated text of the second scrolling screenshot, the user can become familiar with the content of the original text in the second scrolling screenshot, which has a certain memory arousal for the user and assists in continuous reading.
  • the translation display interface can also display the above-mentioned reminder information.
  • the mobile phone may only display one of the above two reminder messages.
  • Fig. 9 shows another set of GUI provided by an embodiment of the present application.
  • GUI shown in (a) in Figure 9, which may be the translation interface for the first scrolling translation.
  • the mobile phone detects the user's operation of clicking the control 901 on the translation interface, it can display the GUI as shown in (b) in FIG. 9.
  • the second scrolling screenshot does not contain any content from the previous scrolling screenshot, that is to say, the second scrolling screenshot may not contain any redundant original content.
  • FIG. 9 is another display interface of the second scrolling screenshot.
  • the mobile phone detects the user's click operation on the screen, the mobile phone can complete the second scrolling screenshot and display the GUI as shown in (d) in FIG. 9.
  • FIG. 9 is the translation display interface of the second scrolling screenshot.
  • the translation content displayed on the translation display interface does not include the translation content of the first scrolling screenshot.
  • the electronic device when the first full-screen translation is completed for the next scrolling translation, the electronic device needs to switch back to the original display interface for scrolling translation, and then switch back to the translation interface, so that the user You can view the desired translation content.
  • the electronic device after the electronic device performs a full-screen translation or scrolling translation, if it detects that the user has clicked on the scrolling translation control, it may not switch back to the original text interface, but can directly load the remaining original text in the background , Take a scrolling screenshot of the remaining original text and obtain a part or all of the remaining original text. The user can continue to read the subsequent translation in the translation interface, without jumping between multiple interfaces, which improves the user's reading coherence experience.
  • Figure 10 shows another set of GUIs provided by an embodiment of the present application.
  • FIG. 10 is the translation display interface after the user performs scrolling translation for the first time.
  • the user can slide his finger upward to view the translation content of the first scroll translation.
  • (a) in FIG. 10 may be a GUI obtained according to (a) to (f) in FIG. 4 described above.
  • the mobile phone can translate all the remaining original texts and present the translations corresponding to all the remaining original texts to the user.
  • the continue translation control 1001 and the copy translation control may not be displayed on the translation display interface.
  • the mobile phone may also prompt the user to select the percentage of the remaining original text to be translated. For example, the mobile phone may prompt the user to select 20%, 40%, 60%, 80%, or 100% of the remaining original text to be translated. .
  • the mobile phone detects that the user clicks on a certain percentage, the mobile phone can take a screenshot of the remaining original text according to the percentage, and then obtain the translation of the content corresponding to the screenshot to present it to the user.
  • the mobile phone can automatically capture one or more screens of the remaining original text, and then obtain a translation of the content corresponding to the screenshot to present it to the user. For example, it can be assumed that the user clicks the control 1001 once, and the mobile phone automatically takes two screens of the remaining original text.
  • the user can click on the control to continue translation on the translation interface obtained after the first full-screen translation, and the mobile phone can automatically present the translations corresponding to all the remaining original texts to the user.
  • the mobile phone can automatically take a scrolling screenshot of the remaining original text.
  • the captured content may include all of the remaining original text.
  • the scrolling screenshot process is visible or invisible to the user.
  • the control 306 which can be called "scrolling translation” or "continue translation”
  • there is no need to switch to (g) in Figure 3 ) Interface for scrolling screenshots but can directly display the translation interface shown in Figure 3 (k) to Figure 3 (m).
  • the GUI shown in (k) in FIG. 3 to (m) in FIG. 3 may not display the scrolling screenshot control and the copy translation control.
  • the mobile phone detects that the user clicks the continue translation control, and the electronic device can take a screenshot in the background (it can be a full screen After taking a screenshot, it can also be a long screenshot) automatically get more translation results of the original text and present it to the user, avoiding the jump back and forth between the original text and the target text, and can further improve the user experience when viewing the translated text.
  • FIG. 11 shows a schematic flowchart of a machine translation method 1100 provided by an embodiment of the present application.
  • the execution subject of the method 1100 may be a mobile phone, and the method includes:
  • the mobile phone detects the operation of pressing with both hands on the original text display interface, and activates the smart screen recognition.
  • the mobile phone After the mobile phone detects the operation of two-finger pressing on the display interface of the English short text, it starts the smart screen recognition, where the smart screen recognition may include full-screen translation function options and The function options of scrolling translation (function options can also be called controls).
  • S1102 The mobile phone detects that the user clicks on the scrolling translation operation, and the mobile phone starts to scroll the screen automatically.
  • S1103 When the mobile phone detects that the user has clicked on a certain position on the screen, or when the mobile phone detects that the original text automatically slides to the bottom of the page, the mobile phone can stop scrolling the screenshot.
  • S1104 Obtain a long picture obtained through a long screenshot.
  • S1105 Crop the long image obtained from the long screenshot to obtain multiple small images whose height is less than or equal to the preset height, and each small image that is cropped can be sent to the cloud for translation.
  • the preset height is the height of the mobile phone screen.
  • the preset height is a preset value smaller than the height of the mobile phone screen.
  • the mobile phone can segment the long image generated by the long screenshot according to the relationship between the height of the image and the height of the mobile phone screen, and use OCR at the segmented position to determine whether the text or image will be truncated, and if the segment is found, the text will be truncated Or picture, move the segmentation position up to the blank line position, and get several pictures whose height is slightly less than or equal to the height of the screen.
  • the multiple small pictures generated can be numbered in the order of the original text, and each small picture generated will be sent to the translation cloud for translation.
  • each small picture can be numbered in the order of the original text, or it can also be understood as the mobile phone adds label information to each small picture, and combines these small pictures Send to the translation cloud for translation.
  • S1106 The mobile phone obtains the translation result of each small image from the cloud.
  • S1107 The mobile phone determines whether each small image is translated successfully.
  • S1110 The mobile phone judges whether the translation result of all the thumbnails is received.
  • S1111 If the mobile phone receives the translation results of all the thumbnails, the mobile phone can continue to determine whether the number of successfully translated pictures in all the thumbnails is less than a preset threshold.
  • the mobile phone can continue to execute S1106.
  • S1112 If the mobile phone determines that the number of successfully translated pictures in all the small images is less than the preset threshold, the mobile phone can use the list to try to display all the translation results.
  • S1113 If the mobile phone determines that the number of successfully translated pictures in all the thumbnails is greater than or equal to a preset threshold, the mobile phone may prompt the user that the translation has failed, and prompt the user whether to perform the translation again.
  • the mobile phone After the mobile phone obtains the translation result returned from the cloud, it determines whether the returned result is successfully translated, if it succeeds, the translation result is rendered and saved; if it fails, the original text is saved as the translation result.
  • the mobile phone receives the translation results of all the thumbnails, it calculates whether the proportion of pages that have failed translation exceeds the set threshold (for example, the proportion of the total number of failed pages is greater than or equal to 60%), and the user is prompted to try again (probability in this case (Lower); if it succeeds, it will be sorted and displayed according to the returned page encoding order or tags (that is, the order of the original text), and the displayed content of the translation starts from the first small picture in the long picture.
  • the set threshold for example, the proportion of the total number of failed pages is greater than or equal to 60%
  • the mobile phone divides the long picture obtained from the long screenshot to obtain 10 small pictures, and each small picture is numbered in order and sent to the cloud.
  • the mobile phone obtains the translation results of 10 small pictures from the cloud.
  • the translation of 8 small pictures is successful, and the translation of 2 small pictures fails, then the mobile phone can also determine that the scrolling translation is successful.
  • the mobile phone displays the translation results the translation results of these 10 small pictures can be spliced according to the number.
  • the position of the two small pictures that failed to translate can display the original text, and the position of the other 8 successfully translated small pictures can display the corresponding translation .
  • the mobile phone when the mobile phone sends multiple thumbnails to the cloud in S1106, it may be sent to the cloud in order, and when the translation results of multiple thumbnails are obtained from the cloud, the translation result of each thumbnail may not be obtained according to the sending order. Since the content of each small picture is different, the time when the cloud translates each small picture is also different, so the mobile phone does not need to receive the translation result of each small picture in the order in which it was sent. Since each small picture is numbered or labeled, the mobile phone can splice the translation results of multiple small pictures according to the number or label when receiving the translation results of multiple small pictures.
  • S1115 The mobile phone determines whether the user continues the long screen capture operation.
  • S1105-S1114 can be executed again.
  • the mobile phone executes S1102-S1114 again, it can automatically jump to the last small picture of the long picture obtained from the last long screenshot to start the next scrolling translation, or it can automatically jump to the end of the long picture obtained from the last long screenshot.
  • a small picture and take a long screenshot from the last paragraph or the last few paragraphs of the last small picture.
  • the user can choose to continue to read the following content, that is, continue to use the scrolling translation function; or exit from the translation result page. If you return and exit, you will return to the original text content of the last small picture where the long screenshot stopped, or the last paragraph or the last few paragraphs of the last small picture; if you continue to use the scrolling translation (that is, the user wants to continue reading the subsequent content), it will Display the original text content of the last small picture where the last long screenshot was stopped, or display the original text content of the last paragraph or the last few paragraphs in the last small picture where the last long screenshot was stopped, and start a new long screenshot operation at the same time to enter a new one Cycle until the end of the article.
  • the mobile phone may also display the last paragraph or the last few paragraphs of the last small picture of the long picture obtained from the last long screenshot.
  • the machine translation method in the embodiments of this application has a wider range of applications. It is not limited to that users must use a browser to view news, especially when used on mobile phones. Three-party information apps, such as NetEase News, Toutiao, etc.
  • the browser-based full text translation method for webpages cannot be used in the third-party APP scenario, and the machine translation method provided in this embodiment can be applied.
  • the machine translation method in the embodiment of the present application can reduce the user's cumbersome operations when viewing the translation corresponding to the original text, improve the intelligence of the electronic device, and help improve the user experience of the user in the process of viewing the translation.
  • the embodiments of the present application provide a machine translation method, which can be implemented in electronic devices with touch screens (such as mobile phones, tablet computers, etc.) as shown in Figures 1 and 2 .
  • the method may include the following steps:
  • the electronic device displays a first user interface on the touch screen, where the first user interface includes first content, and the language of the first content is the first language.
  • the first user interface may be a GUI as shown in (a) in FIG. 4.
  • the electronic device detects a first operation on the first user interface, and the first operation includes a user operation triggered by the user to perform scrolling translation.
  • the first operation may be an operation of the user clicking on the control 401; or, the first operation may also be the user inputting a voice command that triggers the scrolling translation function.
  • the first position may be the starting position of the English short text 303, for example, a scrolling screenshot is taken from the title "A family...were sleeping".
  • the electronic device obtains the first picture, the first picture is the picture corresponding to the second content, the second content includes content from the first position to the second position, and the language of the second content is the first One language.
  • the content displayed on the second user interface is from “I don't think...she write” to "Fee said...rocks at it.”
  • the mobile phone can stop scrolling the screenshot at the end position of the last paragraph on the second user interface.
  • the second position may be the end position of the paragraph "Fee said...rocks at it.”
  • the second position may also be the end position of the last line of the paragraph displayed on the second user interface.
  • the second position may be the end position of the section above the picture or part of the picture if the end position of the second user interface is a picture or a part of a picture.
  • S1205 The electronic device automatically obtains the translation result of the second content according to the first picture, and the language of the translation result of the second content is the second language.
  • the mobile phone may process the first picture according to the method in the above method 1100.
  • the mobile phone may perform segmentation according to the relationship between the height of the first picture and the height of the mobile phone screen.
  • the first picture is divided into multiple pictures, and then sent to the server for translation; the mobile phone can receive the translation result of each picture in the multiple pictures sent by the server, and compose the translation result of each picture into the second The translation result of the content.
  • the translation result of the second content can be from the translation of the title "A family of four...attacked them” to the translation of the last paragraph before the second position "Fei said, he invoked it immediately... threw it at him stone.”
  • the electronic device After automatically acquiring a part or all of the translation result of the second content, the electronic device automatically displays a third user interface, and the third user interface includes a part or all of the translation result of the second content.
  • the translation result of the second content acquired by the mobile phone may be all the translation results of the second content, that is, the translation result of multiple pictures acquired by the mobile phone, and the translation result of each picture is successful; or, It can also be part of the translation result of the second content.
  • the server receives multiple pictures, one of the pictures may not be translated successfully, then the mobile phone can also display a part of the translated translation, and for the untranslated picture, the mobile phone can use the picture
  • the original content corresponding to the above and the translation content corresponding to other pictures constitute the translation result of the second content.
  • the third user interface may be a GUI as shown in (f) in FIG. 4, and a part of the second content may be displayed on the GUI, such as displaying "a family of four...attacked them” to " Canadian National Park...bited their arms by Matthew".
  • the electronic device After detecting the user's upward sliding operation on the third user interface, the electronic device can display the remaining part of the translation result of the second content. As shown in (g) in Figure 4, after the mobile phone detects the user's upward swipe operation on the touch screen, it can display the remaining translation results (from "she wrote...this fear” to "Fei said...threw a stone at him” .”).
  • the method 1200 further includes:
  • the electronic device detects a third operation on the fourth user interface, the fourth user interface includes the ending part of the translation result of the second content, and the third operation includes a user operation that the user triggers a scrolling translation.
  • the fourth user interface may be the GUI shown in (g) in FIG. 4, and the GUI includes the ending part of the translation result of the second content, and the ending part may be "Fei said, he regrets immediately... Throw stones at him.”
  • the third operation may be an operation of the user clicking the scroll translation control 403.
  • the electronic device automatically displays the fifth user interface, and starts to scroll the screenshot from the third position of the fifth user interface, the fifth user interface includes third content, and the third position and the second position Related, the language of the third content is the first language.
  • the fifth user interface may be the GUI shown in (h) in FIG. 4, and the third content may be English content from “Fee said...rocks at it” to "Itcould...shewrote.” .
  • the GUI shows that the mobile phone starts to take a scrolling screenshot from the paragraph "Fee Said...rocks at it.”
  • the scrolling screenshot when the fourth operation of the user is detected on the sixth user interface, or when scrolling to the end position, the scrolling screenshot is stopped at the fourth position of the sixth user interface, and the electronic device gets the first Two pictures, the second picture is a picture corresponding to the fourth content, the fourth content includes content from the third position to the fourth position, and the language of the fourth content is the first language.
  • the sixth user interface may be a GUI as shown in (i) in FIG. 4, and when the mobile phone detects any operation of the user on the GUI, the mobile phone can stop scrolling and taking screenshots.
  • the fourth position may be the end position "Incidents like these...and one in Ontario.” of the last paragraph in the GUI shown in (i) in FIG. 4.
  • the fourth content included in the second picture can be English content from "Fee said...rocks at it.” to "Incidents like these...and one in Ontario.”
  • the electronic device automatically obtains the translation result of the fourth content according to the second picture, and the language of the translation result of the fourth content is the second language.
  • the electronic device may divide the second picture into multiple pictures and send them to the server for translation; and obtain the translation results of the multiple pictures from the server.
  • the electronic device can compose the translation result of the multiple pictures into the translation result of the fourth content.
  • the electronic device After automatically acquiring a part or all of the translation result of the fourth content, the electronic device automatically displays a seventh user interface, and the seventh user interface includes a part or all of the translation result of the fourth content.
  • the seventh user interface may be a GUI as shown in (k) in FIG. 4, and the GUI includes a part of the translation result of the fourth content.
  • the translation result displayed on the GUI ranges from "Fei said...threw a stone at him" to "She wrote...sit here.”.
  • the electronic device After detecting the upward sliding operation of the user on the seventh user interface, the electronic device can display the remaining part of the translation result of the fourth content. As shown in (l) in Figure 4, after the mobile phone detects the user's upward swipe operation on the touch screen, it can display the remaining translation results (from "Elisa Rispoli did not have a request for" to "this time... in British Columbia ").
  • the method 1200 further includes:
  • the electronic device detects a fifth operation on the eighth user interface, the eighth user interface includes the ending part of the translation result of the second content, and the fifth operation includes a user operation that the user triggers to continue translation.
  • the eighth user interface may be a GUI as shown in (b) in FIG. 10, and the GUI may be obtained through full-screen translation; or may be obtained through scrolling translation.
  • the GUI may include the ending part of the translation result of the second content, and the ending part may be "Fei said, he immediately invoked...throwing a stone at him.”.
  • the user can click to continue the operation of the translation control 1001.
  • the electronic device In response to the fifth operation, automatically obtains the translation result of the fifth content.
  • the fifth content includes part or all of the content other than the second content in all the content corresponding to the first language.
  • the language of the translation result is the second language.
  • the mobile phone when the mobile phone detects that the user clicks on the control 1001, the mobile phone can obtain the translation result of the original content except the original text from "A family...were sleeping" to "Fee said...rocks at it.”, that is, the mobile phone The translation result from "Meanwhile...to safety” to the end position of English short 303 "2019 Cable...All rights Reserved.” can be automatically obtained.
  • a third picture can be obtained.
  • the third picture includes from “Meanwhile...to Safety” to the end position of the English short 303 "2019 Cable...All rights Reserved. "Content.
  • the mobile phone can divide the third picture into multiple pictures, and then send the multiple pictures to the server for translation and obtain the translation result of each picture sent by the server.
  • the mobile phone can combine the translation results of multiple pictures into this The translation result of the fifth content.
  • the fifth content may also include a part of content other than the second content.
  • the electronic device may segment the content other than the second content.
  • the second content may be the content of the first part of the multiple parts.
  • the fifth content may also include a part of content that has been read before.
  • the electronic device After automatically acquiring part or all of the translation result of the fifth content, the electronic device automatically displays the ninth user interface or displays the ninth user interface after receiving the user's sliding operation, and the ninth user interface includes the fifth user interface. Part or all of the translation result of the content.
  • the GUI shown in (c) in FIG. 10 includes a part of the translation result of the fifth content, such as "At the same time...escape to a safe place” to "Rispolis...he On hand”.
  • the method 1200 further includes: in response to the fifth operation, the electronic device automatically takes a screenshot to obtain a third picture, and the third picture includes the fifth content.
  • the electronic device may obtain the third picture by taking a screenshot or scrolling the screenshot.
  • the electronic device may send the third picture or a picture corresponding to a part of the third picture to the server; the electronic device receives the third picture or a part corresponding to the third picture returned by the server The translated result of the picture.
  • the electronic device automatically captures the screen to obtain the third picture may be that the electronic device captures the content of one or more screens to obtain the third picture, and the process of the automatic screenshot is visible or invisible to the user.
  • the process of automatically taking screenshots is not visible to the user; for example, (g) in FIG. 4 to (k) in FIG. 4 In the process of ), the process of automatic screenshot is visible to the user.
  • the electronic device may continue to display the third user interface, but when the user swipes up on the touch screen, the mobile phone may display a part of the translation result of the fifth content or All.
  • the method before the automatic acquisition of the translation result of the second content, the method further includes: the electronic device automatically divides the first picture into a plurality of pictures; wherein, the third position is the same as the last of the plurality of pictures.
  • a specific position in a picture is related, and the specific position is: the start position or the end position or the middle position of the last picture or the position of a predetermined ratio; or, the start position of the last paragraph in the last picture or The starting position of the last n rows, n is a positive integer, and n is greater than or equal to 1.
  • the first picture includes the original content from "A family...were sleeping” to “Fee said...rocks at it.”
  • the mobile phone can segment the first picture to obtain multiple pictures, for example, segmentation Two pictures are obtained.
  • the first picture includes the original content from "A family...were sleeping” to "The family was...clamped onto Matthew's arms.”;
  • the second picture includes the text from "I don't...shewrote” "To the original content of "Fee said...rocks at it.”
  • the third position may be the starting position of the second picture, and the starting position of the scrolling screenshot shown in (h) in FIG. 4 may be "I don't...she wrote”.
  • the third position can be the middle position of the second picture, such as from "The wolf was...jumped into help.”, then the starting position of the scrolling screenshot shown in (h) in Figure 4 can be "The wolf was...jumped into help.”
  • the third position may be a position of a predetermined ratio.
  • it may be the position of two-thirds of the second picture, such as scrolling the screenshot from the line "[the wolf]...in the back". Then the starting position of the scrolling screenshot shown in (h) in Figure 4 can be "[the wolf]...in the back".
  • the third position can also be the starting position of the last paragraph of the second picture.
  • the last paragraph of the second picture can be "Fee said...rocks at it.” to start scrolling screenshots. .
  • the third position may also be the last n lines of the last paragraph of the second picture.
  • n 2
  • the mobile phone can start scrolling screenshots from the line "and the two...throwing rocks".
  • the automatic acquisition of the translation result of the second content includes: the electronic device sends the multiple pictures to the server; the electronic device receives the translation result of each of the multiple pictures by the server; The translation result of part of the pictures in one picture constitutes a part of the translation result of the second content, or the translation result of all pictures in the multiple pictures constitutes the translation result of the second content.
  • associating the third position with the first picture includes: the third position is related to a specific position in the first picture, and the specific position is an end position or a middle position or a predetermined ratio of the first picture Or, the starting position of the last paragraph or the starting position of the last n lines in the first picture, where n is a positive integer, and n is greater than or equal to 1.
  • the third position is related to the end position or the middle position of the second content or the position of a predetermined ratio; or, the third position is related to the start position of the last paragraph or the last n lines of the second content.
  • the starting position is related, n is a positive integer, and n is greater than or equal to 1.
  • the electronic device may divide the first picture into multiple pictures, and the third position may be related to the last picture of the multiple pictures or related to the last pictures of the multiple pictures; or The electronic device may not segment the first picture, and the third position may be related to a specific position of the first picture, or the third position may also be related to the second content displayed on the first picture.
  • the electronic device jumps to the vicinity of the position where the long screenshot was stopped last time in the original text (the electronic device has memorized the position), and the electronic device can start from the vicinity of the position where the long screenshot was stopped last time (the position is different from the position
  • the first picture is related, by retaining some redundancy of the content, so that the user can recall where they were last read) Start the scrolling screenshot again and send it to the server for translation.
  • This method is not limited to web-based browser client translation, but can also be used in non-browser scenarios such as third-party information APPs, which greatly expands the applicable scenarios and also ensures the continuity of the user's reading experience.
  • the automatically obtaining the translation result of the second content includes: the electronic device sends the first picture or a picture corresponding to a part of the first picture to the server; the electronic device receives the first picture returned by the server Or the translation result of the picture corresponding to a part of the first picture.
  • the electronic device may directly send the first picture to the server for translation without segmentation; or, after the electronic device sends the first picture to the server, the server divides it into multiple segments. After translating multiple pictures, the translation result of each picture is returned to the electronic device.
  • the electronic device may divide the first picture into multiple pictures, and send the first picture or the first few pictures of the multiple pictures to the server for translation ; Then obtain the translation result of the first picture or the first few pictures returned by the server.
  • the translation result of the second content includes content obtained after the first picture is subjected to OCR text recognition and the text content is translated from the first language to the second language.
  • the method further includes: displaying first prompt information at or near the third position, the first prompt information being used to prompt the user to scroll the starting position of the screenshot; and/or, in the The second prompt information is displayed at or near the second position, and the second prompt information is used to prompt the user to read the second position last time.
  • GUI shown in (b) in Figure 8 may include first prompt information at the beginning of "Fee said...rocks at it.”, and the first prompt information may be "the beginning of this screenshot.” Start position”. The end position of "Fee said...rocks at it.” may include second prompt information, and the second prompt information may be "Last read here".
  • the first operation includes the user clicking on the first control that can trigger the scrolling translation function or the user inputting a voice command that can trigger the scrolling translation function.
  • the first operation may be an operation of the user clicking on the control 401, or the first operation may also be a voice command "scrolling translation" input by the user.
  • the third operation includes the user clicking the first control that can trigger the scrolling translation function or the user inputting a voice command that can trigger the scrolling translation function.
  • the third operation may be an operation of the user clicking the control 403, or the first operation may also be a voice command "scrolling translation" input by the user.
  • the method further includes: after receiving the user's sliding operation on the third user interface, displaying a tenth user interface, the tenth user interface including the translation result included in the third user interface Related subsequent translation results.
  • the mobile phone when the mobile phone detects the user's upward sliding operation, the mobile phone can display the subsequent translation result.
  • the method before the third operation is detected, the method further includes: displaying a control that can trigger a scrolling translation on the fourth user interface.
  • the mobile phone may display the control 403 on the display screen.
  • the method before the detection of the fifth operation, the method further includes: displaying a control that can trigger the continued translation on the eighth user interface.
  • the mobile phone may display the control 1001 through the display screen.
  • the detecting the first operation on the first user interface includes: after detecting the user's multi-finger pressing operation on the first user interface, the electronic device displays a plurality of function controls, and the plurality of functions
  • the control includes a first control that can trigger the scrolling translation; the electronic device detects that the user clicks on the first control or the user inputs a voice command that can trigger the scrolling translation function.
  • the GUI shown in (a) in Figure 4 after the mobile phone detects the user's two-finger pressing operation, it can display the GUI shown in (b) in Figure 4, which can display multiple Functional controls, where multiple functional controls include control 401.
  • the second content includes a part or all of the content other than the first content among all the content corresponding to the first content and the first language.
  • the third content includes a part of all content corresponding to the first language other than the second content
  • the fourth content includes all content corresponding to the first language except the second content. Part or all of other content.
  • the third content may also include part or all of the second content; the fourth content may also include part or all of the second content.
  • the method further includes: after receiving the user's sliding operation on the ninth user interface, displaying an eleventh user interface, the eleventh user interface includes the same as that included in the ninth user interface The subsequent translation result associated with the translation result.
  • the GUI shown in (k) in FIG. 4 when the mobile phone detects the user's sliding operation, the subsequent translation result can be displayed.
  • FIG. 13 shows a schematic flowchart of a method 1300 for machine translation provided by an embodiment of the present application. As shown in FIG. 13, the method 1300 includes:
  • the electronic device displays a first user interface on the touch screen, the first user interface includes first content, and the language of the first content is the first language.
  • the first user interface may be a GUI as shown in (c) in FIG. 3, and the GUI includes items from the title "A family...were sleeping” to "The family was...clamped onto Matthew's arms” English content.
  • the electronic device detects a first operation of the user on the first user interface, and the first operation includes a user operation that the user triggers a full-screen translation.
  • the first operation may be an operation of the user clicking on the control 305.
  • the mobile phone detects that the user clicks on the control 305, it can first trigger the mobile phone to take a screenshot.
  • the electronic device takes a screenshot of the first user interface to obtain a first picture.
  • the first picture may be obtained by a mobile phone taking a screenshot of the original content displayed on the current screen, and the title "A family...were” displayed on the first picture Sleeping" to "The family was...clamped onto Matthew's arms” in English.
  • S1304 The electronic device automatically obtains the translation result of the first content according to the first picture, and the language of the translation result of the first content is the second language.
  • the electronic device may send the first picture to the server, and receive the translation result of the first picture returned by the server.
  • the translation result of the above-mentioned first content includes the content obtained after the text content obtained after the optical character recognition OCR text recognition of the first picture is performed from the first language to the second language.
  • the electronic device After automatically acquiring the translation result of the first content, the electronic device automatically displays a second user interface, where the second user interface includes part or all of the translation result of the first content.
  • the second user interface may be a GUI as shown in (f) in FIG. 3, and the GUI includes the translation result of the first content.
  • the translation results of the first content ranged from the title "A family of four...attacked them” to "Canada National Park...bited them in the arms of Matthew".
  • the electronic device detects a second operation of the user on the second user interface, and the second operation includes a user operation triggered by the user to perform scrolling translation.
  • the second user interface may include a control 306, and the second operation may be an operation of the user clicking the control 306.
  • the mobile phone detects that the user clicks on the control 306, the mobile phone can perform a scrolling translation operation.
  • the electronic device In response to the second operation, the electronic device automatically displays a third user interface and starts scrolling screenshots from a first position of the third user interface, the third user interface includes second content, and the first position is different from the first position.
  • the picture is associated, and the language of the second content is the first language.
  • the mobile phone after the mobile phone detects the user's operation of clicking the control 306 on the GUI as shown in (f) in FIG. 3, it can automatically display the GUI as shown in (g) in FIG. 3.
  • the GUI shown in (g) in FIG. 3 is a display interface for scrolling screenshots, and the first position may be the starting position of the title "A family...were sleeping".
  • the electronic device obtains a second picture, the second picture is a picture corresponding to the third content, the third content includes content from the first position to the second position, and the language of the third content is the first Language.
  • the electronic device when scrolling to the end position, can automatically stop scrolling the screenshot, and the second position can be “2019 Cable News...rights Reserved.” end position.
  • the second picture can be obtained, and the second picture can display the original content from the start position of the title "A family...were sleeping" to the end position of "2019 Cable News...rights Reserved.”
  • S1309 The electronic device automatically obtains the translation result of the third content according to the second picture, and the language of the translation result of the third content is the second language.
  • the electronic device may continue to obtain the translation result of the third content on the second picture.
  • the electronic device may divide the second picture into multiple pictures and send the multiple pictures to the server for translation; the electronic device receives the translation results of the multiple pictures returned by the server, and the translation results of the multiple pictures are composed The translation result of the third content.
  • the electronic device After automatically acquiring part or all of the translation result of the third content, the electronic device automatically displays a fifth user interface, where the fifth user interface includes part or all of the translation result of the third content.
  • the fifth user interface may be as shown in (k) in FIG. 3, and the GUI shown in (k) in FIG. 3 includes a part of the translation result of the third content, for example, from the title Home...attacked them" to "Canada National Park...bited them in the arms of Matthew".
  • the method further includes: after receiving the user's sliding operation on the fifth user interface, displaying a sixth user interface, the sixth user interface including the translation result included in the fifth user interface Related subsequent translation results.
  • the electronic device When the electronic device detects the user's operation of sliding up on the touch screen, the electronic device can display more translated content. Exemplarily, from (k) in FIG. 3 to (m) in FIG. 3, the process of displaying subsequent translations after the user has swiped is shown.
  • the method further includes: before the automatic acquisition of the translation result of the third content, the method further includes: the electronic device automatically divides the second picture into a plurality of pictures; and the electronic device sends the plurality of pictures to the server Picture; the electronic device receives the server's translation result of each picture in the plurality of pictures; the electronic device composes the translation result of part of the pictures in the plurality of pictures as part of the translation result of the third content, or the plurality of pictures The translation result of all the pictures in, compose the translation result of the third content.
  • the translation result of the third content includes the content obtained after the text content obtained after the OCR text recognition of the second picture is performed from the first language to the second language.
  • the method further includes: displaying first prompt information at or near the first position, the first prompt information being used to prompt the user to scroll the starting position of the screenshot; and/or, in the The end position of the first picture displays second prompt information, and the second prompt information is used to prompt the user to read the end position last time.
  • first prompt information and the second prompt information can refer to the GUI shown in FIG. 8.
  • the first prompt information and/or the second prompt information can be displayed on the scrolling screenshot interface. Prompt information.
  • the second operation includes the user clicking on the first control that can trigger the scrolling translation function or the user inputting a voice command that can trigger the scrolling translation function.
  • the second operation may be an operation of the user clicking on the control 306.
  • the first position is associated with the first picture, including: the first position is related to a specific position in the first picture, where the specific position is: the end position or the middle of the first picture The position or the position of a predetermined proportion; or, the starting position of the last segment or the starting position of the last n lines in the first picture, n is a positive integer, and n is greater than or equal to 1.
  • the scrolling screenshot can start from the paragraph "It was like...on Facebook”.
  • the position of the predetermined ratio may be two-thirds of the first picture, for example, starting from the line "when the incident...Friday," a scrolling screenshot is taken.
  • the first position is associated with the first picture, including: the first position is related to the end position or the middle position of the first content or a position of a predetermined proportion; or, the first position is related to the first picture.
  • the starting position of the last paragraph or the starting position of the last n lines in a content is related, n is a positive integer, and n is greater than or equal to 1.
  • the scrolling screenshot may start from a certain line or a certain paragraph in the English content of the title "A family...were sleeping” to "The family was...clamped onto Matthew's arms”.
  • the method before the second operation of the user is detected on the second user interface, the method further includes: displaying a control that can trigger scrolling translation on the second user interface.
  • a GUI as shown in (f) in FIG. 3 a control 306 may be displayed on the GUI.
  • the detecting the first operation of the user on the first user interface includes: after detecting the multi-finger pressing operation of the user on the first user interface, displaying a plurality of function controls, the plurality of functions
  • the control includes a first control that can trigger a full-screen translation; it is detected that the user clicks on the first control or the user inputs a voice command that can trigger the full-screen translation function.
  • control 305 before the user clicks the control 305, the user can press two fingers on the GUI as shown in (c) in Figure 3, and after the mobile phone detects the user's two finger press operation, multiple controls can be displayed.
  • the control includes control 305.
  • the automatically acquiring the translation result of the second content includes: the electronic device sends the second picture or the picture corresponding to a part of the second picture to the server; the electronic device receives the second picture returned by the server.
  • FIG. 14 shows a schematic flowchart of a method 1400 for machine translation provided by an embodiment of the present application. As shown in FIG. 14, the method 1400 includes:
  • S1401 Display a first user interface on the touch screen, where the first user interface includes first content, and the language of the first content is the first language.
  • a first operation of the user is detected on the first user interface, and the first operation includes a user operation of triggering a full-screen translation by the user.
  • S1403 In response to the first operation, take a screenshot of the first user interface to obtain a first picture.
  • S1405 After automatically acquiring the translation result of the first content, automatically display a second user interface, where the second user interface includes part or all of the translation result of the first content.
  • S1401-S1405 may refer to the above description of S1301-S1305, and for the sake of brevity, details are not repeated here.
  • a second operation of the user is detected on the second user interface, and the second operation includes a user operation triggered by the user to continue translation.
  • the electronic device can provide the user with a control to continue translation.
  • the electronic device detects that the user clicks the control to continue translation, it can directly load the translation corresponding to the remaining original text in the background All or part of. In this way, there is no need for the electronic device to jump to the original interface for scrolling screenshots, which can further enhance the user experience of the user when reading the translated text.
  • the electronic device in response to the second operation, automatically takes a screenshot to obtain a second picture, and the second picture is a picture corresponding to the second content; the automatic acquisition of the translation result of the second content includes: Picture, the translation result of the second content is automatically obtained.
  • the electronic device automatically acquiring the translation result of the second content includes: sending the second picture or the picture corresponding to a part of the second picture to the server; receiving the second picture or the first picture returned by the server; 2. The translation result of the picture corresponding to a part of the picture.
  • the electronic device automatically taking a screenshot to obtain the second picture includes: the electronic device automatically taking a screenshot of one or more screens to obtain the second picture, and the automatic screenshot process is visible or invisible to the user.
  • the electronic device automatically obtains the translation result of the second content, including: the electronic device automatically divides the second picture into multiple pictures; the electronic device sends the multiple pictures to the server; The translation result of each picture in multiple pictures; the electronic device composes the translation result of some pictures in the plurality of pictures as part of the translation result of the second content, or composes the translation result of all pictures in the plurality of pictures The translation result of the second content.
  • the second operation includes the user clicking on the first control that can trigger the continued translation function or the user inputting a voice command that can trigger the continued translation function.
  • the method further includes: after receiving the user's sliding operation on the third user interface, the electronic device displays a fourth user interface, and the fourth user interface includes the same as those included in the third user interface.
  • the subsequent translation result associated with the translation result is not limited to:
  • the method before the first operation of the user is detected on the first user interface, the method further includes: the electronic device displays a control that can trigger a full-screen translation on the first user interface.
  • the method before the second operation of the user is detected on the second user interface, the method further includes: the electronic device displays a control that can trigger the continued translation on the second user interface.
  • the detecting the first operation of the user on the first user interface includes: after detecting the multi-finger pressing operation of the user on the first user interface, the electronic device displays a plurality of functional controls, and Each functional control includes a first control that can trigger a full-screen translation; it is detected that a user clicks on the first control or a user input can trigger a voice command that can trigger the full-screen translation function.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are merely illustrative, for example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • User Interface Of Digital Computer (AREA)
  • Machine Translation (AREA)

Abstract

本申请提供了一种机器翻译的方法和电子设备,涉及人工智能(artificial intelligence,AI)、自然语言处理、机器翻译等领域,该方法包括:电子设备显示第一用户界面,该第一用户界面上显示原文内容;电子设备检测到用户触发滚动截屏的操作后,自动开始滚动截屏;电子设备通过滚动截屏获得第一图片;电子设备获得该第一图片上显示的原文内容所对应的译文内容;电子设备自动显示第二用户界面,该第二用户界面上显示该译文内容的一部分或者全部。本申请实施例,有助于提高电子设备(如智能终端设备,如手机)的智能化程度,同时可以提升用户在查看译文时的用户体验。

Description

机器翻译的方法和电子设备
本申请要求于2019年9月20日提交中国专利局、申请号为201910895234.X、申请名称为“机器翻译的方法和电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能领域,并且更具体地,涉及一种机器翻译的方法和电子设备。
背景技术
文本翻译目前广泛应用于手机、平板电脑、个人计算机(personal computer,PC)等多类电子设备,为用户提供了便捷的翻译服务。
文本翻译中包括一种基于单张图片的翻译方式,用户对着一本外文书籍的某一页拍照或在看外文新闻应用(application,APP)时想翻译当前页面内容时,那么用户需要对当前页面内容进行截屏,然后在翻译APP中输入截屏后得到的图片,从而得到翻译结果。如果用户在看一篇比较长的新闻帖子,则需要用户不断在新闻APP中进行截屏,然后切换到翻译APP中输入对应的图片得到翻译结果。如此反复,才能完成一篇外文新闻帖子的阅读。这种方式会给用户带来繁琐的操作,用户体验较差,效率较低。
发明内容
本申请提供一种机器翻译的方法和电子设备,涉及人工智能、自然语言处理和机器翻译领域,有助于提升电子设备的智能化程度和用户体验。
第一方面,提供了一种机器翻译的方法,该方法应用于具有触摸屏的电子设备,该方法包括:电子设备在该触摸屏上显示第一用户界面,该第一用户界面包括第一内容,该第一内容的语言为第一语言;电子设备在该第一用户界面上检测到第一操作,该第一操作包括用户触发进行滚屏翻译的用户操作;电子设备响应于该第一操作,从该第一用户界面的第一位置开始滚动截屏;在滚动截屏的过程中,当在第二用户界面上检测到用户的第二操作时,或者,当在所述第二用户界面滚动到结束位置时,在该第二用户界面的第二位置停止滚动截屏,电子设备得到第一图片,该第一图片为第二内容对应的图片,该第二内容包括从该第一位置到该第二位置的内容,该第二内容的语言为该第一语言;电子设备根据该第一图片,自动获取该第二内容的翻译结果,该第二内容的翻译结果的语言为第二语言;在自动获取该第二内容的翻译结果的一部分或全部后,电子设备自动显示第三用户界面,该第三用户界面包括该第二内容的翻译结果的一部分或全部。
本申请实施例中,用户在希望查看电子设备上原文内容对应的译文内容时,可以通过触发滚屏翻译的用户操作来使得电子设备先进行滚动截屏,然后获取滚动截屏得到的原文内容对应的译文内容,这样可以避免用户在查看译文时的繁琐操作,一次滚屏翻译就可以 获得多屏的译文内容,方便用户进行浏览,有助于提升电子设备的智能化程度,同时也有助于提升用户在查看译文时的用户体验。
结合第一方面,在第一方面的某些实现方式中,该方法还包括:电子设备在第四用户界面上检测到第三操作,该第四用户界面包括该第二内容的翻译结果的结尾部分,该第三操作包括用户触发进行滚屏翻译的用户操作;电子设备响应于该第三操作,自动显示第五用户界面,并从该第五用户界面的第三位置开始滚动截屏,该第五用户界面包括第三内容,该第三位置与该第一图片相关联,该第三内容的语言为该第一语言;在滚动截屏的过程中,当在第六用户界面上检测到用户的第四操作时,或者,当滚动到结束位置时,在该第六用户界面的第四位置停止滚动截屏,电子设备得到第二图片,该第二图片为第四内容对应的图片,该第四内容包括从该第三位置到该第四位置的内容,该第四内容的语言为该第一语言;电子设备根据该第二图片,自动获取该第四内容的翻译结果,该第四内容的翻译结果的语言为该第二语言;在自动获取该第四内容的翻译结果的一部分或全部后,电子设备自动显示第七用户界面,该第七用户界面包括该第四内容的翻译结果的一部分或全部。
本申请实施例中,当用户第一次进行滚屏翻译后还希望查看更多的译文内容,那么用户可以再一次触发滚屏翻译,这样可以避免用户在查看译文时的繁琐操作,一次滚屏翻译就可以获得多屏的译文内容,方便用户进行浏览,有助于提升电子设备的智能化程度,同时也有助于提升用户在查看译文时的用户体验。
结合第一方面,在第一方面的某些实现方式中,该方法还包括:电子设备在第八用户界面上检测到第五操作,该第八用户界面包括该第二内容的翻译结果的结尾部分,该第五操作包括用户触发进行继续翻译的用户操作;电子设备响应于第五操作,自动获取第五内容的翻译结果,该第五内容包括该第一语言对应的全部内容中除该第二内容以外的其他内容的一部分或者全部,该第五内容的翻译结果的语言为该第二语言;在自动获取该第五内容的翻译结果的一部分或全部后,电子设备自动显示第九用户界面或在接收到用户的滑动操作后显示第九用户界面,该第九用户界面上包括该第五内容的翻译结果的一部分或者全部。
本申请实施例中,当用户第一次进行滚屏翻译后还希望查看更多的译文内容,那么用户可以触发继续翻译,电子设备可以跳转至原文界面自动获取更多原文内容进行翻译得到更多的译文内容;也可以电子设备无需跳转至原文界面,而是在后台自动加载更多的译文内容,从而显示给用户更多的译文内容,方便用户进行浏览。
结合第一方面,在第一方面的某些实现方式中,该方法还包括:响应于该第五操作,自动截屏获得第三图片,该第三图片为该第五内容对应的图片。
在一些可能的实现方式中,该自动截屏可以是截屏,也可以是滚动截屏。
结合第一方面,在第一方面的某些实现方式中,该自动获取第五内容的翻译结果包括:电子设备向服务器发送该第三图片或该第三图片的一部分所对应的图片;电子设备接收该服务器返回的对该第三图片或该第三图片的一部分所对应的图片的翻译结果。
本申请实施例中,电子设备在获取第三图片后,向服务器发送该第三图片,或者向服务器发送该第三图片中的一部分对应的图片,由服务器对第三图片上显示的原文内容或者由服务器对第三图片的一部分所对应的图片上显示的原文内容进行翻译得到翻译结果;服务器可以将该翻译结果发送给电子设备,从而由电子设备显示给用户该翻译结果。该第三 图片或者该第三图片中的一部分对应的图片可以包括多屏的图片,那么相比于现有技术中每次只能发送一屏的图片,可以提高翻译的效率,从而提升用户在浏览译文时的用户体验。
结合第一方面,在第一方面的某些实现方式中,该自动截屏获得第三图片包括自动截取一屏或多屏的内容获得该第三图片,该自动截屏过程对用户可见或不可见。
在一些可能的实现方式中,电子设备可以通过截屏截取一屏的内容。
在一些可能的实现方式中,电子设备也可以通过滚动截屏截取多屏的内容。
本申请实施例中,该自动截屏过程可以对用户不可见。那么用户在第一次通过全屏翻译或者滚屏翻译得到译文后,如果想继续查看更多的译文,可以直接通过触发继续翻译得到更多的译文。无需跳转至原文显示截屏或者滚动截屏的过程,直接在上一次译文的基础上查看更多的译文,可以进一步提高用户浏览译文时的用户体验。
结合第一方面,在第一方面的某些实现方式中,该自动获取该第二内容的翻译结果之前,该方法还包括:电子设备自动将该第一图片切分为多张图片;其中,该第三位置与该多张图片中最后一张图片中的特定位置相关,该特定位置为:该最后一张图片的起始位置或结束位置或中间位置或预定比例的位置;或,该最后一张图片中最后一段的起始位置或最后n行的起始位置,n为正整数,n大于或等于1。
本申请实施例中,电子设备在当前显示第一语言(也可称为原文)的页面启动长截屏,自动向下滚动,期间电子设备检测到用户可以点击屏幕时停止长截屏;其次在新的页面显示已翻译成第二语言(也可称为译文)文本数据,用户可上下滑动查看;然后,用户可以在译文页面直接选择继续查看下文内容(在该页面上提供了滚屏翻译的按钮供用户点击),用户再次点击滚屏翻译按钮后则会跳转到原文页面,且跳转到原文上次停止长截屏的位置的附近(电子设备对该位置进行了记忆),电子设备可以从上次停止长截屏的位置的附近(或该位置的前若干行,通过保留一些内容的冗余,让用户能回忆起上次阅读到哪里了)再次启动滚动截屏并翻译。该方法不局限于基于网页的浏览器客户端翻译,还可用于第三方资讯APP等非浏览器场景,极大地扩展了适用场景,同时还保证了用户阅读体验的连贯性。
结合第一方面,在第一方面的某些实现方式中,该自动获取该第二内容的翻译结果,包括:电子设备向服务器发送该多张图片;电子设备接收服务器对该多张图片中每张图片的翻译结果;电子设备将该多张图片中的部分图片的翻译结果组成该第二内容的翻译结果的一部分,或将该多张图片中的全部图片的翻译结果组成该第二内容的翻译结果。
本申请实施例中,电子设备在获取第一图片后,可以将该第一图片切分为多张图片并发送给服务器进行翻译;服务器可以将该多张图片的翻译结果发送给电子设备,从而由电子设备显示给用户该翻译结果。该第一图片可以包括多张的图片,那么相比于现有技术中每次只能发送一屏的图片,可以提高翻译的效率,从而提升用户在浏览译文时的用户体验。
结合第一方面,在第一方面的某些实现方式中,该第三位置与该第一图片相关联包括:该第三位置与该第一图片中的特定位置相关,该特定的位置为:该第一图片的结束位置或中间位置或预定比例的位置;或者,该第一图片中最后一段的起始位置或最后n行的起始位置,n为正整数,n大于或等于1。
本申请实施例中,电子设备可以对该第一图片进行切分,也可以不对该第一图片进行切换。第二次滚动截屏的起始位置可以与该第一图片相关。
结合第一方面,在第一方面的某些实现方式中,该第三位置与该第一图片相关联包括:该第三位置与该第二内容相关,其中,该第三位置与该第二内容的结束位置或中间位置或预定比例的位置相关;或者,该第三位置与该第二内容中最后一段的起始位置或最后n行的起始位置相关,n为正整数,n大于或等于1。
本申请实施例中,电子设备可以对该第一图片进行切分,也可以不对该第一图片进行切换。第二次滚动截屏的起始位置可以与该第一图片上显示的第二内容相关。
结合第一方面,在第一方面的某些实现方式中,该自动获取该第二内容的翻译结果,包括:向服务器发送该第一图片或该第一图片的一部分所对应的图片;接收该服务器返回的对该第一图片或该第一图片的一部分所对应的图片的翻译结果。
结合第一方面,在第一方面的某些实现方式中,该第二内容的翻译结果包括该第一图片被进行光学字符识别OCR文本识别后获得的文本内容被进行从该第一语言到该第二语言的翻译后获得的内容。
本申请实施例中,电子设备可以通过OCR来判断是否会截断文字或者图片,如果手机确定切分处会截断文字或者图片,就可以将切分位置上移至空白行位置。电子设备将通过OCR获得的文本内容发送给服务器,服务器可以对相应的文本内容进行翻译。
结合第一方面,在第一方面的某些实现方式中,该自动获取该第二内容的翻译结果,包括:电子设备向服务器发送该第一图片或该第一图片的一部分所对应的图片;电子设备接收该服务器返回的对该第一图片或该第一图片的一部分所对应的图片的翻译结果。
结合第一方面,在第一方面的某些实现方式中,该第二内容的翻译结果包括该第一图片被进行光学字符识别OCR文本识别后获得的文本内容被进行从该第一语言到该第二语言的翻译后获得的内容。
本申请实施例中,电子设备可以通过OCR来判断是否会截断文字或者图片,如果手机确定切分处会截断文字或者图片,就可以将切分位置上移至空白行位置。
应理解,本申请实施例中,OCR文本识别可以是由电子设备执行,而文本翻译可以是由服务器执行;或者,OCR文本识别和文本翻译可以由服务器完成;或者,OCR文本识别和文本翻译也可以由同一个或者不同服务器一起完成。
结合第一方面,在第一方面的某些实现方式中,该方法还包括:在该第三位置处或该第三位置附近显示第一提示信息,该第一提示信息用于提示用户滚动截屏的起始位置;和/或,在该第二位置处或该第二位置附近显示第二提示信息,该第二提示信息用于提示用户上次阅读到该第二位置。
通过显示第一提示信息和/或第二提示信息,用户在阅读第二次滚动截屏的译文之前,可以再次熟悉第二次滚动截屏中原文的内容,对用户来说有一定记忆唤起并辅助连续阅读的作用。
结合第一方面,在第一方面的某些实现方式中,该第一操作包括用户点击能触发滚屏翻译功能的第一控件或用户输入能触发滚屏翻译功能的语音指令。
结合第一方面,在第一方面的某些实现方式中,该第三操作包括用户点击能触发滚屏翻译功能的第一控件或用户输入能触发滚屏翻译功能的语音指令。
结合第一方面,在第一方面的某些实现方式中,该方法还包括:在该第三用户界面上接收到用户的滑动操作后,显示第十用户界面,该第十用户界面上包括与该第三用户界面 上所包括的翻译结果相关联的后续翻译结果。
结合第一方面,在第一方面的某些实现方式中,该方法还包括:在该检测到该第三操作之前,该方法还包括:在该第四用户界面上显示能触发进行滚屏翻译的控件。
结合第一方面,在第一方面的某些实现方式中,该方法还包括:该检测到该第五操作之前,该方法还包括:在该第八用户界面上显示能触发进行继续翻译的控件。
结合第一方面,在第一方面的某些实现方式中,该方法还包括:该在该第一用户界面上检测到第一操作,包括:在该第一用户界面上检测到用户的多指按压操作后,显示多个功能控件,该多个功能控件包括能触发进行滚屏翻译的第一控件;检测到用户点击该第一控件或用户输入能触发滚屏翻译功能的语音指令。
结合第一方面,在第一方面的某些实现方式中,该第二内容包括该第一内容和该第一语言对应的全部内容中除该第一内容以外的其他内容的一部分或全部。
结合第一方面,在第一方面的某些实现方式中,该第三内容包括该第一语言对应的全部内容中除该第二内容以外的其他内容的一部分,该第四内容包括该第一语言对应的全部内容中除该第二内容以外的其他内容的一部分或全部。
结合第一方面,在第一方面的某些实现方式中,该方法还包括:在该第九用户界面上接收到用户的滑动操作后,显示第十一用户界面,该第十一用户界面上包括与该第九用户界面上所包括的翻译结果相关联的后续翻译结果。
第二方面,提供了一种机器翻译的方法,该方法应用于具有触摸屏的电子设备,该方法包括:电子设备在该触摸屏上显示第一用户界面,该第一用户界面上包括第一内容,该第一内容的语言为第一语言;电子设备在该第一用户界面上检测到用户的第一操作,该第一操作包括用户触发全屏翻译的用户操作;电子设备响应于该第一操作,获取对该第一用户界面进行截屏得到的第一图片;电子设备根据该第一图片,自动获取该第一内容的翻译结果,该第一内容的翻译结果的语言为第二语言;电子设备在自动获取该第一内容的翻译结果后,自动显示第二用户界面,该第二用户界面包括该第一内容的翻译结果的一部分或者全部;电子设备在该第二用户界面上检测到用户的第二操作,该第二操作包括用户触发进行滚屏翻译的用户操作;电子设备响应于该第二操作,自动显示第三用户界面并从该第三用户界面的第一位置开始滚动截屏,该第三用户界面包括第二内容,该第一位置与该第一图片相关联,该第二内容的语言为该第一语言;在滚动截屏的过程中,当在第四用户界面上检测到用户的第三操作时,或者,当在该第四用户界面滚动到结束位置时,在该第四界面的第二位置停止滚动截屏,电子设备得到第二图片,该第二图片为第三内容对应的图片,该第三内容包括从该第一位置到该第二位置的内容,该第三内容的语言为该第一语言;电子设备根据该第二图片,自动获取该第三内容的翻译结果,该第三内容的翻译结果的语言为该第二语言;电子设备在自动获取该第三内容的翻译结果的一部分或全部后,自动显示第五用户界面,该第五用户界面包括该第三内容的翻译结果的一部分或者全部。
本申请实施例中提供了先进行全屏翻译后进行滚屏翻译的过程。也就是说,用户可以先进行全屏翻译,在全屏翻译的译文界面上可以显示滚屏翻译的控件,随后用户可以再进行滚屏翻译。这样,用户在先进行全屏翻译后可以先确定自己是否对该原文内容感兴趣,如果感兴趣可以随后进行滚屏翻译查看更多的译文内容;如果对该原文内容不感兴趣,那么用户可以停止阅读当前的原文,进而查找自己感兴趣的原文。
在一些可能的实现方式中,该第二内容和该第一内容可以相同;或者,该第二内容包括第一内容的一部分。
结合第二方面,在第二方面的某些实现方式中,该自动获取该第三内容的翻译结果之前,该方法还包括:电子设备自动将该第二图片切分为多张图片;电子设备向服务器发送该多张图片;电子设备接收服务器对该多张图片中每张图片的翻译结果;电子设备将该多张图片中的部分图片的翻译结果组成该第三内容的翻译结果的一部分,或将该多张图片中的全部图片的翻译结果组成该第三内容的翻译结果。
结合第二方面,在第二方面的某些实现方式中,该第三内容的翻译结果包括该第二图片被进行OCR文本识别后获得的文本内容被进行从该第一语言到该第二语言的翻译后获得的内容。
本申请实施例中,电子设备可以通过OCR来判断是否会截断文字或者图片,如果手机确定切分处会截断文字或者图片,就可以将切分位置上移至空白行位置。电子设备将通过OCR获得的文本内容发送给服务器,服务器可以对相应的文本内容进行翻译。
结合第二方面,在第二方面的某些实现方式中,该方法还包括:电子设备在该第一位置处或者该第一位置附近显示第一提示信息,该第一提示信息用于提示用户滚动截屏的起始位置;和/或,电子设备在该第一图片的结束位置显示第二提示信息,该第二提示信息用于提示用户上次阅读到该结束位置。
本申请实施例中,通过显示第一提示信息和/或第二提示信息,用户在阅读第二次滚动截屏的译文之前,可以再次熟悉第二次滚动截屏中原文的内容,对用户来说有一定记忆唤起并辅助连续阅读的作用。
结合第二方面,在第二方面的某些实现方式中,该第二操作包括用户点击能触发滚屏翻译功能的第一控件或用户输入能触发滚屏翻译功能的语音指令。
结合第二方面,在第二方面的某些实现方式中,该第一位置与该第一图片相关联,包括:该第一位置与该第一图片中的特定位置相关,其中,该特定位置为:该第一图片的结束位置或中间位置或预定比例的位置;或者,该第一图片中最后一段的起始位置或最后n行的起始位置,n为正整数,n大于或等于1。
结合第二方面,在第二方面的某些实现方式中,该第一位置与该第一图片相关联,包括:该第一位置与该第一内容的结束位置或中间位置或预定比例的位置相关;或者,该第一位置与该第一内容中最后一段的起始位置或最后n行的起始位置相关,n为正整数,n大于或等于1。
本申请实施例中,电子设备可以从上次截屏的得到的第一图片上某一个位置(或该位置的前若干行,通过保留一些内容的冗余,让用户能回忆起上次阅读到哪里了)启动滚动截屏并翻译。该方法不局限于基于网页的浏览器客户端翻译,还可用于第三方资讯APP等非浏览器场景,极大地扩展了适用场景,同时还保证了用户阅读体验的连贯性。
结合第二方面,在第二方面的某些实现方式中,该方法还包括:在该第五用户界面上接收到用户的滑动操作后,电子设备显示第六用户界面,该第六用户界面上包括与该第五用户界面上所包括的翻译结果相关联的后续翻译结果。
结合第二方面,在第二方面的某些实现方式中,该在该第二用户界面上检测到用户的第二操作之前,该方法还包括:电子设备在该第二用户界面上显示能触发进行滚屏翻译的 控件。
结合第二方面,在第二方面的某些实现方式中,该在该第一用户界面上检测到用户的第一操作,包括:电子设备在该第一用户界面上检测到用户的多指按压操作后,显示多个功能控件,该多个功能控件包括能触发进行全屏翻译的第一控件;电子设备检测到用户点击该第一控件或用户输入能触发全屏翻译功能的语音指令。
结合第二方面,在第二方面的某些实现方式中,该自动获取该第二内容的翻译结果,包括:电子设备向服务器发送该第二图片或该第二图片的一部分所对应的图片;电子设备接收该服务器返回的对该第二图片或该第二图片的一部分所对应的图片的翻译结果。
第三方面,提供了一种机器翻译的方法,该方法应用于具有触摸屏的电子设备,该方法包括:电子设备在该触摸屏上显示第一用户界面,该第一用户界面上包括第一内容,该第一内容的语言为第一语言;电子设备在该第一用户界面上检测到用户的第一操作,该第一操作包括用户触发全屏翻译的用户操作;电子设备响应于该第一操作,对该第一用户界面进行截屏得到第一图片;电子设备根据该第一图片,自动获取该第一内容的翻译结果,该第一内容的翻译结果的语言为第二语言;电子设备在自动获取该第一内容的翻译结果后,自动显示第二用户界面,该第二用户界面包括该第一内容的翻译结果的一部分或者全部;电子设备在该第二用户界面上检测到用户的第二操作,该第二操作包括用户触发进行继续翻译的用户操作;响应于该第二操作,自动获取第二内容的翻译结果,该第二内容包括该第一语言对应的所有内容中除该第一内容以外的其他内容的一部分或者全部,该第二内容的翻译结果的语言为该第二语言;在自动获取该第二内容的翻译结果的一部分或者全部后,电子设备自动显示第三用户界面或者在接收到用户的滑动操作后显示该第三用户界面,该第三用户界面包括该第二内容的翻译结果的一部分或者全部。
本申请实施例中,电子设备在进行了一次全屏翻译后,电子设备可以为用户提供继续翻译的控件,当电子设备检测到用户点击继续翻译的控件后,可以直接在后台加载剩余原文对应的译文的全部或者一部分。这样就不用电子设备在跳转至原文界面进行滚动截屏,这样可以进一步提升用户在阅读译文时的用户体验。
结合第三方面,在第三方面的某些实现方式中,该方法还包括:响应于该第二操作,自动截屏获得第二图片,该第二图片为该第二内容对应的图片;该自动获取第二内容的翻译结果包括:根据该第二图片,自动获取该第二内容的翻译结果。
结合第三方面,在第三方面的某些实现方式中,该自动获取第二内容的翻译结果包括:电子设备向服务器发送该第二图片或该第二图片的一部分所对应的图片;电子设备接收该服务器返回的对该第二图片或该第二图片的一部分所对应的图片的翻译结果。
结合第三方面,在第三方面的某些实现方式中,该自动截屏获得第二图片包括:电子设备自动截取一屏或多屏的内容获得该第二图片,该自动截屏过程对用户可见或不可见。
本申请实施例中,当用户触发滚动截屏的操作后,电子设备可以不跳转至原文界面进行截屏,而是可以自动在后台加载剩余原文对应的译文中的一部分或者全部,避免原文和译文之间跳转给用户带来的影响。
结合第三方面,在第三方面的某些实现方式中,该自动获取第二内容的翻译结果,包括:电子设备自动将该第二图片切分为多张图片;电子设备向服务器发送该多张图片;电子设备接收服务器对该多张图片中每张图片的翻译结果;电子设备将该多张图片中的部分 图片的翻译结果组成该第二内容的翻译结果的一部分,或将该多张图片中的全部图片的翻译结果组成该第二内容的翻译结果。
结合第三方面,在第三方面的某些实现方式中,该第二操作包括用户点击能触发继续翻译功能的第一控件或用户输入能触发继续翻译功能的语音指令。
结合第三方面,在第三方面的某些实现方式中,该方法还包括:在该第三用户界面上接收到用户的滑动操作后,电子设备显示第四用户界面,该第四用户界面上包括与该第三用户界面上所包括的翻译结果相关联的后续翻译结果。
结合第三方面,在第三方面的某些实现方式中,在该第一用户界面上检测到用户的第一操作之前,该方法还包括:电子设备在该第一用户界面上显示能触发进行全屏翻译的控件。
结合第三方面,在第三方面的某些实现方式中,在该第二用户界面上检测到用户的第二操作之前,该方法还包括:在该第二用户界面上显示能触发进行继续翻译的控件。
结合第三方面,在第三方面的某些实现方式中,在该第一用户界面上检测到用户的第一操作,包括:在该第一用户界面上检测到用户的多指按压操作后,显示多个功能控件,该多个功能控件包括能触发进行全屏翻译的第一控件;检测到用户点击该第一控件或用户输入能触发全屏翻译功能的语音指令。
第四方面,提供了一种装置,该装置包含在电子设备中,该装置具有实现上述方面及上述方面的可能实现方式中电子设备行为的功能。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块或单元。
第五方面,提供了一种电子设备,包括:触摸屏;一个或多个处理器;存储器;以及一个或多个计算机程序。其中,一个或多个计算机程序被存储在存储器中,一个或多个计算机程序包括指令。当指令被电子设备执行时,使得电子设备执行上述第一方面、第二方面或者第三方面中任一项可能的实现中的机器翻译的方法。
第六方面,本技术方案提供了一种计算机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行上述任一方面任一项可能的实现中的机器翻译的方法。
第七方面,本技术方案提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述任一方面任一项可能的设计中的机器翻译的方法。
第八方面,本技术方案提供了一种芯片系统,该芯片系统包括至少一个处理器,当程序指令在该至少一个处理器中执行时,使得上述第一方面任一项可能的方法在电子设备上的功能得以实现。
附图说明
图1是本申请实施例提供的电子设备的结构示意图。
图2是本申请实施例提供的电子设备的软件结构框图。
图3是本申请实施例提供的一组GUI。
图4是本申请实施例提供的另一组GUI。
图5是本申请实施例提供的另一组GUI。
图6是本申请实施例提供的另一组GUI。
图7是本申请实施例提供的另一组GUI。
图8是本申请实施例提供的另一组GUI。
图9是本申请实施例提供的另一组GUI。
图10是本申请实施例提供的另一组GUI。
图11是本申请实施例提供的机器翻译的方法的示意性流程图。
图12是本申请实施例提供的机器翻译的方法的示意性流程图。
图13是本申请实施例提供的机器翻译的方法的示意性流程图。
图14是本申请实施例提供的机器翻译的方法的示意性流程图。
具体实施方式
以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在也包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请以下各实施例中,“至少一个”、“一个或多个”是指一个、两个或两个以上。术语“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
以下介绍电子设备、用于这样的电子设备的用户界面、和用于使用这样的电子设备的实施例。在一些实施例中,电子设备可以是还包含其它功能诸如个人数字助理和/或音乐播放器功能的便携式电子设备,诸如手机、平板电脑、具备无线通讯功能的可穿戴电子设备(如智能手表)等。便携式电子设备的示例性实施例包括但不限于搭载
Figure PCTCN2020116128-appb-000001
Figure PCTCN2020116128-appb-000002
或者其它操作系统的便携式电子设备。上述便携式电子设备也可以是其它便携式电子设备,诸如膝上型计算机(Laptop)等。还应当理解的是,在其他一些实施例中,上述电子设备也可以不是便携式电子设备,而是台式计算机。
示例性的,图1示出了电子设备100的结构示意图。电子设备100可以包括处理器110、外部存储器接口120、内部存储器121、通用串行总线(universal serial bus,USB)接口130、充电管理模块140、电源管理模块141、电池142、天线1、天线2、移动通信模块150、无线通信模块160、音频模块170、扬声器170A、受话器170B、麦克风170C、耳机接口170D、传感器模块180、指南针190、马达191、指示器192、摄像头193、显示屏194以及用户标识模块(subscriber identification module,SIM)卡接口195等。
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部 件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的部件,也可以集成在一个或多个处理器中。在一些实施例中,电子设备101也可以包括一个或多个处理器110。其中,控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。在其他一些实施例中,处理器110中还可以设置存储器,用于存储指令和数据。示例性地,处理器110中的存储器可以为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。这样就避免了重复存取,减少了处理器110的等待时间,因而提高了电子设备101处理数据或执行指令的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路间(inter-integrated circuit,I2C)接口、集成电路间音频(inter-integrated circuit sound,I2S)接口、脉冲编码调制(pulse code modulation,PCM)接口、通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口、移动产业处理器接口(mobile industry processor interface,MIPI)、用输入输出(general-purpose input/output,GPIO)接口、SIM卡接口和/或USB接口等。其中,USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口、Micro USB接口、USB Type C接口等。USB接口130可以用于连接充电器为电子设备101充电,也可以用于电子设备101与外围设备之间传输数据。该USB接口130也可以用于连接耳机,通过耳机播放音频。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110、内部存储器121、外部存储器、显示屏194、摄像头193和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量、电池循环次数、电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1、天线2、移动通信模块150、无线通信模块160、调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络)、蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS)、调频(frequency modulation,FM)、近距离无线通信技术(near field communication,NFC)、红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像、视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD)、有机发光二极管(organic light-emitting diode,OLED)、有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED)、柔性发光二极管(flex light-emitting diode,FLED)、Miniled、MicroLed、Micro-oLed、量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或多个显示屏194。
在本申请的一些实施例中,当显示面板采用OLED、AMOLED、FLED等材料时,上述图1中的显示屏194可以被弯折。这里,上述显示屏194可以被弯折是指显示屏可以在任意部位被弯折到任意角度,并可以在该角度保持,例如,显示屏194可以从中部左右对折。也可以从中部上下对折。
电子设备100的显示屏194可以是一种柔性屏,目前,柔性屏以其独特的特性和巨大的潜力而备受关注。柔性屏相对于传统屏幕而言,具有柔韧性强和可弯曲的特点,可以给用户提供基于可弯折特性的新交互方式,可以满足用户对于电子设备的更多需求。对于配置有可折叠显示屏的电子设备而言,电子设备上的可折叠显示屏可以随时在折叠形态下的小屏和展开形态下大屏之间切换。因此,用户在配置有可折叠显示屏的电子设备上使用分屏功能,也越来越频繁。
电子设备100可以通过ISP、摄像头193、视频编解码器、GPU、显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点、亮度、肤色进行算法优化。ISP还可以对拍摄场景的曝光、色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或多个摄像头193。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1、MPEG2、MPEG3、MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别、人脸识别、语音识别、文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储一个或多个计算机程序,该一个或多个计算机程序包括指令。处理器110可以通过运行存储在内部存储器121的上述指令,从而使得电子设备101执行本申请一些实施例中所提供的机器翻译的方法,以及各种应用以及数据处理等。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统;该存储程序区还可以存储一个或多个应用(比如图库、联系人等)等。存储数据区可存储电子设备101使用过程中所创建的数据(比如照片,联系人等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储部件,闪存部件,通用闪存存储器(universal flash storage,UFS)等。在一些实施例中,处理器110可以通过运行存储在内部存储器121的指令,和/或存储在设置于处理器110中的存储器的指令,来使得电子设备101执行本申请实施例中所提供的机器翻译的方法,以及其他应用及数据处理。电子设备100可以通过音频模块170、扬声器170A、受话器170B、麦克风170C、耳机接口170D、以及应用处理器等实现音频功能。例如音乐播放、录音等。
传感器模块180可以包括压力传感器180A、陀螺仪传感器180B、气压传感器180C、 磁传感器180D、加速度传感器180E、距离传感器180F、接近光传感器180G、指纹传感器180H、温度传感器180J、触摸传感器180K、环境光传感器180L、骨传导传感器180M等。
其中,压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即X、Y和Z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施 例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
图2是本申请实施例的电子设备100的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。应用程序层可以包括一系列应用程序包。
如图2所示,应用程序包可以包括相机、图库、日历、通话、地图、导航、WLAN、蓝牙、音乐、视频、短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架,应用程序框架层包括一些预先定义的函数。
如图2所示,应用程序框架层可以包括窗口管理器、内容提供器、视图系统、电话管理器、资源管理器、通知管理器等。
窗口管理器用于管理窗口程序,窗口管理器可以获取显示屏大小,判断是否有状态栏、锁定屏幕、截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频、图像、音频、拨打和接听的电话、浏览历史和书签、电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串、图标、图片、布局文件、视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息、发出提示音、电子设备振动、指示灯闪烁等。
系统库可以包括多个功能模块。例如:表面管理器(surface manager)、媒体库(media libraries)、三维图形处理库(例如:OpenGL ES)、2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频、视频格式回放和录制以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4、H.264、MP3、AAC、AMR、JPG和PNG等。
三维图形处理库用于实现三维图形绘图、图像渲染、合成和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动、摄像头驱动、音频驱动、传感器驱动。
在介绍本申请实施例的机器翻译的方法之前,先介绍几个和本申请实施例相关的概念。
全屏截屏/全屏截图:对当前电子设备显示的内容做“快照”操作,形成一张同屏幕长宽一致并且内容一致的图片。例如,在iPhone中使用Home键和电源键同时短按一次可以进行全屏截屏,或者无Home键的机型使用音量增加键和电源键同时短按一次触发。又例如,在华为手机上可以采用指关节敲击屏幕两次触发。其他厂商也可以有其他启动全屏截屏的方式。
长截屏/长截图:对电子设备显示的内容通过某种交互方式触发后生成一张长度超过屏幕高度的图片,内容是从当前显示的位置开始往下截取超过一屏内容连贯的一张长图片。例如,在华为手机上是指关节在屏幕上画“S”启动,点击则停止。其他厂商也可以有其他启动长截屏的方式。
为了便于理解,本申请以下实施例将以具有图1和图2所示结构的手机为例,结合附图对本申请实施例提供的机器翻译的方法进行具体阐述。
图3示出了手机的一组图形用户界面(graphical user interface,GUI),其中,从图3中的(a)到图3中的(m)示出了用户进行全屏翻译和滚屏翻译的过程。
参见图3中的(a)所示的GUI,该GUI为手机的桌面。其中手机的桌面包括3个桌面页面,每个桌面页面包括一个或者多个应用程序(Application,APP)的图标。其中,当前手机的桌面显示的是第二个桌面页面301,这个桌面页面上包括支付宝的图标、任务卡商店的图标、微博的图标、英语阅读的图标302、微信的图标、卡包的图标、设置的图标和相机的图标。当手机检测到用户点击图标302的操作后,可以显示如图3中的(b)所示的GUI。
参见图3中的(b)所示的GUI,该GUI为英语阅读APP的显示界面。该显示界面包括多篇英文短文。其中包括标题为“A family of four was on a camping trip in Canada.Then a wolf attacked while they were sleeping”的英文短文303、标题为“Draft law seeks strict action against throwing objects from buildings”的英文短文和标题为“71-Year-Old Grandma Sets New Half Marathon World Record in Ohio”的英文短文。当手机检测到用户点击英文短文303的操作后,可以显示如图3中的(c)所示的GUI。
参见图3中的(c)所示的GUI,该GUI为英文短文303的显示界面。其中,用户可以通过在屏幕上上下滑动来阅读该英文短文的原文。参见图3中的(c)所示,当手机检测到用户双指按压界面的操作时,手机可以显示如图3中的(d)所示的GUI。
参见图3中的(d)所示的GUI,该GUI为智慧识屏的显示界面。当手机检测到用户双指按压屏幕的操作时,手机可以自动弹出提醒框304,该提醒框304可以是智慧识屏的显示界面,手机可以自动通过识别出该英文短文中的分词,例如,“wolf”、“It”、“was”、“Something”、“out”和“a”等等分词。该提醒框304中还可以包括搜索、复制、地图、分享和全屏翻译等等控件。当手机检测到用户点击控件305的操作时,可以显示如图3中的(e)所示的GUI。
本申请实施例中,手机可以具备智慧识屏功能。其中,智慧识屏功能可以包括手机检测到双指按压文字后,手机可以自动提取按压区域的文字内容,分析关键词等等;还可以包括手机检测到双指按压图片后,手机提取按压区域的图片内容并分析图片中的物品。
应理解,本申请实施例中,全屏翻译还可以理解为对当前屏幕上显示的原文进行翻译,或者,对当前屏幕进行截屏或者截图操作后显示的一屏内容进行翻译。当手机检测到用户点击控件305时,手机可以自动翻译如图3中的(c)所示的屏幕上的原文。
参见图3中的(e)所示的GUI,该GUI为全屏翻译的加载界面。其中,手机默认将当前屏幕的英文翻译为中文。当手机对当前屏幕上显示的内容翻译完成时,可以自动显示如图3中的(f)所示的GUI。
参见图3中的(f)所示的GUI,该GUI为全屏翻译的译文界面。手机将图3中的(c)上显示的英文短文翻译为了对应的中文。用户还可以点击该译文界面上的译文语种。例如,当用户点击“中文”时,可以显示多个其他外文语种,用户可以选择其他译文语种。该译文界面还包括滚屏翻译的控件306和复制译文的控件。当手机检测到用户点击控件306的操作时,可以显示如图3中的(g)所示的GUI。
应理解,本申请实施例中,滚屏翻译还可以称之为长截屏翻译。与全屏翻译的区别是,滚屏翻译可以是手机先对原文的内容进行长截屏,然后可以自动对长截屏上的内容(可以是多屏的内容)进行翻译,而全屏翻译可以只对例如图3中的(c)所示的当前原文显示的内容(一屏的内容)进行翻译。
参见图3中的(g)所示的GUI,该GUI为长截屏的滚屏显示界面。如图3中的(g)所示,该长截屏的滚屏显示界面上可以包括提醒框307。其中提醒框307中可以通过文字提醒用户“正在滚动截屏..点击滚动区域可以完成截屏”。手机可以自动向下翻滚屏幕。示例性的,从图3中的(g)至图3中的(h),再到图3中的(i)均为手机自动下面滚动的过程。
参见图3中的(i)所示的GUI,当手机在滚动截屏中翻滚到该英文短文的最底部(或者,英文短文的末端)时,手机可以自动完成自动截屏,此时长截屏的起始位置可以为如图3中的(c)所示的英文短文的开头,长截屏的终点位置可以是英文短文的末端。当手机完成长截屏时,手机可以自动显示如图3中的(j)所示的界面。
参见图3中的(j)所示的GUI,该GUI为滚屏翻译的加载界面。手机可以将长截屏上的英文翻译为对应的中文。当翻译完成时,手机可以自动显示如图3中的(k)所示的GUI。
参见图3中的(k)所示的GUI,该GUI为滚屏翻译的译文界面。手机将长截屏上的英文短文翻译为了对应的中文。当手机在屏幕上检测到用户向上滑动的操作后,手机可以滚动显示该译文内容。在滚动显示该译文内容的过程中,该滚屏翻译的译文界面上还可以出现滚动条308。当手机向下滚动显示该译文内容时,滚动条308也可以对应的向下滑动。滚动条308的位置可以对应当前界面上的译文在整个译文的位置。
从图3中的(k)至图3中的(m)为手机滚动显示该译文内容的变化过程。用户可以通过向上或者向下滑动查看对应的译文。
一个实施例中,当用户查看完该长截屏对应的译文时,可以点击控件309退出该滚屏翻译的译文界面。本申请实施例中,当手机检测到用户点击控件309的操作后,可以显示原文界面,该原文界面可以是电子设备开始进行滚动截屏时的原文内容显示界面。示例性的,当手机检测到用户点击控件309的操作时,可以显示如图3中的(c)所示的GUI。
应理解,上述图3中的(i)是以滚动截屏中滚动到英文短文的末端后自动停止长截 屏为例进行说明的,也可以是在手机屏幕自动滚动到英文短文的末端之前,手机在屏幕上检测到用户点击操作后自动停止长截屏,对应的过程可以参考图4中的GUI。
还应理解,上述图3中的(k)至(i)中的译文界面上可以继续显示滚屏翻译的控件306。也可以是手机在确定已经翻译完英文短文的整个内容后(或者,手机确定长截屏是以滚动到英文短文的末端自动停止),可以在该译文界面不显示该滚屏翻译的控件306。
以上结合图3中的(a)至(i)介绍了用户从打开英文短文,先进行全屏翻译后进行滚屏翻译的过程。也就是说,用户可以先进行全屏翻译,在全屏翻译的译文界面上可以显示滚屏翻译的控件,随后用户可以再进行滚屏翻译。这样,用户在先进行全屏翻译后可以先确定自己是否对该原文内容感兴趣,如果感兴趣可以随后进行滚屏翻译查看更多的译文内容;如果对该原文内容不感兴趣,那么用户可以停止阅读当前的原文,进而查找自己感兴趣的原文。
下面结合图4介绍本申请实施例提供的另一组GUI。
参见图4中的(a)所示的GUI,该GUI为智慧识屏的显示界面。其中,用户可以通过在屏幕上上下滑动来阅读该英文短文的原文。参见图4中的(a)所示,当手机检测到用户双指按压界面的操作时,手机可以显示如图4中的(b)所示的GUI。
参见图4中的(b)所示的GUI,该GUI为该GUI为智慧识屏的另一显示界面。相比于图3中的(d),图4中的(b)中的智慧识屏界面上包括了全屏翻译和滚屏翻译两个控件。用户可以选择全屏翻译,即对图4中的(a)所示界面上的原文内容(一屏内容)进行翻译;也可以选择滚屏翻译,即可以先进行长截屏,并对长截屏上显示的原文内容(可以是多屏内容)进行翻译。当手机检测到用户点击控件401的操作时,显示如图4中的(c)所示的GUI。
参见图4中的(c)所示的GUI,该GUI为长截屏的滚屏显示界面。如图4中的(c)所示,该长截屏的滚屏显示界面上可以包括提醒框402。其中提醒框402中可以通过文字提醒用户“正在滚动截屏..点击滚动区域可以完成截屏”。手机可以自动向下翻滚屏幕。示例性的,从图4中的(c)至图4中的(d)均为英文短文自动下面滚动的过程。
参见图4中的(d)所示的GUI,该GUI为长截屏的滚屏的另一显示界面。当手机检测到用户在屏幕上的点击动作时,手机可以完成长截屏操作。手机可以自动显示如图4中的(e)所示的GUI。
参见图4中的(e)所示的GUI,该GUI为滚屏翻译的加载界面。手机可以将长截屏上的英文翻译为对应的中文。当翻译完成时,手机可以自动显示如图4中的(f)所示的GUI。
参见图4中的(f)所示的GUI,该GUI为滚屏翻译的译文界面。手机将长截屏上的英文短文翻译为了对应的中文。当手机在屏幕上检测到用户向上或者向下滑动的操作后,手机可以滚动显示该译文内容。
从图4中的(f)至图4中的(g)所示的GUI的变化过程为用户查看第一次长截屏得到的多屏内容对应的译文的过程。用户在查看完后,如果想继续查看剩余的原文对应的译文,可以点击滚屏翻译控件403。当手机检测到用户点击控件403的操作后,可以显示如图4中的(h)所示的GUI。
参见图4中的(h)所示的GUI,该GUI为滚动截屏的另一显示界面。手机可以从“Fee  said he immediately…rocks at it”(第一次长截屏的最后一段)开始进行长截屏。
参见图4中的(i)所示的GUI,当手机检测到用户在屏幕上的点击操作时,可以完成滚屏翻译。长截屏的最后一段为图4中的(i)所示的“Incidents like these are extremely…in Ontario”。
应理解,图4中的(c)至图4中的(d)可以为第一次长截屏的过程,图4中的(h)至(i)可以为第二次长截屏的过程。
一个实施例中,手机进行下一次长截屏时,下一次长截屏的起点可以是上一次长截屏的最后一段,如图4中的(h)所示,第二次长截屏的起点可以是第一次长截屏的最后一段。
一个实施例中,手机进行下一次长截屏时,下一次长截屏的起点可以是上一次长截屏的最后两段等等。
示例性的,手机也可以从““The screams were so…situation,”…in the back hip area”(第一次长截屏的倒数第二段)开始进行长截屏。
一个实施例中,手机进行下一次长截屏时,下一次长截屏的起点可以是上一次长截屏的最后一屏内容。
应理解,手机在进行长截屏后,如果长截屏的内容超过一屏的大小,那么手机可以对长截屏的内容切分成多屏的内容。
示例性的,手机可以将长截屏产生的长图按照图片的高度和手机屏幕的高度的关系做切分,在切分的位置利用光学字符识别(optical character recognition,OCR)来判断是否会截断文字或者图片,如果手机确定切分处会截断文字或者图片,就可以将切分位置上移至空白行位置,得到高度略小于或者等于屏幕高度的若干张图片。那么下一次滚屏翻译时,长截屏就可以从上一次长截屏得到的多张图片(或者,多屏内容)中最后一张图片(或者,最后一屏的内容)开始进行长截屏。或者,手机也可以对上一次长截屏的得到的最后一张图片(或者,最后一屏的内容)进行分析后,提取中最后一张图片中最后一段或者最后几段的内容作为下一次滚屏翻译时长截屏的起点。
这样做的好处是用户在阅读体验上是从上一次译文最后一张图片(或者,最后一屏的内容)或者最后一张图片(或者,最后一屏的内容)的最后几段开始,对用户来说有一定记忆唤起并辅助连续阅读的作用。
参见图4中的(i)所示的GUI,当手机检测到用户在屏幕上的点击操作时,可以自动显示如图4中的(j)所示的GUI。
参见图4中的(j)所示的GUI,该GUI为滚屏翻译的另一加载界面。手机可以将长截屏上的英文翻译为对应的中文。当翻译完成时,手机可以自动显示如图4中的(k)所示的GUI。
参见图4中的(k)所示的GUI,该GUI为滚屏翻译的译文界面。手机将长截屏上的英文短文翻译为了对应的中文。当手机在屏幕上检测到用户向上或者向下滑动的操作后,手机可以滚动显示该译文内容。
从图4中的(k)至图4中的(l)所示的GUI的变化过程为用户查看第二次长截屏得到的多屏内容对应的译文的过程。用户在查看完后,如果想继续查看剩余的原文对应的译文,可以点击滚屏翻译控件403,手机可以进行第三次滚屏翻译。第三次滚屏翻译的过 程可以参考上述第二次滚屏翻译的过程,为了简洁,在此不再赘述。
本申请的实施例提供了一种机器翻译方法,首先手机在当前显示第一语言(也可称为原文)的页面启动长截屏,自动向下滚动,期间手机检测到用户可以点击屏幕时停止长截屏;其次在新的页面显示已翻译成第二语言(也可称为译文)文本数据,用户可上下滑动查看;然后,用户可以在译文页面直接选择继续查看下文内容(在该页面上提供了滚屏翻译的按钮供用户点击),用户再次点击滚屏翻译按钮后则会跳转到原文页面,且跳转到原文上次停止长截屏的位置(手机对该位置进行了记忆),手机可以从上次停止长截屏的位置(或该位置的前若干行,通过保留一些内容的冗余,让用户能回忆起上次阅读到哪里了)再次启动长截屏并翻译,重复上述过程直到文章末尾。该方法不局限于基于网页的浏览器客户端翻译,还可用于第三方资讯APP等非浏览器场景,极大地扩展了适用场景,同时还保证了用户阅读体验的连贯性。
本申请实施例中,当用户触发对原文进行翻译的操作后,电子设备可以显示全屏翻译和滚屏翻译的入口,为用户提供了多种翻译的方式,方便用户进行选择,提升了用户在对原文进行翻译时的用户体验。
以上图3和图4所示的两组GUI中是以点击滚屏翻译控件后触发长截屏,然后对长截屏得到的一张或者多张图片进行翻译的过程。下面结合图5介绍先进行长截屏操作,在得到长截屏图片的处理界面上触发对长截屏图片的翻译的过程。
图5示出了本申请实施例提供的另一组GUI。
参见图5中的(a)所示的GUI,该GUI为英文短文303的显示界面。当手机检测到用户在该界面上用指关节划出“S”时,手机可以启动长截屏的操作,自动显示如图5中的(b)所示的GUI。
参见图5中的(b)所示的GUI,该GUI为长截屏的滚屏显示界面。如图5中的(b)所示,该长截屏的滚屏显示界面上可以包括提醒框501。其中提醒框501中可以通过文字提醒用户“正在滚动截屏..点击滚动区域可以完成截屏”。手机可以自动向下翻滚屏幕。示例性的,从图5中的(b)至图5中的(c)均为英文短文自动下面滚动的过程。
参见图5中的(c)所示的GUI,该GUI为长截屏的滚屏的另一显示界面。当手机检测到用户在屏幕上的点击动作时,手机可以完成长截屏操作。手机可以自动显示如图5中的(d)所示的GUI。
参见图5中的(d)所示的GUI,该GUI为长截屏得到的图片的处理界面。该处理界面包括对该长截屏得到的图片的处理方式,其中,处理方式包括分享、编辑、删除和翻译。用户可以通过点击分享将该长截屏得到的图片分享给其他用户;用户也可以通过点击编辑对该长截屏得到的图片进行编辑,例如,可以对图片进行亮度、曝光度以及裁剪等等编辑处理;用户还可以通过点击删除来删除该长截屏得到的图片。当手机检测到用户点击翻译对应的控件502的操作时,手机可以显示如图5中的(e)所示的GUI。
应理解,与上述图4中的(d)和图4中的(i)不同的地方是,图4中的(d)和图4中的(i)中是在滚动截屏(或者长截屏)结束后自动进行翻译,也就是说手机在检测到用户点击滚屏翻译的控件后,可以自动触发滚动截屏(或者长截屏)和机器翻译两个动作。而对于图5中的(d),是在长截屏得到的图片的处理界面检测到用户点击翻译控件502的操作后再触发机器翻译,也就是说触发长截屏和机器翻译需要手机检测到用户不同的触 发操作。
参见图5中的(e)所示的GUI,该GUI为长截屏得到的图片的翻译加载界面。手机可以将长截屏得到的图片上的英文翻译为对应的中文。当翻译完成时,手机可以自动显示如图5中的(f)所示的GUI。
参见图5中的(f)所示的GUI,该GUI为长截屏得到的图片的译文界面。手机将长截屏得到的图片上的英文短文翻译为了对应的中文。当手机在屏幕上检测到用户向上或者向下滑动的操作后,手机可以滚动显示该译文内容。
一个实施例中,若用户希望继续查看英文短文剩余的内容对应的译文,可以点击图5中的(f)所示的滚屏翻译的控件503,则手机可以继续进行滚屏翻译的过程,该滚屏翻译的过程可以参考上述图3或者图4中的GUI。
图6示出了本申请实施例提供的另一组GUI。
参见图6中的(a)所示的GUI,该GUI为英文短文303的显示界面。当手机检测到用户在该界面上“family”这个单词上的按压操作时,可以自动显示如图6中的(b)所示的GUI。
参见图6中的(b)所示的GUI,该GUI为英文短文303的另一显示界面。该显示界面上可以自动弹出提醒框601。其中,提醒框601包括复制、分享、全选、网页搜索、搜索和控件602。
参见图6中的(c)所示的GUI,该GUI为英文短文303的另一显示界面。当手机检测到用户点击控件602的操作后,可以自动弹出提醒框603,其中,提醒框603中包括滚屏翻译和全屏翻译。
参见图6中的(d)所示的GUI,该GUI为英文短文303的另一显示界面。当手机检测到用户点击滚屏翻译的控件604的操作后,可以进行滚屏翻译,后续的GUI显示可以参考图4中的(c)至(g),为了简洁,在此不再赘述。
图7示出了本申请实施例提供的另一组GUI。
参见图7中的(a)所示的GUI,该GUI为英文短文303的显示界面。当手机检测到用户在该界面上“family”这个单词上的按压操作时,可以自动显示如图7中的(b)所示的GUI。
参见图7中的(b)所示的GUI,该GUI为英文短文303的另一显示界面。该显示界面上手机可以自动选中单词“family”并自动弹出提醒框701。其中,提醒框701包括复制、分享、全选、网页搜索和搜索等等。当手机检测到用户点击光标701向右滑动时,手机可以选中更多的单词,并显示如图7中的(c)所示的GUI。
参见图7中的(c)所示的GUI,该GUI为英文短文303的另一显示界面。该显示界面上手机可以根据用户的滑动操作自动选中多个单词“family was fast asleep”并自动在提醒框701中增加滚屏翻译的功能选项。
参见图7中的(d)所示的GUI,当手机检测到用户点击滚屏翻译的控件702的操作后,可以进行滚屏翻译,后续的GUI显示可以参考图4中的(c)至(g),为了简洁,在此不再赘述。
本申请实施例中,为了增加对用户的提示,手机还可以在进行下一次滚屏翻译(或者,长截屏翻译)时,在GUI上增加对截屏起始位置以及上次阅读到的位置的提示。
图8示出了本申请实施例提供的另一组GUI。
参见图8中的(a)所示的GUI,该GUI可以为第一次滚屏翻译的译文界面。手机将第一次长截屏得到的图片上的英文短文翻译为了对应的中文。当手机在屏幕上检测到用户向上或者向下滑动的操作后,手机可以滚动显示该译文内容。当手机在该译文界面检测到用户点击控件801的操作时,可以显示如图8中的(b)所示的GUI。
参见图8中的(b)所示的GUI,该GUI可以为第二次滚屏翻译的显示界面。在该显示界面可以包括对用户的两个提醒信息,一个提醒信息是在“Fee said he immediately…rocks at it”这一段之前,手机可以提醒用户“此次截屏的起始位置”,并在这一段之后提醒用户“上次阅读到此处”。
参见图8中的(c)所示的GUI,该GUI为第二滚动截屏的另一显示界面。当手机检测到用户在屏幕上的点击操作时,手机可以完成第二次滚动截屏,并显示如图8中的(d)所示的GUI。
参见图8中的(d)所示的GUI,该GUI第二次滚动截屏的译文加载界面。该加载界面上也可以显示上述提醒信息,以方便用户在阅读第二次滚动截屏的译文之前,也可以先查看此次滚动截屏的起点和上一次阅读到的原文的位置,这样做的好处是用户在阅读第二次滚动截屏的译文之前,可以再次熟悉第二次滚动截屏中原文的内容,对用户来说有一定记忆唤起并辅助连续阅读的作用。
参见图8中的(e)所示的GUI,该GUI为第二次滚动截屏的译文显示界面。该译文显示界面也可以显示上述提醒信息。
一个实施例中,手机可以只显示上述两个提醒信息中的其中一个。
示例性的,在图8中的(b)、(d)和(e)中可以只显示“上次阅读到此处”这一提醒信息。
示例性的,在图8中的(b)、(d)和(e)中可以只显示“此次截屏的起始位置”这一提醒信息。
图9示出了本申请实施例提供的另一组GUI。
参见图9中的(a)所示的GUI,该GUI可以为第一次滚屏翻译的译文界面。当手机在该译文界面检测到用户点击控件901的操作时,可以显示如图9中的(b)所示的GUI。
参见图9中的(b)所示的GUI,该GUI可以为第二次滚屏翻译的显示界面。相比于图4中的(h),第二次滚动截屏中并不包含上一次滚动截屏中的任何内容,也就是说第二次滚动截屏可以不包含任何冗余的原文内容。
参见图9中的(c)所示的GUI,该GUI为第二滚动截屏的另一显示界面。当手机检测到用户在屏幕上的点击操作时,手机可以完成第二次滚动截屏,并显示如图9中的(d)所示的GUI。
参见图9中的(d)所示的GUI,该GUI为第二次滚动截屏的译文加载界面。
参见图9中的(e)所示的GUI,该GUI为第二次滚动截屏的译文显示界面。该译文显示界面显示的译文内容也不包含第一次滚动截屏的译文内容。
从图9中的(e)至图9中的(f)为手机滚动显示译文内容的过程。当手机检测到用户向上或者向下滑动的操作时,手机可以滚动显示该译文内容。
以上图3至图9所示的GUI中,当第一次全屏翻译完成进行下一次滚屏翻译时,电 子设备需要切回到原文的显示界面进行滚屏翻译,然后再切回到译文界面,从而用户可以查看想要的译文内容。本申请实施例中,当电子设备进行了一次全屏翻译或者滚屏翻译后,如果检测到用户点击滚屏翻译的控件的操作后,也可以不切回原文界面,而是可以直接在后台加载剩余的原文,对剩余的原文进行滚动截屏并获得剩余的原文的一部分或全部的翻译,用户在译文界面可以继续阅读后续的译文,不用在多个界面间跳转,提高了用户阅读的连贯性体验。
图10示出了本申请实施例提供的另一组GUI。
参见图10中的(a)所示的GUI,该GUI为用户第一次进行滚屏翻译后的译文显示界面,用户可以通过手指向上滑动来查看第一次滚屏翻译的译文内容。
示例性的,图10中的(a)可以是按照上述图4中的(a)至图4中的(f)得到的GUI。
参见图10中的(b)所示的GUI,该GUI为用户第一次进行滚屏翻译后的译文显示界面,可以看出,第一次滚屏翻译的结尾段落是“费说…朝他扔石头。”当手机检测到用户点击控件1001的操作后,手机可以显示如图10中的(c)所示的GUI。
参见图10中的(c)至图10中的(e)所示的GUI,该GUI为另一译文显示界面。当手机检测到用户点击控件1001的操作后,手机可以自动在后台加载剩余原文对应的译文并显示给用户。
应理解,当用户点击控件1001后,手机可以将剩余的原文全部翻译后向用户呈现剩余全部原文对应的译文。在向用户显示剩余全部的译文内容时,继续翻译控件1001和复制译文控件可以不显示在译文显示界面上。
一个实施例中,在手机点击控件1001后,手机还可以提示用户选择翻译剩余原文的百分比,例如,手机可以提示用户选择翻译剩余原文的20%、40%、60%、80%或100%等。当手机检测到用户点击某个百分比后,手机可以按照该百分比去对剩余的原文进行截图,进而获得该截图所对应的内容的翻译,以呈现给用户。
一个实施例中,在手机点击控件1001后,手机可以自动对剩余的原文截取1屏或多屏,进而获得截图所对应的内容的翻译,以呈现给用户。如,可以默认用户点击一次控件1001,则手机自动对剩余的原文截取两屏。
一个实施例中,用户可以在第一次全屏翻译后得到的译文界面上点击继续翻译的控件,进而手机可以自动将剩余全部原文对应的译文呈现给用户。具体地,这种情况下,用户在点击继续翻译的控件后,手机可以自动对剩余的原文进行滚动截屏,截取的内容可以包括剩余的原文的全部,该滚动截屏过程对用户可见或不可见。示例性的,如图3中的(f),当用户点击控件306(可以称为“滚屏翻译”,也可以称为“继续翻译”)的操作后,可以不用切换到图3中的(g)的界面进行滚动截屏,而是可以直接显示图3中的(k)至图3中的(m)所示的译文界面。在图3中的(k)至图3中的(m)所示的GUI上也可以不显示滚动截屏控件和复制译文控件。
上述图10中的(a)至(e)所示的GUI中,用户如果想查看更多的译文,那么手机检测到用户点击继续翻译控件后,电子设备可以进行在后台进行截屏(可以是全屏截屏,也可以是长截屏)后自动获得更多原文的翻译结果并呈现给用户,避免了在原文和译文之间的来回跳转,可以进一步提升用户查看译文时的用户体验。
以上结合图3至图10中的GUI介绍了本申请实施例提供的机器翻译过程的GUI,下 面结合图11介绍本申请实施例提供的另一机器翻译的方法。
图11示出了本申请实施例提供的机器翻译的方法1100的示意性流程图,如图11所述,该方法1100的执行主体可以为手机,该方法包括:
S1101,手机在原文显示界面检测到双手按压的操作,启动智慧识屏。
示例性的,参见图4中的(a)所示,手机在英文短文的显示界面检测到双指按压的操作后,启动智慧识屏,其中,智慧识屏中可以包括全屏翻译的功能选项和滚屏翻译的功能选项(功能选项也可以称之为控件)。
S1102,手机检测到用户点击滚屏翻译的操作,手机开始自动滚动屏幕。
示例性的,参见图4中的(b)所示,当手机检测到用户点击控件401的操作时,手机可以启动滚屏翻译。
用户在阅读原文的时候双指按压屏幕会出现滚屏翻译的入口,点击后启动长截屏操作,以一定速率和节奏自动上滑屏幕内容,在并在上方提示用户可以点击停止截屏,或达到文章末尾也会自动停止截屏。
示例性的,参见图4中的(c)至图4中的(d),为手机自动滚动屏幕的过程。
S1103,当手机检测到用户点击屏幕的某一个位置,或者,当手机检测到原文自动滑动到页面底部时,手机可以停止滚动截屏。
示例性的,参见图4中的(d)所示,当手机检测到用户点击屏幕的某一个位置时,手机可以停止滚动截屏。
S1104,获取通过长截屏得到的长图。
S1105,对长截屏得到的长图进行裁剪,得到高度小于或者等于预设高度的多个小图,每裁剪好一张小图可以送到云端进行翻译。
一个实施例中,该预设高度为手机屏幕的高度。
一个实施例中,该预设高度为小于手机屏幕的高度的一个预设值。
示例性的,手机可以将长截屏产生的长图按照图片高度和手机屏幕高度的关系做切分,在切分的位置利用OCR来判断是否会截断文字或图片,如果发现切分处会截断文字或图片,就将切分位置上移至空白行位置,得到高度略小于等于屏幕高度的若干张图片。
在切分过程中可以将生成的多个小图按照原文顺序进行编号,每生成一张小图即发送到翻译云端进行翻译。
应理解,手机在将长图切分为多个小图时,可以对每个小图按照原文顺序进行编号,或者,也可以理解为手机对每个小图添加标签信息,并将这些小图发送给翻译云端进行翻译。
S1106,手机从云端获取每个小图的翻译结果。
S1107,手机确定每个小图是否翻译成功。
应理解,手机在判断就每个小图是否翻译成功时,可以根据每个小图翻译的接口保存的成功与否的标志位进行判断。
S1108,若接收的小图翻译成功,那么手机将小图对应的翻译结果渲染并保存。
S1109,若接收的小图翻译失败,那么手机将该小图对应的原文保存为翻译结果。
S1110,手机判断是否接收到所有小图的翻译结果。
S1111,若手机接收到所有小图的翻译结果,那么手机可以继续判断所有小图中翻译 成功的图片个数是否小于预设的阈值。
如果手机还没有接收到所有小图的翻译结果,那么手机可以继续执行S1106。
S1112,若手机确定所有小图中翻译成功的图片个数小于预设的阈值,那么手机可以使用列表试图显示出所有的翻译结果。
S1113,若手机确定所有小图中翻译成功的图片个数大于或者等于预设的阈值,那么手机可以提示用户翻译失败,并提示用户是否重新进行翻译。
一个实施例中,手机拿到云端返回的翻译结果后,判断返回结果是否成功翻译,如果成功则将翻译结果渲染并保存;如果失败则将原文保存为翻译结果。当手机接收到所有小图的翻译结果后,计算翻译失败的页面比例是否超过设定的阈值(例如,失败的总页数占比大于等于60%),则提示用户重试(此种情况概率较低);如果成功,则根据返回的页面编码顺序或者标签(即原文顺序)进行排序并显示,译文显示内容从长图中的第一个小图开始。
示例性的,手机对长截屏得到的长图进行切分,得到了10张小图,每张小图按照顺序进行编号后发给云端。手机从云端得到对10张小图的翻译结果,其中,对8张小图翻译成功,对2张小图翻译失败,那么手机也可以确定此次滚屏翻译是成功的。手机在显示翻译结果时,可以对这10张小图的翻译结果按照编号进行拼接,其中,2张翻译失败的小图的位置可以显示原文,其他8张翻译成功的小图的位置可以显示对应的译文。
应理解,S1106中手机向云端发送多张小图时,可以是按照顺序向云端发送,而从云端获取多张小图的翻译结果时可能不是按照与发送顺序得到每张小图的翻译结果。由于每张小图的内容不同,那么云端在对每张小图做翻译处理时的时长也不同,所以手机可以不是按照发送时的顺序接收每张小图的翻译结果。由于每张小图进行了编号或者打上了标签,那么手机可以在接收到多张小图的翻译结果时,按照编号或者标签对多张小图的翻译结果进行拼接。
S1114,当手机检测到用户指示重新翻译时,可以从S1106重新执行该翻译过程。
S1115,手机确定用户是否继续长截屏操作。
当手机在翻译结果的界面上检测到用户继续点击滚屏翻译的操作时,可以再一次执行S1105-S1114。
应理解,手机再一次执行S1102-S1114时可以自动跳转至上一次长截屏得到的长图的最后一张小图处开始下一次滚屏翻译,也可以是自动跳转至上一次长截屏得到的长图的最后一张小图,并从最后一张小图的最后一段或者最后几段开始进行长截屏。
当看完第一次长截屏的翻译内容后,用户可以选择继续看下面的内容,也就是继续使用滚屏翻译功能;也可以从译文结果页返回即退出。如果返回退出,则回到上一次长截屏停止的最后一张小图原文内容,或者最后一张小图的最后一段或者最后几段的位置;如果继续使用滚屏翻译(即用户想继续阅读后续内容),则会显示上一次长截屏停止的最后一张小图原文内容,或者显示上一次长截屏停止的最后一张小图中的最后一段或者最后几段的原文内容,并同时启动新一次的长截屏操作,进入新的一轮循环,直到文章末尾。
一个实施例中,从本次长截屏译文结果页面,继续阅读后续内容的话,需要回到本次长截屏停止时候的最后一张小图原文内容,从这一张小图内容开始启动下一次的滚屏翻译操作。这样做的好处是用户在阅读体验上是从上一次译文最后一页开始,有一定记忆唤起 并辅助连续阅读的作用。如果本次长截屏是滚动到文章末尾导致的停止,则在译文结果页,隐藏可以继续点击的滚屏翻译入口。
S1116,当手机检测到用户退出长截屏的翻译结果界面时,手机可以显示上一次长截屏得到的长图的最后一张小图。
一个实施例中,手机也可以显示上一次长截屏得到的长图的最后一张小图的最后一段或者最后几段开始显示。
本申请实施例中的机器翻译的方法,相对于基于浏览器的网页翻译,应用范围更广,不局限于用户必须使用浏览器查看新闻,尤其在手机上使用的时候,很多用户查看的是第三方资讯类APP,比如网易新闻、今日头条等等。基于浏览器的网页全文翻译方法在第三方APP场景下无法使用,而本实施例提供的机器翻译的方法可以适用。
同样,基于单张图片的翻译使用起来操作繁琐,要查看多屏内容的翻译内容的情况下,需要用户每一屏点击一次翻译按钮,操作繁琐、耗时,会打断用户的阅读连续性,而本实施例提供的机器翻译的方法只需用户点击一次翻译按钮,之后在上次译文结果页继续触发滚屏翻译,即可阅读后续的内容的译文。
本申请实施例中的机器翻译的方法,可以减少用户在查看原文对应的译文时的繁琐操作,提高了电子设备的智能化程度,有助于提升用户在查看译文过程中的用户体验。
结合上述实施例及相关附图,本申请实施例提供了一种机器翻译的方法,该方法可以在如图1、图2所示的具有触摸屏的电子设备(例如手机、平板电脑等)中实现。如图12所示,该方法可以包括以下步骤:
S1201,电子设备在该触摸屏上显示第一用户界面,该第一用户界面包括第一内容,该第一内容的语言为第一语言。
示例性的,该第一用户界面可以如图4中的(a)所示的GUI。
S1202,电子设备在该第一用户界面上检测到第一操作,该第一操作包括用户触发进行滚屏翻译的用户操作。
示例性的,如图4中的(b)所示的GUI,该第一操作可以为用户点击控件401的操作;或者,该第一操作也可以为用户输入触发滚屏翻译功能的语音指令。
S1203,电子设备响应于该第一操作,从该第一用户界面的第一位置开始滚动截屏。
示例性的,如图4中的(c)所示的GUI,该第一位置可以为该英文短文303的起始位置,例如,从标题“A family…were sleeping”开始进行滚动截屏。
S1204,在滚动截屏的过程中,当在第二用户界面上检测到用户的第二操作时,或者,当在该第二用户界面滚动到结束位置时,在该第二用户界面的第二位置停止滚动截屏,电子设备得到第一图片,该第一图片为第二内容对应的图片,该第二内容包括从该第一位置到该第二位置的内容,该第二内容的语言为该第一语言。
示例性的,如图4中的(d)所示的GUI,该第二用户界面上显示的内容为从“I don’t think…she wrote”至“Fee said…rocks at it.”。当手机在该第二用户界面上任意一个位置到用户的操作后,手机可以在该第二用户界面上的最后一段的结束位置停止滚动截屏。如图4中的(d)所示,该第二位置可以为“Fee said…rocks at it.”这一段的结束位置。
一个实施例中,当第二用户界面的结束位置不是一个完整的段落时,那么该第二位置也可以为该段落在第二用户界面上显示的最后一行的结束位置。
一个实施例中,若该第二用户界面的结束位置是一张图片,或者为一张图片的一部分,那么该第二位置可以为该张图片或者该张图片的一部分上面的那一段的结束位置。
S1205,电子设备根据该第一图片,自动获取该第二内容的翻译结果,该第二内容的翻译结果的语言为第二语言。
示例性的,手机在获取该第一图片后,可以将按照上述方法1100中的方法对第一图片进行处理,例如,手机可以按照该第一图片的高度和手机屏幕高度的关系做切分,将该第一图片切分为多张图片,然后发送给服务器进行翻译;手机可以接收服务器发送的多张图片中每一张图片的翻译结果,并将每一张图片的翻译结果组成该第二内容的翻译结果。
示例性的,该第二内容的翻译结果可以为从标题对应的译文“一个四口之家…袭击了他们”到第二位置前的最后一段的译文“费说,他立刻后悔…朝他扔石头。”。
S1206,在自动获取该第二内容的翻译结果的一部分或全部后,电子设备自动显示第三用户界面,该第三用户界面包括该第二内容的翻译结果的一部分或全部。
本申请实施例中,手机获取的第二内容的翻译结果可以是第二内容所有的翻译结果,即手机获取到多张图片的翻译结果,每一张图片的翻译结果都是成功的;或者,也可以是第二内容的翻译结果的一部分。例如,服务器在接收到多张图片后,可能对其中的某一张图片没有翻译成功,那么手机也可以显示一部分翻译成功的译文,而对于那一张没有翻译成功的图片,手机可以将该图片上对应的原文内容和其他图片对应的译文内容组成第二内容的翻译结果。
示例性的,该第三用户界面可以是如图4中的(f)所示的GUI,该GUI上可以显示第二内容的部分,例如显示“一个四口之家…袭击了他们”至“加拿大国家公园…咬住了他们马修的怀抱”。
电子设备在该第三用户界面上检测到用户向上滑动的操作后,可以显示第二内容的翻译结果的剩余部分。如图4中的(g)所示,手机在触摸屏上检测到用户向上滑动的操作后,可以显示剩余的翻译结果(从“她写道…这种恐惧”至“费说…朝他扔石头。”)。
一个实施例中,该方法1200还包括:
电子设备在第四用户界面上检测到第三操作,该第四用户界面包括该第二内容的翻译结果的结尾部分,该第三操作包括用户触发进行滚屏翻译的用户操作。
示例性的,该第四用户界面可以为图4中的(g)所示的GUI,该GUI上包括第二内容的翻译结果的结尾部分,该结尾部分可以为“费说,他立刻后悔…朝他扔石头。”。该第三操作可以用户点击滚屏翻译控件403的操作。
响应于该第三操作,电子设备自动显示第五用户界面,并从该第五用户界面的第三位置开始滚动截屏,该第五用户界面包括第三内容,该第三位置与该第二位置相关联,该第三内容的语言为该第一语言。
示例性的,该第五用户界面可以为图4中的(h)所示的GUI,该第三内容可以是从“Fee said…rocks at it”至“It could…she wrote.”的英文内容。该GUI上显示手机从“Fee said…rocks at it.”这一段开始进行滚动截屏。
在滚动截屏的过程中,当在第六用户界面上检测到用户的第四操作时,或者,当滚动到结束位置时,在该第六用户界面的第四位置停止滚动截屏,电子设备得到第二图片,该第二图片上为第四内容对应的图片,该第四内容包括从该第三位置到该第四位置的内容, 该第四内容的语言为该第一语言。
示例性的,该第六用户界面可以为如图4中的(i)所示的GUI,当手机检测到用户在该GUI上的任意操作后,手机可以停止滚动截屏。该第四位置可以为图4中的(i)所示的GUI中的最后一段的结束位置“Incidents like these…and one in Ontario.”。那么该第二图片上包括的第四内容可以是从“Fee said…rocks at it.”至“Incidents like these…and one in Ontario.”的英文内容。
电子设备根据该第二图片,自动获取该第四内容的翻译结果,该第四内容的翻译结果的语言为该第二语言。
示例性的,电子设备可以将该第二图片切分为多张图片后送到服务器进行翻译;并从服务器获得多张图片的翻译结果。该电子设备可以将该多张图片的翻译结果组成该第四内容的翻译结果。
在自动获取该第四内容的翻译结果的一部分或全部后,电子设备自动显示第七用户界面,该第七用户界面包括该第四内容的翻译结果的一部分或全部。
示例性的,该第七用户界面可以为如图4中的(k)所示的GUI,该GUI上包括第四内容的翻译结果的一部分。例如,该GUI上显示的翻译结果为从“费说…朝他扔石头”至“她写道…坐在这里。”。
电子设备在该第七用户界面上检测到用户向上滑动的操作后,可以显示第四内容的翻译结果的剩余部分。如图4中的(l)所示,手机在触摸屏上检测到用户向上滑动的操作后,可以显示剩余的翻译结果(从“Elisa Rispoli没有…的请求”至“这样的时间…在不列颠哥伦比亚省”)。
一个实施例中,该方法1200还包括:
电子设备在第八用户界面上检测到第五操作,该第八用户界面包括该第二内容的翻译结果的结尾部分,该第五操作包括用户触发进行继续翻译的用户操作。
示例性的,该第八用户界面可以是如图10中的(b)所示的GUI,该GUI可以是通过全屏翻译得到的;也可以是通过滚屏翻译得到的。该GUI上可以包括第二内容的翻译结果的结尾部分,该结尾部分可以为“费说,他立刻后悔…朝他扔石头。”。该第五操作可以用户点击继续翻译控件1001的操作。
电子设备响应于第五操作,自动获取第五内容的翻译结果,该第五内容包括该第一语言对应的全部内容中除该第二内容以外的其他内容的一部分或者全部,该第五内容的翻译结果的语言为该第二语言。
示例性的,当手机检测到用户点击控件1001的操作后,手机可以获取原文中除“A family…were sleeping”至“Fee said…rocks at it.”的原文以外原文内容的翻译结果,即手机可以自动获取从“Meanwhile…to safety”至英文短文303的结尾位置“2019 Cable…All rights Reserved.”的翻译结果。
示例性的,当手机检测到用户点击控件1001的操作后,可以得到第三图片,该第三图片上包括从“Meanwhile…to safety”至英文短文303的结尾位置“2019 Cable…All rights Reserved.”的内容。手机可以将该第三图片切分为多张图片,然后将该多张图片发送给服务器进行翻译并获得服务器发送的每一张图片的翻译结果,手机可以将多张图片的翻译结果组合成该第五内容的翻译结果。
示例性的,该第五内容也可以包括是除第二内容以外的其他内容的一部分,例如,电子设备在检测到用户点击控件1001的操作后,可以将除第二内容以外的其他内容切分为多个部分,该第二内容可以为多个部分中第一部分的内容。
示例性的,该第五内容也可以包括之前已经阅读过的一部分内容。
在自动获取该第五内容的翻译结果的一部分或全部后,电子设备自动显示第九用户界面或者在接收到用户的滑动操作后显示该第九用户界面,该第九用户界面上包括该第五内容的翻译结果的一部分或者全部。
示例性的,如图10中的(c)所示的GUI,该GUI上包括第五内容的翻译结果的一部分,如“与此同时…逃到安全的地方”至“里斯波利斯…他手上”。
一个实施例中,该方法1200还包括:响应于该第五操作,电子设备自动截屏获得第三图片,第三图片包括第五内容。
示例性的,该电子设备可以通过截屏或者滚动截屏获得该第三图片。
电子设备在获取该第三图片后,可以向服务器发送该第三图片或者该第三图片的一部分所对应的图片;电子设备接收服务器返回的对应该第三图片或者该第三图片的一部分所对应的图片的翻译结果。
一个实施例中,电子设备自动截屏获得第三图片可以是电子设备截取一屏或者多屏的内容获得该第三图片,该自动截屏的过程对用户可见或者不可见。
示例性的,如图10中的(b)至图10中的(c)的过程中,自动截屏的过程对用户不可见;又例如,图4中的(g)至图4中的(k)的过程中,自动截屏的过程对用户可见。
一个实施例中,在自动获取该第五内容的翻译结果后,电子设备还可以继续显示第三用户界面,但是当用户在触摸屏上向上滑动时,手机可以显示第五内容的翻译结果的一部分或者全部。
一个实施例中,该自动获取该第二内容的翻译结果之前,该方法还包括:电子设备自动将该第一图片切分为多张图片;其中,该第三位置与该多张图片中最后一张图片中的特定位置相关,该特定位置为:该最后一张图片的起始位置或结束位置或中间位置或预定比例的位置;或,该最后一张图片中最后一段的起始位置或最后n行的起始位置,n为正整数,n大于或等于1。
示例性的,该第一图片包括从“A family…were sleeping”至“Fee said…rocks at it.”的原文内容,手机可以对该第一图片进行切分得到多张图片,例如,切分后得到两张图片,第一张图片上包括从“A family…were sleeping”至“The family was…clamped onto Matthew’s arms.”的原文内容;第二张图片包括从“I don’t…she wrote”至“Fee said…rocks at it.”的原文内容。
例如,第三位置可以是第二张图片的起始位置,那么图4中的(h)所示的滚动截屏的起始位置可以为“I don’t…she wrote”。
又例如,第三位置可以是第二张图片的中间位置,如从“The wolf was…jumped into help.”,那么图4中的(h)所示的滚动截屏的起始位置可以为“The wolf was…jumped into help.”。
又例如,该第三位置可以为预定比例的位置。示例性的,可以是第二张图片三分之二的位置,如从“[the wolf]…in the back”这一行开始滚动截屏。那么图4中的(h)所示的滚 动截屏的起始位置可以为“[the wolf]…in the back”。
该第三位置还可以是第二张图片的最后一段的起始位置,如图4中的(h)所示,可以第二张图片的最后一段“Fee said…rocks at it.”开始滚动截屏。
又例如,该第三位置还可以是第二张图片的最后一段的最后n行。例如,当n为2时,手机可以从“and the two…throwing rocks”这一行开始滚动截屏。
一个实施例中,该自动获取该第二内容的翻译结果,包括:电子设备向服务器发送该多张图片;电子设备接收服务器对该多张图片中每张图片的翻译结果;电子设备将该多张图片中的部分图片的翻译结果组成该第二内容的翻译结果的一部分,或将该多张图片中的全部图片的翻译结果组成该第二内容的翻译结果。
应理解,电子设备将第一图片这第二图片切分为多张图片的过程以及将多张图片发送给服务器进行翻译并获取翻译结果的过程可以参考上述方法1100中的描述,为了简洁,在此不再赘述。
一个实施例中,该第三位置与该第一图片相关联包括:该第三位置与该第一图片中的特定位置相关,该特定位置为该第一图片的结束位置或中间位置或预定比例的位置;或者,该第一图片中最后一段的起始位置或最后n行的起始位置,n为正整数,n大于或等于1。
一个实施例中,该第三位置与该第二内容的结束位置或中间位置或预定比例的位置相关;或者,该第三位置与该第二内容中最后一段的起始位置或最后n行的起始位置相关,n为正整数,n大于或等于1。
本申请实施例中,电子设备可以将第一图片切分为多张图片,第三位置可以与该多张图片的最后一张图片相关或者与该多张图片中的最后几张图片相关;或者,电子设备也可以不对第一图片进行切分,第三位置可以与该第一图片的特定位置相关,或者,第三位置也可以与该第一图片上显示的第二内容相关。
本申请实施例中,电子设备跳转到原文上次停止长截屏的位置的附近(电子设备对该位置进行了记忆),电子设备可以从上次停止长截屏的位置的附近(该位置与该第一图片相关联,通过保留一些内容的冗余,让用户能回忆起上次阅读到哪里了)再次启动滚动截屏并发送给服务器翻译。该方法不局限于基于网页的浏览器客户端翻译,还可用于第三方资讯APP等非浏览器场景,极大地扩展了适用场景,同时还保证了用户阅读体验的连贯性。
一个实施例中,该自动获取该第二内容的翻译结果,包括:电子设备向服务器发送第一图片或者第一图片的一部分所对应的图片;该电子设备接收该服务器返回的对该第一图片或者该第一图片的一部分所对应的图片的翻译结果。
示例性的,该电子设备获取该第一图片后,可以不用切分直接将该第一图片发送给服务器进行翻译;或者,电子设备在将第一图片发送给服务器后,由服务器进行切分成多张图片,并将多张图片进行翻译后向电子设备返回每张图片的翻译结果。
示例性的,电子设备也可以在获取该第一图片后,将该第一图片切分为多张图片,并将该多张图片中的第一张图片或者前几张图片发送给服务器进行翻译;然后获得服务器返回的对该第一张图片或者前几张图片的翻译结果。
一个实施例中,上述第二内容的翻译结果包括该第一图片被进行光学字符识别OCR文本识别后获得的文本内容被进行从所述第一语言到所述第二语言的翻译后获得的内容。
一个实施例中,该方法还包括:在该第三位置处或该第三位置附近显示第一提示信息,该第一提示信息用于提示用户滚动截屏的起始位置;和/或,在该第二位置处或该第二位置附近显示第二提示信息,该第二提示信息用于提示用户上次阅读到该第二位置。
示例性的,如图8中的(b)所示的GUI,在“Fee said…rocks at it.”的开始位置可以包括第一提示信息,该第一提示信息可以为“此次截屏的起始位置”。在“Fee said…rocks at it.”的结束位置可以包括第二提示信息,该第二提示信息可以为“上次阅读到此处”。
一个实施例中,该第一操作包括用户点击能触发滚屏翻译功能的第一控件或用户输入能触发滚屏翻译功能的语音指令。
示例性的,该第一操作可以为用户点击控件401的操作,或者,该第一操作也可以为用户输入的语音指令“滚屏翻译”。
一个实施例中,该第三操作包括用户点击能触发滚屏翻译功能的第一控件或用户输入能触发滚屏翻译功能的语音指令。
示例性的,该第三操作可以为用户点击控件403的操作,或者,该第一操作也可以为用户输入的语音指令“滚屏翻译”。
一个实施例中,该方法还包括:在该第三用户界面上接收到用户的滑动操作后,显示第十用户界面,该第十用户界面上包括与该第三用户界面上所包括的翻译结果相关联的后续翻译结果。
示例性的,如图10中的(d)和(e)所示,当手机检测到用户向上滑动的操作后,手机可以显示后续的翻译结果。
一个实施例中,该检测到该第三操作之前,该方法还包括:在该第四用户界面上显示能触发进行滚屏翻译的控件。
示例性的,如图4中的(g)所示,手机可以通过显示屏显示该控件403。
一个实施例中,该检测到该第五操作之前,该方法还包括:在该第八用户界面上显示能触发进行继续翻译的控件。
示例性的,如图10中的(b)所示,手机可以通过显示屏显示控件1001。
一个实施例中,该在该第一用户界面上检测到第一操作,包括:在该第一用户界面上检测到用户的多指按压操作后,电子设备显示多个功能控件,该多个功能控件包括能触发进行滚屏翻译的第一控件;电子设备检测到用户点击该第一控件或用户输入能触发滚屏翻译功能的语音指令。
示例性的,如图4中的(a)所示的GUI,手机检测到用户双指按压的操作后,可以显示如图4中的(b)所示的GUI,该GUI上可以显示多个功能控件,其中多个功能控件包括控件401。
一个实施例中,该第二内容包括该第一内容和该第一语言对应的全部内容中除该第一内容以外的其他内容的一部分或全部。
一个实施例中,该第三内容包括该第一语言对应的全部内容中除该第二内容以外的其他内容的一部分,该第四内容包括该第一语言对应的全部内容中除该第二内容以外的其他内容的一部分或全部。
一个实施例中,该第三内容也可以包括第二内容的一部分或者全部;该第四内容也可以包括第二内容中的一部分或者全部。
一个实施例中,该方法还包括:在该第九用户界面上接收到用户的滑动操作后,显示第十一用户界面,该第十一用户界面上包括与该第九用户界面上所包括的翻译结果相关联的后续翻译结果。
示例性的,如图4中的(k)所示的GUI,当手机检测到用户的滑动操作后,可以显示后续的翻译结果。
图13示出了本申请实施例提供的机器翻译的方法1300的示意性流程图。如图13所示,该方法1300包括:
S1301,电子设备在该触摸屏上显示第一用户界面,该第一用户界面上包括第一内容,该第一内容的语言为第一语言。
示例性的,该第一用户界面可以是如图3中的(c)所示的GUI,该GUI上包括从从标题“A family…were sleeping”至“The family was…clamped onto Matthew’s arms”的英文内容。
S1302,电子设备在该第一用户界面上检测到用户的第一操作,该第一操作包括用户触发全屏翻译的用户操作。
示例性的,参见图3中的(d)所示的GUI,该第一操作可以为用户点击控件305的操作。当手机检测到用户点击控件305的操作后,可以先触发手机进行截屏操作。
S1303,电子设备响应于该第一操作,对该第一用户界面进行截屏得到第一图片。
示例性的,参见图3中的(d)所示的GUI,该第一图片可以是手机对当前屏幕上显示的原文内容进行截屏得到的,该第一图片上显示从标题“A family…were sleeping”至“The family was…clamped onto Matthew’s arms”的英文内容。
S1304,电子设备根据该第一图片,自动获取该第一内容的翻译结果,该第一内容的翻译结果的语言为第二语言。
示例性的,该电子设备可以将该第一图片发送给服务器,并接收服务器返回的对该第一图片的翻译结果。
上述第一内容的翻译结果包括该第一图片被进行光学字符识别OCR文本识别后获得的文本内容被进行从所述第一语言到所述第二语言的翻译后获得的内容。
S1305,在自动获取该第一内容的翻译结果后,电子设备自动显示第二用户界面,该第二用户界面包括该第一内容的翻译结果的一部分或者全部。
示例性的,该第二用户界面可以是如图3中的(f)所示的GUI,该GUI上包括第一内容的翻译结果。该第一内容的翻译结果为从标题“一个四口之家…袭击了他们”至“加拿大国家公园…咬住了他们马修的怀抱”。
S1306,电子设备在该第二用户界面上检测到用户的第二操作,该第二操作包括用户触发进行滚屏翻译的用户操作。
示例性的,该第二用户界面上可以包括控件306,该第二操作可以是用户点击控件306的操作。当手机检测到用户点击控件306的操作后,手机可以进行滚屏翻译操作。
S1307,电子设备响应于该第二操作,自动显示第三用户界面并从该第三用户界面的第一位置开始滚动截屏,该第三用户界面包括第二内容,该第一位置与该第一图片相关联,该第二内容的语言为该第一语言。
示例性的,手机在如图3中的(f)所示的GUI上检测到用户点击控件306的操作后, 可以自动显示如图3中的(g)所示的GUI。图3中的(g)所示的GUI为滚动截屏的显示界面,该第一位置可以为标题“A family…were sleeping”的起始位置。
S1308,在滚动截屏的过程中,当在第四用户界面上检测到用户的第三操作时,或者,当在该第四用户界面滚动到结束位置时,在该第四界面的第二位置停止滚动截屏,电子设备得到第二图片,该第二图片为第三内容对应的图片,该第三内容包括从该第一位置到该第二位置的内容,该第三内容的语言为该第一语言。
示例性的,如图3中的(g)至图3中的(i)所示,当滚动到结束位置时,电子设备可以自动停止滚动截屏,该第二位置可以为“2019 Cable News…rights Reserved.”的结束位置。电子设备停止滚动截屏时可以获得第二图片,该第二图片上可以显示从标题“A family…were sleeping”的起始位置至“2019 Cable News…rights Reserved.”的结束位置的原文内容。
S1309,电子设备根据该第二图片,自动获取该第三内容的翻译结果,该第三内容的翻译结果的语言为该第二语言。
示例性的,电子设备通过滚动截屏获得该第二图片后,可以继续获取该第二图片上第三内容的翻译结果。例如,电子设备可以将该第二图片切分为多张图片,并将该多张图片发送给服务器进行翻译;电子设备接收服务器返回的多张图片的翻译结果,该多张图片的翻译结果组成了该第三内容的翻译结果。
S1310,电子设备在自动获取该第三内容的翻译结果的一部分或全部后,自动显示第五用户界面,该第五用户界面包括该第三内容的翻译结果的一部分或者全部。
示例性的,该第五用户界面可以如图3中的(k)所示,图3中的(k)所示的GUI上包括第三内容的翻译结果的一部分,例如从标题“一个四口之家…袭击了他们”至“加拿大国家公园…咬住了他们马修的怀抱”。
一个实施例中,该方法还包括:在该第五用户界面上接收到用户的滑动操作后,显示第六用户界面,该第六用户界面上包括与该第五用户界面上所包括的翻译结果相关联的后续翻译结果。
当电子设备检测到用户在触摸屏上向上滑动的操作后,电子设备可以显示更多的译文内容。示例性的,从图3中的(k)至图3中的(m)示出了用户滑动后显示后续译文的过程。
一个实施例中,该方法还包括:该自动获取该第三内容的翻译结果之前,该方法还包括:电子设备自动将该第二图片切分为多张图片;电子设备向服务器发送该多张图片;电子设备接收服务器对该多张图片中每张图片的翻译结果;电子设备将该多张图片中的部分图片的翻译结果组成该第三内容的翻译结果的一部分,或将该多张图片中的全部图片的翻译结果组成该第三内容的翻译结果。
一个实施例中,该第三内容的翻译结果包括该第二图片被进行OCR文本识别后获得的文本内容被进行从该第一语言到该第二语言的翻译后获得的内容。
应理解,电子设备将该第二图片切分为多张图片的过程可以参考上述方法1100中的描述,为了简洁,在此不再赘述。
一个实施例中,该方法还包括:在该第一位置处或者该第一位置附近显示第一提示信息,该第一提示信息用于提示用户滚动截屏的起始位置;和/或,在该第一图片的结束位 置显示第二提示信息,该第二提示信息用于提示用户上次阅读到该结束位置。
应理解,该第一提示信息和该第二提示信息可以参考图8所示的GUI,手机在全屏翻译完成进行滚屏翻译时,可以在滚动截屏的界面上显示第一提示信息和/或第二提示信息。
一个实施例中,该第二操作包括用户点击能触发滚屏翻译功能的第一控件或用户输入能触发滚屏翻译功能的语音指令。
示例性的,如图3中的(f)所示,该第二操作可以是用户点击控件306的操作。
一个实施例中,该第一位置与该第一图片相关联,包括:该第一位置与该第一图片中的特定位置相关,其中,该特定位置为:该第一图片的结束位置或中间位置或预定比例的位置;或者,该第一图片中最后一段的起始位置或最后n行的起始位置,n为正整数,n大于或等于1。
示例性的,如图3中的(g)所示,滚动截屏可以从“It was like…on Facebook”这一段开始。
示例性的,该预定比例的位置可以为第一图片的三分之二处,例如,从“when the incident…Friday,”这一行开始进行滚动截屏。
一个实施例中,该第一位置与该第一图片相关联,包括:该第一位置与该第一内容的结束位置或中间位置或预定比例的位置相关;或者,该第一位置与该第一内容中最后一段的起始位置或最后n行的起始位置相关,n为正整数,n大于或等于1。
示例性的,滚动截屏可以是从标题“A family…were sleeping”至“The family was…clamped onto Matthew’s arms”的英文内容中的某一行或者某一段开始。
一个实施例中,该在该第二用户界面上检测到用户的第二操作之前,该方法还包括:在该第二用户界面上显示能触发进行滚屏翻译的控件。
示例性的,如图3中的(f)所示的GUI,该GUI上可以显示控件306。
一个实施例中,该在该第一用户界面上检测到用户的第一操作,包括:在该第一用户界面上检测到用户的多指按压操作后,显示多个功能控件,该多个功能控件包括能触发进行全屏翻译的第一控件;检测到用户点击该第一控件或用户输入能触发全屏翻译功能的语音指令。
示例性的,在用户点击控件305之前,用户可以在如图3中的(c)所示的GUI上双指按压,手机检测到用户双指按压的操作后,可以显示多个控件,多个控件中包括控件305。
一个实施例中,该自动获取该第二内容的翻译结果,包括:电子设备向服务器发送该第二图片或该第二图片的一部分所对应的图片;电子设备接收该服务器返回的对该第二图片或该第二图片的一部分所对应的图片的翻译结果。
图14示出了本申请实施例提供的机器翻译的方法1400的示意性流程图。如图14所示,该方法1400包括:
S1401,在该触摸屏上显示第一用户界面,该第一用户界面上包括第一内容,该第一内容的语言为第一语言。
S1402,在该第一用户界面上检测到用户的第一操作,该第一操作包括用户触发全屏翻译的用户操作。
S1403,响应于该第一操作,对该第一用户界面进行截屏得到第一图片。
S1404,根据该第一图片,自动获取该第一内容的翻译结果,该第一内容的翻译结果的语言为第二语言。
S1405,在自动获取该第一内容的翻译结果后,自动显示第二用户界面,该第二用户界面包括该第一内容的翻译结果的一部分或者全部。
应理解,S1401-S1405可以参考上述S1301-S1305的描述,为了简洁,在此不再赘述。
S1406,在该第二用户界面上检测到用户的第二操作,该第二操作包括用户触发进行继续翻译的用户操作。
S1407,响应于该第二操作,自动获取第二内容的翻译结果,该第二内容包括该第一语言对应的所有内容中除该第一内容以外的其他内容的一部分或者全部,该第二内容的翻译结果的语言为该第二语言。
S1408,在自动获取该第二内容的翻译结果的一部分或者全部后,自动显示第三用户界面或者在接收到用户的滑动操作后显示该第三用户界面,该第三用户界面包括该第二内容的翻译结果的一部分或者全部。
应理解,S1406-S1408的过程可以参考上述方法1300中的相关描述,为了简洁,在此不再赘述。
本申请实施例中,电子设备在进行了一次全屏翻译后,电子设备可以为用户提供继续翻译的控件,当电子设备检测到用户点击继续翻译的控件后,可以直接在后台加载剩余原文对应的译文的全部或者一部分。这样就不用电子设备在跳转至原文界面进行滚动截屏,这样可以进一步提升用户在阅读译文时的用户体验。
一个实施例中,该电子设备响应于该第二操作,自动截屏获得第二图片,该第二图片为该第二内容对应的图片;该自动获取第二内容的翻译结果包括:根据该第二图片,自动获取该第二内容的翻译结果。
一个实施例中,该电子设备自动获取第二内容的翻译结果包括:向服务器发送该第二图片或该第二图片的一部分所对应的图片;接收该服务器返回的对该第二图片或该第二图片的一部分所对应的图片的翻译结果。
一个实施例中,该电子设备自动截屏获得第二图片包括:电子设备自动截取一屏或多屏的内容获得该第二图片,该自动截屏过程对用户可见或不可见。
一个实施例中,该电子设备自动获取第二内容的翻译结果,包括:电子设备自动将该第二图片切分为多张图片;电子设备向服务器发送该多张图片;电子设备接收服务器对该多张图片中每张图片的翻译结果;电子设备将该多张图片中的部分图片的翻译结果组成该第二内容的翻译结果的一部分,或将该多张图片中的全部图片的翻译结果组成该第二内容的翻译结果。
应理解,从切分到获得翻译结果的过程可以参考上述方法1100,为了简洁,在此不再赘述。
一个实施例中,该第二操作包括用户点击能触发继续翻译功能的第一控件或用户输入能触发继续翻译功能的语音指令。
一个实施例中,该方法还包括:在该第三用户界面上接收到用户的滑动操作后,电子设备显示第四用户界面,该第四用户界面上包括与该第三用户界面上所包括的翻译结果相关联的后续翻译结果。
一个实施例中,该在该第一用户界面上检测到用户的第一操作之前,该方法还包括:电子设备在该第一用户界面上显示能触发进行全屏翻译的控件。
一个实施例中,该在该第二用户界面上检测到用户的第二操作之前,该方法还包括:电子设备在该第二用户界面上显示能触发进行继续翻译的控件。
一个实施例中,该在该第一用户界面上检测到用户的第一操作,包括:在该第一用户界面上检测到用户的多指按压操作后,电子设备显示多个功能控件,该多个功能控件包括能触发进行全屏翻译的第一控件;检测到用户点击该第一控件或用户输入能触发全屏翻译功能的语音指令。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。各实施例可以相互参考和组合。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (18)

  1. 一种电子设备,其特征在于,包括:
    触摸屏;
    一个或多个处理器;
    一个或多个存储器;
    所述一个或多个存储器存储有一个或多个计算机程序,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:
    在所述触摸屏上显示第一用户界面,所述第一用户界面上包括第一内容,所述第一内容的语言为第一语言;
    在所述第一用户界面上检测到用户的第一操作,所述第一操作包括用户触发全屏翻译的用户操作;
    响应于所述第一操作:
    获取对所述第一用户界面进行截屏得到的第一图片;
    根据所述第一图片,获取所述第一内容的翻译结果,所述第一内容的翻译结果的语言为第二语言;并
    显示第二用户界面,所述第二用户界面包括所述第一内容的翻译结果的一部分或者全部;
    在所述第二用户界面上检测到用户的第二操作,所述第二操作包括用户触发进行滚屏翻译的用户操作;
    响应于所述第二操作,显示第三用户界面并从所述第三用户界面的第一位置开始滚动截屏,所述第三用户界面包括第二内容,所述第一位置与所述第一图片相关联或与所述第一内容相关联或与所述第一用户界面相关联,所述第二内容的语言为所述第一语言;
    在滚动截屏的过程中,当在第四用户界面上检测到用户的第三操作时,或者,当在所述第四用户界面滚动到结束位置时,在所述第四界面的第二位置停止滚动截屏,得到第二图片,所述第二图片为第三内容对应的图片,所述第三内容包括从所述第一位置到所述第二位置的内容,所述第三内容的语言为所述第一语言;
    根据所述第二图片,获取所述第三内容的翻译结果,所述第三内容的翻译结果的语言为所述第二语言;
    在获取所述第三内容的翻译结果的一部分或全部后,显示第五用户界面,所述第五用户界面包括所述第三内容的翻译结果的一部分或者全部。
  2. 根据权利要求1所述的电子设备,其特征在于,所述第一位置与所述第一图片相关联,包括:所述第一位置与所述第一图片中的特定位置相关,其中,所述特定位置为:
    所述第一图片的结束位置或中间位置或预定比例的位置;或者,
    所述第一图片中最后一段的起始位置或最后n行的起始位置,n为正整数,n大于或等于1。
  3. 根据权利要求1或2所述的电子设备,其特征在于,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:
    在获取所述第三内容的翻译结果之前,将所述第二图片切分为多张图片;
    向服务器发送所述多张图片;
    接收服务器对所述多张图片中每张图片的翻译结果;
    将所述多张图片中的部分图片的翻译结果组成所述第三内容的翻译结果的一部分,或将所述多张图片中的全部图片的翻译结果组成所述第三内容的翻译结果。
  4. 根据权利要求1至3中任一项所述的电子设备,其特征在于,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:
    在所述第一位置处或者所述第一位置附近显示第一提示信息,所述第一提示信息用于提示用户滚动截屏的起始位置;和/或,
    在所述第一图片的结束位置显示第二提示信息,所述第二提示信息用于提示用户上次阅读到所述结束位置。
  5. 根据权利要求1至4中任一项所述的电子设备,其特征在于,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:
    在所述第一用户界面上检测到用户的多指按压操作后,显示多个功能控件,所述多个功能控件包括能触发进行全屏翻译的第一控件;
    检测到用户点击所述第一控件或用户输入能触发全屏翻译功能的语音指令。
  6. 一种电子设备,其特征在于,包括:
    触摸屏;
    一个或多个处理器;
    一个或多个存储器;
    所述一个或多个存储器存储有一个或多个计算机程序,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:
    在所述触摸屏上显示第一用户界面,所述第一用户界面包括第一内容,所述第一内容的语言为第一语言;
    在所述第一用户界面上检测到第一操作,所述第一操作包括用户触发进行滚屏翻译的用户操作;
    响应于所述第一操作,从所述第一用户界面的第一位置开始滚动截屏;
    在滚动截屏的过程中,当在第二用户界面上检测到用户的第二操作时,或者,当在所述第二用户界面滚动到结束位置时,在所述第二用户界面的第二位置停止滚动截屏,得到第一图片,所述第一图片为第二内容对应的图片,所述第二内容包括从所述第一位置到所述第二位置的内容,所述第二内容的语言为所述第一语言;
    根据所述第一图片,获取所述第二内容的翻译结果,所述第二内容的翻译结果的语言为第二语言;
    在获取所述第二内容的翻译结果的一部分或全部后,显示第三用户界面,所述第三用户界面包括所述第二内容的翻译结果的一部分或全部。
  7. 根据权利要求6所述的电子设备,其特征在于,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:
    在第四用户界面上检测到第三操作,所述第四用户界面包括所述第二内容的翻译结果的结尾部分,所述第三操作包括用户触发进行滚屏翻译的用户操作;
    响应于所述第三操作,显示第五用户界面,并从所述第五用户界面的第三位置开始滚动截屏,所述第五用户界面包括第三内容,所述第三位置与所述第一图片相关联或与所述第二位置相关联或与所述第二内容相关联或与所述第二用户界面相关联,所述第三内容的语言为所述第一语言;
    在滚动截屏的过程中,当在第六用户界面上检测到用户的第四操作时,或者,当滚动到结束位置时,在所述第六用户界面的第四位置停止滚动截屏,得到第二图片,所述第二图片为第四内容对应的图片,所述第四内容包括从所述第三位置到所述第四位置的内容,所述第四内容的语言为所述第一语言;
    根据所述第二图片,获取所述第四内容的翻译结果,所述第四内容的翻译结果的语言为所述第二语言;
    在获取所述第四内容的翻译结果的一部分或全部后,显示第七用户界面,所述第七用户界面包括所述第四内容的翻译结果的一部分或全部。
  8. 根据权利要求7所述的电子设备,其特征在于,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:
    在获取所述第二内容的翻译结果之前,将所述第一图片切分为多张图片;
    其中,所述第三位置与所述多张图片中最后一张图片中的特定位置相关,所述特定位置为:
    所述最后一张图片的起始位置或结束位置或中间位置或预定比例的位置;或,
    所述最后一张图片中最后一段的起始位置或最后n行的起始位置,n为正整数,n大于或等于1。
  9. 根据权利要求7或8所述的电子设备,其特征在于,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:
    在所述第三位置处或所述第三位置附近显示第一提示信息,所述第一提示信息用于提示用户滚动截屏的起始位置;和/或,
    在所述第二位置处或所述第二位置附近显示第二提示信息,所述第二提示信息用于提示用户上次阅读到所述第二位置。
  10. 根据权利要求6所述的电子设备,其特征在于,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:
    在第八用户界面上检测到第五操作,所述第八用户界面包括所述第二内容的翻译结果的结尾部分,所述第五操作包括用户触发进行继续翻译的用户操作;
    响应于第五操作,获取第五内容的翻译结果,所述第五内容包括所述第一语言对应的全部内容中除所述第二内容以外的其他内容的一部分或者全部,所述第五内容的翻译结果的语言为所述第二语言;
    在获取所述第五内容的翻译结果的一部分或全部后,显示第九用户界面或在接收到用户的滑动操作后显示所述第九用户界面,所述第九用户界面上包括所述第五内容的翻译结果的一部分或者全部。
  11. 根据权利要求6至10中任一项所述的电子设备,其特征在于,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:
    在获取所述第二内容的翻译结果之前,将所述第一图片切分为多张图片;
    向服务器发送所述多张图片;
    接收服务器对所述多张图片中每张图片的翻译结果;
    将所述多张图片中的部分图片的翻译结果组成所述第二内容的翻译结果的一部分,或将所述多张图片中的全部图片的翻译结果组成所述第二内容的翻译结果。
  12. 一种电子设备,其特征在于,包括:
    触摸屏;
    一个或多个处理器;
    一个或多个存储器;
    所述一个或多个存储器存储有一个或多个计算机程序,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:
    在所述触摸屏上显示第一用户界面,所述第一用户界面上包括第一内容,所述第一内容的语言为第一语言;
    在所述第一用户界面上检测到用户的第一操作,所述第一操作包括用户触发全屏翻译的用户操作;
    响应于所述第一操作:
    对所述第一用户界面进行截屏得到第一图片;
    根据所述第一图片,获取所述第一内容的翻译结果,所述第一内容的翻译结果的语言为第二语言;并
    显示第二用户界面,所述第二用户界面包括所述第一内容的翻译结果的一部分或者全部;
    在所述第二用户界面上检测到用户的第二操作,所述第二操作包括用户触发进行继续翻译的用户操作;
    响应于所述第二操作,获取第二内容的翻译结果,所述第二内容包括所述第一语言对应的所有内容中除所述第一内容以外的其他内容的一部分或者全部,所述第二内容的翻译结果的语言为所述第二语言;
    在获取所述第二内容的翻译结果的一部分或者全部后,显示第三用户界面或者在接收到用户的滑动操作后显示所述第三用户界面,所述第三用户界面包括所述第二内容的翻译结果的一部分或者全部。
  13. 根据权利要求12所述的电子设备,其特征在于,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:
    响应于所述第二操作,截屏获得第二图片,所述第二图片为所述第二内容对应的图片,所述截屏过程对用户不可见;
    将所述第二图片切分为多张图片;
    向服务器发送所述多张图片;
    接收服务器对所述多张图片中每张图片的翻译结果;
    将所述多张图片中的部分图片的翻译结果组成所述第二内容的翻译结果的一部分,或将所述多张图片中的全部图片的翻译结果组成所述第二内容的翻译结果。
  14. 根据权利要求12或13所述的电子设备,其特征在于,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:
    在所述第一用户界面上检测到用户的多指按压操作后,显示多个功能控件,所述多个功能控件包括能触发进行全屏翻译的第一控件;
    检测到用户点击所述第一控件或用户输入能触发全屏翻译功能的语音指令。
  15. 一种机器翻译的方法,所述方法应用于具有触摸屏的电子设备,其特征在于,包括:
    在所述触摸屏上显示第一用户界面,所述第一用户界面上包括第一内容,所述第一内容的语言为第一语言;
    在所述第一用户界面上检测到用户的第一操作,所述第一操作包括用户触发全屏翻译的用户操作;
    响应于所述第一操作:
    获取对所述第一用户界面进行截屏得到的第一图片;
    根据所述第一图片,获取所述第一内容的翻译结果,所述第一内容的翻译结果的语言为第二语言;并
    显示第二用户界面,所述第二用户界面包括所述第一内容的翻译结果的一部分或者全部;
    在所述第二用户界面上检测到用户的第二操作,所述第二操作包括用户触发进行滚屏翻译的用户操作;
    响应于所述第二操作,显示第三用户界面并从所述第三用户界面的第一位置开始滚动截屏,所述第三用户界面包括第二内容,所述第一位置与所述第一图片相关联或与所述第一内容相关联或与所述第一用户界面相关联,所述第二内容的语言为所述第一语言;
    在滚动截屏的过程中,当在第四用户界面上检测到用户的第三操作时,或者,当在所述第四用户界面滚动到结束位置时,在所述第四界面的第二位置停止滚动截屏,得到第二图片,所述第二图片为第三内容对应的图片,所述第三内容包括从所述第一位置到所述第二位置的内容,所述第三内容的语言为所述第一语言;
    根据所述第二图片,获取所述第三内容的翻译结果,所述第三内容的翻译结果的语言为所述第二语言;
    在获取所述第三内容的翻译结果的一部分或全部后,显示第五用户界面,所述第五用户界面包括所述第三内容的翻译结果的一部分或者全部。
  16. 一种机器翻译的方法,所述方法应用于具有触摸屏的电子设备,其特征在于,包括:
    在所述触摸屏上显示第一用户界面,所述第一用户界面包括第一内容,所述第一内容的语言为第一语言;
    在所述第一用户界面上检测到第一操作,所述第一操作包括用户触发进行滚屏翻译的用户操作;
    响应于所述第一操作,从所述第一用户界面的第一位置开始滚动截屏;
    在滚动截屏的过程中,当在第二用户界面上检测到用户的第二操作时,或者,当在所述第二用户界面滚动到结束位置时,在所述第二用户界面的第二位置停止滚动截屏,得到第一图片,所述第一图片为第二内容对应的图片,所述第二内容包括从所述第一位置到所述第二位置的内容,所述第二内容的语言为所述第一语言;
    根据所述第一图片,获取所述第二内容的翻译结果,所述第二内容的翻译结果的语言为第二语言;
    在获取所述第二内容的翻译结果的一部分或全部后,显示第三用户界面,所述第三用户界面包括所述第二内容的翻译结果的一部分或全部。
  17. 一种机器翻译的方法,所述方法应用于具有触摸屏的电子设备,其特征在于,包括:
    在所述触摸屏上显示第一用户界面,所述第一用户界面上包括第一内容,所述第一内容的语言为第一语言;
    在所述第一用户界面上检测到用户的第一操作,所述第一操作包括用户触发全屏翻译的用户操作;
    响应于所述第一操作:
    对所述第一用户界面进行截屏得到第一图片;
    根据所述第一图片,获取所述第一内容的翻译结果,所述第一内容的翻译结果的语言为第二语言;并
    显示第二用户界面,所述第二用户界面包括所述第一内容的翻译结果的一部分或者全部;
    在所述第二用户界面上检测到用户的第二操作,所述第二操作包括用户触发进行继续翻译的用户操作;
    响应于所述第二操作,获取第二内容的翻译结果,所述第二内容包括所述第一语言对应的所有内容中除所述第一内容以外的其他内容的一部分或者全部,所述第二内容的翻译结果的语言为所述第二语言;
    在获取所述第二内容的翻译结果的一部分或者全部后,显示第三用户界面或者在接收到用户的滑动操作后显示所述第三用户界面,所述第三用户界面包括所述第二内容的翻译结果的一部分或者全部。
  18. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求15至17中任一项所述的机器翻译的方法。
PCT/CN2020/116128 2019-09-20 2020-09-18 机器翻译的方法和电子设备 WO2021052458A1 (zh)

Priority Applications (5)

Application Number Priority Date Filing Date Title
EP20864367.6A EP4033394A4 (en) 2019-09-20 2020-09-18 MACHINE TRANSLATION METHOD AND ELECTRONIC DEVICE
CN202080066200.0A CN114503116A (zh) 2019-09-20 2020-09-18 机器翻译的方法和电子设备
US17/762,169 US11847314B2 (en) 2019-09-20 2020-09-18 Machine translation method and electronic device
JP2022517924A JP2022549236A (ja) 2019-09-20 2020-09-18 機械翻訳方法および電子デバイス
BR112022005108A BR112022005108A2 (pt) 2019-09-20 2020-09-18 Método de tradução automática e dispositivo eletrônico

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910895234.XA CN110781688B (zh) 2019-09-20 2019-09-20 机器翻译的方法和电子设备
CN201910895234.X 2019-09-20

Publications (1)

Publication Number Publication Date
WO2021052458A1 true WO2021052458A1 (zh) 2021-03-25

Family

ID=69384112

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/116128 WO2021052458A1 (zh) 2019-09-20 2020-09-18 机器翻译的方法和电子设备

Country Status (6)

Country Link
US (1) US11847314B2 (zh)
EP (1) EP4033394A4 (zh)
JP (1) JP2022549236A (zh)
CN (3) CN112183121B (zh)
BR (1) BR112022005108A2 (zh)
WO (1) WO2021052458A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113970971A (zh) * 2021-09-10 2022-01-25 荣耀终端有限公司 基于触控笔的数据处理方法和装置
EP4170476A4 (en) * 2021-09-02 2024-01-24 Honor Device Co., Ltd. TRANSLATION METHOD AND ELECTRONIC DEVICE

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20200100918A (ko) * 2019-02-19 2020-08-27 삼성전자주식회사 카메라를 이용하는 어플리케이션을 통해 다양한 기능을 제공하는 전자 장치 및 그의 동작 방법
CN110109593B (zh) * 2019-04-29 2021-04-02 维沃移动通信有限公司 一种截屏方法及终端设备
CN110442879B (zh) * 2019-04-30 2024-02-13 华为技术有限公司 一种内容翻译的方法和终端
CN112183121B (zh) * 2019-09-20 2022-02-25 华为技术有限公司 机器翻译的方法和电子设备
CN111553172A (zh) * 2020-04-02 2020-08-18 支付宝实验室(新加坡)有限公司 翻译文案展示方法、装置、系统及存储介质
CN111401323A (zh) * 2020-04-20 2020-07-10 Oppo广东移动通信有限公司 文字翻译方法、装置、存储介质及电子设备
USD945464S1 (en) * 2020-06-18 2022-03-08 Apple Inc. Display screen or portion thereof with graphical user interface
WO2022002213A1 (zh) * 2020-07-02 2022-01-06 华为技术有限公司 翻译结果显示方法、装置及电子设备
CN114721614A (zh) * 2020-12-22 2022-07-08 华为技术有限公司 一种调用其他设备能力的方法、电子设备和系统
CN114970459A (zh) * 2021-02-26 2022-08-30 Oppo广东移动通信有限公司 文本处理方法、装置以及电子设备
CN114967994A (zh) * 2021-02-26 2022-08-30 Oppo广东移动通信有限公司 文本处理方法、装置以及电子设备
CN112905093B (zh) * 2021-03-10 2022-11-15 Oppo广东移动通信有限公司 内容显示方法、装置、存储介质及电子设备
EP4287005A1 (en) * 2021-04-06 2023-12-06 Samsung Electronics Co., Ltd. Electronic device for performing capture function and method for operating electronic device
CN113919374B (zh) * 2021-09-08 2022-06-24 荣耀终端有限公司 语音翻译的方法、电子设备及存储介质
CN115016694A (zh) * 2021-11-18 2022-09-06 荣耀终端有限公司 一种应用程序启动方法及电子设备
CN114995698A (zh) * 2022-06-17 2022-09-02 维沃移动通信有限公司 图像处理方法、装置
US20240205508A1 (en) * 2022-12-20 2024-06-20 Rovi Guides, Inc. Systems and methods for fast, intuitive, and personalized language learning from video subtitles

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110216095A1 (en) * 2010-03-04 2011-09-08 Tobias Rydenhag Methods, Devices, and Computer Program Products Providing Multi-Touch Drag and Drop Operations for Touch-Sensitive User Interfaces
CN104636326A (zh) * 2014-12-30 2015-05-20 小米科技有限责任公司 一种文字信息的翻译方法及装置
CN106776582A (zh) * 2015-11-24 2017-05-31 英业达科技有限公司 实时翻译系统、方法及计算机可读取记录媒体
CN110209456A (zh) * 2019-05-31 2019-09-06 努比亚技术有限公司 屏幕界面长截图的方法、移动终端及计算机可读存储介质
CN110781688A (zh) * 2019-09-20 2020-02-11 华为技术有限公司 机器翻译的方法和电子设备

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0981566A (ja) 1995-09-08 1997-03-28 Toshiba Corp 翻訳装置及び翻訳方法
WO2004092338A2 (en) * 2003-04-11 2004-10-28 Diadexus, Inc. Compositions, splice variants and methods relating to cancer specific genes and proteins
EP2347343A4 (en) * 2008-10-29 2013-02-13 Google Inc SYSTEM AND METHOD FOR TRANSLUCTING TEXTUAL SUBTITLES FROM A VIDEO BROADCASTED ON THE WEB
CN103294665A (zh) * 2012-02-22 2013-09-11 汉王科技股份有限公司 电子阅读器文本翻译的方法及电子阅读器
US9570050B2 (en) * 2012-03-13 2017-02-14 Assima Switzerland Sa System and method for enhanced screen copy
US9985922B2 (en) * 2015-05-29 2018-05-29 Globechat, Inc. System and method for multi-langual networking and communication
CN105094628A (zh) * 2015-07-31 2015-11-25 联想(北京)有限公司 一种截屏方法及电子设备
CN105487766A (zh) * 2015-11-24 2016-04-13 努比亚技术有限公司 一种实现截图的方法和装置
US10324828B2 (en) * 2016-03-28 2019-06-18 Dropbox, Inc. Generating annotated screenshots based on automated tests
US9953030B2 (en) * 2016-08-24 2018-04-24 International Business Machines Corporation Automated translation of screen images for software documentation
JP2019537103A (ja) * 2016-09-28 2019-12-19 シストラン インターナショナル カンパニー.,リミテッド.Systran International Co.,Ltd. 文字を翻訳する方法及びその装置
CN107967099A (zh) * 2016-10-19 2018-04-27 中兴通讯股份有限公司 一种终端截屏的方法、装置及移动终端
CN107832311A (zh) * 2017-11-30 2018-03-23 珠海市魅族科技有限公司 一种翻译方法、装置、终端及可读存储设备
CN108829686B (zh) * 2018-05-30 2022-04-15 北京小米移动软件有限公司 翻译信息显示方法、装置、设备及存储介质
CN108959274B (zh) * 2018-06-27 2022-09-02 维沃移动通信有限公司 一种应用程序的翻译方法及服务器
CN109271081B (zh) 2018-07-28 2019-09-20 华为技术有限公司 滚动截屏的方法及电子设备
CN110442879B (zh) * 2019-04-30 2024-02-13 华为技术有限公司 一种内容翻译的方法和终端

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110216095A1 (en) * 2010-03-04 2011-09-08 Tobias Rydenhag Methods, Devices, and Computer Program Products Providing Multi-Touch Drag and Drop Operations for Touch-Sensitive User Interfaces
CN104636326A (zh) * 2014-12-30 2015-05-20 小米科技有限责任公司 一种文字信息的翻译方法及装置
CN106776582A (zh) * 2015-11-24 2017-05-31 英业达科技有限公司 实时翻译系统、方法及计算机可读取记录媒体
CN110209456A (zh) * 2019-05-31 2019-09-06 努比亚技术有限公司 屏幕界面长截图的方法、移动终端及计算机可读存储介质
CN110781688A (zh) * 2019-09-20 2020-02-11 华为技术有限公司 机器翻译的方法和电子设备

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4170476A4 (en) * 2021-09-02 2024-01-24 Honor Device Co., Ltd. TRANSLATION METHOD AND ELECTRONIC DEVICE
CN113970971A (zh) * 2021-09-10 2022-01-25 荣耀终端有限公司 基于触控笔的数据处理方法和装置

Also Published As

Publication number Publication date
CN114503116A (zh) 2022-05-13
CN112183121B (zh) 2022-02-25
JP2022549236A (ja) 2022-11-24
BR112022005108A2 (pt) 2022-06-21
EP4033394A4 (en) 2022-11-16
EP4033394A1 (en) 2022-07-27
US11847314B2 (en) 2023-12-19
US20220382448A1 (en) 2022-12-01
CN110781688A (zh) 2020-02-11
CN110781688B (zh) 2023-11-07
CN112183121A (zh) 2021-01-05

Similar Documents

Publication Publication Date Title
WO2021052458A1 (zh) 机器翻译的方法和电子设备
WO2021103981A1 (zh) 分屏显示的处理方法、装置及电子设备
WO2020062294A1 (zh) 系统导航栏的显示控制方法、图形用户界面及电子设备
WO2021027725A1 (zh) 显示页面元素的方法和电子设备
KR102026717B1 (ko) 사진 촬영 가이드 방법 및 이를 구현하는 휴대 단말
WO2021104030A1 (zh) 一种分屏显示方法及电子设备
WO2020221063A1 (zh) 切换父页面和子页面的方法、相关装置
CN111176506A (zh) 一种屏幕显示方法及电子设备
WO2021000841A1 (zh) 一种生成用户头像的方法及电子设备
WO2021169399A1 (zh) 一种暂存应用界面的方法及电子设备
WO2022062898A1 (zh) 一种窗口显示方法及设备
WO2022068819A1 (zh) 一种界面显示方法及相关装置
CN110830645B (zh) 一种操作方法和电子设备及计算机存储介质
WO2022012418A1 (zh) 拍照方法及电子设备
CN112068907A (zh) 一种界面显示方法和电子设备
CN113536866A (zh) 一种人物追踪显示方法和电子设备
WO2022228042A1 (zh) 显示方法、电子设备、存储介质和程序产品
WO2023116012A9 (zh) 屏幕显示方法和电子设备
WO2022002213A1 (zh) 翻译结果显示方法、装置及电子设备
CN115268727A (zh) 显示方法及其装置
WO2024152676A1 (zh) 一种窗口管理方法以及电子设备
WO2024067122A1 (zh) 一种窗口显示方法及电子设备
WO2023160455A1 (zh) 删除对象的方法及电子设备
WO2023246666A1 (zh) 一种搜索方法及电子设备
EP4258649A1 (en) Method for determining tracking target, and electronic device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20864367

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022517924

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

REG Reference to national code

Ref country code: BR

Ref legal event code: B01A

Ref document number: 112022005108

Country of ref document: BR

ENP Entry into the national phase

Ref document number: 2020864367

Country of ref document: EP

Effective date: 20220420

ENP Entry into the national phase

Ref document number: 112022005108

Country of ref document: BR

Kind code of ref document: A2

Effective date: 20220318