Multilingual translation test method and device, electronic equipment and storage medium
By performing two character recognition and data mergers on multi -language interface images, the problem of high multi -language translation test cost, long cycle, high error rate, and high rely on high -level talents in existing technologies have achieved efficient and accurate and accurate and accurate. Translation test.
Patent Information
- Application Number
- CN202411137535.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2025-01-28
AI Technical Summary
In the prior art, multilingual translation testing has high cost, long cycle, high error rate and high dependence on high-level talents.
By obtaining the standard translation data and multiple interface images of the interface to be tested, the first character recognition and cutting character recognition areas are performed, and the second character recognition and target recognition data merge. Test results.
The accuracy of character recognition is improved, the test cost and error rate are reduced, the test cycle is reduced, and the dependence on high -level talents is reduced.
Smart Images

Figure CN119378570A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of literary language testing, and in particular to a multilingual translation testing method, device, electronic device and storage medium. Background Art
[0002] At present, manual proofreading is usually used for language proofreading of export products. However, this method has some problems and challenges, such as high cost, long cycle, high error rate and talent shortage. Manual proofreading requires the recruitment of high-level talents, resulting in high costs; manual proofreading is slow, resulting in a long time for proofreading; manual proofreading is prone to omissions and misjudgments; products covering multiple export countries need to cover multiple languages, which requires a high dependence on high-level talents, but the corresponding professional talents are very limited. Summary of the invention
[0003] The present invention provides a multilingual translation test method, device, electronic device and storage medium to solve the technical problems of high cost, long cycle, high error rate and high dependence on high-level talents in the multilingual translation test.
[0004] In one embodiment of the present application, the present application provides a multi-language translation test method, including: obtaining standard translation data of an interface to be tested and multiple language interface images; performing a first character recognition on each of the language interface images to obtain initial recognition data of each of the language interface images, and cutting the character recognition area of the corresponding language interface image according to each of the initial recognition data to obtain multiple character area images of each of the language interface images; performing a second character recognition on all character area images of each language interface image to obtain target recognition data of each language interface image, and restoring all target recognition data to the corresponding language interface image to obtain target coordinate information; merging the target recognition data at the same recognition data position in different languages according to the target coordinate information to obtain multiple recognition data to be tested, and performing a similarity comparison between the standard translation data and each of the recognition data to be tested to obtain a translation test result.
[0005] In one embodiment of the present application, the language interface image is divided into character areas according to the initial recognition data to obtain multiple character area images of the language interface image, including: performing adjacent detection on the multiple character recognition areas in the initial recognition data in turn to obtain adjacent data serial numbers; combining and deduplicating each of the character recognition areas according to the adjacent data serial numbers, and updating the area boundaries of each of the combined and deduplicated character recognition areas to obtain a target recognition area; and cutting the language interface image based on the target recognition area to obtain multiple character area images.
[0006] In one embodiment of the present application, the adjacent detection includes: performing an area intersection detection on the first data to be detected and the second data to be detected to obtain an area intersection result, wherein the first data to be detected and the second data to be detected are used to characterize different data for adjacent detection; detecting a first alignment state of the first data to be detected and the second data to be detected; if the area intersection result is intersection, and the first center point difference is greater than a preset first threshold, performing a proximity detection based on the left and right boundary distances between the first data to be detected and the second data to be detected to obtain a proximity detection result, wherein the first center point difference is obtained based on the difference between the first height center point of the first data to be detected and the second height center point of the second data to be detected; if the first pair If the alignment state is the same alignment method and the proximity detection result is similar, the adjacent detection result is determined to be adjacent; if the area intersection result is non-intersection, and the adjacent detection is used to obtain the identification data to be tested, the second center point difference is compared with the preset second threshold, and the second alignment state of the preset initial area is detected according to the first alignment state, and the second center point difference is obtained based on the difference between the initial center point of the preset initial area and the target vertical coordinate, and the target vertical coordinate is used to characterize the maximum vertical coordinate in the first data to be tested and the second data to be tested; if the second center point difference is less than or equal to the preset second threshold, and the second alignment state is that the alignment methods are the same, the area intersection result is updated to intersection.
[0007] In one embodiment of the present application, an area intersection detection is performed on the first data to be checked and the second data to be checked to obtain an area intersection result, including: if the initial size of the preset initial area is less than or equal to the size difference, the initial size is compared with a preset third threshold, the initial size includes an initial width and an initial height, and the size difference includes a width difference and a height difference; if the initial size of the preset initial area is greater than the size difference, the size difference is compared with a preset sixth threshold; if the initial size of the preset initial area is greater than the preset third threshold, or the size difference is greater than the preset third threshold, the size identifier is determined to be non-zero, and the size identifier includes a width identifier and a height identifier; if the initial size of the preset initial area is less than or equal to the preset third threshold, or the size difference is less than or equal to the preset If a third threshold is set, the size identifier is determined to be zero; if the product of the width identifier and the height identifier is greater than zero, the area intersection result is determined to be intersection; if the product of the width identifier and the height identifier is less than or equal to zero, the area intersection result is determined to be non-intersection; wherein the size difference is obtained based on the difference between the target size and the maximum boundary offset, the maximum boundary offset is used to characterize the maximum value of the first boundary offset and the second boundary offset, the target size is used to characterize the area size in the data to be inspected corresponding to the maximum boundary offset, the first boundary offset is used to characterize the difference between the initial boundary of the preset initial area and the first boundary of the first data to be inspected, and the second boundary offset is used to characterize the difference between the initial boundary of the preset initial area and the second boundary of the second data to be inspected.
[0008] In one embodiment of the present application, second character recognition is performed on all character area images of the language interface image to obtain target recognition data of the language interface image, including: performing second character recognition on all character area images of the language interface image to obtain multiple first recognition data of the language interface image; if the left and right rudder indicators of the language interface image are right rudder, each of the first recognition data is mirrored to obtain multiple second recognition data, and each of the second recognition data is sorted according to the left boundary coordinates of each of the second recognition data to obtain multiple third recognition data; each of the first recognition data is sorted according to the left boundary coordinates of each of the first recognition data, or each of the third recognition data is sorted according to the left boundary coordinates of each of the third recognition data to obtain fourth recognition data; performing in-line detection on two adjacent fourth recognition data in turn to obtain multiple first in-line results; if a first in-line result is in the same row, the single-row coordinate height and single-row coordinate width of the two adjacent first recognition data corresponding to the first in-line result are updated to obtain in-line recognition data; each of the fourth recognition data is updated according to all in-line recognition data to obtain target recognition data.
[0009] In one embodiment of the present application, all target recognition data of different languages are merged at the same recognition data position according to the target coordinate information to obtain multiple recognition data to be tested, including: performing a same-line detection on at least one area recognition data of interface images in different languages according to the target coordinate information to obtain multiple second same-line results; if a second same-line result is in the same line, then merging the area recognition data of interface images in different languages corresponding to the second same-line result into the recognition data to be tested; if a second same-line result is not in the same line, then performing an adjacent detection on the area recognition data of interface images in different languages according to the target coordinate information; if the result of the adjacent detection is satisfied, then merging the area recognition data of interface images in different languages into the recognition data to be tested; wherein, the target recognition data includes at least one area recognition data.
[0010] In one embodiment of the present application, the standard translation data is compared with the identification data to be tested for similarity to obtain a translation test result, including: determining a to-be-tested identification string in the to-be-tested identification data as the to-be-tested current string, and determining the standard translation string corresponding to the to-be-tested current string in the standard translation data as the standard current string; if the first length of the to-be-tested current string is equal to the second length of the standard current string, performing a full similarity calculation on the standard current string and the to-be-tested current string to obtain a first similarity; if the first similarity is greater than or equal to a preset fourth threshold, determining the translation test result of the to-be-tested current string as a first trust; if the first length of the to-be-tested current string is less than the second length of the standard current string, performing a front-part similarity calculation on the standard current string and the to-be-tested current string according to the length of the to-be-tested current string to obtain a second similarity. similarity; if the second similarity is less than the preset fifth threshold value, then starting from the first character of the standard current character string, the truncated character string of the first length is sequentially truncated, and all similarity calculations are performed in sequence with the current character string to be tested to obtain multiple third similarities; if the first similarity is greater than the preset sixth threshold value and the first similarity is less than the preset fourth threshold value, or the second similarity is greater than or equal to the preset fifth threshold value, or the maximum third similarity is greater than or equal to the preset seventh threshold value, then the translation test result of the current character to be tested is determined as the second trust degree; if the first length of the current character to be tested is greater than the second length of the standard current character, or the maximum third similarity is less than the preset seventh threshold value, then the translation test result of the current character to be tested is determined as the third trust degree; the current character string to be tested is updated according to the recognition data to be tested, and the standard current character string is updated according to the standard translation data to perform a new similarity comparison.
[0011] In one embodiment of the present application, multiple language interface images of the interface to be tested are obtained, including: obtaining the language to be tested and multiple language configuration files of the interface to be tested; displaying the interface to be tested in sequence according to the language configuration files corresponding to the language to be tested, and performing image acquisition on each of the interface displays through an acquisition tool to obtain multiple current interface images; saving each of the current interface images as two-dimensional matrix data to obtain multiple language interface images.
[0012] In one embodiment of the present application, the present application provides a multilingual translation test device, including: an acquisition module, used to acquire standard translation data of an interface to be tested and multiple language interface images; a primary recognition module, used to perform a first character recognition on each of the language interface images, obtain initial recognition data of each of the language interface images, and cut the character recognition area of the corresponding language interface image according to each of the initial recognition data to obtain multiple character area images of each of the language interface images; a secondary recognition module, used to perform a second character recognition on all character area images of each language interface image, obtain target recognition data of each language interface image, and restore all target recognition data to the corresponding language interface image to obtain target coordinate information; a translation test module, used to merge the positions of the same recognition data of different languages for all target recognition data according to the target coordinate information to obtain multiple recognition data to be tested, and compare the similarity of the standard translation data with each of the recognition data to be tested to obtain a translation test result.
[0013] In one embodiment of the present application, the present application provides an electronic device, which includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the multilingual translation testing method as described in any of the above embodiments.
[0014] In one embodiment of the present application, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor of a computer, the computer executes the multilingual translation test method described in any one of the above embodiments.
[0015] Beneficial effects of the embodiments of the present invention: The present invention provides a multilingual translation test method, device, electronic device and storage medium. The embodiments of the present invention obtain multiple character area images by cutting the character recognition area according to the initial recognition data after the first character recognition, and obtain target recognition data by performing a second character recognition on each character area image. The accuracy of character recognition is improved through two character recognitions; and the target recognition data is merged at the same recognition data position in different languages through the target coordinate information to obtain multiple recognition data to be tested, thereby comparing the standard translation data with each of the recognition data to be tested to obtain the translation test result, thereby improving the test efficiency, reducing the test cost and error rate, shortening the test cycle, and reducing the dependence on high-level talents.
[0016] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0018] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;
[0019] Figure 2 A schematic diagram of a multilingual translation test method according to an embodiment of the present application is shown;
[0020] Figure 3 A schematic diagram of a graphical user interface of a collection tool according to an embodiment of the present application is shown;
[0021] Figure 4 A schematic diagram of the process of image acquisition according to an embodiment of the present application is shown;
[0022] Figure 5 A schematic diagram of an event logic flow of a collection tool according to an embodiment of the present application is shown;
[0023] Figure 6 A schematic diagram of a process of adjacent calculation and combination strategy according to an embodiment of the present application is shown;
[0024] Figure 7 A schematic diagram of a process for determining an intersection area according to an embodiment of the present application is shown;
[0025] Figure 8 A schematic diagram of a process of peer detection according to an embodiment of the present application is shown;
[0026] Fig. 9 A schematic diagram of a process of OCR enhanced recognition according to an embodiment of the present application is shown;
[0027] Fig.10 A schematic diagram of the flow of OCR recognition logic according to an embodiment of the present application is shown;
[0028] Fig.11 A schematic diagram of a process for generating identification data to be tested according to an embodiment of the present application is shown;
[0029] Fig.12 A schematic diagram of a comparison process according to an embodiment of the present application is shown;
[0030] Fig.13 A flow chart of a character comparison algorithm according to an embodiment of the present application is shown;
[0031] Fig.14 A block diagram of a multilingual translation testing device according to an embodiment of the present application is shown;
[0032] Fig.15 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0033] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0034] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0035] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.
[0036] See also Figure 1 , Figure 1 A schematic diagram of an exemplary system architecture to which the technical solution of the embodiment of the present application can be applied is shown. Figure 1 As shown, the system architecture may include a computer device 101 and a device under test 102. The interface under test is located in the device under test 102.
[0037] Exemplarily, the computer device 102 obtains standard translation data of the interface to be tested and multiple language interface images; performs a first character recognition on each language interface image to obtain initial recognition data of each language interface image, and cuts the character recognition area of the corresponding language interface image according to each initial recognition data to obtain multiple character area images of each language interface image; performs a second character recognition on all character area images of each language interface image to obtain target recognition data of each language interface image, and restores all target recognition data to the corresponding language interface image to obtain target coordinate information; merges the same recognition data position of all target recognition data in different languages according to the target coordinate information to obtain multiple recognition data to be tested, and compares the standard translation data with each recognition data to be tested for similarity to obtain a translation test result.
[0038] Among the related technologies, language proofreading work has technical problems such as high cost, long cycle, high error rate and high dependence on high-level talents.
[0039] In order to solve the above technical problems, the present application provides a multilingual translation test method, device, electronic device and storage medium. The implementation details of the technical solution of the embodiment of the present application are elaborated in detail below.
[0040] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of a multilingual translation test method according to an embodiment of the present application. Figure 2 As shown, in an exemplary embodiment, the multilingual translation test method includes at least steps S210 to S240, which are described in detail as follows:
[0041] Step S210, obtaining standard translation data of the interface to be tested and interface images in multiple languages.
[0042] In one embodiment of the present application, the standard translation data includes Chinese translation data.
[0043] In one embodiment of the present application, the standard translation data is obtained based on the product translation document of the export target country.
[0044] In one embodiment of the present application, multiple language interface images of the interface to be tested are obtained, including: obtaining the language to be tested and multiple language configuration files of the interface to be tested; displaying the interface to be tested in sequence according to the language configuration files corresponding to the language to be tested, and performing image acquisition on each interface display through an acquisition tool to obtain multiple current interface images; saving each current interface image as two-dimensional matrix data to obtain multiple language interface images.
[0045] In one embodiment of the present application, a graphical user interface (GUI) GUI of a collection tool is written using Python's tkinter integrated framework to collect multiple interface images of the interface to be tested in different languages, to achieve display of the image after collection and display of the Chinese counterpart interface when inputting move and remove commands.
[0046] In one embodiment of the present application, a text control is encapsulated separately through tkinter, and the running log and the effect are synchronously displayed on the main interface of the acquisition tool through the provided API add_log, and are written to the log file (.log) at the same time.
[0047] In one embodiment of the present application, see Figure 3 , Figure 3 FIG. 1 is a schematic diagram of a graphical user interface of a collection tool according to an embodiment of the present application. Figure 3As shown, the control functions of the acquisition tool include language configuration file entry function, Android Debug Bridge (ADB) language switching command entry function, ADB language switching command test function, language switching mode, image acquisition function, image deletion function, data file copying function, log display function, and run and stop functions. Among them, the language switching methods include automatic switching and manual switching. The dotted area is the display area, and the solid area is the button area. For example, select the button to select the corresponding language configuration file; Language switching button: obtain the language to be tested and the configured ADB switching command according to the language configuration file to automatically change the display language of the interface to be tested to the language to be tested; Image acquisition button: acquire the current interface image through ADB and convert its current interface image into a format for image display and image storage. The image is displayed in the format corresponding to PIL, and the image is stored in the format corresponding to the open source computer vision library (opencv); Image deletion button: display the image according to the unique ID generated by the current interface image collected, and delete the data after confirmation; View log button: display all log contents of this run through a pop-up window; Test button: provides a test entry for the language switching command; Copy data file: provides a one-click copy data file to the clipboard function.
[0048] In one embodiment of the present application, a collection tool is used to collect interface images of multiple languages of the device under test. After the device under test is connected, the language of the device under test is switched and a screenshot is taken through a universal serial bus (USB) and the configured language to be tested to obtain the current interface image.
[0049] In one embodiment of the present application, a binary file format (feather) is used to store image data, the collected current interface image is saved as two-dimensional matrix data, and the image data is compressed and saved using local serialization to obtain a language interface image.
[0050] In one embodiment of the present application, see Figure 4 , Figure 4 FIG. 2 shows a schematic diagram of the image acquisition process according to an embodiment of the present application. Figure 4As shown, run: run the acquisition tool; whether the language switching is manual mode: select manual mode for language switching; whether there is a device connected: connect the device to be tested, and the interface to be tested is located in the device to be tested; whether to select a language configuration file: select the language configuration file corresponding to the language to be tested; determine whether all conditions are passed: if the above three conditions are all passed, enter the step of initializing the ADB service, if at least one of them is not passed, enter the step of running; initialize ADB service: start ADB; initialize the configuration module: configure the interface to be tested to the corresponding language to be tested according to the language configuration file; create a data storage directory: create a data storage directory for storing the collected language interface images; change the function status of each button; update the function status of each button according to the running status of the acquisition tool; wait for event triggering: wait for the event triggering corresponding to each control function to realize the control function; whether to click stop: if stop is not clicked, enter the step of waiting for event triggering, if stop is clicked, enter the step of running.
[0051] In one embodiment of the present application, see Figure 5 , Figure 5 FIG. 1 shows a schematic diagram of an event logic flow of a collection tool according to an embodiment of the present application. Figure 5 As shown, wait for events; whether to click mode switch: if clicked, change the language switching mode and continue to wait for events, if not clicked, continue to wait for events; whether to click test: if clicked, execute the language switching command, if not clicked, continue to wait for events; pop-up success confirmation window: if not popped up, the log record fails, and continue to wait for events, if popped up, the log record passes, and the language switching command is updated to the current command, and continue to wait for events; whether to click to switch: if clicked, switch to the next language, and continue to wait for events, if not clicked, continue to wait for events; whether to click to collect: if clicked, the language interface corresponding to the current interface of the acquisition device image, if not clicked, continue to wait for events; whether the configuration language has been collected: if collected, save the interface data and continue to wait for events, if not collected, continue to wait for events; whether to click to delete: if clicked, enter the interface ID, if not clicked, continue to wait for events; whether the ID exists: if it exists, confirm the image, if not, continue to wait for events; if confirmed, delete the image data, if not confirmed, continue to wait for events; whether to click to select: if clicked, a file selection box pops up, if not clicked, continue to wait for events; whether the file meets the requirements: if it meets, initialize the configuration, if not, continue to wait for events.
[0052] Step S220, performing first character recognition on each language interface image respectively to obtain initial recognition data of each language interface image, and cutting the character recognition area of the corresponding language interface image according to each initial recognition data to obtain multiple character area images of each language interface image.
[0053] In one embodiment of the present application, the present application performs multilingual translation testing through an automated comparison system. The automated comparison system includes a character recognition module, a recognition configuration file, a data preprocessing module, a log module, a spreadsheet operation module, a Feather data input and output module, a configuration module, a comparison module, and a report generation module.
[0054] In one embodiment of the present application, character recognition includes optical character recognition (OCR).
[0055] In one embodiment of the present application, a set of OCR recognition application programming interfaces (APIs) are encapsulated based on a public platform or a local OCR recognition engine to form an OCR recognition module, which implements initial recognition and enhanced recognition after inputting an image and then returns fixed-format text data, such as target coordinate information and target recognition data. The OCR recognition module includes an API control module and an enhanced recognition strategy.
[0056] In one embodiment of the present application, the API control module includes API management, parameter management, security verification, language recognition model management, public platform access link (URL) management, and recognition data normalization processing modules.
[0057] In one embodiment of the present application, the Feather data input and output module is used to read and write data files corresponding to the language interface images collected by the collection tool. Feather data has the characteristics of fast reading and writing and small file size after being serialized using pickle.
[0058] In one embodiment of the present application, the language interface image is first recognized with medium precision, and the character area image with text display is divided through area combination and adjacent algorithms to recognize the character area image with high precision, so as to improve the recognition accuracy by enhancing the recognition strategy.
[0059] In one embodiment of the present application, a language interface image is divided into character areas according to initial recognition data to obtain multiple character area images of the language interface image, including: performing adjacent detection on multiple character recognition areas in the initial recognition data in turn to obtain adjacent data serial numbers; combining and deduplicating each character recognition area according to the adjacent data serial numbers, and updating the area boundaries of each combined and deduplicated character recognition area to obtain a target recognition area; and cutting the language interface image based on the target recognition area to obtain multiple character area images.
[0060] In one embodiment of the present application, the adjacent detection includes: performing an area intersection detection on the first data to be detected and the second data to be detected to obtain an area intersection result, the first data to be detected and the second data to be detected are used to characterize different data for adjacent detection; detecting a first alignment state of the first data to be detected and the second data to be detected; if the area intersection result is intersection, and the first center point difference is greater than a preset first threshold, performing a proximity detection based on the left and right boundary distances between the first data to be detected and the second data to be detected to obtain a proximity detection result, the first center point difference is obtained based on the difference between the first height center point of the first data to be detected and the second height center point of the second data to be detected; if the first alignment If the state is that the alignment method is the same and the result of the similar detection is similar, the result of the adjacent detection is determined to be adjacent; if the area intersection result is non-intersection, and the adjacent detection is used to obtain the identification data to be tested, the second center point difference is compared with the preset second threshold, and the second alignment state of the preset initial area is detected according to the first alignment state. The second center point difference is obtained based on the difference between the initial center point of the preset initial area and the target vertical coordinate, and the target vertical coordinate is used to characterize the maximum vertical coordinate in the first data to be tested and the second data to be tested; if the second center point difference is less than or equal to the preset second threshold, and the second alignment state is that the alignment methods are the same, the area intersection result is updated to intersection.
[0061] In one embodiment of the present application, the proximity detection includes: if the difference between the first right boundary of the first data to be inspected and the second left boundary of the second data to be inspected is less than or equal to the preset eighth threshold, or the difference between the second right boundary of the second data to be inspected and the first left boundary of the first data to be inspected is less than or equal to the preset eighth threshold, then the proximity detection result is determined to be similar.
[0062] In one embodiment of the present application, the initial recognition data is cleaned and combined using an adjacent algorithm, the coordinates of all the initial recognition data in a single language interface image are taken out, and it is determined whether the rectangular areas of the two intersect or are adjacent. The preset eighth threshold corresponding to the adjacent threshold is 30 pixels. After the adjacent coordinates are sorted, the corresponding adjacent data sequence numbers are adjusted to remove duplication, and then the data is reorganized. The reorganization process involves special algorithms for splicing characters of some languages, such as Arabic.
[0063] In one embodiment of the present application, any two character recognition areas need to be detected to be adjacent to each other.
[0064] In one embodiment of the present application, see Figure 6 , Figure 6 FIG. 2 shows a flow chart of adjacent calculation and combination strategy according to an embodiment of the present application. Figure 6As shown in the figure, backup data: back up all the original data that need to be adjacently detected; original data value: take the data of this adjacent detection from the original data; whether the iteration of backup data is completed: if not completed, take the value of this adjacent detection from the backup data, if completed, take the value of the next data from the original data; judge whether the backup data and the original data are equal: if not equal, get the first data to be checked and the second data to be checked, if equal, take the value of the next data from the backup data; judge whether the area intersects: if the area intersects, judge whether the height center point difference exceeds the threshold, if the area does not intersect, Take the value of the next data from the backup data; determine whether the height center point difference value exceeds the threshold: if the first center point difference is greater than the preset first threshold, store the height judgment result to adjust the threshold size; if the first center point difference is less than or equal to the preset first threshold, take the value of the next data from the backup data; determine whether the left and right horizontal distances are close: if they are close, and the alignment method is the same, such as horizontal left or right alignment or center alignment, then the adjacent detection is adjacent; if they are adjacent, combine the first data to be tested and the second data to be tested, if not adjacent, do not combine: add the original data to be tested: update the original data according to the combination or non-combination result.
[0065] In one embodiment of the present application, an area intersection detection is performed on the first data to be inspected and the second data to be inspected to obtain an area intersection result, including: if the initial size of the preset initial area is less than or equal to the size difference, the initial size is compared with a preset third threshold, the initial size includes an initial width and an initial height, and the size difference includes a width difference and a height difference; if the initial size of the preset initial area is greater than the size difference, the size difference is compared with a preset sixth threshold; if the initial size of the preset initial area is greater than the preset third threshold, or the size difference is greater than the preset third threshold, the size identifier is determined to be non-zero, and the size identifier includes a width identifier and a height identifier; if the initial size of the preset initial area is less than or equal to the preset third threshold, or the size difference is less than or equal to the preset The third threshold is set, the size identifier is determined to be zero; if the product of the width identifier and the height identifier is greater than zero, the area intersection result is determined to be intersection; if the product of the width identifier and the height identifier is less than or equal to zero, the area intersection result is determined to be non-intersection; wherein the size difference is obtained based on the difference between the target size and the maximum boundary offset, the maximum boundary offset is used to characterize the maximum value of the first boundary offset and the second boundary offset, the target size is used to characterize the area size in the data to be inspected corresponding to the maximum boundary offset, the first boundary offset is used to characterize the difference between the initial boundary of the preset initial area and the first boundary of the first data to be inspected, and the second boundary offset is used to characterize the difference between the initial boundary of the preset initial area and the second boundary of the second data to be inspected.
[0066] In one embodiment of the present application, the initial boundary includes an initial left boundary and an initial upper boundary, the first boundary includes a first left boundary and a first upper boundary, the second boundary includes a second left boundary and a second upper boundary, and the maximum boundary offset includes a maximum left boundary offset and a maximum upper boundary offset.
[0067] In one embodiment of the present application, the width difference is obtained based on the difference between the target width and the maximum left boundary offset, the maximum left boundary offset is used to characterize the maximum value of the first left boundary offset and the second left boundary offset, the target width is used to characterize the area width in the data to be inspected corresponding to the maximum left boundary offset, the first left boundary offset is used to characterize the difference between the initial left boundary of the preset initial area and the first left boundary of the first data to be inspected, and the second left boundary offset is used to characterize the difference between the initial left boundary of the preset initial area and the second left boundary of the second data to be inspected.
[0068] In one embodiment of the present application, the height difference is obtained based on the difference between the target height and the maximum upper boundary offset, the maximum upper boundary offset is used to characterize the maximum value of the first upper boundary offset and the second upper boundary offset, the target height is used to characterize the area height in the data to be inspected corresponding to the maximum upper boundary offset, the first upper boundary offset is used to characterize the difference between the initial upper boundary of the preset initial area and the first upper boundary of the first data to be inspected, and the second upper boundary offset is used to characterize the difference between the initial upper boundary of the preset initial area and the second upper boundary of the second data to be inspected.
[0069] In one embodiment of the present application, the preset initial area is a Chinese text area. The preset third threshold is 0.
[0070] In one embodiment of the present application, see Figure 7 , Figure 7 FIG. 2 shows a schematic diagram of a process for determining an intersection area according to an embodiment of the present application. Figure 7As shown, whether the rectangular width of the Chinese text area is greater than the width of the text area of other languages minus the maximum left of Chinese and other languages: if the initial width of the Chinese text area is greater than the width difference, then enter the step of whether the rectangular width of the Chinese text area is greater than 0; if the initial width of the Chinese text area is less than or equal to the width difference, then enter the step of comparing whether the rectangular width of the Chinese text area is greater than 0, and the width difference represents the target width of the text area of other languages minus the maximum left boundary offset of Chinese and other languages; whether the rectangular width of the Chinese text area is greater than 0: if the initial width is greater than 0, the width flag is determined to be non-zero, that is, X≠0; if the initial width is less than or equal to 0, the width flag is determined to be zero, that is, X=0; whether the width of the text area of other languages minus the maximum left of Chinese and other languages is greater than 0: if the width difference is greater than 0, the width flag is determined to be non-zero; if the width difference is less than or equal to 0, the width flag is determined to be zero; whether the rectangular height of the Chinese text area is greater than the height of the text area of other languages minus the The maximum top of the Chinese text area and other languages: If the initial height of the Chinese text area is greater than the height difference, then enter the step of whether the rectangular height of the Chinese text area is greater than 0; if the initial height of the Chinese text area is less than or equal to the height difference, then enter the step of comparing whether the rectangular height of the Chinese text area is greater than 0. The height difference represents the target height of the text area of other languages minus the maximum upper boundary offset of Chinese and other languages; Whether the rectangular height of the Chinese text area is greater than 0: If the initial height is greater than 0, the height mark is determined to be non-zero, that is, Y≠0; if the initial height is less than or equal to 0, the height mark is determined to be zero, that is, Y=0; Whether the height of the text area of other languages minus the maximum left of Chinese and other languages is greater than 0: If the height difference is greater than 0, the height mark is determined to be non-zero; if the height difference is less than or equal to 0, the height mark is determined to be zero; Judge X*Y>0: If the product of the width mark and the height mark is greater than zero, the areas intersect; if the product of the width mark and the height mark is less than or equal to zero, there is no intersection.
[0071] In one embodiment of the present application, the recognition configuration file in the automated comparison system is used to store and configure the language to be tested, the language switch language identifier, the recognition language identifier, the language recognition parameters of the recognition language identifier, and the post-recognition text supplementation and replacement strategy. The recognition configuration file includes the language to be tested (language), the text reading parameter (Readtext_config), the text change data (Text_change), and the position information (POS_INFO).
[0072] In one embodiment of the present application, the configuration module in the automated comparison system provides program operation by inputting and outputting the identification configuration file through ymal.
[0073] In one embodiment of the present application, the language to be tested (language) is a key-value pair with an identification identifier as KEY and a switching identifier as VALUE.
[0074] In one embodiment of the present application, Readtext_config is used to identify the target language configuration, with the language identification identifier as KEY and the configuration information as a key-value pair of VALUE. The configuration information includes text binarization threshold, image preprocessing magnification, region recognition expansion width threshold, region recognition expansion height threshold, confidence threshold, text filtering regular expression, recognition API selection, and whether it is a right-hand language.
[0075] In one embodiment of the present application, Text_change is a key-value pair data with the target language as KEY and the key-value pairs consisting of change phrases, letters and their replacement characters as VALUE, which is used to assist in the confusion processing of the latter part of the character recognition, for example, the number "0" and the letter "o", as well as the replacement of language special characters.
[0076] In one embodiment of the present application, POS_INFO is used to increase the content of the upper and lower areas to expand the height threshold of the vertical data search range when merging the recognition data to be tested, so as to merge the regional recognition data of the same row of interface images in different languages into the recognition data to be tested through the height threshold.
[0077] Step S230, performing second character recognition on all character area images of each language interface image to obtain target recognition data of each language interface image, and restoring all target recognition data to the corresponding language interface image to obtain target coordinate information.
[0078] In one embodiment of the present application, a second character recognition is performed on all character area images of a language interface image to obtain target recognition data of the language interface image, including: performing a second character recognition on all character area images of the language interface image to obtain a plurality of first recognition data of the language interface image; if the left and right rudder indicators of the language interface image are right rudder, mirroring each first recognition data to obtain a plurality of second recognition data, and sorting each second recognition data according to the left boundary coordinate of each second recognition data to obtain a plurality of third recognition data; sorting each first recognition data according to the left boundary coordinate of each first recognition data, or sorting each third recognition data according to the left boundary coordinate of each third recognition data to obtain fourth recognition data; performing a same-row detection on two adjacent fourth recognition data in turn to obtain a plurality of first same-row results; if a first same-row result is in the same row, updating the single-row coordinate height and single-row coordinate width of two adjacent first recognition data corresponding to the first same-row result to obtain same-row recognition data; updating each fourth recognition data according to all same-row recognition data to obtain target recognition data.
[0079] In one embodiment of the present application, after obtaining the character area image, the recognition magnification is enlarged and some parameters are adjusted to first organize all target recognition data into text line data by area, and then organize all area data into interface data output.
[0080] In one embodiment of the present application, a first peer result is obtained by performing a threshold comparison on the height center point difference of two first recognition data.
[0081] In one embodiment of the present application, the right-rudder language is determined by configuration and the data after right-rudder recognition is mirror-reversed, and the right-rudder language of the recognized data is flipped in a mirrored manner to correspond to the coordinates of the Chinese interface.
[0082] In one embodiment of the present application, see Figure 8 , Figure 8 FIG. 2 shows a schematic diagram of a process of peer detection according to an embodiment of the present application. Figure 8 As shown, data is sorted, and the data is sorted according to the left value according to the left and right rudder identifiers: the first identification data is mirrored according to the left and right rudder identifiers, and sorted according to the left boundary coordinates to obtain backup data; the original data traversal is completed: if completed, the target identification data is returned, if not completed, the step of judging whether the backup data traversal is completed is entered; the backup data traversal is completed: if completed, the step of judging whether the original data traversal is completed is entered, if not completed, the step of judging whether the absolute value of the height center point difference is less than the threshold value is entered; whether the absolute value of the height center point difference is less than the threshold value: if the height center point difference is less than the preset ninth threshold value, the single-row coordinate height and the single-row coordinate width are updated, and the data is returned, if the height center point difference is greater than or equal to the preset ninth threshold value, the step of judging whether the backup data traversal is completed is entered.
[0083] In one embodiment of the present application, see Fig. 9 , Fig. 9 FIG. 2 shows a schematic diagram of a process of OCR enhanced recognition according to an embodiment of the present application. Fig. 9As shown, the corresponding language recognition engine first recognizes the parameters with higher precision: the first character recognition is performed on the language interface image to obtain the initial recognition data of the language interface image; the recognition preprocessing data format is converted and waited for processing: the initial recognition data is structured, such as arranging rows and columns according to the initial recognition data; whether the adjacent algorithm passes: if passed, the adjacent data list is added to obtain the adjacent data sequence number; if not passed, the step of judging whether the processing is completed is entered; whether the processing is completed: if completed, the adjacent data sequence number is combined and deduplicated; if not completed, the step of converting the recognition preprocessing data format and waiting for processing is entered; the top\left\height\width is taken to the maximum value to include the area of all data in the same area : Update the regional boundaries of each character recognition area after combination and deduplication to obtain the target recognition area, such as the upper boundary, left boundary, height and width; perform coordinate cutting on the original image to extract the text area image: cut the language interface image based on the target recognition area to obtain multiple character area images; perform high-precision recognition on the regional image: perform second character recognition on each character area image respectively to obtain target recognition data; convert the recognition preprocessing data format and wait for processing: perform structured processing on the target recognition data; combine the same line data (paragraph and same line data algorithm): combine the same line data; restore the coordinate data according to the original image using the recognized coordinate information: restore the target recognition data to the language interface image to obtain the target coordinate information; return the recognition result.
[0084] In one embodiment of the present application, see Fig.10 , Fig.10 FIG. 2 shows a flow chart of OCR recognition logic according to an embodiment of the present application. Fig.10As shown, whether the image acquisition data file exists: if the data file corresponding to the language interface image exists, then enter the step of taking out the graphics and configuring the image size for mirror processing, if not, then end; take out the graphics and configure the image size for mirror processing: read the data corresponding to the language interface image, and determine the mirror flip size; call the corresponding API: call the OCR recognition API; generate parameters: determine the calling parameters of the OCR recognition API, such as the target language for recognition; generate a URL for the public API, and generate a model preload object for the local model: if the OCR recognition API is a public API, generate an access link, if the OCR recognition API is a local model, generate a model preload object; obtain configuration data: obtain the recognition corresponding to the OCR recognition Configuration file; calling a public API or a local model: performing a first character recognition on a language interface image to obtain initial recognition data of the language interface image; normalizing recognition data: performing structured processing on the initial recognition data; dividing regional data through an adjacent algorithm and a coordinate combination algorithm: cutting the character recognition area corresponding to the language interface image according to the initial recognition data to obtain a plurality of character area images; calling a public API or a local model: performing a second character recognition on each character area image respectively to obtain first recognition data of each character area image; normalizing recognition data: mirror-flipping the first recognition data corresponding to the left and right rudders as the right rudder to correspond to the Chinese interface, and finally combining the same-line data and restoring it to the language interface image to obtain target coordinate information.
[0085] In one embodiment of the present application, the present application performs text recognition through OCR technology, and adopts a text enhancement recognition strategy during the recognition process. After the character area image is divided out by medium-precision OCR for the first time, the text in the character area image is accurately recognized by high-precision OCR again, and the area coordinates are restored after recognition.
[0086] In one embodiment of the present application, the data preprocessing in the automated comparison system preprocesses the data recognized by the OCR module. After receiving the language data, according to the right-rudder language configuration, it is adjusted to mirror data, that is, the right-rudder display layout is converted to the left-rudder, so as to match the Chinese interface for translation matching; regional data sorting: using the coordinate information in the recognition data to calculate the adjacent data sequence number through the adjacent coordinate area algorithm, and finally combining the regional real data using the list and set related calculation method; data filtering: filtering out data with low recognition confidence; data collection: putting the cleaned data into the memory and waiting for other languages to be stored; data acquisition: waiting for other modules to call the data preprocessing module, assembling all the collected data and returning the key-value pair with the language as the KEY and the classical Chinese data content as the VALUE, and clearing the data cache. The classical Chinese data content will be assembled with the coordinates as the medium after judging the translation relationship.
[0087] Step S240, merging all target recognition data of the same recognition data position in different languages according to the target coordinate information to obtain a plurality of recognition data to be tested, and performing a similarity comparison between the standard translation data and each recognition data to be tested to obtain a translation test result.
[0088] In one embodiment of the present application, all target recognition data of different languages are merged at the same recognition data position according to the target coordinate information to obtain multiple recognition data to be tested, including: performing a same-row detection on at least one area recognition data of interface images in different languages according to the target coordinate information to obtain multiple second same-row results; if a second same-row result is in the same row, then merging the area recognition data of interface images in different languages corresponding to the second same-row result into the recognition data to be tested; if a second same-row result is not in the same row, then performing an adjacent detection on the area recognition data of interface images in different languages according to the target coordinate information; if the result of the adjacent detection is satisfied, then merging the area recognition data of interface images in different languages into the recognition data to be tested; wherein, the target recognition data includes at least one area recognition data.
[0089] In one embodiment of the present application, multi-language data is combined: target recognition data of interface images in different languages are combined based on target coordinate information according to whether the coordinates intersect or are adjacent, and all combined data are generated into recognition data to be tested in a fixed format.
[0090] In one embodiment of the present application, if the adjacent detection is used to generate the identification data to be tested, and the area intersection result is non-intersection, the absolute value of the Y coordinate difference between the initial center point of the Chinese rectangular box and the upper boundary of other languages is compared. If the difference at the second center point is within the configuration range of the Chinese rectangular box and the left alignment range is within the configuration range, the area intersection result is updated to intersection, and the preset second threshold is obtained based on the configuration of the Chinese rectangular box.
[0091] In one embodiment of the present application, see Fig.11 , Fig.11 FIG. 2 shows a schematic diagram of a process for generating identification data to be tested according to an embodiment of the present application. Fig.11 , determine whether the regional data are in the same row: perform the same-row detection on the regional recognition data of the interface images of different languages. If they are in the same row, merge the regional recognition data into one piece of data to be tested and add the data cache. If they are not in the same row, directly add the data cache; whether it is necessary to generate data to be tested in all languages: if not, end; if necessary, calculate the classical Chinese data at the same position of different interfaces according to the adjacent algorithm: if the result of the adjacent detection is met, merge the regional recognition data of the interface images of different languages into one piece of data to be tested; convert the format into the format of the recognition data to be tested: perform format conversion on the data to be tested to obtain the recognition data to be tested.
[0092] In one embodiment of the present application, the standard translation data is compared with the recognition data to be tested for similarity to obtain a translation test result, including: determining a recognition string to be tested in the recognition data to be tested as the current string to be tested, and determining the standard translation string corresponding to the current string to be tested in the standard translation data as the standard current string; if the first length of the current string to be tested is equal to the second length of the standard current string, then performing a full similarity calculation on the standard current string and the current string to be tested to obtain a first similarity; if the first similarity is greater than or equal to a preset fourth threshold, then determining the translation test result of the current string to be tested as a first trust; if the first length of the current string to be tested is less than the second length of the standard current string, then performing a front part similarity calculation on the standard current string and the current string to be tested according to the length of the current string to be tested to obtain a second similarity. degree; if the second similarity is less than the preset fifth threshold value, then starting from the first character of the standard current character string, the truncated character string of the first length is sequentially truncated, and all similarities are calculated in sequence with the current character string to be tested to obtain multiple third similarities; if the first similarity is greater than the preset sixth threshold value and the first similarity is less than the preset fourth threshold value, or the second similarity is greater than or equal to the preset fifth threshold value, or the maximum third similarity is greater than or equal to the preset seventh threshold value, then the translation test result of the current character to be tested is determined as the second trust degree; if the first length of the current character to be tested is greater than the second length of the standard current character, or the maximum third similarity is less than the preset seventh threshold value, then the translation test result of the current character to be tested is determined as the third trust degree; the current character string to be tested is updated according to the recognition data to be tested, and the standard current character string is updated according to the standard translation data to perform a new similarity comparison.
[0093] In one embodiment of the present application, the comparison module in the automated comparison system uses thread tasks to compare interface classical Chinese data with the interface as a unit. Among them, the functions of the comparison module include secondary data sorting: the total data of the test interface is obtained through secondary data sorting, such as the number of character strings to be tested and recognized, etc.; data comparison: data comparison is performed through run processing (run_handling), combined according to the Chinese word list, and then compared with other language combinations one by one. If there are multiple Chinese words that need to be combined, only the data that can be combined is recorded. The results are divided into four types. The first trust level is used to represent absolute trust, the second trust level is used to represent suspicion, the third trust level is used to represent absolute trust, and the fourth trust level is used to represent that classical Chinese is not found.
[0094] In one embodiment of the present application, the comparison module includes a blind guessing strategy for words and sentences to avoid failure to match standard translation data due to line breaks, and also includes a string editing distance algorithm to compare string similarity; process data statistics: each comparison result is recorded and counted according to different types, such as the total number of classical Chinese recognized by OCR, the number of classical Chinese that have completed the comparison, the number of classical Chinese documents in which no corresponding Chinese is found, the number of languages with no data after OCR recognition, the number of errors detected as absolutely untrustworthy, the number of controversial ones detected as suspicious, the number of corresponding language translation missings detected, and the number of passes detected as absolutely trustworthy; result data accumulation: the number of tested interfaces that have been tested and statistical information summary.
[0095] In one embodiment of the present application, after the recognition data to be tested is taken out, the corresponding standard translation data is taken out in the product translation document according to different languages to obtain the standard translation string corresponding to each recognition string to be tested, and the similarity is calculated by the string edit distance.
[0096] In one embodiment of the present application, the comparison strategy divides the translation test results into three categories, namely, absolute trust, suspicion, and absolute trust, according to character length, head similarity, tail similarity, continuous similarity, or whether they are directly equal.
[0097] In one embodiment of the present application, see Fig.12 , Fig.12 FIG. 2 shows a comparative flow chart according to an embodiment of the present application. Fig.12 , take the next comparison data: take out a test recognition data; take out Chinese data: take out the test recognition string corresponding to the Chinese in the test recognition data; whether there is more than one Chinese classical language in a single comparison data: if more than, generate multiple combination comparison data (non-repeating subsets), non-repeating subsets are used to represent the mapping relationship between the test recognition string corresponding to Chinese and the test recognition string corresponding to each other language; if not more than, enter the step of all combined Chinese not being in the translation document; all combined Chinese are not in the product translation document: if the test recognition string corresponding to Chinese can be matched in the product translation document, Then enter the step of retrieving the data of the translation document corresponding to the combined Chinese. If no match is found, enter the step of retrieving the next piece of comparison data; retrieve the data of the translation document corresponding to the combined Chinese: retrieve the standard translation strings of all languages corresponding to the test recognition string corresponding to the Chinese; retrieve the data of other languages and generate multiple combination data: map and combine the test recognition string corresponding to each language with the standard translation string; determine the similarity and save the result data; whether the traversal of this piece of data is completed: if completed, enter the step of retrieving the next piece of comparison data; if not completed, enter the step of retrieving the data of the translation document corresponding to the combined Chinese.
[0098] In one embodiment of the present application, see Fig.13 , Fig.13 FIG. 2 shows a flow chart of a character comparison algorithm according to an embodiment of the present application. Fig.13 , the text in the file is empty: if there is no standard translation string corresponding to the current string to be tested, the fourth confidence level is returned. If there is a standard translation string corresponding to the current string to be tested, the step of determining whether the lengths are equal is entered; the lengths are equal: if they are equal, the step of determining whether the similarity reaches the threshold is entered. If they are not equal, the step of determining whether the length of the identified text is greater than the length of the text in the comparison file is entered; whether the similarity reaches the threshold: if the first similarity is greater than or equal to the preset fourth threshold, the first confidence level is returned. If the first similarity is less than the preset fourth threshold, the step of determining whether it is lower than the threshold and higher than the threshold minus 10% is entered; whether it is lower than the threshold and higher than the threshold minus 10% is entered: if the first similarity is greater than the preset sixth threshold and the first similarity is less than the preset fourth threshold, the second confidence level is returned. The preset sixth threshold is the preset fourth threshold minus 10%; whether the length of the identified text is greater than the length of the text in the comparison file: if the first length of the current string to be tested is less than the second length of the standard current string, the step of determining whether the first part reaches 70% similarity is entered. If the first length of the current character to be tested is greater than If the second length of the standard current character is greater than or equal to the preset fifth threshold, the third trust is returned; whether the front part reaches 70% similarity: if the second similarity is greater than or equal to the preset fifth threshold, the second trust is returned; if the second similarity is less than the preset fifth threshold, the step of sequentially truncating the length of the shorter string starting from the first character of the longest string is entered, and the preset fifth threshold is 70%; sequentially truncating the length of the shorter string starting from the first character of the longest string: starting from the first character of the standard current string, the truncated string of the first length is intercepted, and the next character is used as the first character; record the similarity: calculate the total similarity of the standard current string and the truncated string to obtain the third similarity; whether the last digit of the longer string is reached: if it is reached, the step of whether the maximum similarity exceeds the threshold is entered; if not, the step of sequentially truncating the length of the shorter string starting from the first character of the longest string is entered; whether the maximum similarity exceeds the threshold: if the maximum third similarity is greater than or equal to the preset seventh threshold, the second trust is returned; if the maximum third similarity is less than the preset seventh threshold, the third trust is returned.
[0099] In one embodiment of the present application, the preset seventh threshold value is equal to the preset fourth threshold value.
[0100] In one embodiment of the present application, the translation test results are statistically analyzed in different dimensions, including interface ID dimension and total data statistics.
[0101] In one embodiment of the present application, a report generation module in an automated comparison system draws the translation test results of each interface to be tested on an image of the corresponding language in different colors corresponding to different results to facilitate subsequent manual review, updates the process data and statistical data to the result table, and updates the test completion status of the corresponding translated classical Chinese in the product translation document.
[0102] In one embodiment of the present application, the electronic spreadsheet operation module in the automated comparison system is used to load the product translation document, read the standard translation data in the product translation document, and provide a data writing function for the translation test result.
[0103] In one embodiment of the present application, the log module in the automated comparison system uses python_logging to output all program logs during OCR recognition, data sorting, and data comparison.
[0104] In one embodiment of the present application, the product translation documents of the export target country are sorted out as a reference for proofreading. The image acquisition tool is used to collect interface images of various languages of the interface to be tested, including Chinese. The collected language interface images are converted into recognizable text data using image text recognition technology, and the text data is processed to generate multiple recognition data to be tested. The recognition data to be tested is compared and verified with the product translation document. The translation test results are sorted and output, and finally the accuracy is checked. Compared with traditional technologies, the present application has high versatility: it supports languages of more than 80 countries and has almost no restrictions on translation talents. Low time cost: According to existing business calculations, it usually takes one month for one person to complete a single language test of a system, and it only takes two days to pass the present application. Low economic cost: The present application does not require additional translation human resources, which greatly reduces labor costs. High test accuracy: After rigorous testing, the recognition accuracy of the present application exceeds 95%, and the comparison accuracy also reaches more than 95%. The present application improves the accuracy and efficiency of proofreading by reducing capital, manpower and time costs.
[0105] See also Fig.14 , Fig.14 A block diagram of a multilingual translation test device according to an embodiment of the present application is shown. The device can be applied to Figure 1 The implementation environment shown in the figure is specifically configured in the computer device 101. The device can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applied.
[0106] like Fig.14 As shown, a multilingual translation testing device 1400 according to an embodiment of the present application includes: an acquisition module 1401 , a primary recognition module 1402 , a secondary recognition module 1403 and a translation testing module 1404 .
[0107] The acquisition module 1401 is used to acquire standard translation data of the interface to be tested and interface images in multiple languages;
[0108] The primary recognition module 1402 is used to perform first character recognition on each language interface image to obtain initial recognition data of each language interface image, and cut the character recognition area of the corresponding language interface image according to each initial recognition data to obtain multiple character area images of each language interface image;
[0109] The secondary recognition module 1403 is used to perform a second character recognition on all character region images of each language interface image to obtain target recognition data of each language interface image, and restore all target recognition data to the corresponding language interface image to obtain target coordinate information;
[0110] The translation test module 1404 is used to merge the same recognition data position of different languages for all target recognition data according to the target coordinate information to obtain multiple recognition data to be tested, and to compare the similarity between the standard translation data and each recognition data to be tested to obtain the translation test result.
[0111] It should be noted that the multilingual translation test device provided in the above embodiment and the multilingual translation test method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In practical applications, the multilingual translation test device provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0112] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the multilingual translation test method provided in the above-mentioned embodiments.
[0113] See also Fig.15 , Fig.15 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Fig.15 The computer system 1500 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0114] like Fig.15As shown, the computer system 1500 includes a central processing unit (CPU) 1501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1502 or the program loaded from the storage part 1508 to the random access memory (RAM) 1503, such as executing the method in the above embodiment. In RAM 1503, various programs and data required for system operation are also stored. CPU 1501, ROM 1502 and RAM 1503 are connected to each other through bus 1504. Input / output (I / O) interface 1505 is also connected to bus 1504.
[0115] The following components are connected to the I / O interface 1505: an input section 1506 including a keyboard, a mouse, etc.; an output section 1507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1508 including a hard disk, etc.; and a communication section 1509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1509 performs communication processing via a network such as the Internet. A drive 1510 is also connected to the I / O interface 1505 as needed. A removable medium 1511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1510 as needed so that a computer program read therefrom is installed into the storage section 1508 as needed.
[0116] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1509, and / or installed from a removable medium 1511. When the computer program is executed by a central processing unit (CPU) 1501, various functions defined in the system of the present application are executed.
[0117] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0118] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0119] The units involved in the embodiments described in the present application can be implemented by software or by hardware, and the units described can also be set in a processor. Among them, the names of these units do not constitute a limitation on the units themselves under certain circumstances. Therefore, the technical solution according to the implementation mode of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including a number of instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation mode of the present application.
[0120] Another aspect of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the multilingual translation test method provided in the above embodiments. The computer-readable storage medium may be included in the electronic device described in the above embodiments, or may exist independently without being assembled into the electronic device.
[0121] In the above embodiments, unless otherwise specified, by using serial numbers such as "first" and "second" to describe common objects, it only means that they refer to different instances of the same object, rather than indicating that the objects being described must adopt a given order, whether in time, space, sorting or any other way.
[0122] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A multilingual translation testing method, characterized in that: The method comprises: Obtain standard translation data of the interface to be tested and interface images in multiple languages; Performing first character recognition on each of the language interface images to obtain initial recognition data of each of the language interface images, and cutting the character recognition area of the corresponding language interface image according to each of the initial recognition data to obtain a plurality of character area images of each of the language interface images; Performing second character recognition on all character region images of each language interface image to obtain target recognition data of each language interface image, and restoring all target recognition data to the corresponding language interface image to obtain target coordinate information; According to the target coordinate information, all target recognition data of the same recognition data position in different languages are merged to obtain a plurality of recognition data to be tested, and the standard translation data is respectively compared with each of the recognition data to be tested for similarity to obtain a translation test result.
2. The multilingual translation test method according to claim 1, characterized in that: Dividing the language interface image into character regions according to the initial recognition data to obtain a plurality of character region images of the language interface image includes: sequentially performing adjacent detection on a plurality of character recognition areas in the initial recognition data to obtain adjacent data sequence numbers; At least one of combining and deduplicating each of the character recognition areas according to the adjacent data sequence numbers, and updating the area boundaries of each of the combined and deduplicated character recognition areas to obtain a target recognition area; The language interface image is cut based on the target recognition area to obtain a plurality of character area images.
3. The multilingual translation test method according to claim 2, characterized in that: The adjacent detection includes: Performing an area intersection test on the first data to be tested and the second data to be tested to obtain an area intersection result, wherein the first data to be tested and the second data to be tested are used to represent different data for adjacent detection; Detecting a first alignment state of the first to-be-checked data and the second to-be-checked data; If the area intersection result is an intersection, and the first center point difference is greater than a preset first threshold, a proximity detection is performed according to the left and right boundary distances between the first to-be-checked data and the second to-be-checked data to obtain a proximity detection result, wherein the first center point difference is obtained based on the difference between the first height center point of the first to-be-checked data and the second height center point of the second to-be-checked data; If the first alignment state is that the alignment modes are the same, and the close detection result is close, determining the adjacent detection result as adjacent; If the area intersection result is non-intersection, and the adjacent detection is used to obtain the identification data to be tested, then compare the second center point difference with the preset second threshold, and detect the second alignment state of the preset initial area according to the first alignment state, the second center point difference is obtained based on the difference between the initial center point of the preset initial area and the target vertical coordinate, and the target vertical coordinate is used to characterize the maximum vertical coordinate of the first data to be tested and the second data to be tested; If the second center point difference is less than or equal to the preset second threshold, and the second alignment state is that the alignment modes are the same, the area intersection result is updated to intersection.
4. The multilingual translation test method according to claim 3, characterized in that: Performing area intersection detection on the first data to be inspected and the second data to be inspected to obtain an area intersection result includes: If the initial size of the preset initial area is less than or equal to the size difference, comparing the initial size with a preset third threshold, the initial size includes an initial width and an initial height, and the size difference includes a width difference and a height difference; If the initial size of the preset initial area is greater than the size difference, comparing the size difference with a preset sixth threshold; If the initial size of the preset initial area is greater than a preset third threshold, or the size difference is greater than the preset third threshold, the size identifier is determined to be non-zero, and the size identifier includes a width identifier and a height identifier; If the initial size of the preset initial area is less than or equal to the preset third threshold, or the size difference is less than or equal to the preset third threshold, the size flag is determined to be zero; If the product of the width identifier and the height identifier is greater than zero, the area intersection result is determined to be an intersection; If the product of the width identifier and the height identifier is less than or equal to zero, the area intersection result is determined to be non-intersecting; Among them, the size difference is obtained based on the difference between the target size and the maximum boundary offset, the maximum boundary offset is used to characterize the maximum value of the first boundary offset and the second boundary offset, the target size is used to characterize the area size in the data to be inspected corresponding to the maximum boundary offset, the first boundary offset is used to characterize the difference between the initial boundary of the preset initial area and the first boundary of the first data to be inspected, and the second boundary offset is used to characterize the difference between the initial boundary of the preset initial area and the second boundary of the second data to be inspected.
5. The multilingual translation testing method according to any one of claims 1 to 4, characterized in that: Performing second character recognition on all character region images of the language interface image to obtain target recognition data of the language interface image includes: Performing second character recognition on all character region images of the language interface image to obtain a plurality of first recognition data of the language interface image; If the left and right steering indicators of the language interface image are right steering, each of the first recognition data is mirrored to obtain a plurality of second recognition data, and each of the second recognition data is sorted according to the left boundary coordinates of each of the second recognition data to obtain a plurality of third recognition data; The first identification data are sorted according to the left boundary coordinates of the first identification data, or the third identification data are sorted according to the left boundary coordinates of the third identification data to obtain fourth identification data; Performing peer detection on two adjacent fourth identification data in sequence to obtain a plurality of first peer results; If a first result in the same row is in the same row, the single row coordinate height and the single row coordinate width of two adjacent first identification data corresponding to the first result in the same row are updated to obtain identification data in the same row; The fourth identification data are updated according to all the peer identification data to obtain the target identification data.
6. The multilingual translation testing method according to any one of claims 1 to 4, characterized in that: According to the target coordinate information, all target recognition data of the same recognition data position in different languages are merged to obtain a plurality of recognition data to be tested, including: Performing peer detection on at least one region recognition data of interface images in different languages according to the target coordinate information to obtain a plurality of second peer results; If a second row result is the same row, then the region recognition data of the interface images of different languages corresponding to the second row result are combined into the recognition data to be tested; If the second row result is not the same row, performing adjacent detection on the region recognition data of the interface images of different languages according to the target coordinate information; If the adjacent detection result is satisfied, the regional recognition data of the interface images of different languages are merged into the recognition data to be tested; Wherein, the target identification data includes at least one area identification data.
7. The multilingual translation testing method according to any one of claims 1 to 4, characterized in that: Comparing the standard translation data with the recognition data to be tested for similarity to obtain a translation test result, including: Determine a recognition string to be tested in the recognition data to be tested as a current string to be tested, and determine a standard translation string corresponding to the current string to be tested in the standard translation data as a standard current string; If the first length of the current character string to be tested is equal to the second length of the standard current character string, performing a full similarity calculation on the standard current character string and the current character string to be tested to obtain a first similarity; If the first similarity is greater than or equal to a preset fourth threshold, determining the translation test result of the current character string to be tested as a first confidence level; If the first length of the current character string to be tested is less than the second length of the standard current character string, calculating the similarity of the first part between the standard current character string and the current character string to be tested according to the length of the current character string to be tested, to obtain a second similarity; If the second similarity is less than a preset fifth threshold, sequentially truncating truncated character strings of the first length starting from the first character of the standard current character string, and sequentially performing all similarity calculations with the current character string to be tested to obtain a plurality of third similarities; If the first similarity is greater than a preset sixth threshold and the first similarity is less than a preset fourth threshold, or the second similarity is greater than or equal to a preset fifth threshold, or the maximum third similarity is greater than or equal to a preset seventh threshold, the translation test result of the current character to be tested is determined as a second confidence level; If the first length of the current character to be tested is greater than the second length of the standard current character, or the maximum third similarity is less than a preset seventh threshold, the translation test result of the current character to be tested is determined as a third confidence level; The current character string to be tested is updated according to the recognition data to be tested, and the standard current character string is updated according to the standard translation data to perform a new similarity comparison.
8. The multilingual translation testing method according to any one of claims 1 to 4, characterized in that: Get interface images in multiple languages of the interface to be tested, including: Get the language to be tested and multiple language configuration files of the interface to be tested; Displaying the interfaces to be tested in sequence according to the language configuration file corresponding to the language to be tested, and acquiring images of each of the interface displays by using an acquisition tool to obtain multiple current interface images; Each of the current interface images is saved as two-dimensional matrix data to obtain multiple language interface images.
9. A multilingual translation testing device, characterized in that: include: An acquisition module is used to acquire standard translation data of the interface to be tested and interface images in multiple languages; A primary recognition module, used to perform first character recognition on each of the language interface images to obtain initial recognition data of each of the language interface images, and to cut the character recognition area of the corresponding language interface image according to each of the initial recognition data to obtain a plurality of character area images of each of the language interface images; A secondary recognition module is used to perform a second character recognition on all character area images of each language interface image to obtain target recognition data of each language interface image, and restore all target recognition data to the corresponding language interface image to obtain target coordinate information; The translation test module is used to merge the positions of the same recognition data in different languages of all target recognition data according to the target coordinate information to obtain multiple recognition data to be tested, and to compare the similarity between the standard translation data and each recognition data to be tested to obtain a translation test result.
10. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the multilingual translation test method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the multilingual translation test method according to any one of claims 1 to 8.
Citation Information
Cited By
Method and system for testing multi-language translation of menu interface of vehicle-mounted multimedia system
CN122507651A