WO2022095735A1 - 应用程序多语言支持方法、装置、计算机设备及存储介质 - Google Patents

应用程序多语言支持方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2022095735A1
WO2022095735A1 PCT/CN2021/125952 CN2021125952W WO2022095735A1 WO 2022095735 A1 WO2022095735 A1 WO 2022095735A1 CN 2021125952 W CN2021125952 W CN 2021125952W WO 2022095735 A1 WO2022095735 A1 WO 2022095735A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
target
page
translated
target language
Prior art date
Application number
PCT/CN2021/125952
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 深圳壹账通智能科技有限公司
Publication of WO2022095735A1 publication Critical patent/WO2022095735A1/zh

Links

Images

Classifications

    • 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
    • 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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/07Target detection

Definitions

  • the present application relates to the technical field of artificial intelligence, and in particular, to a method, apparatus, computer equipment and storage medium for multi-language support of application programs.
  • the application/system needs to be internationalized or multilingual, whether it is a Web program, a form program or a mobile application, it is usually defined using a resource file and implemented by switching the language used by the thread. If it is picture text, you need to prepare picture cutouts in multiple language versions.
  • Embodiments of the present application provide a method, apparatus, computer device and storage medium for multilingual application program support, aiming to solve the problem that the existing application program multilingual solution causes the application program code to be huge and occupy a lot of memory.
  • an embodiment of the present application provides a method for multilingual support of an application program, which includes:
  • an embodiment of the present application also provides a device for multilingual support of an application program, which includes:
  • a first receiving unit configured to receive a page translation request sent by a user terminal, where the page translation request includes a page picture and a target language
  • a first acquiring unit configured to acquire the text area included in the page picture and the coordinates of the text area through a pre-trained target detection model, where the target detection model is obtained by training the page sample pictures marked with the text area;
  • an identification unit configured to separate the text region from the page picture, and identify the text contained in the text region through a preset OCR text recognition plug-in;
  • a conversion unit for converting the text into the target language to obtain translated text
  • a first adding unit configured to add the translated text to the page picture, and set the translated text on one side of the text region according to the coordinates of the text region to obtain a target page picture
  • the first sending unit is configured to send the target page picture to the user terminal.
  • an embodiment of the present application further provides a computer device, which includes a memory and a processor, where a computer program is stored on the memory, and the processor implements the following steps when executing the computer program:
  • an embodiment of the present application further provides a computer-readable storage medium, where the storage medium stores a computer program, and when the computer program is executed by a processor, the following steps can be implemented:
  • the embodiments of the present application provide a method, device, computer equipment and storage medium for multi-language support for applications.
  • the page translation request includes a page picture and a target language;
  • the detection model obtains the text area contained in the page picture and the coordinates of the text area, and the target detection model is obtained by training the page sample pictures marked with the text area; the text area is separated from the page image, and is pre-
  • the set OCR text recognition plug-in recognizes the text contained in the text area; after converting the text into the target language, the translated text is obtained; the translated text is added to the page picture, and according to the text area Coordinates setting the translated text on one side of the text area to obtain a picture of the target page; sending the picture of the target page to the user terminal to achieve unified multi-language management and avoid multi-language maintenance on the terminal side, There is no need to set up a multi-language library at the terminal, and there is no need to exchange language versions, thereby simplifying the code of the terminal, reducing
  • FIG. 1 is a schematic diagram of an application scenario of a method for multilingual support of an application program provided by an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a method for multilingual support of an application program provided by an embodiment of the present application
  • FIG. 3 is a schematic sub-flow diagram of a method for multi-language support for an application program provided by an embodiment of the present application
  • FIG. 4 is a schematic sub-flow diagram of a method for multi-language support for an application program provided by an embodiment of the present application
  • FIG. 5 is a schematic sub-flow diagram of a method for multi-language support for an application program provided by an embodiment of the present application
  • FIG. 6 is a schematic sub-flow diagram of a method for multi-language support for an application program provided by an embodiment of the present application
  • FIG. 7 is a schematic sub-flow diagram of a method for multi-language support for an application program provided by an embodiment of the present application.
  • FIG. 8 is a schematic block diagram of an apparatus for multilingual support of an application program provided by an embodiment of the present application.
  • FIG. 9 is a schematic block diagram of a first acquisition unit of an apparatus for multilingual support of an application program provided by an embodiment of the present application.
  • FIG. 10 is a schematic block diagram of a recognition unit of an application multilingual support device provided by an embodiment of the present application.
  • FIG. 11 is a schematic block diagram of a conversion unit of a device for multilingual support of an application program provided by an embodiment of the present application;
  • FIG. 12 is a schematic block diagram of a judgment unit of a device for multilingual support of an application program provided by an embodiment of the present application;
  • FIG. 13 is a schematic block diagram of a first adding unit of an apparatus for multilingual support of an application program provided by an embodiment of the present application;
  • FIG. 14 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • FIG. 15 is a schematic diagram of a target page picture provided by an embodiment of the present application.
  • FIG. 1 is a schematic diagram of an application scenario of the method for multilingual support of an application program provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a method for multilingual application support provided by an embodiment of the present application.
  • the application multi-language support method is applied in the server 2 .
  • the server 2 receives the page translation request sent by the user terminal 1, and the page translation request includes the page picture and the target language; the server 2 obtains the text area contained in the page image and the coordinates of the text area through the pre-trained target detection model, and the The target detection model is obtained by training the page sample pictures marked with the text region; the server 2 separates the text region from the page picture, and recognizes the text contained in the text region through a preset OCR text recognition plug-in; the server 2 After converting the text into the target language, the translated text is obtained; the translated text is added to the page picture, and the translated text is set on one side of the text area according to the coordinates of the text area to obtain the target page picture; the server 2 sends the target page picture to the user terminal 1 .
  • FIG. 2 is a schematic flowchart of a method for multilingual support of an application program provided by an embodiment of the present application. As shown in the figure, the method includes the following steps S1-S6.
  • S1 Receive a page translation request sent by a user terminal, where the page translation request includes a page picture and a target language.
  • the user when a page of an application needs to be translated, the user inputs a translation instruction to the user terminal.
  • the user terminal pops up a language list.
  • the user selects the target language.
  • the user terminal intercepts the current page picture, and sends a page translation request to the server, where the page translation request includes the page picture and the target language.
  • the server receives the page translation request sent by the user terminal.
  • the page translation request includes a page picture and a target language.
  • S2 Obtain the text area included in the page picture and the coordinates of the text area through a pre-trained target detection model, where the target detection model is obtained by training the page sample pictures marked with the text area.
  • the object detection model can be, for example, YOLO.
  • YOLO You Only Look Once
  • YOLO V1 YOLO V2
  • YOLO V3 YOLO V3.
  • YOLO is only an example of a target detection model, and those skilled in the art can also adopt other target detection models, which will not exceed the protection scope of the present application.
  • the target detection model is trained through a large number of page pictures marked with text areas in advance, so that the target detection model has the ability to recognize text areas. Understandably, the more training samples, the better the recognition effect of the target detection model.
  • the page picture is input into the trained target detection model, so that the trained target detection model detects and recognizes the text area in the page picture, and marks the coordinates of the text area.
  • step S2 specifically includes the following steps S21-S22.
  • S21 Obtain a feature map of the page picture, and input the feature map into the target detection model.
  • a feature map of the page image is acquired, and the feature map is input into the target detection model.
  • the page picture is composed of multiple pixels, and the color of the pixels is obtained by adding the three primary colors of red (Red), green (Green), and blue (Blue) in different proportions. Then each pixel can be represented as (a, b, c), where a is the proportion of red, b is the proportion of green, and c is the proportion of blue. Then, three feature matrices can be obtained by extracting the a, b, and c values of each pixel respectively.
  • the three-dimensional tensor composed of the three feature matrices is the feature map of the page image.
  • the feature map is the data that the object detection model can recognize.
  • S22 Receive a detection result output by the target detection model, where the detection result includes the text area and the coordinates of the text area detected by the target detection model in the page picture.
  • a detection result output by the target detection model is received, and the detection result includes the text area and the coordinates of the text area detected by the target detection model in the page picture.
  • the coordinates of the text area can be represented by a position feature vector A(x, y, w, h).
  • (x, y) are the coordinates of the center of the text area.
  • w is the width of the text area.
  • h is the height of the text area.
  • the text area is cut and separated from the page image to obtain the text area image, so that the background without text in the page image can be removed and the interference of the background can be avoided.
  • the text contained in the text area picture is obtained by scanning with OCR (Optical Character Recognition, Optical Character Recognition).
  • step S3 specifically includes the following steps S31-S32.
  • the page picture is input into a preset OCR text recognition plug-in.
  • the text contained in the picture on the page is obtained by scanning with the OCR text recognition plug-in.
  • OCR text recognition plug-in is a plug-in that uses OCR (Optical Character Recognition, Optical Character Recognition) technology to recognize text on pictures and photos and locate text coordinates.
  • OCR Optical Character Recognition, Optical Character Recognition
  • S32 Receive a character recognition result output by the OCR character recognition plug-in, where the character recognition result includes characters recognized from the character area.
  • the character recognition result output by the OCR character recognition plug-in is received, and the character recognition result includes the characters recognized from the character area. And extract text from the text recognition result output by the OCR text recognition plug-in.
  • the translated text is obtained after converting the text into the target language.
  • each character is translated one by one.
  • multi-threading technology to translate multiple characters at the same time.
  • the text may be translated through a translation model or a translation plug-in, or other methods may be used to translate the text, which is not specifically limited in this application.
  • step S4 specifically includes the following steps: S41-S44.
  • the multilingual database refers to a database for storing translation results of text in page pictures in multiple languages.
  • the multilingual library is pre-established by operation and maintenance personnel and updated in real time.
  • step S41 specifically includes the following steps: S311-S313.
  • a query request is sent to the multilingual database, where the query request includes the text and the target language.
  • the multilingual library When the multilingual library receives the query request, please query whether there is a translated text of the text corresponding to the target language.
  • the multilingual library returns the query result to the server. If it does not exist, the multi-language library returns a prompt message of no query result to the server.
  • the query result returned by the multilingual database is received, it is determined that there is a translated text of the text corresponding to the target language in the multilingual database.
  • the translated text of the text corresponding to the target language is acquired from the multilingual database.
  • the translated text corresponding to the target language is queried from the query result returned by the multilingual database.
  • a translation request is sent to a preset translation plug-in, where the translation request includes the text and the target language.
  • Translation plugins refer to plugins used to translate text, such as Google Translate plugins and Baidu Translator plugins. It should be noted that the translation plugin implements translation work through a pre-trained LSTM (Long Short-Term Memory) model. First, the word vector of the text is obtained, and then the word vector is input into the LSTM model, so that the LSTM model predicts the translation result of the text corresponding to the target language.
  • LSTM Long Short-Term Memory
  • S44 Receive a translation result returned by the translation plug-in, where the translation result includes the translated text of the text corresponding to the target language.
  • the translation result returned by the translation plug-in is received, and the translation result includes the translated text of the text corresponding to the target language.
  • the method further includes: storing the translated text of the text corresponding to the target language in the multilingual database.
  • the text, the target language, and the translated text of the text corresponding to the target language are stored in the multilingual database, so as to update the multilingual database.
  • the translated text of the text corresponding to the target language can be directly queried from the multilingual database, which improves the efficiency.
  • the translated text is added to the page picture, and the translated text is set on one side of the text region according to the coordinates of the text region to obtain the target page picture.
  • the page picture refers to an uncropped page picture (that is, a page picture with a text area reserved), and the original text information of the page picture is reserved.
  • step S5 specifically includes the following steps: S51-S53.
  • a text box is set on one side of the text region according to the coordinates of the text region.
  • the coordinates of the text box are first determined according to the coordinates of the text area. Then set the textbox according to the coordinates of the textbox.
  • the translated text is added to the text box to obtain the target page picture.
  • FIG. 15 shows a final image of the target page obtained in an embodiment of the present application.
  • the target page picture is sent to the user terminal.
  • the user terminal displays the picture of the target page accordingly, so that the user can see the picture of the target page and quickly and accurately see the translation result of the text.
  • a page translation request sent by a user terminal is received, and the page translation request includes a page image and a target language; the text area included in the page image and the coordinates of the text area are obtained through a pre-trained target detection model , the target detection model is obtained by training the page sample pictures marked with the text region; the text region is separated from the page picture, and the text contained in the text region is recognized by a preset OCR text recognition plug-in; After the text is converted into the target language, the translated text is obtained; the translated text is added to the page picture, and the translated text is set on one side of the text area according to the coordinates of the text area. Obtain the target page picture; send the target page picture to the user terminal.
  • the application realizes unified multi-language management through the server, avoids multi-language maintenance on the terminal side, does not need to set up a multi-language library at the terminal, and does not need to exchange language versions, thereby simplifying the code of the terminal and reducing the memory of the application program Occupy, improve the running speed of the application.
  • the pre-trained target detection model locates the position of the text area in the page image, and then separates the text area from the page image, which can effectively avoid the interference of invalid background on text recognition and improve the recognition accuracy.
  • FIG. 8 is a schematic block diagram of an apparatus 70 for supporting multilingual application programs provided by an embodiment of the present application.
  • the present application further provides an application multilingual support apparatus 70 .
  • the application multi-language support device 70 includes a unit for executing the above-mentioned application multi-language support method, and the application multi-language support device 70 may be configured in a server.
  • the application multilingual support device 70 includes a first receiving unit 71 , a first acquiring unit 72 , an identifying unit 73 , a converting unit 74 , a first adding unit 75 and a first sending unit 76 .
  • the first receiving unit 71 is configured to receive a page translation request sent by a user terminal, where the page translation request includes a page picture and a target language;
  • the first obtaining unit 72 is configured to obtain the text area included in the page picture and the coordinates of the text area through a pre-trained target detection model, where the target detection model is obtained by training the page sample pictures marked with the text area;
  • An identification unit 73 configured to separate the text region from the page picture, and identify the text contained in the text region through a preset OCR text recognition plug-in;
  • a conversion unit 74 configured to convert the text into the target language to obtain translated text
  • the first adding unit 75 is used to add the translated text to the page picture, and set the translated text on one side of the text region according to the coordinates of the text region to obtain the target page picture;
  • the first sending unit 76 is configured to send the target page picture to the user terminal.
  • the first obtaining unit 72 includes a first input unit 721 and a first receiving unit 722 .
  • the first input unit 721 is used to obtain the feature map of the page picture, and input the feature map into the target detection model;
  • the second receiving unit 722 is configured to receive a detection result output by the target detection model, where the detection result includes the text area and the coordinates of the text area detected by the target detection model in the page picture.
  • the identifying unit 73 includes a second input unit 731 and a third receiving unit 732 .
  • the second input unit 731 is used to input the text area into a preset OCR text recognition plug-in;
  • the third receiving unit 732 is configured to receive a character recognition result output by the OCR character recognition plug-in, where the character recognition result includes the characters recognized from the character area.
  • the converting unit 74 includes a determining unit 741 , a second obtaining unit 742 , a second sending unit 743 and a fourth receiving unit 744 .
  • a judgment unit 741 configured to judge whether there is a translated text corresponding to the target language in the preset multilingual database
  • a second acquiring unit 742 configured to acquire, from the multilingual database, the translated text of the text corresponding to the target language if there is a translated text of the text corresponding to the target language in the multilingual database;
  • the second sending unit 743 is configured to send a translation request to a preset translation plug-in if there is no translated text corresponding to the target language in the multilingual database, where the translation request includes the text and the Target language;
  • the fourth receiving unit 744 is configured to receive a translation result returned by the translation plug-in, where the translation result includes the translated text of the text corresponding to the target language.
  • the determining unit 741 includes a third sending unit 7411 , a first determining unit 7412 and a second determining unit 7413 .
  • a third sending unit 7411 configured to send a query request to the multilingual database, where the query request includes the text and the target language;
  • a first determining unit 7412 configured to determine that there is a translated text of the text corresponding to the target language in the multilingual database if the query result returned by the multilingual database is received;
  • the second determining unit 7413 is configured to determine that there is no translated text corresponding to the target language in the multilingual database if the prompt message of no query result returned by the multilingual database is received.
  • the first adding unit 75 includes a setting unit 751 and a second adding unit 752 .
  • a setting unit 751 configured to set a text box on one side of the text area according to the coordinates of the text area;
  • the second adding unit 752 is configured to add the translated text to the text box.
  • the above-mentioned application multi-language support apparatus 70 can be implemented in the form of a computer program, and the computer program can be executed on a computer device as shown in FIG. 14 .
  • FIG. 14 is a schematic block diagram of a computer device provided by an embodiment of the present application.
  • the computer device 500 is a server.
  • the server can be an independent server or a server cluster composed of multiple servers.
  • the computer device 500 includes a processor 502 , a memory and a network interface 505 connected through a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .
  • the nonvolatile storage medium 503 can store an operating system 5031 and a computer program 5032 .
  • the computer program 5032 when executed, can cause the processor 502 to execute a method of multi-language support for application programs.
  • the processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .
  • the internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503.
  • the processor 502 can execute a method for supporting multiple languages of an application program.
  • the network interface 505 is used for network communication with other devices.
  • the structure shown in FIG. 14 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied.
  • the specific computer device 500 may include more or fewer components than shown, or combine certain components, or have a different arrangement of components.
  • the processor 502 is configured to run the computer program 5032 stored in the memory, so as to implement the method for multi-language support for application programs described in the embodiments of the present application.
  • the processor 502 may be a central processing unit (Central Processing Unit, CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), special-purpose processors Integrated circuit (Application Specific Integrated Circuit, ASIC), off-the-shelf Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor can be a microprocessor or the processor can also be any conventional processor or the like.
  • the computer program can be stored in a storage medium, which is a computer-readable storage medium.
  • the computer program is executed by at least one processor in the computer system to implement the flow steps of the above-described method embodiments.
  • the present application also provides a storage medium.
  • the storage medium may be a computer-readable storage medium.
  • the storage medium stores a computer program.
  • the processor executes the steps of the method for multilingual support of an application program described in the above embodiments.
  • the storage medium is a physical, non-transitory storage medium, such as a U disk, a removable hard disk, a read-only memory (Read-Only Memory, ROM), a magnetic disk or an optical disk and other physical storage that can store program codes. medium.
  • ROM Read-Only Memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Biophysics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Machine Translation (AREA)

Abstract

本申请公开了一种应用程序多语言支持方法、装置、计算机设备及存储介质。涉及人工智能技术领域,可应用于智慧城市建设中。该方法包括:接收用户终端发送的页面翻译请求;通过预训练的目标检测模型获取页面图片包含的文字区域及其坐标;将文字区域从页面图片中分离,并识别其中的文字;将文字转换为目标语言后得到翻译文字;将翻译文字添加到页面图片中,并设置在文字区域的一侧以得到目标页面图片;将目标页面图片发送给用户终端。

Description

应用程序多语言支持方法、装置、计算机设备及存储介质
本申请要求于2020年11月05日提交中国专利局、申请号为202011223224.0、申请名称为“应用程序多语言支持方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能技术领域,尤其涉及一种应用程序多语言支持方法、装置、计算机设备及存储介质。
背景技术
如果应用程序/系统需要国际化或者说多语言化,不管是Web程序、窗体程序还是移动应用程序通常都会使用资源文件来定义,并通过切换线程的使用语言来实现。如果是图片文字,则需要准备多个语言版本的图片切图。发明人发现,当前微服务应用非常广泛,一个系统/平台往往包含很多个微服务。如需实现多语言化,则需要每个服务应用都要维护一套多语言,而且服务之间调用码值、话术文本不统一,造成很大的维护成本和对接困难,同时还会使得应用程序的代码十分冗余庞大,运行时占用大量内存。
发明内容
本申请实施例提供了一种应用程序多语言支持方法、装置、计算机设备及存储介质,旨在解决现有应用程序多语言方案导致应用程序代码庞大,占用内存多的问题。
第一方面,本申请实施例提供了一种应用程序多语言支持方法,其包括:
接收用户终端发送的页面翻译请求,所述页面翻译请求包括页面图片以及目标语言;
通过预训练的目标检测模型获取所述页面图片包含的文字区域以及文字区域的坐标,所述目标检测模型由标注了文字区域的页面样本图片训练得到;
将所述文字区域从所述页面图片中分离,并通过预设的OCR文字识别插件识别所述文字区域包含的文字;
将所述文字转换为所述目标语言后得到翻译文字;
将所述翻译文字添加到所述页面图片中,并根据所述文字区域的坐标将所述翻译文字设置在所述文字区域的一侧以得到目标页面图片;
将所述目标页面图片发送给用户终端。
第二方面,本申请实施例还提供了一种应用程序多语言支持装置,其包括:
第一接收单元,用于接收用户终端发送的页面翻译请求,所述页面翻译请求包括页面图片以及目标语言;
第一获取单元,用于通过预训练的目标检测模型获取所述页面图片包含的文字区域以及文字区域的坐标,所述目标检测模型由标注了文字区域的页面样本图片训练得到;
识别单元,用于将所述文字区域从所述页面图片中分离,并通过预设的OCR文字识别插件识别所述文字区域包含的文字;
转换单元,用于将所述文字转换为所述目标语言后得到翻译文字;
第一添加单元,用于将所述翻译文字添加到所述页面图片中,并根据所述文字区域的坐标将所述翻译文字设置在所述文字区域的一侧以得到目标页面图片;
第一发送单元,用于将所述目标页面图片发送给用户终端。
第三方面,本申请实施例还提供了一种计算机设备,其包括存储器及处理器,所述存储器上存储有计算机程序,所述处理器执行所述计算机程序时实现如下步骤:
接收用户终端发送的页面翻译请求,所述页面翻译请求包括页面图片以及目标语言;
通过预训练的目标检测模型获取所述页面图片包含的文字区域以及文字区域的坐标,所述目标检测模型由标注了文字区域的页面样本图片训练得到;
将所述文字区域从所述页面图片中分离,并通过预设的OCR文字识别插件识别所述文字区域包含的文字;
将所述文字转换为所述目标语言后得到翻译文字;
将所述翻译文字添加到所述页面图片中,并根据所述文字区域的坐标将所述翻译文字设置在所述文字区域的一侧以得到目标页面图片;
将所述目标页面图片发送给用户终端。
第四方面,本申请实施例还提供了一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序当被处理器执行时可实现如下步骤:
接收用户终端发送的页面翻译请求,所述页面翻译请求包括页面图片以及目标语言;
通过预训练的目标检测模型获取所述页面图片包含的文字区域以及文字区域的坐标,所述目标检测模型由标注了文字区域的页面样本图片训练得到;
将所述文字区域从所述页面图片中分离,并通过预设的OCR文字识别插件识别所述文字区域包含的文字;
将所述文字转换为所述目标语言后得到翻译文字;
将所述翻译文字添加到所述页面图片中,并根据所述文字区域的坐标将所述翻译文字设置在所述文字区域的一侧以得到目标页面图片;
将所述目标页面图片发送给用户终端。
本申请实施例提供了一种应用程序多语言支持方法、装置、计算机设备及存储介质,通过接收用户终端发送的页面翻译请求,所述页面翻译请求包括页面图片以及目标语言;通过预训练的目标检测模型获取所述页面图片包含的文字区域以及文字区域的坐标,所述目标检测模型由标注了文字区域的页面样本图片训练得到;将所述文字区域从所述页面图片中分离,并通过预设的OCR文字识别插件识别所述文字区域包含的文字;将所述文字转换为所述目标语言后得到翻译文字;将所述翻译文字添加到所述页面图片中,并根据所述文字区域的坐标将所述翻译文字设置在所述文字区域的一侧以得到目标页面图片;将所述目标页面图片发送给用户终端,实现了统一的多语言管理,避免了在终端侧进行多语言维护,终端处无需设置多语言库,无需进行语言版本的调换,从而简化了终端的代码,减少了应用程序的内存占用,提高了应用程序的运行速度。通过预训练的目标检测模型定位页面图片中文字区域的位置,然后将文字区域从页面图片中分离出来,可有效避免无效背景对文字识别的干扰,提高识别的准确性。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种应用程序多语言支持方法的一种应用场景示意图;
图2为本申请实施例提供的一种应用程序多语言支持方法的流程示意图;
图3为本申请实施例提供的一种应用程序多语言支持方法的子流程示意图;
图4为本申请实施例提供的一种应用程序多语言支持方法的子流程示意图;
图5为本申请实施例提供的一种应用程序多语言支持方法的子流程示意图;
图6为本申请实施例提供的一种应用程序多语言支持方法的子流程示意图;
图7为本申请实施例提供的一种应用程序多语言支持方法的子流程示意图;
图8为本申请实施例提供的一种应用程序多语言支持装置的示意性框图;
图9为本申请实施例提供的一种应用程序多语言支持装置的第一获取单元的示意性框图;
图10为本申请实施例提供的一种应用程序多语言支持装置的识别单元的示意性框图;
图11为本申请实施例提供的一种应用程序多语言支持装置的转换单元的示意性框图;
图12为本申请实施例提供的一种应用程序多语言支持装置的判断单元的示意性框图;
图13为本申请实施例提供的一种应用程序多语言支持装置的第一添加单元的示意性框图;
图14为本申请实施例提供的一种计算机设备的示意性框图;
图15为本申请实施例提供的目标页面图片的示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
请参阅图1和图2,图1为本申请实施例提供的应用程序多语言支持方法的应用场景示意图。图2为本申请实施例提供的应用程序多语言支持方法的示意性流程图。所述应用程序多语言支持方法应用于服务器2中。服务器2接收用户终端1发送的页面翻译请求,所述页面翻译请求包括页面图片以及目标语言;服务器2通过预训练的目标检测模型获取所述页面图片包含的文字区域以及文字区域的坐标,所述目标检测模型由标注了文字区域的页面样本图片训练得到;服务器2将所述文字区域从所述页面图片中分离,并通过预设的OCR文字识别插件识别所述文字区域包含的文字;服务器2将所述文字转换为所述目标语言后得到翻译文字;将所述翻译文字添加到所述页面图片中,并根据所述文字区域的坐标将所述翻译文字设置在所述文字区域的一侧以得到目标页面图片;服务器2将所述目标页面图片发送给用户终端1。
图2是本申请实施例提供的应用程序多语言支持方法的流程示意图。如图所示,该方法包括以下步骤S1-S6。
S1,接收用户终端发送的页面翻译请求,所述页面翻译请求包括页面图片以及目标语言。
具体实施中,在需要对应用的页面进行翻译时,用户向用户终端输入翻译指令。用户终端弹出语言列表。用户选中目标语言。之后用户终端截取当前的页面图片,并向服务器发送页面翻译请求,所述页面翻译请求包括页面图片、以及目标语言。
相应地,服务器接收用户终端发送的页面翻译请求。所述页面翻译请求包括页面图片以及目标语言。
S2,通过预训练的目标检测模型获取所述页面图片包含的文字区域以及文字区域的坐标,所述目标检测模型由标注了文字区域的页面样本图片训练得到。
目标检测模型可例如为YOLO。YOLO(You Only Look Once)是一种基于深度神经网络的目标检测模型。YOLO的版本目前总共有三种,分别为YOLO V1、YOLO V2以及YOLO V3。
需要说明的是,YOLO仅仅是目标检测模型的一个示例,本领域技术人员还可以采用其他目标检测模型,则并不会超出本申请的保护范围。
首先,预先通过大量经过标注文字区域的页面图片来对目标检测模型进行训练,使得目标检测模型具有识别文字区域的能力。可以理解地,训练样本越多,目标检测模型的识别效果越好。
之后,将所述页面图片输入到训练后的目标检测模型中,以通过训练后的目标检测模型来检测识别页面图片中的文字区域,并标注文字区域的坐标。
参见图3,在一实施例中,以上步骤S2具体包括如下步骤S21-S22。
S21,获取所述页面图片的特征图,并将所述特征图输入所述目标检测模型中。
具体实施中,获取所述页面图片的特征图,并将所述特征图输入所述目标检测模型中。
页面图片是由多个像素组成的,像素的颜色由红(Red)、绿(Green)、蓝(Blue)三原色的色光以不同的比例相加得到。则每个像素可表示为(a,b,c),其中a为红的比例,b为绿的比例,c为蓝的比例。则分别提取每个像素的a、b、c值可得到三个特征矩阵。此三个特征矩阵组成的三维张量即为页面图片的特征图。特征图为目标检测模型能够识别的数据。
S22,接收所述目标检测模型输出的检测结果,所述检测结果包含所述目标检测模型在所述页面图片中检测到的文字区域以及文字区域的坐标。
具体实施中,接收所述目标检测模型输出的检测结果,所述检测结果包含所述目标检测模型在所述页面图片中检测到的文字区域以及文字区域的坐标。
文字区域的坐标可通过位置特征向量A(x,y,w,h)表示。其中,(x,y)为文字区域中心的坐标。w为文字区域的宽度。h为文字区域的高度。
S3,将所述文字区域从所述页面图片中分离,并通过预设的OCR文字识别插件识别所述文字区域包含的文字。
具体实施中,将所述文字区域从所述页面图片中裁剪分离出来得到文字区域图片,从而可去除页面图片中没有文字的背景,避免背景的干扰。
在裁剪出文字区域得到文字区域图片后,通过OCR(Optical Character Recognition,光学字符识别)扫描的方式获取所述文字区域图片包含的文字。
需要说明的是,在剪裁页面图片之前,会对页面图片做备份。
参见图4,在一实施例中,以上步骤S3具体包括如下步骤S31-S32。
S31,将所述文字区域输入到预设的OCR文字识别插件中。
具体实施中,将所述页面图片输入到预设的OCR文字识别插件中。以由OCR文字识别插件来扫描,获取所述页面图片包含的文字。
OCR文字识别插件,是一种利用OCR(Optical Character Recognition,光学字符识别)技术,识别图片、照片上的文字以及定位文字坐标的插件。
S32,接收所述OCR文字识别插件输出的文字识别结果,所述文字识别结果包含从所述文字区域中识别到的文字。
具体实施中,接收所述OCR文字识别插件输出的文字识别结果,所述文字识别结果包含从所述文字区域中识别到的文字。并从所述OCR文字识别插件输出的文字识别结果中提取文字。
S4,将所述文字转换为所述目标语言后得到翻译文字。
具体实施中,将所述文字转换为所述目标语言后得到翻译文字。
具体地,如果所述页面图片中包含多处文字,则逐一对各文字进行翻译。或者采用多线程技术同时对多个文字进行翻译。
可通过翻译模型或者翻译插件来对文字进行翻译,或者采用其他方式来对文字进行翻译,对此,本申请不作具体限定。
参见图5,在一实施例中,以上步骤S4具体包括如下步骤:S41-S44。
S41,判断预设的多语言库中是否存在所述文字对应所述目标语言的翻译文字。
具体实施中,判断预设的多语言库中是否存在所述文字对应所述目标语言的翻译文字。
需要说明的是,多语言库是指用于储存页面图片中的文字的多种语言的翻译结果的数据库。多语言库预先由运维人员建立,并实时更新。
参见图6在一实施例中,以上步骤S41具体包括如下步骤:S311-S313。
S411,向所述多语言库发送查询请求,所述查询请求包含所述文字以及所述目标语言。
具体实施中,向所述多语言库发送查询请求,所述查询请求包含所述文字以及所述目标语言。
多语言库在接收到所述查询请求时,请查询是否存在所述文字对应所述目标语言的翻译文字。
若存在,多语言库向服务器返回查询结果。若不存在,多语言库向服务器返回无查询结果提示消息。
S412,若接收到所述多语言库返回的查询结果,则判定所述多语言库中存在所述文字对应所述目标语言的翻译文字。
具体实施中,如果接收到所述多语言库返回的查询结果,则判定所述多语言库中存在所述文字对应所述目标语言的翻译文字。
S413,若接收到所述多语言库返回的无查询结果提示消息,则判定所述多语言库中不存 在所述文字对应所述目标语言的翻译文字。
具体实施中,若接收到所述多语言库返回的无查询结果提示消息,则判定所述多语言库中不存在所述文字对应所述目标语言的翻译文字。
S42,若所述多语言库中存在所述文字对应所述目标语言的翻译文字,则从所述多语言库中获取所述文字对应所述目标语言的翻译文字。
具体实施中,若所述多语言库中存在所述文字对应所述目标语言的翻译文字,则从所述多语言库中获取所述文字对应所述目标语言的翻译文字。
具体地,从所述多语言库返回的查询结果中查询所述文字对应所述目标语言的翻译文字。
S43,若所述多语言库中不存在所述文字对应所述目标语言的翻译文字,向预设的翻译插件发送翻译请求,所述翻译请求包含所述文字以及所述目标语言。
具体实施中,若所述多语言库中不存在所述文字对应所述目标语言的翻译文字,向预设的翻译插件发送翻译请求,所述翻译请求包含所述文字以及所述目标语言。
翻译插件是指用于翻译文字的插件,例如Google翻译插件以及百度翻译插件等。需要说明的是,翻译插件通过预训练的LSTM(Long Short-Term Memory,长短期记忆网络)模型来实现翻译工作。首先将获取文本的词向量,然后将词向量输入到LSTM模型中,以由LSTM模型预测所述文本对应目标语言的翻译结果。
S44,接收所述翻译插件返回的翻译结果,所述翻译结果包含所述文字对应所述目标语言的翻译文字。
具体实施中,接收所述翻译插件返回的翻译结果,所述翻译结果包含所述文字对应所述目标语言的翻译文字。
在一实施例中,在步骤S44之后,所述方法还包括:将所述文字对应所述目标语言的翻译文字储存到所述多语言库中。
具体实施中,将所述文字、所述目标语言以及所述文字对应所述目标语言的翻译文字储存到所述多语言库中,以实现对多语言库的更新。
之后,可直接从所述多语言库中查询所述文字对应所述目标语言的翻译文字,提高了效率。
S5,将所述翻译文字添加到所述页面图片中,并根据所述文字区域的坐标将所述翻译文字设置在所述文字区域的一侧以得到目标页面图片。
具体实施中,将所述翻译文字添加到所述页面图片中,并根据所述文字区域的坐标将所述翻译文字设置在所述文字区域的一侧以得到目标页面图片。由此,可让用户快速准确看到文字的翻译结果。
需要说明的是,该页面图片是指未经剪裁的页面图片(即保留了文字区域的页面图片),页面图片原始的文字信息是保留的。
参见图7,在一实施例中,以上步骤S5具体包括如下步骤:S51-S53。
S51,根据文字区域的坐标在所述文字区域的一侧设置文本框。
具体实施中,根据文字区域的坐标在所述文字区域的一侧设置文本框。
具体地,首先根据文字区域的坐标确定文本框的坐标。然后根据文本框的坐标设置文本框。
S52,将所述翻译文字添加到所述文本框中。
具体实施中,将所述翻译文字添加到所述文本框中,以得到所述目标页面图片。
参见图15,图15展示了本申请一实施例的最终得到的目标页面图片。
S6,将所述目标页面图片发送给用户终端。
具体实施中,将所述目标页面图片发送给用户终端。
用户终端相应展示所述目标页面图片,从而用户可看到该目标页面图片,并快速准确看到文字的翻译结果。
通过应用本申请的技术方案,接收用户终端发送的页面翻译请求,所述页面翻译请求包括页面图片以及目标语言;通过预训练的目标检测模型获取所述页面图片包含的文字区域以及文字区域的坐标,所述目标检测模型由标注了文字区域的页面样本图片训练得到;将所述文字区域从所述页面图片中分离,并通过预设的OCR文字识别插件识别所述文字区域包含的文字;将所述文字转换为所述目标语言后得到翻译文字;将所述翻译文字添加到所述页面图片中,并根据所述文字区域的坐标将所述翻译文字设置在所述文字区域的一侧以得到目标页面图片;将所述目标页面图片发送给用户终端。本申请通过服务器实现了统一的多语言管理,避免了在终端侧进行多语言维护,终端处无需设置多语言库,无需进行语言版本的调换,从而简化了终端的代码,减少了应用程序的内存占用,提高了应用程序的运行速度。通过预训练的目标检测模型定位页面图片中文字区域的位置,然后将文字区域从页面图片中分离出来,可有效避免无效背景对文字识别的干扰,提高识别的准确性。
图8是本申请实施例提供的一种应用程序多语言支持装置70的示意性框图。如图8所示,对应于以上应用程序多语言支持方法,本申请还提供一种应用程序多语言支持装置70。该应用程序多语言支持装置70包括用于执行上述应用程序多语言支持方法的单元,该应用程序多语言支持装置70可以被配置于服务器中。具体地,请参阅图8,该应用程序多语言支持装置70包括第一接收单元71、第一获取单元72、识别单元73、转换单元74、第一添加单元75以及第一发送单元76。
第一接收单元71,用于接收用户终端发送的页面翻译请求,所述页面翻译请求包括页面图片以及目标语言;
第一获取单元72,用于通过预训练的目标检测模型获取所述页面图片包含的文字区域以及文字区域的坐标,所述目标检测模型由标注了文字区域的页面样本图片训练得到;
识别单元73,用于将所述文字区域从所述页面图片中分离,并通过预设的OCR文字识别插件识别所述文字区域包含的文字;
转换单元74,用于将所述文字转换为所述目标语言后得到翻译文字;
第一添加单元75,用于将所述翻译文字添加到所述页面图片中,并根据所述文字区域的坐标将所述翻译文字设置在所述文字区域的一侧以得到目标页面图片;
第一发送单元76,用于将所述目标页面图片发送给用户终端。
在一实施例中,如图9所示,所述第一获取单元72包括第一输入单元721以及第一接收单元722。
第一输入单元721,用于获取所述页面图片的特征图,并将所述特征图输入所述目标检测模型中;
第二接收单元722,用于接收所述目标检测模型输出的检测结果,所述检测结果包含所述目标检测模型在所述页面图片中检测到的文字区域以及文字区域的坐标。
在一实施例中,如图10所示,所述识别单元73包括第二输入单元731以及第三接收单元732。
第二输入单元731,用于将所述文字区域输入到预设的OCR文字识别插件中;
第三接收单元732,用于接收所述OCR文字识别插件输出的文字识别结果,所述文字识别结果包含从所述文字区域中识别到的文字。
在一实施例中,如图11所示,所述转换单元74包括判断单元741、第二获取单元742、第二发送单元743以及第四接收单元744。
判断单元741,用于判断预设的多语言库中是否存在所述文字对应所述目标语言的翻译文字;
第二获取单元742,用于若所述多语言库中存在所述文字对应所述目标语言的翻译文字,则从所述多语言库中获取所述文字对应所述目标语言的翻译文字;
第二发送单元743,用于若所述多语言库中不存在所述文字对应所述目标语言的翻译文字,向预设的翻译插件发送翻译请求,所述翻译请求包含所述文字以及所述目标语言;
第四接收单元744,用于接收所述翻译插件返回的翻译结果,所述翻译结果包含所述文字对应所述目标语言的翻译文字。
在一实施例中,如图12所示,所述判断单元741包括第三发送单元7411、第一判定单元7412以及第二判定单元7413。
第三发送单元7411,用于向所述多语言库发送查询请求,所述查询请求包含所述文字以及所述目标语言;
第一判定单元7412,用于若接收到所述多语言库返回的查询结果,则判定所述多语言库中存在所述文字对应所述目标语言的翻译文字;
第二判定单元7413,用于若接收到所述多语言库返回的无查询结果提示消息,则判定所述多语言库中不存在所述文字对应所述目标语言的翻译文字。
在一实施例中,如图13所示,所述第一添加单元75包括设置单元751以及第二添加单元752。
设置单元751,用于根据文字区域的坐标在所述文字区域的一侧设置文本框;
第二添加单元752,用于将所述翻译文字添加到所述文本框中。
需要说明的是,所属领域的技术人员可以清楚地了解到,上述应用程序多语言支持装置70和各单元的具体实现过程,可以参考前述方法实施例中的相应描述,为了描述的方便和简洁,在此不再赘述。
上述应用程序多语言支持装置70可以实现为一种计算机程序的形式,该计算机程序可以在如图14所示的计算机设备上运行。
请参阅图14,图14是本申请实施例提供的一种计算机设备的示意性框图。该计算机设备500是服务器。服务器可以是独立的服务器,也可以是多个服务器组成的服务器集群。
参阅图14,该计算机设备500包括通过系统总线501连接的处理器502、存储器和网络接口505,其中,存储器可以包括非易失性存储介质503和内存储器504。
该非易失性存储介质503可存储操作系统5031和计算机程序5032。该计算机程序5032被执行时,可使得处理器502执行一种应用程序多语言支持方法。
该处理器502用于提供计算和控制能力,以支撑整个计算机设备500的运行。
该内存储器504为非易失性存储介质503中的计算机程序5032的运行提供环境,该计算机程序5032被处理器502执行时,可使得处理器502执行一种应用程序多语言支持方法。
该网络接口505用于与其它设备进行网络通信。本领域技术人员可以理解,图14中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备500的限定,具体的计算机设备500可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
其中,所述处理器502用于运行存储在存储器中的计算机程序5032,以实现本申请实施例所描述的所述应用程序多语言支持方法。
应当理解,在本申请实施例中,处理器502可以是中央处理单元(Central ProcessingUnit,CPU),该处理器502还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable GateArray,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
本领域普通技术人员可以理解的是实现上述实施例的方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成。该计算机程序可存储于一存储介质中,该存储介质为计算机可读存储介质。该计算机程序被该计算机系统中的至少一个处理器执行,以实现上述方法的实施例的流程步骤。
因此,本申请还提供一种存储介质。该存储介质可以为计算机可读存储介质。该存储介质存储有计算机程序。该计算机程序被处理器执行时使处理器执行以上各实施例中所描述的 所述应用程序多语言支持方法的步骤。
所述存储介质为实体的、非瞬时性的存储介质,例如可以是U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的实体存储介质。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种应用程序多语言支持方法,包括:
    接收用户终端发送的页面翻译请求,所述页面翻译请求包括页面图片以及目标语言;
    通过预训练的目标检测模型获取所述页面图片包含的文字区域以及文字区域的坐标,所述目标检测模型由标注了文字区域的页面样本图片训练得到;
    将所述文字区域从所述页面图片中分离,并通过预设的OCR文字识别插件识别所述文字区域包含的文字;
    将所述文字转换为所述目标语言后得到翻译文字;
    将所述翻译文字添加到所述页面图片中,并根据所述文字区域的坐标将所述翻译文字设置在所述文字区域的一侧以得到目标页面图片;
    将所述目标页面图片发送给用户终端。
  2. 根据权利要求1所述的应用程序多语言支持方法,其中,所述通过预训练的目标检测模型获取所述页面图片包含的文字区域以及文字区域的坐标,包括:
    获取所述页面图片的特征图,并将所述特征图输入所述目标检测模型中;
    接收所述目标检测模型输出的检测结果,所述检测结果包含所述目标检测模型在所述页面图片中检测到的文字区域以及文字区域的坐标。
  3. 根据权利要求1所述的应用程序多语言支持方法,其中,所述通过预设的OCR文字识别插件识别所述文字区域包含的文字,包括:
    将所述文字区域输入到预设的OCR文字识别插件中;
    接收所述OCR文字识别插件输出的文字识别结果,所述文字识别结果包含从所述文字区域中识别到的文字。
  4. 根据权利要求1所述的应用程序多语言支持方法,其中,所述将所述文字转换为所述目标语言后得到翻译文字,包括:
    判断预设的多语言库中是否存在所述文字对应所述目标语言的翻译文字;
    若所述多语言库中存在所述文字对应所述目标语言的翻译文字,则从所述多语言库中获取所述文字对应所述目标语言的翻译文字。
  5. 根据权利要求4所述的应用程序多语言支持方法,其中,所述将所述文字转换为所述目标语言后得到翻译文字,还包括:
    若所述多语言库中不存在所述文字对应所述目标语言的翻译文字,向预设的翻译插件发送翻译请求,所述翻译请求包含所述文字以及所述目标语言;
    接收所述翻译插件返回的翻译结果,所述翻译结果包含所述文字对应所述目标语言的翻译文字。
  6. 根据权利要求4所述的应用程序多语言支持方法,其中,所述判断预设的多语言库中是否存在所述文字对应所述目标语言的翻译文字,包括:
    向所述多语言库发送查询请求,所述查询请求包含所述文字以及所述目标语言;
    若接收到所述多语言库返回的查询结果,则判定所述多语言库中存在所述文字对应所述目标语言的翻译文字;
    若接收到所述多语言库返回的无查询结果提示消息,则判定所述多语言库中不存在所述文字对应所述目标语言的翻译文字。
  7. 根据权利要求1所述的应用程序多语言支持方法,其中,所述根据所述文字区域的坐标将所述翻译文字设置在所述文字区域的一侧以得到目标页面图片,包括:
    根据文字区域的坐标在所述文字区域的一侧设置文本框;
    将所述翻译文字添加到所述文本框中。
  8. 一种应用程序多语言支持装置,包括:
    第一接收单元,用于接收用户终端发送的页面翻译请求,所述页面翻译请求包括页面图片以及目标语言;
    第一获取单元,用于通过预训练的目标检测模型获取所述页面图片包含的文字区域以及文字区域的坐标,所述目标检测模型由标注了文字区域的页面样本图片训练得到;
    识别单元,用于将所述文字区域从所述页面图片中分离,并通过预设的OCR文字识别插件识别所述文字区域包含的文字;
    转换单元,用于将所述文字转换为所述目标语言后得到翻译文字;
    第一添加单元,用于将所述翻译文字添加到所述页面图片中,并根据所述文字区域的坐标将所述翻译文字设置在所述文字区域的一侧以得到目标页面图片;
    第一发送单元,用于将所述目标页面图片发送给用户终端。
  9. 一种计算机设备,所述计算机设备包括存储器及处理器,所述存储器上存储有计算机程序,所述处理器执行所述计算机程序时实现如下步骤:
    接收用户终端发送的页面翻译请求,所述页面翻译请求包括页面图片以及目标语言;
    通过预训练的目标检测模型获取所述页面图片包含的文字区域以及文字区域的坐标,所述目标检测模型由标注了文字区域的页面样本图片训练得到;
    将所述文字区域从所述页面图片中分离,并通过预设的OCR文字识别插件识别所述文字区域包含的文字;
    将所述文字转换为所述目标语言后得到翻译文字;
    将所述翻译文字添加到所述页面图片中,并根据所述文字区域的坐标将所述翻译文字设置在所述文字区域的一侧以得到目标页面图片;
    将所述目标页面图片发送给用户终端。
  10. 根据权利要求9所述的计算机设备,其中,所述通过预训练的目标检测模型获取所述页面图片包含的文字区域以及文字区域的坐标,包括:
    获取所述页面图片的特征图,并将所述特征图输入所述目标检测模型中;
    接收所述目标检测模型输出的检测结果,所述检测结果包含所述目标检测模型在所述页面图片中检测到的文字区域以及文字区域的坐标。
  11. 根据权利要求9所述的计算机设备,其中,所述通过预设的OCR文字识别插件识别所述文字区域包含的文字,包括:
    将所述文字区域输入到预设的OCR文字识别插件中;
    接收所述OCR文字识别插件输出的文字识别结果,所述文字识别结果包含从所述文字区域中识别到的文字。
  12. 根据权利要求9所述的计算机设备,其中,所述将所述文字转换为所述目标语言后得到翻译文字,包括:
    判断预设的多语言库中是否存在所述文字对应所述目标语言的翻译文字;
    若所述多语言库中存在所述文字对应所述目标语言的翻译文字,则从所述多语言库中获取所述文字对应所述目标语言的翻译文字。
  13. 根据权利要求12所述的计算机设备,其中,所述将所述文字转换为所述目标语言后得到翻译文字,还包括:
    若所述多语言库中不存在所述文字对应所述目标语言的翻译文字,向预设的翻译插件发送翻译请求,所述翻译请求包含所述文字以及所述目标语言;
    接收所述翻译插件返回的翻译结果,所述翻译结果包含所述文字对应所述目标语言的翻译文字。
  14. 根据权利要求12所述的计算机设备,其中,所述判断预设的多语言库中是否存在所述文字对应所述目标语言的翻译文字,包括:
    向所述多语言库发送查询请求,所述查询请求包含所述文字以及所述目标语言;
    若接收到所述多语言库返回的查询结果,则判定所述多语言库中存在所述文字对应所述目标语言的翻译文字;
    若接收到所述多语言库返回的无查询结果提示消息,则判定所述多语言库中不存在所述 文字对应所述目标语言的翻译文字。
  15. 根据权利要求9所述的计算机设备,其中,所述根据所述文字区域的坐标将所述翻译文字设置在所述文字区域的一侧以得到目标页面图片,包括:
    根据文字区域的坐标在所述文字区域的一侧设置文本框;
    将所述翻译文字添加到所述文本框中。
  16. 一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序当被处理器执行时可实现如下步骤:接收用户终端发送的页面翻译请求,所述页面翻译请求包括页面图片以及目标语言;
    通过预训练的目标检测模型获取所述页面图片包含的文字区域以及文字区域的坐标,所述目标检测模型由标注了文字区域的页面样本图片训练得到;
    将所述文字区域从所述页面图片中分离,并通过预设的OCR文字识别插件识别所述文字区域包含的文字;
    将所述文字转换为所述目标语言后得到翻译文字;
    将所述翻译文字添加到所述页面图片中,并根据所述文字区域的坐标将所述翻译文字设置在所述文字区域的一侧以得到目标页面图片;
    将所述目标页面图片发送给用户终端。
  17. 根据权利要求16所述的计算机可读存储介质,其中,所述通过预训练的目标检测模型获取所述页面图片包含的文字区域以及文字区域的坐标,包括:
    获取所述页面图片的特征图,并将所述特征图输入所述目标检测模型中;
    接收所述目标检测模型输出的检测结果,所述检测结果包含所述目标检测模型在所述页面图片中检测到的文字区域以及文字区域的坐标。
  18. 根据权利要求16所述的计算机可读存储介质,其中,所述通过预设的OCR文字识别插件识别所述文字区域包含的文字,包括:
    将所述文字区域输入到预设的OCR文字识别插件中;
    接收所述OCR文字识别插件输出的文字识别结果,所述文字识别结果包含从所述文字区域中识别到的文字。
  19. 根据权利要求16所述的计算机可读存储介质,其中,所述将所述文字转换为所述目标语言后得到翻译文字,包括:
    判断预设的多语言库中是否存在所述文字对应所述目标语言的翻译文字;
    若所述多语言库中存在所述文字对应所述目标语言的翻译文字,则从所述多语言库中获取所述文字对应所述目标语言的翻译文字。
  20. 根据权利要求19所述的计算机可读存储介质,其中,所述将所述文字转换为所述目标语言后得到翻译文字,还包括:
    若所述多语言库中不存在所述文字对应所述目标语言的翻译文字,向预设的翻译插件发送翻译请求,所述翻译请求包含所述文字以及所述目标语言;
    接收所述翻译插件返回的翻译结果,所述翻译结果包含所述文字对应所述目标语言的翻译文字。
PCT/CN2021/125952 2020-11-05 2021-10-25 应用程序多语言支持方法、装置、计算机设备及存储介质 WO2022095735A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011223224.0A CN112328348A (zh) 2020-11-05 2020-11-05 应用程序多语言支持方法、装置、计算机设备及存储介质
CN202011223224.0 2020-11-05

Publications (1)

Publication Number Publication Date
WO2022095735A1 true WO2022095735A1 (zh) 2022-05-12

Family

ID=74317121

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/125952 WO2022095735A1 (zh) 2020-11-05 2021-10-25 应用程序多语言支持方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN112328348A (zh)
WO (1) WO2022095735A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117573810A (zh) * 2024-01-15 2024-02-20 腾讯烟台新工科研究院 一种多语言产品包装说明书文字识别查询方法及系统

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328348A (zh) * 2020-11-05 2021-02-05 深圳壹账通智能科技有限公司 应用程序多语言支持方法、装置、计算机设备及存储介质
CN113052067A (zh) * 2021-03-24 2021-06-29 Oppo广东移动通信有限公司 实时翻译方法、装置、存储介质及终端设备
CN113553524B (zh) * 2021-06-30 2022-10-18 上海硬通网络科技有限公司 一种网页的文字排版方法、装置、设备和存储介质
CN113591437B (zh) * 2021-08-09 2023-08-08 网易(杭州)网络有限公司 游戏文本翻译方法、电子设备及存储介质
CN113780254A (zh) * 2021-11-12 2021-12-10 阿里巴巴达摩院(杭州)科技有限公司 图片处理方法、装置、电子设备及计算机存储介质
CN114579235B (zh) * 2022-02-24 2024-04-09 百果园技术(新加坡)有限公司 基于语言类型的图标显示方法、装置、设备及存储介质
CN115688816A (zh) * 2023-01-04 2023-02-03 赤子城网络技术(北京)有限公司 翻译模型文字的方法及相关设备
CN115936017B (zh) * 2023-01-12 2023-07-25 北京三维天地科技股份有限公司 一种支持界面多语言和数据多语言的主数据管理方法

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110313754A1 (en) * 2010-06-21 2011-12-22 International Business Machines Corporation Language translation of selected content in a web conference
CN104317787A (zh) * 2014-10-23 2015-01-28 迎新科技有限公司 即时通讯终端及其信息翻译方法和装置
CN108182183A (zh) * 2017-12-27 2018-06-19 北京百度网讯科技有限公司 图片文字翻译方法、应用及计算机设备
CN108319592A (zh) * 2018-02-08 2018-07-24 广东小天才科技有限公司 一种翻译的方法、装置及智能终端
CN109815957A (zh) * 2019-01-30 2019-05-28 邓悟 一种基于彩色图像在复杂背景下的文字识别方法
CN110674814A (zh) * 2019-09-25 2020-01-10 深圳传音控股股份有限公司 一种图片识别翻译方法、终端及介质
CN112328348A (zh) * 2020-11-05 2021-02-05 深圳壹账通智能科技有限公司 应用程序多语言支持方法、装置、计算机设备及存储介质

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7310781B2 (en) * 2003-06-05 2007-12-18 International Business Machines Corporation System and method for content and information transfer between program entities
CN105138350B (zh) * 2015-07-29 2018-08-31 北京四方继保自动化股份有限公司 一种组态软件国际化多语言的实现方法
US11474836B2 (en) * 2018-03-13 2022-10-18 Microsoft Technology Licensing, Llc Natural language to API conversion
CN110472251B (zh) * 2018-05-10 2023-05-30 腾讯科技(深圳)有限公司 翻译模型训练的方法、语句翻译的方法、设备及存储介质
US11594028B2 (en) * 2018-05-18 2023-02-28 Stats Llc Video processing for enabling sports highlights generation
CN110334361B (zh) * 2019-07-12 2022-11-22 电子科技大学 一种面向小语种语言的神经机器翻译方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110313754A1 (en) * 2010-06-21 2011-12-22 International Business Machines Corporation Language translation of selected content in a web conference
CN104317787A (zh) * 2014-10-23 2015-01-28 迎新科技有限公司 即时通讯终端及其信息翻译方法和装置
CN108182183A (zh) * 2017-12-27 2018-06-19 北京百度网讯科技有限公司 图片文字翻译方法、应用及计算机设备
CN108319592A (zh) * 2018-02-08 2018-07-24 广东小天才科技有限公司 一种翻译的方法、装置及智能终端
CN109815957A (zh) * 2019-01-30 2019-05-28 邓悟 一种基于彩色图像在复杂背景下的文字识别方法
CN110674814A (zh) * 2019-09-25 2020-01-10 深圳传音控股股份有限公司 一种图片识别翻译方法、终端及介质
CN112328348A (zh) * 2020-11-05 2021-02-05 深圳壹账通智能科技有限公司 应用程序多语言支持方法、装置、计算机设备及存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117573810A (zh) * 2024-01-15 2024-02-20 腾讯烟台新工科研究院 一种多语言产品包装说明书文字识别查询方法及系统
CN117573810B (zh) * 2024-01-15 2024-04-09 腾讯烟台新工科研究院 一种多语言产品包装说明书文字识别查询方法及系统

Also Published As

Publication number Publication date
CN112328348A (zh) 2021-02-05

Similar Documents

Publication Publication Date Title
WO2022095735A1 (zh) 应用程序多语言支持方法、装置、计算机设备及存储介质
US20210271917A1 (en) Image processing method and apparatus, electronic device, and storage medium
US10282643B2 (en) Method and apparatus for obtaining semantic label of digital image
US10878234B1 (en) Automated form understanding via layout agnostic identification of keys and corresponding values
WO2022017163A1 (zh) 图像处理方法、装置、设备及存储介质
CN108563559A (zh) 一种验证码的测试方法、装置、终端设备及存储介质
CN110555334B (zh) 人脸特征确定方法、装置、存储介质及电子设备
CN110727417B (zh) 一种数据处理方法和装置
US20230334880A1 (en) Hot word extraction method and apparatus, electronic device, and medium
WO2019144756A1 (zh) 验证短信的处理方法及系统
CN111368145A (zh) 一种知识图谱的创建方法、创建系统及终端设备
CN111881740A (zh) 人脸识别方法、装置、电子设备及介质
TWI671686B (zh) 影像數據擷取方法及影像數據擷取裝置
CN111881900B (zh) 语料生成、翻译模型训练、翻译方法、装置、设备及介质
CN108665769B (zh) 基于卷积神经网络的网络教学方法以及装置
CN111240790B (zh) 一种应用的多语言适配方法、装置、客户端和存储介质
CN115376137B (zh) 一种光学字符识别处理、文本识别模型训练方法及装置
WO2020124454A1 (zh) 字体切换方法及相关产品
CN111401367A (zh) 基于联邦ocr模型的字符检测方法、装置、设备和介质
CN115063807A (zh) 图像处理方法、装置、可读存储介质及电子设备
CN110221874A (zh) 快速启动应用的方法、装置及设备
WO2021088333A1 (zh) 图像存储方法、图像读取方法、图像存储器及存储介质
CN111046243B (zh) 一种基于网络拓扑图配置sonic的方法、设备及介质
CN108875748B (zh) 无线访问接入点信息的生成方法、设备和计算机可读介质
CN114399782B (zh) 文本图像处理方法、装置、设备、存储介质及程序产品

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: 21888432

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 09.08.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21888432

Country of ref document: EP

Kind code of ref document: A1