Translation method and apparatus and electronic device
AssigneeBaidu Online Network Technology (Beijing) Co., Ltd.
InventorsShaoting Yi, Yongjia Yu
Life of this patent
Estimating the term…
Abstract
A translation method includes acquiring an image, where the image includes a text to be translated; splitting the text to be translated in the image and acquiring a plurality of target objects, where each of the plurality of target objects includes a word or a phrase of the text to be translated; receiving an input operation for the plurality of target objects, acquiring an object to be translated among the plurality of target objects, and translating the object to be translated.
Claims10
A translation method, performed by an electronic device, the method comprising:
- acquiring an image, wherein the acquired image comprises a text to be translated;
- splitting the text to be translated in the acquired image and acquiring a plurality of target objects, wherein each of the plurality of target objects comprises a word or a phrase of the text to be translated;
- and
- receiving an input operation for the plurality of target objects, and acquiring an object to be translated among the plurality of target objects;
- and
- translating the object to be translated;
- wherein the translating the object to be translated comprises:
- translating the object to be translated and acquiring a translation result;
- acquiring a context of the object to be translated in the text to be translated, and extracting a plurality of knowledge points from a database, wherein the knowledge points comprise fixed collocations of a group of words related to the object to be translated, related allusions of the target objects, the target objects in tenses and grammatical sentence pattern of the target objects;
- determining priorities of the plurality of knowledge points based on historical query data of a user;
- ranking the plurality of knowledge points according to the priorities, and acquiring top N knowledge points, wherein N is a positive integer;
- and
- displaying the translation result and the N knowledge points;
- wherein the splitting the text to be translated in the acquired image and acquiring the plurality of target objects comprises:
- identifying the acquired image by using an identification model and acquiring a second identification result;
- and
- when it is determined that the acquired image is a study scenario image of a plurality of study scenario images used in a study scenario according to the second identification result, splitting the text to be translated in the acquired image and acquiring the plurality of target objects, wherein the study scenario images comprise (i) images of printed text topics, or (ii) images of color textbooks having pictures and texts;
- wherein the acquiring process of the identification model comprises:
- acquiring the study scenario images and non-study scenario images used in a non-study scenario, and labelling manually each of the study scenario images and each of the non-study scenario images to form a training set;
- training a classifier by using the training set to learn characteristics of the study scenario images and the non-study scenario images;
- predicting classifications of input images by using the trained classifier, comparing a prediction result of the trained classifier with a real label of an input image of the input images, to adjust parameters of the trained classifier, thereby forming an adjusted classifier;
- and
- identifying the input images by using the adjusted classifier, to determine whether the input images are the study scenario images used in the study scenario.
A translation apparatus, comprising:
- at least one processor;
- and
- a memory in communication connection with the at least one processor;
- wherein the memory has stored thereon instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:
- acquire an image, wherein the acquired image comprises a text to be translated;
- split the text to be translated in the acquired image and acquire a plurality of target objects, wherein each of the plurality of target objects comprises a word or a phrase of the text to be translated;
- receive an input operation for the plurality of target objects, and acquire an object to be translated among the plurality of target objects, and
- translate the object to be translated;
- wherein executing the instructions to translate the object to be translated includes executing the instructions by the at least one processor to enable the at least one processor to:
- translate the object to be translated and acquire a translation result;
- acquire a context of the object to be translated in the text to be translated, and extract a plurality of knowledge points from a database, wherein the knowledge points comprise fixed collocations of a group of words related to the object to be translated, related allusions of the target objects, the target objects in tenses and grammatical sentence pattern of the target objects;
- determine priorities of the plurality of knowledge points based on historical query data of a user;
- rank the plurality of knowledge points according to the priorities, and acquire top N knowledge points, wherein N is a positive integer;
- and
- display the translation result and the N knowledge points;
- wherein executing the instructions to split the text to be translated in the acquired image and to acquire the plurality of target objects includes executing the instructions by the at least one processor to enable the at least one processor to:
- identify the acquired image by using an identification model and acquiring a second identification result;
- and
- when it is determined that the acquired image is a study scenario image of a plurality of study scenario images used in a study scenario according to the second identification result, split the text to be translated in the acquired image and acquire the plurality of target objects, wherein the study scenario images comprise (i) images of printed text topics, or (ii) images of color textbooks having pictures and texts;
- wherein the acquiring process of the identification model comprises:
- acquiring the study scenario images and non-study scenario images used in a non-study scenario, and labelling manually each of the study scenario image and each of the non-study scenario images to form a training set;
- training a classifier by using the training set to learn characteristics of the study scenario images and the non-study scenario images;
- predicting classifications of input images by using the trained classifier, comparing a prediction result of the trained classifier with a real label of an input image of the input images, to adjust parameters of the trained classifier, thereby forming an adjusted classifier;
- and
- identifying the input images by using the adjusted classifier, to determine whether the input images are the study scenario images used in the study scenario.
Dependencies are inferred from the claim text.