Text circle selection method and device, electronic equipment and computer readable storage medium

By obtaining and traversing the position information in the page detection results and determining the user's circle selection area, the problem of limitations in the existing technology and low recognition accuracy is solved, and the support of multiple circle selection methods and high-precision recognition is achieved.

CN119964168APending Publication Date: 2025-05-09深圳市星桐科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510022010.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

The existing text circle selection method is relatively limited, and the recognition accuracy is not high, so it is impossible to effectively support users to circle selection through multiple trajectories.

Method used

By obtaining page detection results, including position information and text information of each character and text line, traverse the user's initial circle selection trajectory and the position information of the target circle selection trajectory, determine the intersection situation, and then determine the area selected by the user, and output the circle selection result.

Benefits of technology

It supports multiple circle selection methods (such as drawing circles, drawing straight lines, and drawing irregular curves), which improves the accuracy and intelligence of circle selection. Users can circle a variety of areas such as single characters, multiple characters, single text lines, and multiple text lines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119964168A_ABST
    Figure CN119964168A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, and discloses a text circle selection method and device, electronic equipment and a computer readable storage medium. The method comprises the steps of obtaining a page detection result, wherein the page detection result comprises position information of each character, text information of each character, position information of each text line and text information of each text line; traversing the position information of each character, the position information of each text line, the position information of the initial circle selection track of the user and the position information of the target circle selection track, and determining a traversing result; wherein the target circling track is a track obtained after the initial circling track moves by a preset height; determining an area circled by the user based on a traversal result; and outputting a circling result based on the text information of the characters and the text information of the text lines included in the area circled by the user. According to the invention, various circle selection modes are supported, and the circle selection precision and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a text selection method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the development of artificial intelligence technology, smart devices (such as learning machines, point-reading machines, etc.) are becoming increasingly popular in people's daily lives. Users circle text content in the interface, and smart devices identify, analyze, and translate the content by identifying the content circled by the user, and display the circled results and analysis results on the screen, saving users time and effort in learning. However, the existing circle selection method is relatively limited, and the recognition accuracy is not high. Summary of the invention

[0003] In view of the above situation, the embodiments of the present application provide a text circle selection method, device, electronic device and computer-readable storage medium, which aim to solve the above problems or at least partially solve the above problems.

[0004] In a first aspect, an embodiment of the present application provides a text selection method, the method comprising:

[0005] Acquire a page detection result, wherein the page detection result includes position information of each character, text information of each character, position information of each text line, and text information of each text line;

[0006] Traversing the position information of each character, the position information of each text line, the position information of the user's initial circle selection track, and the position information of the target circle selection track, and determining the traversal result, the traversal result including the first number of characters intersected by the initial circle selection track and the character, the first number of lines intersected by the circle selection track and the text line, the second number of characters intersected by the target circle selection track and the character, and the second number of lines intersected by the target circle selection track and the text line; wherein the target circle selection track is the track after the initial circle selection track moves a preset height;

[0007] Based on the traversal result, determining the area selected by the user;

[0008] Based on the text information of the characters included in the area circled by the user and the text information of the text line, a circle selection result is output.

[0009] In a second aspect, an embodiment of the present application further provides a text circle selection device, the device comprising:

[0010] An acquisition module, used for acquiring a page detection result, wherein the page detection result includes position information of each character, text information of each character, position information of each text line, and text information of each text line;

[0011] A traversal module, used to traverse the position information of each character, the position information of each text line, the position information of the user's initial circle selection trajectory and the position information of the target circle selection trajectory, and determine the traversal result, wherein the traversal result includes the first number of characters intersected by the initial circle selection trajectory and the character, the first number of lines intersected by the circle selection trajectory and the text line, the second number of characters intersected by the target circle selection trajectory and the character, and the second number of lines intersected by the target circle selection trajectory and the text line; wherein the target circle selection trajectory is the trajectory of the initial circle selection trajectory after moving a preset height;

[0012] A processing module, used for determining the area circled by the user based on the traversal result;

[0013] The output module is used to output the circle selection result based on the text information of the characters and the text information of the text line included in the area circled by the user.

[0014] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor; and a memory arranged to store computer executable instructions, wherein the executable instructions, when executed, cause the processor to perform the steps of the first aspect described above.

[0015] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores one or more programs. When the one or more programs are executed by an electronic device including multiple application programs, the electronic device executes the steps of the first aspect above.

[0016] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: by performing page detection on the page, obtaining the position information and text information of each character in the page and the position information and text information of each text line, by traversing each character, each text line, the user's initial circle selection trajectory and the position information of the target circle selection trajectory, the intersection of the user's initial circle selection trajectory and the target circle selection trajectory with the character and text line is determined, and then the area selected by the user is determined based on the traversal result, and the circle selection result is output through the text information of the characters and text lines in the circled area. In the embodiments of the present application, by introducing the target circle selection trajectory, since the target circle selection is the trajectory after the initial circle selection trajectory moves a preset height, it can avoid the situation that when the user's initial circle selection trajectory is a straight line or an irregular line, the area that the user wants to circle cannot be determined by the intersection of the initial circle selection trajectory with the character and text line, that is, in the embodiments of the present application, the user is supported to select content on the screen by drawing circles, drawing straight lines, drawing irregular curves and other circle selection methods. At the same time, by traversing the intersection of the trajectory with each character and text line, the minimum selection range is set to the character, allowing users to select a single character, multiple characters, a single text line, multiple text lines and other selection areas, and are no longer limited to the selection method of the entire title or the entire paragraph, thereby improving the intelligence and accuracy of the device and enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 A schematic diagram of the structure of the circle selection system provided in an embodiment of the present application is shown;

[0019] Figure 2 A schematic diagram of the process of the text selection method provided in the embodiment of the present application is shown;

[0020] Figure 3 A schematic diagram showing the contents of a page detection result provided by an embodiment of the present application is shown;

[0021] Figure 4 A flowchart of a text selection method provided by another embodiment of the present application is shown;

[0022] Figure 5 A structural diagram of a text circle selection device provided in an embodiment of the present application is shown;

[0023] Figure 6 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that such use is interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the term "including" and its variants are to be interpreted as open-ended terms meaning "including but not limited to".

[0026] The present application is described in detail below through specific embodiments.

[0027] Figure 1 A schematic diagram of the structure of a circle selection system according to an embodiment of the present application is shown. The circle selection method provided in the embodiment of the present application can be implemented by Figure 1 The system implementation from Figure 1 It can be seen that the circle selection system 100 includes a server 101 and a terminal 102 that are in communication connection, wherein the server is equipped with a text circle selection device ( Figure 4 The text circle selection method of the present application is specifically applied to the server 101 of the circle selection system 100. The terminal 102 is used to receive the circle selection result of the server 101 and render the circle selection result to display the circle selection result.

[0028] It should be noted that this application is not limited to Figure 1 The circled system shown may be any system, device, framework, etc. that can implement the business logic of this application. Figure 1 This is for illustrative purposes only.

[0029] Figure 2 A schematic diagram of a text selection method according to an embodiment of the present application is shown. Figure 2 It can be seen that the method may include steps S201 to S204:

[0030] Step S101: Obtain page detection results.

[0031] In some embodiments, the page detection result includes position information of each character, text information of each character, position information of each text line, and text information of each text line.

[0032] The position information may refer to an x-coordinate and a y-coordinate. Specifically, an xy coordinate system is established in the page, for example, an xy coordinate system is established with the lower left corner of the page as the origin, and the position information of each character in the page can be determined by the xy coordinate system. Furthermore, based on the y-coordinate of each character, characters with the same y-coordinate are merged into a row to obtain the position information of the text row. Similarly, the text information of the text row is obtained based on the text information of each character in the text row. Figure 3 As shown, the page detection result includes n single-line results, each of which includes single-character information and whole-line information. The single-character information includes the position coordinates of each character and the character text, and the whole-line information includes the position table of the whole line and the whole-line text.

[0033] It is worth noting that the text information involved in the embodiments of the present application may include words, numbers, letters, formulas, and any other information that can appear on a page.

[0034] In some embodiments, step S101 can be specifically implemented as follows: when the screen is in the on-screen state, it is detected that the user has pressed the screen for a time greater than a preset time and the pressing pressure is greater than a preset pressure, the circle selection function is called, page detection is started, and page detection results are generated. At the same time, a mask layer animation is added to the screen to fix the screen, so that the user knows that the circle selection function has been turned on and can circle the current interface.

[0035] Step S102: traverse the position information of each character, the position information of each text line, the position information of the user's initial circle selection trajectory, and the position information of the target circle selection trajectory to determine the traversal result.

[0036] In some embodiments, the traversal results include a first number of intersection characters between the initial circle selection track and the character, a first number of intersection lines between the circle selection track and the text line, a second number of intersection characters between the target circle selection track and the character, and a second number of intersection lines between the target circle selection track and the text line.

[0037] Among them, the target circle selection trajectory is the trajectory of the initial circle selection trajectory after moving the preset height. In some embodiments, the preset height should be greater than 0 and less than the line height. For example, the line height is h, and the preset height can be 0.4h. In this way, when the initial circle selection trajectory is a horizontal straight line, the first number of intersection characters between the initial circle selection trajectory and the character and the first number of intersection lines between the circle selection trajectory and the text line in the traversal result are both 0, and the initial circle selection trajectory can be determined as a straight line through the second number of intersection characters between the target circle selection trajectory and the character and the second number of intersection lines between the target circle selection trajectory and the text line, and the area selected by the user can be determined through the second number of intersection characters between the target circle selection trajectory and the character and the second number of intersection lines between the target circle selection trajectory and the text line.

[0038] Step S103: Based on the traversal result, determine the area circled by the user.

[0039] Specifically, the area circled by the user is determined based on at least one of the first number of intersecting characters, the first number of intersecting rows, the second number of intersecting characters, and the second number of intersecting rows.

[0040] Step S104: outputting a circle selection result based on the text information of the characters and the text information of the text line included in the area circled by the user.

[0041] from Figure 1 It can be seen from the method shown that the present application introduces a target circle selection track. Since the target circle selection is the track after the initial circle selection track moves to a preset height, it can avoid the situation where the user's initial circle selection track is a straight line or an irregular line, and the area that the user wants to circle cannot be determined by the intersection of the initial circle selection track with the characters and text lines. That is, the embodiment of the present application supports users to select content on the screen by drawing circles, straight lines, irregular curves, and other circle selection methods. At the same time, by traversing the intersection of the track with each character and text line, the minimum circle selection range is set to the character, so that the user can circle a single character, multiple characters, a single text line, multiple text lines, and other circle selection areas, and is no longer limited to the circle selection method of the entire title or the entire paragraph, thereby improving the intelligence and accuracy of the device and the user's experience.

[0042] In some embodiments of the present application, in the above method, the page detection result in step S101 is generated based on optical character recognition (OCR) technology detection.

[0043] Specifically, in response to the user's pressing operation, the circle function is called, the page is subjected to OCR detection, and the page detection result is generated. Since there may be multiple types of text information in the page, such as handwritten text, printed text, handwritten formulas, printed formulas, images or tables, etc., in order to better identify each type of text information, multiple OCR models are adopted in the embodiment of the present application, and an OCR model is trained for each type of text information. The multiple types of text information included in the page are detected by multiple OCR models. In one embodiment, the page is subjected to OCR detection respectively by multiple OCR models with different functions, and multiple OCR detection results are generated. In another embodiment, the text information in the page is extracted by the text detection model, and the text information is further subjected to OCR detection respectively based on multiple OCR models with different functions to generate OCR detection results.

[0044] In the embodiment of the present application, by setting multiple OCR models, the text information of each text type can be identified for a complex page including multiple text types, so that the circled text information can be accurately determined when the circle selection result is determined later, and the circle selection precision and accuracy are improved. At the same time, the embodiment of the present application can obtain the OCR detection result of the entire page by performing an OCR detection on the current page once, ensuring that one OCR is used multiple times, reducing the time spent on recognition after each circle selection.

[0045] In some embodiments of the present application, in the above method, the traversal result in step S102 is determined by the following steps: Figure 4 As shown, the following steps are included:

[0046] Step S201: Based on the position information of each character, the position information of each text line and the position information of the initial circle selection track, the intersection area of ​​each character and the initial circle selection track and the intersection area of ​​each text line and the initial circle selection track are calculated.

[0047] In some embodiments, the character area is determined based on the x-coordinate and y-coordinate of the character, the text line area is determined based on the x-coordinate and y-coordinate of the text line, the track area of ​​the initial circled track is determined based on the x-coordinate and y-coordinate of the initial circled track, the intersection area is determined based on the character area and the track area, and the intersection area is determined based on the text line area and the track area.

[0048] Specifically, the intersection area IOU is determined based on the following formula:

[0049]

[0050] Step S202: Based on the position information of each character, the position information of each text line and the position information of the target circle selection track, the intersection area of ​​each character and the target circle selection track and the intersection area of ​​each text line and the target circle selection track are calculated.

[0051] The specific implementation method of step S202 can refer to step S201 and will not be repeated here.

[0052] Step S203: Determine the traversal result based on the intersection area.

[0053] In step S203, determining the traversal result based on the intersection area includes at least one of the following situations:

[0054] (a) determining a first number of characters intersected by the initial circled track and the characters based on the number of first characters whose intersection area with the initial circled track is greater than a preset value;

[0055] (b) determining a first number of intersections between the initial circled track and the row based on the first number of rows whose intersection area with the initial circled track is greater than a preset value;

[0056] (c) determining a second number of intersecting characters between the target circled track and the character based on the number of second characters whose intersecting area with the target circled track is greater than a preset value;

[0057] (d) determining a second number of intersection rows with the target circled track based on a second number of rows whose intersection area with the target circled track is greater than a preset value.

[0058] The preset value may be set to 0.3, and if the IOU is greater than 0.3, the intersection count between the track and the character or line is determined to be +1. For example, if the intersection area of ​​7 characters with the initial circled track is greater than 0.3, the number of the first intersection characters is 7.

[0059] In the embodiment of the present application, the number of intersecting characters and the number of intersecting rows are determined by the intersection area, so that the area circled by the user's circle selection track can be accurately determined.

[0060] In some embodiments of the present application, in the above method, determining the area circled by the user based on the traversal result in step S103 includes at least one of the following situations:

[0061] (a) If the first number of intersecting characters is greater than 0 and the first number of intersecting rows is 1, the area circled by the user is determined based on the first number of intersecting characters.

[0062] When the first number of intersecting characters is greater than 0 and the first number of intersecting rows is 1, it means that the initial selection track selects characters in a row but does not select the entire row, that is, the initial selection track is an area selection, and the area selected by the user is determined by the first number of intersecting characters. For example, if the first number of intersecting characters is 6, the area selected by the user is the 6 characters.

[0063] (b) If the first number of intersecting characters is greater than 0 and the first number of intersecting rows is greater than 1, the area circled by the user is determined based on the first number of intersecting rows.

[0064] When the first number of intersecting characters is greater than 0 and the first number of intersecting lines is greater than 1, it means that the initial selection track has selected multiple lines of text, and the area selected by the user is determined by the first number of intersecting lines. For example, if the first number of intersecting lines is 3, the area selected by the user is 3 lines.

[0065] (c) If the first number of intersecting characters is greater than 0, the first number of intersecting rows is 0, and the second number of intersecting rows is greater than 0, the area circled by the user is determined based on the second number of intersecting characters.

[0066] When the first number of intersecting characters is greater than 0, the first number of intersecting rows is 0, and the second number of intersecting rows is greater than 0, it means that the initial selection trajectory is an irregular line, such as a curve, and the curve intersects with the characters, but the intersection area with the complete row is too small, so the first number of intersecting rows is 0. At this time, the area selected by the user is based on the second number of intersecting characters. For example, if the second number of intersecting characters is 7, it is determined that the area selected by the user is these 7 characters.

[0067] (d) If the first number of intersecting characters is 0, the first number of intersecting lines is 0, the second number of intersecting characters is 0, and the second number of intersecting lines is 0, the area circled by the user is determined based on the x-coordinate of the target circled track and the x-coordinate of the text line.

[0068] When the first number of intersecting characters, the first number of intersecting lines, the second number of intersecting characters and the second number of intersecting lines are all 0, it means that the initial circle selection trajectory is a horizontal straight line, and neither the initial circle selection trajectory nor the target circle selection trajectory has a y coordinate. At this time, it is possible to determine whether the user has circled an area based on the x coordinate of the target circle selection trajectory and the x coordinate of the text line.

[0069] In some embodiments, based on the x-coordinate of the target circle selection track and the x-coordinate of the text line, the number of overlapping characters of the target circle selection track and the text line is determined. If the number of overlapping characters is greater than 0, the area selected by the user is determined based on the number of overlapping characters. If the number of overlapping characters is 0, it is determined that the area selected by the user is empty, that is, the initial circle selection track may be an accidental touch.

[0070] In the embodiment of the present application, when it is determined that the area circled by the user is empty, the mask displayed on the page does not disappear, and the user can re-circle the area on the mask.

[0071] In an embodiment of the present application, by judging the intersection of the initial circle selection trajectory and the target circle selection trajectory with the characters and text lines, the shape of the user's circle selection trajectory can be determined, and the circle selection areas corresponding to various trajectories such as circles, rectangles, straight lines, and curves can be identified, thereby improving the user's experience.

[0072] In some embodiments of the present application, when determining the output circled result in step S104, if the circled area includes 2 lines or more, it is determined whether the end of each line ends with an English letter. If so, a space is added between the first line and the second line to make reading smoother.

[0073] In some embodiments of the present application, when determining the output circle selection result in step S104, if the circled area includes N text lines, and the N text lines include a pinyin line and a text line corresponding to the pinyin line, the pinyin line is deleted. If the circled area includes only one pinyin line, the pinyin line is retained.

[0074] In some embodiments of the present application, a text encircling device is provided, which corresponds one-to-one to the text encircling method in the above embodiments. Figure 5 As shown, the text circle selection device includes an acquisition module 301 , a traversal module 302 , a processing module 303 and an output module 304 .

[0075] An acquisition module 301 is used to acquire a page detection result, wherein the page detection result includes position information of each character, text information of each character, position information of each text line, and text information of each text line;

[0076] The traversal module 302 is used to traverse the position information of each character, the position information of each text line, the position information of the user's initial circle selection trajectory, and the position information of the target circle selection trajectory, and determine the traversal result, wherein the traversal result includes the first number of characters intersected by the initial circle selection trajectory and the character, the first number of lines intersected by the circle selection trajectory and the text line, the second number of characters intersected by the target circle selection trajectory and the character, and the second number of lines intersected by the target circle selection trajectory and the text line; wherein the target circle selection trajectory is the trajectory of the initial circle selection trajectory after moving a preset height;

[0077] A processing module 303 is used to determine the area circled by the user based on the traversal result;

[0078] The output module 304 is used to output the circle selection result based on the text information of the characters and the text information of the text line included in the area circled by the user.

[0079] In some embodiments of the present application, in the above-mentioned device, the page detection result is generated based on OCR detection;

[0080] The acquisition module 301 is specifically used to perform OCR detection on the page based on multiple OCR models to generate multiple OCR detection results, including handwriting detection results, printed text detection results, handwritten formula detection results, printed formula detection results, image detection results, and table detection results.

[0081] In some embodiments of the present application, in the above device, the traversal module 302 is specifically used to calculate the intersection area of ​​each character and the initial circle selection track and the intersection area of ​​each text line and the initial circle selection track based on the position information of each character, the position information of each text line and the position information of the initial circle selection track;

[0082] Based on the position information of each character, the position information of each text line and the position information of the target circle selection track, the intersection area of ​​each character and the target circle selection track and the intersection area of ​​each text line and the target circle selection track are calculated;

[0083] Determine traversal results based on intersection area.

[0084] In some embodiments of the present application, in the above device, determining the traversal result based on the intersection area includes at least one of the following situations:

[0085] Based on the first number of characters whose intersection area with the initial circled track is greater than a preset value, determining a first number of characters that intersect the initial circled track with the characters;

[0086] Based on the first number of rows whose intersection area with the initial circled track is greater than a preset value, determining a first number of intersection rows between the initial circled track and the row;

[0087] Determining a second number of intersecting characters between the target circled selection track and the character based on a second number of characters whose intersecting area with the target circled selection track is greater than a preset value;

[0088] The second number of rows intersecting with the target circled track and the row is determined based on the second number of rows whose intersecting area with the target circled track is greater than a preset value.

[0089] In some embodiments of the present application, in the above device, determining the area circled by the user based on the traversal result includes at least one of the following situations:

[0090] If the first number of intersecting characters is greater than 0 and the first number of intersecting rows is 1, determining the area circled by the user based on the first number of intersecting characters;

[0091] If the first number of intersecting characters is greater than 0 and the first number of intersecting rows is greater than 1, determining the area circled by the user based on the first number of intersecting rows;

[0092] If the first number of intersecting characters is greater than 0, the first number of intersecting rows is 0, and the second number of intersecting rows is greater than 0, determining the area circled by the user based on the second number of intersecting characters;

[0093] If the first number of intersecting characters is 0, the first number of intersecting rows is 0, the second number of intersecting characters is 0, and the second number of intersecting rows is 0, the area circled by the user is determined based on the x-coordinate of the target circle selection trajectory and the x-coordinate of the text line.

[0094] In some embodiments of the present application, in the above device, the processing module 303 is specifically used to determine the number of overlapping characters based on the x-coordinate of the target circle selection track and the x-coordinate of the text line;

[0095] If the number of overlapping characters is greater than 0, determining the area circled by the user based on the number of overlapping characters; or

[0096] If the number of overlapping characters is 0, it is determined that the area circled by the user is empty.

[0097] In some embodiments of the present application, in the above-mentioned device, the output module 304 is specifically used to delete the pinyin line in the circled result if the area circled by the user includes N lines of text, and the N lines of text include pinyin lines and text lines corresponding to the pinyin lines.

[0098] It should be noted that any of the above-mentioned text selection devices can implement the above-mentioned text selection method in a one-to-one correspondence, which will not be repeated here.

[0099] Figure 6 FIG. 1 is a schematic diagram showing the structure of an electronic device provided in an embodiment of the present application. Figure 6 As shown, at the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. Among them, the memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage, etc. Of course, the electronic device may also include hardware required for other services.

[0100] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0101] The memory is used to store programs. Specifically, the program may include program code, and the program code includes computer operation instructions. The memory may include internal memory and non-volatile memory, and provides instructions and data to the processor.

[0102] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a text circle selection device at the logical level. The processor executes the program stored in the memory and is specifically used to execute the above method.

[0103] The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to be executed, or a combination of hardware and software modules in the decoding processor to be executed. The software module may be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0104] The electronic device can execute the text encircling method provided by the multiple embodiments of the present application, and realize the text encircling device in Figure 5 The functions of the illustrated embodiment will not be described in detail in the embodiments of the present application.

[0105] An embodiment of the present application also proposes a computer-readable storage medium, which stores one or more programs, and the one or more programs include instructions. When the instructions are executed by an electronic device including multiple application programs, the electronic device can execute the text selection method provided by multiple embodiments of the present application.

[0106] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0107] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0108] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0109] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0110] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0111] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0112] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0113] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity or device including the element.

[0114] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0115] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A text selection method, characterized in that: The method comprises: Acquire a page detection result, wherein the page detection result includes position information of each character, text information of each character, position information of each text line, and text information of each text line; Traversing the position information of each character, the position information of each text line, the position information of the user's initial circle selection track, and the position information of the target circle selection track, and determining the traversal result, the traversal result including the first number of characters intersected by the initial circle selection track and the character, the first number of lines intersected by the circle selection track and the text line, the second number of characters intersected by the target circle selection track and the character, and the second number of lines intersected by the target circle selection track and the text line; wherein the target circle selection track is the track after the initial circle selection track moves a preset height; Based on the traversal result, determining the area selected by the user; Based on the text information of the characters included in the area circled by the user and the text information of the text line, a circle selection result is output.

2. The method according to claim 1, characterized in that The page detection result is generated based on OCR detection; The obtaining of page detection results includes: Based on multiple OCR models, OCR detection is performed on the page to generate multiple OCR detection results, including handwriting detection results, printed text detection results, handwritten formula detection results, printed formula detection results, image detection results, and table detection results.

3. The method according to claim 1, characterized in that The traversing the position information of each character, the position information of each text line, the position information of the user's initial circle selection track, and the position information of the target circle selection track to determine the traversal result includes: Based on the position information of each character, the position information of each text line and the position information of the initial circle selection track, the intersection area of ​​each character and the initial circle selection track and the intersection area of ​​each text line and the initial circle selection track are calculated; Based on the position information of each character, the position information of each text line and the position information of the target circle selection track, the intersection area of ​​each character and the target circle selection track and the intersection area of ​​each text line and the target circle selection track are calculated; Determine traversal results based on intersection area.

4. The method according to claim 3, characterized in that The determining of the traversal result based on the intersection area includes at least one of the following situations: Based on the first number of characters whose intersection area with the initial circled track is greater than a preset value, determining a first number of characters that intersect the initial circled track with the characters; Based on the first number of rows whose intersection area with the initial circled track is greater than a preset value, determining a first number of intersection rows between the initial circled track and the row; Determining a second number of intersecting characters between the target circled selection track and the character based on a second number of characters whose intersecting area with the target circled selection track is greater than a preset value; The second number of rows intersecting with the target circled track and the row is determined based on the second number of rows whose intersecting area with the target circled track is greater than a preset value.

5. The method according to claim 1, characterized in that The determining the area selected by the user based on the traversal result includes at least one of the following situations: If the first number of intersecting characters is greater than 0 and the first number of intersecting rows is 1, determining the area circled by the user based on the first number of intersecting characters; If the first number of intersecting characters is greater than 0 and the first number of intersecting rows is greater than 1, determining the area circled by the user based on the first number of intersecting rows; If the first number of intersecting characters is greater than 0, the first number of intersecting rows is 0, and the second number of intersecting rows is greater than 0, determining the area circled by the user based on the second number of intersecting characters; If the first number of intersecting characters is 0, the first number of intersecting rows is 0, the second number of intersecting characters is 0, and the second number of intersecting rows is 0, the area circled by the user is determined based on the x-coordinate of the target circle selection trajectory and the x-coordinate of the text line.

6. The method according to claim 5, characterized in that The determining the area circled by the user based on the x-coordinate of the target circled track and the x-coordinate of the text line includes: Determine the number of overlapping characters based on the x-coordinate of the target circled track and the x-coordinate of the text line; If the number of overlapping characters is greater than 0, determining the area circled by the user based on the number of overlapping characters; or If the number of overlapping characters is 0, it is determined that the area circled by the user is empty.

7. The method according to any one of claims 1 to 6, characterized in that: The step of outputting the result of the circle selection based on the text information of the characters and the text information of the text line included in the area circled by the user comprises: If the area circled by the user includes N text lines, and the N text lines include pinyin lines and text lines corresponding to the pinyin lines, the pinyin lines are deleted from the circled result.

8. A text circle selection device, characterized in that: The device comprises: An acquisition module, used for acquiring a page detection result, wherein the page detection result includes position information of each character, text information of each character, position information of each text line, and text information of each text line; A traversal module, used to traverse the position information of each character, the position information of each text line, the position information of the user's initial circle selection trajectory and the position information of the target circle selection trajectory, and determine the traversal result, wherein the traversal result includes the first number of characters intersected by the initial circle selection trajectory and the character, the first number of lines intersected by the circle selection trajectory and the text line, the second number of characters intersected by the target circle selection trajectory and the character, and the second number of lines intersected by the target circle selection trajectory and the text line; wherein the target circle selection trajectory is the trajectory of the initial circle selection trajectory after moving a preset height; A processing module, used for determining the area circled by the user based on the traversal result; The output module is used to output the circle selection result based on the text information of the characters and the text information of the text line included in the area circled by the user.

9. An electronic device, comprising: processor; as well as A memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes the steps of the text encircling method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing one or more programs, which, when executed by an electronic device including a plurality of application programs, enable the electronic device to perform the steps of the text encircling method as described in any one of claims 1 to 7.