Text positioning method and device, electronic equipment, scanning pen and storage medium
By detecting text navigation instructions or content on printed books, the system can quickly locate the position in e-books, solving the problem of low positioning efficiency for both printed and e-books and improving reading efficiency and convenience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-21
- Publication Date
- 2026-03-17
AI Technical Summary
Current technology cannot directly and quickly locate the same position in an e-book based on the reading position on the paper book, resulting in low reading efficiency for users.
The system detects whether the recognition text corresponding to the input data contains a text jump instruction. If it does, the text position in the target text is determined as the localization result; otherwise, the matching text position is retrieved from the target text as the localization result. Localization is performed using text image data and voice data.
It enables quick navigation between print and ebooks, improving reading efficiency, and further enhances convenience through voice control, reducing the number of steps required for user operation.
Smart Images

Figure CN115223176B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more particularly to a text positioning method, apparatus, electronic device, scanning pen, and storage medium. Background Technology
[0002] Common reading and learning methods generally include reading physical books and reading e-books. E-books are typically stored on electronic devices such as scanning pens, mobile phones, and e-readers. However, when users read the same book using both physical and electronic devices, they cannot quickly locate the same position in the e-book based on the reading position in the physical book. They need to manually turn pages to find it, resulting in low reading efficiency. Summary of the Invention
[0003] Based on the above needs, this application proposes a text positioning method, device, electronic device, scanning pen, and storage medium to solve the problem in the prior art that it is impossible to quickly locate the same position in an electronic book directly based on the reading position on a paper book, resulting in low reading efficiency for users.
[0004] The technical solution proposed in this application is as follows:
[0005] On the one hand, this application provides a text localization method, including:
[0006] The system detects whether the recognized text corresponding to the input data content contains a text jump instruction; wherein, the input data content includes text image data and / or voice data; the text jump instruction is used to indicate a jump to a specific text position in the target text;
[0007] If the identified text contains a text jump instruction, then the text position in the target text that matches the text jump instruction is determined as the text location result;
[0008] If the identified text does not contain a text jump instruction, the position of the text that matches the identified text retrieved from the target text will be determined as the text location result.
[0009] Furthermore, in the method described above, detecting whether the recognized text corresponding to the input data content contains a text jump instruction includes:
[0010] By performing semantic understanding on the identified text, text jump indication information is detected from the identified text;
[0011] If a text jump instruction is detected in the identified text, it is determined that the identified text contains a text jump instruction.
[0012] Furthermore, in the method described above, when text jump indication information is detected from the identified text, the method further includes:
[0013] Determine whether the text jump instruction information meets the scene instruction conditions; the scene instruction conditions include the conditions that the text jump instruction information should meet as a text jump instruction in the current scene;
[0014] If the text jump instruction information meets the scene instruction conditions, then it is determined that the identified text contains a text jump instruction, and the detected text jump instruction information is determined as a text jump instruction;
[0015] If the text jump instruction information does not meet the scene instruction conditions, then it is determined that the identified text does not contain a text jump instruction.
[0016] Furthermore, in the method described above, determining whether the text jump instruction information meets the scene instruction conditions includes:
[0017] Determine whether the language of the text jump instruction information is the same as that of the target text;
[0018] If the text jump instruction information is in a different language than the target text, then the text jump instruction information is determined to meet the scene instruction conditions.
[0019] Furthermore, in the method described above, detecting whether the recognized text corresponding to the input data content contains a text jump instruction includes:
[0020] Detect whether the identified text contains text location information;
[0021] If the identified text contains text location information, then it is determined that the identified text contains a text jump instruction.
[0022] Furthermore, in the method described above, detecting whether the identified text contains text location information includes:
[0023] Determine whether the identified text is a page number;
[0024] If the identified text is a page number, then it is determined that the identified text contains text location information.
[0025] Furthermore, in the method described above, determining whether the identified text is a page number includes:
[0026] Determine whether the length of the identified text is within the page number length threshold of the target text;
[0027] If the length of the identified text is within the page number length threshold of the target text, then it is determined whether the identified text contains only numerical text.
[0028] If the identified text contains only numerical text, then determine whether the numerical value corresponding to the identified text is within the page number value threshold of the target text;
[0029] If the numerical value corresponding to the identified text is within the page number value threshold of the target text, then the identified text is determined to be a page number.
[0030] Furthermore, in the method described above, determining the position of the text matching the identified text retrieved from the target text as the text localization result includes:
[0031] Retrieve text that matches the identified text from the first retrieval area of the target text; the first retrieval area includes the text area where the current text position is located and the text area adjacent to the current text position, the current text position includes the text positioning result obtained from the previous text positioning or a preset position;
[0032] If a text matching the identified text is retrieved from the first retrieval area of the target text, the position of the text matching the identified text retrieved from the first retrieval area of the target text is determined as the text location result;
[0033] If no text matching the identified text is found in the first search area of the target text, the position of the text matching the identified text found in the second search area of the target text is determined as the text location result; the second search area includes the text area in the target text other than the first search area.
[0034] Further, in the method described above, determining the position of the text matching the identified text retrieved from the first retrieval region of the target text as the text location result includes:
[0035] If the number of positions of texts that match the identified text retrieved from the first retrieval area of the target text is one, then the position of the text that matches the identified text retrieved from the first retrieval area of the target text is determined as the text location result;
[0036] If the number of positions of texts matching the identified text retrieved from the first retrieval area of the target text is at least two, then the positions of each of the retrieved texts matching the identified text are output, and the text location result is determined according to the selection instruction provided by the user.
[0037] The selection instruction includes an instruction for the user to select a text location from at least two locations of text that match the identified text.
[0038] Further, in the method described above, determining the position of the text matching the identified text retrieved from the second retrieval area of the target text as the text location result includes:
[0039] Retrieve text that matches the identified text from the second retrieval area of the target text;
[0040] If a text matching the identified text is retrieved from the second retrieval area of the target text, the text location result is determined based on the position of the text matching the identified text retrieved from the second retrieval area of the target text;
[0041] If no matching text is found in the second search area of the target text, a prompt message is output to prompt the user to re-enter the input data.
[0042] Furthermore, in the method described above, the first search area includes a first interval and a second interval;
[0043] The step of retrieving text matching the identified text from the first retrieval region of the target text includes:
[0044] Retrieve text that matches the identified text from a first interval of the target text; the first interval includes the page where the current text is located and M pages after the current text location;
[0045] If no text matching the identified text is found in the first interval of the target text, then the text matching the identified text is retrieved from the second interval of the target text, which includes N pages before the current text position, where M and N are both positive integers.
[0046] Furthermore, in the method described above, the page where the current text position is located, and each page in the M pages after the current text position, correspond to different hit thresholds;
[0047] The step of retrieving text matching the identified text from the first interval of the target text includes:
[0048] Retrieve text that matches the identified text from each page of the first interval;
[0049] If a text with a similarity greater than the identified text is found on any page of the first interval, then it is determined that a text matching the identified text has been retrieved from that page.
[0050] On the other hand, this application also provides a text positioning device, including:
[0051] The detection module is used to detect whether the recognized text corresponding to the input data content contains a text jump instruction; wherein, the input data content includes text image data and / or voice data; the text jump instruction is used to indicate a jump to a specific text position in the target text;
[0052] The first determining module is used to determine the text position in the target text that matches the text jump instruction as the text positioning result if the identified text contains a text jump instruction;
[0053] The second determining module is used to determine the position of the text that matches the identified text retrieved from the target text as the text location result if the identified text does not contain a text jump instruction.
[0054] On the other hand, this application also provides an electronic device, including:
[0055] Memory and first processor;
[0056] The memory is used to store programs;
[0057] The first processor is configured to implement the text positioning method described above by running a program in the memory.
[0058] On the other hand, this application also provides a scanning pen, including: a second processor, a display screen connected to the second processor, and a voice acquisition component and / or a text image acquisition component connected to the second processor;
[0059] The voice acquisition component is used to acquire voice data;
[0060] The text image acquisition component is used to acquire text image data;
[0061] The second processor is configured to detect whether the recognized text corresponding to the input data content contains a text jump instruction; wherein the input data content includes text image data and / or voice data; the text jump instruction is used to indicate a jump to a specific text position in the target text; if the recognized text contains a text jump instruction, the text position in the target text that matches the text jump instruction is determined as the text positioning result; if the recognized text does not contain a text jump instruction, the position of the text retrieved from the target text that matches the recognized text is determined as the text positioning result.
[0062] The display screen is used to display text content corresponding to the text location result sent by the second processor.
[0063] On the other hand, this application also provides a storage medium, including: a computer program stored on the storage medium, wherein when the computer program is executed by a processor, it implements each step of the text positioning method described in any of the above claims.
[0064] This application discloses a text location method, apparatus, electronic device, scanning pen, and storage medium. The method includes detecting whether the recognized text corresponding to the input data content contains a text jump instruction for indicating a jump to a specific text position in the target text. The input data content includes text image data and / or voice data. If the text is contained, the text position in the target text that matches the text jump instruction is determined as the text location result; otherwise, the text position in the target text that matches the text jump instruction is determined as the text location result. Thus, when a user reads to a certain position in a physical book, they can quickly locate the same position in the electronic book based on the input data content, making it convenient to use and effectively improving the user's reading efficiency. Furthermore, this application can be controlled by voice, further enhancing ease of use.
[0065] When this solution is applied to a scanning pen, users can quickly locate the same position on the pen and the paper book when reading the same book using both the scanning pen and a paper book, effectively improving reading efficiency. Moreover, when using voice as input data, users do not need to scan the text, thus reducing the process of repeatedly "holding the pen to scan and then laying it flat to read," further enhancing convenience. Attached Figure Description
[0066] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0067] Figure 1 This is a flowchart illustrating a text location method provided in an embodiment of this application;
[0068] Figure 2 This is a flowchart illustrating a method for determining whether a text jump instruction is contained in an identification text according to an embodiment of this application.
[0069] Figure 3 This is a flowchart illustrating another method for determining whether a text jump instruction is contained in the text to be identified, provided in an embodiment of this application.
[0070] Figure 4 This is a flowchart illustrating the process of determining whether the identified text is a page number, provided in an embodiment of this application.
[0071] Figure 5 This is a flowchart illustrating the process of determining the position of text that matches the identified text retrieved from the target text as the text location result, provided in an embodiment of this application.
[0072] Figure 6 This is a schematic diagram of the process for retrieving and identifying text matching the target text from a first interval of the target text, provided in an embodiment of this application.
[0073] Figure 7 This is a schematic diagram of the structure of a text positioning device provided in an embodiment of this application;
[0074] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0075] Figure 9 This is a schematic diagram of the structure of a scanning pen provided in an embodiment of this application. Detailed Implementation
[0076] The technical solution of this application embodiment is applicable to the application scenario of locating text. By adopting the technical solution of this application embodiment, when a user reads to a certain position in a paper book, he / she can quickly locate the same position in the corresponding electronic book, effectively improving the user's reading efficiency.
[0077] For example, the technical solutions of this application can be applied to hardware devices such as hardware processors, or packaged as software programs and run. When the hardware processor executes the processing procedure of the technical solutions of this application, or when the aforementioned software program is run, the process of locating text can be realized. This application only provides an exemplary description of the specific processing procedure of the technical solutions of this application, and does not limit the specific execution form of the technical solutions of this application. Any technical implementation form that can execute the processing procedure of the technical solutions of this application can be adopted by this application.
[0078] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0079] This embodiment proposes a text localization method, see [link to relevant documentation]. Figure 1 As shown, the method includes:
[0080] S101. Detect whether the recognized text corresponding to the input data content contains a text jump instruction.
[0081] The aforementioned input data refers to data content that can be used to determine the target location to be navigated to, so that the user can navigate to the target location within the target text based on the input data. The target text refers to the subject of the text being located, including various types of e-books, such as e-textbooks, e-dictionaries, and e-books. In the embodiments of this application, the user needs to pre-select the target text to be located, and then locate the target location of that target text through the input data.
[0082] For example, if a user is reading a book and reaches a specific location, and wishes to locate the same location in an e-book of the same book, they can input the aforementioned input data to determine that location. The technical solution of this application embodiment can then jump to the same location in the corresponding e-book based on the user's input data. Here, the corresponding e-book is the target text, and the location is the target location.
[0083] The input data includes text, image data, and / or voice data.
[0084] Regarding the methods for acquiring text image data, this embodiment includes, but is not limited to, the following methods:
[0085] The text image data can be obtained by scanning with a scanning device installed on or connected to the electronic device, where the electronic device can be any device using the text positioning method of this embodiment; by capturing images or videos with a camera installed on or connected to the electronic device; by inputting text with a keyboard, touchscreen, or other human-computer interaction device installed on or connected to the electronic device; or by downloading text image data from the cloud or a storage device. In other words, users can obtain text image data through screenshots, scanning, taking photos, or text input, and then upload the text image data to the cloud or store it in a storage device. In this embodiment, the text image data is downloaded from the cloud or a storage device, where the storage device includes devices with storage functions such as USB flash drives or memory cards.
[0086] Regarding the methods for acquiring voice data, this embodiment includes, but is not limited to, the following methods:
[0087] Voice data is obtained by recording in real time using a recording device installed on or connected to the electronic device. This recording method eliminates the need for users to perform operations such as screenshotting, scanning, or taking photos, making it more convenient. Moreover, for electronic pens, it can significantly reduce the user's repetitive process of "lifting the pen to scan - placing the device flat to read," improving the user's experience of reading e-books. The voice data can also be downloaded from the cloud or storage device; that is, users can upload the voice data to the cloud or store it in a storage device. In the embodiments of this application, the voice data is downloaded from the cloud or storage device.
[0088] Because text image data comes from diverse sources and has various formats, it's common to see text image data generated from photographs or screenshots in image format, and text image data obtained through scanning in image or PDF format. Neither image nor PDF formats can be used for semantic recognition. Therefore, text image data in image or PDF formats, which cannot be directly semantically recognized, needs to undergo text recognition to obtain the corresponding recognized text. Text image data generated from text input, however, is already in text format and doesn't require recognition; the input text can be used directly. Similarly, speech data cannot be directly semantically recognized, but speech recognition can be performed to obtain the corresponding recognized text.
[0089] Text image data can be recognized and converted based on existing text recognition technologies, such as Optical Character Recognition (OCR) technology, and speech data can be recognized and converted based on existing speech recognition technologies.
[0090] The recognition text corresponding to the input data content includes two types: text jump instructions and text content.
[0091] The text jump command described above is used to instruct the user to jump to a specific text location within the target text. The specific text location is the target location the user wishes to switch to. This specific text location can be a specific page number or chapter; that is, the user can jump to a specific page number or chapter using the text jump command.
[0092] Text jump instructions can include instruction information and parameter information. Instruction information is an action command, such as "jump to," "jump to," or "turn to," while parameter information is the target location, including specific chapters or page numbers. For example, if a user wants to jump to Chapter 3, Section 3 of a book, they can use "jump to Chapter 3, Section 3" as input data, which is then recognized and converted to obtain the text jump instruction. The input data for a text jump instruction that includes both instruction and parameter information is generally voice data; for example, a user can give a voice command, and in this embodiment, the text jump instruction corresponding to the voice data is obtained. Alternatively, the input data for a text jump instruction that includes both instruction and parameter information can also be text image data; for example, a user can write instructions or edit instructions on a screen device such as a mobile phone or tablet, and in this embodiment, the text jump instruction corresponding to text image data obtained through methods such as taking a picture, scanning, or screenshotting is obtained.
[0093] Text jump instructions can consist of only parameter information. For example, if a user wants to jump to page 40 of a book, "40" can be used as input data, and the text jump instruction can be obtained through recognition and conversion. The input data for text jump instructions that consist of only parameter information is generally text image data. For example, a user can write the instruction or edit the instruction on a screen device such as a mobile phone or tablet. In this embodiment, the text jump instruction corresponding to the text image data obtained by taking a picture, scanning, or taking a screenshot is obtained. In addition, since books generally have page number markings, the page number markings can also be directly photographed, scanned, or screenshotted to obtain the text jump instruction corresponding to the text image data. Text jump instructions that consist of only parameter information can also be voice data. For example, a user can give a voice command. In this embodiment, the text jump instruction corresponding to the voice data is obtained.
[0094] The aforementioned text content refers to the specific content at the target location to which the user is to be redirected. This can be a paragraph of text or a set of words, etc. The purpose is to match the target text with consistent content and then redirect to the location corresponding to that consistent content.
[0095] Correspondingly, the input data for the text content can be text image data, i.e., text image data obtained through methods such as taking photos, scanning, or screenshots. For example, if a user is reading a book in a physical book and wants to locate the same position in the same e-book, they can scan or photograph the content corresponding to the current reading position in the physical book to obtain text image data, which is then recognized and converted to obtain the text content. Similarly, if a user is reading an e-book on their current electronic device and wants to locate the same position in another electronic device, they can scan, photograph, or screenshot the content corresponding to the current reading position on their current electronic device to obtain text image data, which is then recognized and converted to obtain the text content. The input data for the target text can also be voice data, i.e., the user simply reads the content corresponding to the current reading position.
[0096] Furthermore, the embodiments of this application do not limit the language of the input data content and the target text; for example, it can be Chinese, English, or any other language that can be recognized. The languages of the input data content and the target text can be the same or different, and this embodiment does not impose any limitation.
[0097] In the embodiments of this application, the detection method detects whether the identified text corresponding to the input data content contains a text jump instruction or text content, so as to further determine the text positioning result based on the obtained detection result.
[0098] S102. If the identified text contains a text jump instruction, then the text position in the target text that matches the text jump instruction is determined as the text location result.
[0099] If it is determined that the identified text contains a text jump instruction, then the text position in the target text that matches the text jump instruction can be determined as the text location result.
[0100] For example, after obtaining the input data content and determining the corresponding recognition text, the semantic understanding of the recognition text can be directly performed. If a text jump instruction is obtained, the step of detecting the text position that matches the text jump instruction can be executed directly. It should be noted that if the recognition text contains a text jump instruction, the text position that matches the text jump instruction in the recognition text can be detected. If the recognition text does not contain a text jump instruction, the text position that matches the recognition text cannot be detected, and the text location result cannot be determined. In this step, if it is determined through detection that the recognition text contains a text jump instruction, the text position that matches the text jump instruction in the recognition text is determined as the text location result.
[0101] Another example is that after obtaining the input data content and determining the recognition text corresponding to the input data content, if it is determined that the recognition text contains a text jump instruction, the action of detecting the text position that matches the text jump instruction in the target text can be triggered, and then the detected text position that matches the text jump instruction can be determined as the text positioning result.
[0102] If a text jump instruction includes both instruction information and parameter information, such as "jump to page 20", then page 20 will be the text location result. Similarly, "jump to Chapter 3, Section 3" will be the text location result. If the text jump instruction only includes parameter information, such as "20", then page 20 will be the text location result.
[0103] In this embodiment, after determining the text location result, the system jumps to the text position corresponding to the text location result and displays it. It should be noted that if the display screen is too small to display the entire content corresponding to the text jump instruction, then the content of the beginning portion of the target text corresponding to that text position will be displayed. For example, if the display screen cannot display the entire page, the system jumps to page 20 and displays the beginning portion of page 20; similarly, if the display screen cannot display the entire content of a chapter, the system jumps to a specific chapter and displays the beginning portion of that chapter.
[0104] S103. If the identified text does not contain a text jump instruction, the position of the text that matches the identified text retrieved from the target text will be determined as the text location result.
[0105] If it is determined that the identified text does not contain text jump instructions but contains text content, then the position of the text that matches the identified text retrieved from the target text will be determined as the text location result.
[0106] For example, after obtaining the input data content and determining the corresponding recognition text, the step of searching the target text can be directly performed to determine the position of the text matching the recognition text from the target text. It should be noted that if the recognition text contains text content, then text matching the text content in the recognition text can be retrieved from the target text; if the recognition text does not contain text content, then text matching the text content in the recognition text cannot be retrieved from the target text. In this embodiment, if it is determined that the recognition text contains text content, then the position of the text matching the text content in the recognition text is determined as the text location result.
[0107] Another example is that after obtaining the input data content and determining the recognition text corresponding to the input data content, if it is determined that the recognition text contains text content, the action of searching the target text can be triggered again, and the position of the text that matches the recognition text retrieved from the target text can be determined as the text location result.
[0108] The target text is pre-annotated using existing annotation algorithms to classify the e-book into multiple recognition regions. When retrieving the target text based on the recognition regions, each recognition region in the target text is considered a retrieval unit. The similarity between the text corresponding to a recognition region in the target text and the recognition text is calculated. When the similarity between the recognition text and the text corresponding to any recognition region is greater than or equal to a preset hit threshold, the text in that recognition region is determined to be the matching text.
[0109] When retrieving target text, the similarity between the text corresponding to the identified regions in the target text and the identified text can be calculated according to a predetermined arrangement of the identified regions. For example, the similarity between the text corresponding to the identified regions in the target text and the identified text can be calculated according to the order of the identified regions in the target text from front to back; or, the similarity between the text corresponding to the identified regions in the target text and the identified text can be calculated according to the order of the identified regions in the target text from back to front, in order to determine the text that matches the identified text. This embodiment does not impose any limitations.
[0110] To improve retrieval speed, in addition to calculating the similarity between the text corresponding to the identified regions in the target text and the identified text, based on the order of the identified regions in the target text from front to back and from back to front, it is also possible to first determine the position in the target text that the user is likely to read. The position that the user is likely to read is the text location result obtained from the user's previous text location. If the current text location is the first location for this target text, the first page of the target text can be determined as the position that the user is likely to read. Calculating the similarity between the text corresponding to the identified regions in the target text and the identified text, based on the position that the user is likely to read, and proceeding backwards or forwards from the starting position, makes it easier to identify the text that matches the identified text in a shorter time.
[0111] After determining the text location result, jump to the text position corresponding to the text location result and display it.
[0112] In this embodiment, when a user reads to a certain position in a physical book, they can quickly locate the same position in the e-book based on the input data, making it convenient and effectively improving reading efficiency. Furthermore, this application allows for voice control, further enhancing ease of use. Applying this solution to a scanning pen allows users to quickly locate the same position in the physical book using both the scanning pen and a physical book, effectively improving reading efficiency. Moreover, when using voice as input data, users do not need to scan text, reducing the repetitive "pen-scanning-reading" process and further enhancing convenience.
[0113] In one alternative embodiment, such as Figure 2 As shown, the steps in the above embodiment for detecting whether the recognized text corresponding to the input data content contains a text jump instruction include the following steps:
[0114] S201. By performing semantic understanding on the identified text, detect text jump indication information from the identified text.
[0115] Semantic understanding is performed on the identified text to facilitate the detection of text jump instructions from the identified text.
[0116] For example, text jump instructions include command information and parameter information. The command information is an action command, such as "jump to," "jump to," or "turn to," while the parameter information is the target location, such as the specific chapter or page number. Alternatively, text jump instructions may only include parameter information.
[0117] In this embodiment, an existing semantic recognition engine is used to perform semantic understanding on the recognized text to obtain corresponding instruction information and parameter information, or only parameter information. Those skilled in the art can refer to existing technologies for the specific process of semantic understanding, and this embodiment will not elaborate further. It should be noted that the semantic recognition engine can be deployed locally on the electronic device using the text localization method of this embodiment, or it can be deployed in the cloud; this embodiment does not impose any limitations.
[0118] S202. Determine whether text jump instruction information is detected in the recognized text. If text jump instruction information is detected in the recognized text, proceed to S203. If no text jump instruction information is detected in the recognized text, the step ends.
[0119] In this step, it is determined whether a text jump instruction is detected in the identified text. If a text jump instruction is detected in the identified text, step S203 can be executed; otherwise, this step ends.
[0120] S203. Determine that the identified text contains a text jump instruction.
[0121] If a text jump instruction is detected in the identified text, then in this embodiment, it can be determined that the identified text contains a text jump instruction, and the text position in the target text that matches the text jump instruction is determined as the text location result.
[0122] In this embodiment, by detecting the recognized text corresponding to the input data content, it is determined whether the recognized text includes text jump instruction information, and thus whether the recognized text contains a text jump instruction. If a text jump instruction is contained, the user jumps to the corresponding specific text position, effectively improving the user's reading efficiency.
[0123] In an optional embodiment, when the steps of the above embodiments detect text jump indication information from the identified text, the following steps are further included:
[0124] Determine whether the text jump instruction information meets the scene instruction conditions; if the text jump instruction information meets the scene instruction conditions, then determine that the identified text contains a text jump instruction, and identify the detected text jump instruction information as a text jump instruction; if the text jump instruction information does not meet the scene instruction conditions, then determine that the identified text does not contain a text jump instruction.
[0125] The aforementioned scenario instruction conditions include the conditions that text jump instruction information should meet as a text jump instruction in the current scenario. By setting scenario instruction conditions, the text jump instruction information can be restricted according to the current scenario, avoiding misidentification of all content that formally meets the requirements of text jump instruction information as jump instruction information, thereby avoiding obtaining incorrect text location results.
[0126] If the text jump instruction information meets the scene instruction conditions, it is determined that the identified text contains a text jump instruction, and the detected text jump instruction information is identified as a text jump instruction; if the text jump instruction information does not meet the scene instruction conditions, it is determined that the currently parsed content only conforms to the text jump information in form, and cannot be used to confirm that the identified text contains a text jump instruction.
[0127] In the embodiments of this application, scene instruction conditions are added as restrictions on text jump indication information to avoid misidentifying all content that meets the requirements of text jump indication information in form as jump indication information, thereby improving the accuracy of text positioning.
[0128] In an optional embodiment, the steps of the above embodiments to determine whether the text jump instruction information meets the scene instruction conditions specifically include the following steps:
[0129] Determine whether the language of the text jump instruction information is the same as that of the target text; if the language of the text jump instruction information is different from that of the target text, then determine that the text jump instruction information meets the scene instruction conditions.
[0130] Specifically, in this embodiment, it is detected whether the language of the text jump indication information is the same as that of the target text. If the language of the text jump indication information is the same as that of the target text, then there is a possibility that the content detected from the identified text is structurally similar to the text jump indication information, but its corresponding content is the content in the target text and does not indicate a specific text position.
[0131] For example, if a user reads a certain section of a book in a physical book and wants to locate the same section in the same e-book, the recognized text corresponding to the user's input data is the text content at the section the user reads in the physical book, which is "Jump to Chapter 3". This is similar in structure to the text jump instruction information, but instead of indicating to jump to Chapter 3, it indicates to jump to the location in the target text that contains the content "Jump to Chapter 3".
[0132] If, in this situation, the identified text contains text jump instruction information, and the detected text jump instruction information is determined to be a text jump instruction, it will lead to a false jump. Therefore, in this embodiment, if the detected text jump instruction information is in the same language as the target text, it is determined that the text jump instruction information does not meet the scene instruction conditions; if the detected text jump instruction information is in a different language than the target text, it can be determined that the content detected from the identified text is not the content of the target text, and the text jump instruction information meets the scene instruction conditions.
[0133] In this embodiment, when the text jump instruction information is in a different language than the target text, it is determined that the text jump instruction information meets the scene instruction conditions, and the detected text jump instruction information is identified as a text jump command to avoid misidentification. In such cases, this embodiment determines the text location result by retrieving the position of the text that matches the identified text from the target text.
[0134] In one alternative embodiment, such as Figure 3 As shown, the steps in the above embodiment for detecting whether the recognized text corresponding to the input data content contains a text jump instruction also include the following steps:
[0135] S301. Detect text location information from the recognized text.
[0136] The aforementioned text location information includes information that indicates the specific location of a particular text position within the target text, including page numbers, which are generally numerical text. In embodiments of this application, it is detected whether the identified text includes numerical text that meets the page number requirements of the target text. If the identified text includes numerical text that meets the page number requirements of the target text, it indicates that the identified text contains text location information.
[0137] S302. Determine whether the identified text contains text location information. If the identified text contains text location information, proceed to S303. If the identified text does not contain text location information, this step ends.
[0138] In this embodiment, it is determined whether the identified text contains text location information. If the identified text contains text location information, then S303 is executed. If the identified text does not contain text location information, then this step ends.
[0139] S303. Determine that the identified text contains a text jump instruction.
[0140] If the identified text contains text location information, it means that the identified text contains a text jump instruction.
[0141] In this embodiment, by detecting the identified text, it is determined whether the identified text contains text location information, and then it can be determined whether the identified text contains a text jump instruction. If a text jump instruction is contained, the user jumps to the corresponding specific text location, effectively improving the user's reading efficiency.
[0142] In an optional embodiment, the steps of the above embodiments for detecting and identifying whether the text contains text location information specifically include the following steps:
[0143] Determine whether the identified text is a page number; if the identified text is a page number, then determine that the identified text contains text location information.
[0144] Specifically, in this embodiment, the system detects whether the identified text is a page number. If the identified text is numerical text that meets the page number requirements of the target text, then the identified text is determined to be a page number.
[0145] The page number requirements for the target text include requirements for the text format, text length, and corresponding numerical values. The format requirement means the text location information must be in numerical form, such as Arabic numerals, Chinese numerals, or Roman numerals. The text length requirement means the length of the text location information cannot exceed the maximum page number length of the target text. For example, if the target text has a maximum of 200 pages, and 200 pages is 10 units long, then the length of the text location information cannot exceed 10 units. The numerical requirement means the value corresponding to the text location information cannot be greater than the maximum page number of the target text. For example, if the target text has a maximum of 200 pages, then the value corresponding to the text location information cannot be greater than 200.
[0146] The engine for detecting whether text contains text location information can be deployed locally on the electronic device that applies the text location method of this embodiment, or it can be deployed in the cloud. This embodiment does not limit this.
[0147] Furthermore, it should be noted that the input data includes text image data and / or audio data, obtained through taking photos, scanning, screenshots, or recordings. To accurately determine whether the text length of the text location information meets the page number length requirements, the format of the recognized text needs to be adjusted after converting the input data into recognized text, so that the format of the recognized text is consistent with the page number format in the target text.
[0148] If, after evaluation, the identified text does not meet the page number requirements of the target text, then the identified text is not a page number. If the identified text meets the page number requirements of the target text, then the identified text is a page number.
[0149] In this embodiment, by determining whether the identified text meets the page number requirements of the target text, it is determined whether the identified text is a page number. If the identified text is a page number, it is determined that the identified text contains text location information. This setting can effectively determine whether the identified text contains text location information, and thus whether the identified text contains a text jump instruction. If a text jump instruction is contained, the user jumps to the corresponding specific text location, effectively improving the user's reading efficiency.
[0150] In one alternative embodiment, such as Figure 4 As shown, the steps in the above embodiment to determine whether the identified text is a page number specifically include the following:
[0151] S401. Determine whether the length of the identified text is within the page length threshold of the target text; if the length of the identified text is within the page length threshold of the target text, then execute S402; if the length of the identified text is not within the page length threshold of the target text, then execute S405.
[0152] In this embodiment, when the identified text meets the text format requirements, text length requirements, and corresponding numerical requirements of the target text page number, it indicates that the identified text corresponding to the input data content is a page number.
[0153] Among these methods, determining whether the identified text meets the text length requirement involves the least computation and is the fastest. Therefore, this implementation first checks whether the text length of the identified text is within the page number length threshold of the target text. If the text length of the identified text exceeds the page number length threshold of the target text, S405 can be executed directly to determine that the identified text is not a page number, and thus to determine that the identified text does not contain text position information or text jump instructions. It is then unnecessary to further determine whether the identified text meets the text format requirements or the corresponding numerical requirements.
[0154] If the text length of the identified text is determined to be within the page number length threshold, it means that the identified text meets one of the above three requirements. S402 needs to be executed to determine whether the identified text meets the remaining two requirements.
[0155] S402. Determine whether the identified text contains only numerical text. If the identified text contains only numerical text, proceed to S403. If the identified text contains non-numerical text, proceed to S405.
[0156] If the detected text length is within the page number length threshold of the target text, it is also necessary to check whether the detected text meets the text format requirements and the corresponding numerical requirements.
[0157] Among these steps, the computational workload for detecting whether the identified text conforms to the text format requirements is relatively small and the calculation speed is relatively fast. Therefore, in this implementation, the detection method checks whether the identified text contains only numerical text. If non-numerical text is also detected, it can be determined that the identified text does not conform to the text format requirements. In this case, step S405 can be executed directly to determine that the identified text is not a page number, and thus it can be determined that the identified text does not contain text position information or text jump instructions. It is not necessary to further determine whether the identified text conforms to the corresponding numerical requirements.
[0158] If it is determined that the identified text contains only numerical text and the identified text meets the text form requirements, it means that the identified text meets two of the above three requirements, and further execution of S403 is required to determine whether the identified text meets the remaining requirement.
[0159] S403. Determine whether the value corresponding to the identified text is within the page number value threshold of the target text; if the value corresponding to the identified text is within the page number value threshold of the target text, then execute S404; if the value corresponding to the identified text is not within the page number value threshold of the target text, then execute S405.
[0160] If the detected text length is within the page number length threshold of the target text and meets the text format requirements, it is also necessary to check whether the detected text meets the corresponding numerical requirements.
[0161] If the value corresponding to the identified text is not within the page number value threshold of the target text, it can be determined that the identified text does not meet the value requirements corresponding to the text. S405 can be executed to determine that the identified text is not a page number, and further determine that the identified text does not contain text position information and does not contain text jump instructions.
[0162] If the value corresponding to the identified text is detected to be within the page number value threshold of the target text, it means that the identified text meets the above three requirements, and the identified text is determined to be a page number.
[0163] S404. Determine that the recognition text corresponding to the input data content is the page number.
[0164] If, after evaluation, the identified text is determined to meet the requirements for text format, text length, and corresponding numerical value of the target text, then the identified text is a page number.
[0165] S405. Determine that the recognition text corresponding to the input data content is not a page number.
[0166] If, after evaluation, it is determined that the identified text does not meet the text format requirements, text length requirements, or corresponding numerical requirements of the target text, then the identified text is not a page number.
[0167] In the embodiments of this application, the text is detected in the order of whether the identified text meets the text format requirements of the target text, whether it meets the text length requirements, and whether it meets the corresponding numerical requirements of the text. This can effectively improve the detection speed and shorten the detection time.
[0168] It should be noted that if the calculation speed of the above items changes due to optimization of the calculation method, then in this embodiment, the detection order can be adjusted according to the speed, and the items with faster calculation speed can be detected first.
[0169] In one alternative embodiment, such as Figure 5 As shown, the steps in the above embodiments determine the location of the text that matches the identified text retrieved from the target text as the text location result, specifically including the following:
[0170] S501. Retrieve text that matches the identified text from the first retrieval area of the target text.
[0171] In this embodiment, if the identified text does not contain a text jump instruction, the action corresponding to the step of retrieving text that matches the identified text from the first retrieval area of the target text can be triggered.
[0172] The aforementioned first search area includes the text area where the current text position is located and the text areas adjacent to the current text position. Specifically, in this embodiment, the text area where the current text position is located includes the area corresponding to the page where the current text position is located or the area corresponding to the chapter where the current text position is located; the text areas adjacent to the current text position include the areas corresponding to the preceding and / or following pages of the page where the current text position is located, or the text areas corresponding to the preceding and / or following chapters of the chapter where the current text position is located.
[0173] The current text position mentioned above includes the text positioning result obtained from the previous text positioning or the preset position. The text positioning result obtained from the previous text positioning refers to the position obtained by the user when locating the target text last time, that is, the user's previous reading position. When the user performs text positioning again, the target position that the user needs to locate is very likely to be near the previous reading position.
[0174] Therefore, in this embodiment, the retrieval is preferentially performed from the text region where the current text position is located and the text regions adjacent to the current text position, making it easier to determine the text that matches the identified text in a shorter time.
[0175] It should also be noted that during the current use of the electronic device employing the text positioning method of this embodiment, when performing the first text positioning, the current text position refers to the text positioning result of the last text positioning operation performed when the electronic device was previously used. During the current use of the electronic device, when performing text positioning for the Tth time, where T is an integer greater than 1, the current text position refers to the text positioning result corresponding to the (T-1)th text positioning operation. Furthermore, if the user is reading the target text for the first time and has not performed text positioning before, or if the user is not reading the target text for the first time but the history of text positioning results has been deleted, then the text positioning result obtained from the previous text positioning does not exist. In this case, a preset position can be used as the current text position. For example, the homepage of the target text can be used as the preset position.
[0176] S502. Determine whether a text matching the identified text is retrieved from the first search area of the target text; if a text matching the identified text is retrieved from the first search area of the target text, then execute S503; if no text matching the identified text is retrieved from the first search area of the target text, then execute S504.
[0177] Each identification region in the first retrieval area is identified. The identification regions are obtained by resource annotation using existing annotation algorithms. The similarity between the text in each identification region and the identified text in the first retrieval area is calculated. When the similarity between the identified text and the text corresponding to any identification region is greater than or equal to a preset hit threshold, the text in that identification region is determined to be the text that matches the identified text.
[0178] It should be noted that the similarity between the text in the recognition area and the recognized text can be calculated using existing text similarity calculation methods, and this embodiment does not limit it.
[0179] In this embodiment, it is determined whether a text matching the identified text is retrieved from the first retrieval area of the target text. If a text matching the identified text is retrieved from the first retrieval area of the target text, S503 is executed; if no text matching the identified text is retrieved from the first retrieval area of the target text, S504 is executed to perform further retrieval.
[0180] S503. The position of the text that matches the identified text and is retrieved from the first retrieval area of the target text is determined as the text location result.
[0181] If a matching text is found in the first search area of the target text, the text location result can be determined by the position of the matching text found in the first search area of the target text.
[0182] S504. The location of the text that matches the identified text and is retrieved from the second retrieval area of the target text is determined as the text location result.
[0183] If no matching text is found in the first search area of the target text, the second search area is searched, and the similarity between the text in each recognition area of the second search area and the recognition text is calculated. When the similarity between the recognition text and the text corresponding to any recognition area is greater than or equal to a preset hit threshold, the text in that recognition area is determined to be the matching text.
[0184] The second search area includes the area in the target text other than the first search area, specifically all areas other than the first search area.
[0185] Furthermore, this step can be triggered not by the event that the identified text does not contain a text jump instruction, but by, after acquiring the input data and determining the corresponding identified text, first searching the first search area to determine if any text matching the identified text is found. If no matching text is found in the first search area, a second search area can be searched to determine if any matching text is found in the second search area. If the identified text contains text content, then matching text can be found in either the first or second search area.
[0186] If, after detection, it is determined that the identified text does not contain text jump instructions but contains text content, the search results described above can be directly used. Specifically, if text matching the text content in the identified text is found in the first search area, the position of the text matching the identified text found in the first search area of the target text will be used to determine the text location result; if text matching the text content in the identified text is found in the second search area, the position of the text matching the identified text found in the second search area of the target text will be used to determine the text location result.
[0187] In this embodiment, the text matching the identified text is retrieved first from the first search area adjacent to the current text position. If the text matching the identified text cannot be retrieved from the first search area, the remaining second search area is searched. This makes it easier to determine the text matching the identified text in a shorter time and improves retrieval efficiency.
[0188] In an optional embodiment, the steps of the above embodiments determine the position of the text that matches the identified text retrieved from the target text as the text location result, specifically including the following:
[0189] If the number of positions of text matching the identified text retrieved from the first search area of the target text is one, then the position of the text matching the identified text retrieved from the first search area of the target text is determined as the text location result; if the number of positions of text matching the identified text retrieved from the first search area of the target text is at least two, then the positions of each of the retrieved texts matching the identified text are output, and the text location result is determined according to the selection instructions provided by the user.
[0190] If the identified text is a high-frequency word in the target text or the identified text is too short, it may result in multiple positions of text matching the identified text being retrieved from the first retrieval area of the target text. In such cases, the positions of each of the retrieved texts matching the identified text can be output so that the user can select a text position from at least two positions matching the identified text and receive a selection instruction. In this embodiment, the text location result is determined based on the user's selection instruction.
[0191] If the number of positions of text matching the identified text retrieved from the first search area of the target text is only one, then the position of the text matching the identified text retrieved from the first search area of the target text is determined as the text location result, and no user feedback is required.
[0192] In this embodiment, when there are multiple text locations that match the identified text, the user manually locates the text to avoid directly determining the wrong text location result, which would affect the user experience.
[0193] Similarly, if the number of positions of texts that match the identified text retrieved from the second retrieval area of the target text is one, then the position of the text that matches the identified text retrieved from the second retrieval area of the target text is determined as the text location result; if the number of positions of texts that match the identified text retrieved from the second retrieval area of the target text is at least two, then the positions of each of the retrieved texts that match the identified text are output, and the text location result is determined according to the selection instructions provided by the user.
[0194] In an optional embodiment, the steps of the above embodiments retrieve the positions of text matching the identified text from the second retrieval area of the target text, specifically including the following:
[0195] Retrieve text that matches the identified text from the second retrieval area of the target text; if text that matches the identified text is found from the second retrieval area of the target text, determine the text location result based on the position of the text that matches the identified text from the second retrieval area of the target text; if no text that matches the identified text is found from the second retrieval area of the target text, output a prompt message to prompt the user to re-enter the data content.
[0196] Specifically, the similarity between the text in each recognition region in the second retrieval region and the recognized text is calculated. When the similarity between the recognized text and the text corresponding to any recognition region is greater than or equal to a preset hit threshold, the text in that recognition region is determined to be the text that matches the recognized text. Based on the position of the text that matches the recognized text retrieved from the second retrieval region of the target text, the text location result is determined.
[0197] When the similarity between the identified text and the text corresponding to any identified region is less than the preset hit threshold, and no matching text can be found in the second retrieval region of the target text, a prompt message can be output so that the user can re-enter the above input data content according to the prompt message.
[0198] In the embodiments of this application, if no text matching the identified text can be found through the second search area, the user can be prompted to re-enter the above input data.
[0199] In one optional embodiment, the first search area includes a first interval and a second interval;
[0200] The steps in the above embodiments retrieve text that matches the identified text from the first retrieval area of the target text, specifically including the following:
[0201] Retrieve text that matches the identified text from the first interval of the target text; the first interval includes the page where the current text position is located and M pages after the current text position; if no text matching the identified text is found from the first interval of the target text, then retrieve text that matches the identified text from the second interval of the target text; the second interval includes N pages before the current text position, where M and N are both positive integers.
[0202] Specifically, reading from front to back according to the page numbers is the reading habit of most people. Therefore, the probability that the target location corresponding to the user's current text positioning is after the current text position is greater than the probability that it is before the current text position.
[0203] Therefore, in this embodiment, the search is first performed in the first interval of the target text, that is, the page where the current text is located and the M pages after the current text, to determine whether text matching the identified text can be retrieved. If text matching the identified text is retrieved in the first interval of the target text, the position of the text matching the identified text retrieved in the first interval of the target text is determined as the text location result.
[0204] If no matching text is found in the first interval of the target text, the search continues in the second interval of the target text, which is N pages before the current text position. If a matching text is found in the second interval of the target text, the position of the matching text is determined as the text location result. If no matching text is found in the second interval of the target text, further searching can be performed in the second search area of the target text.
[0205] The specific values of M and N can be determined based on the user's reading speed. For example, if the user's reading speed is detected to be fast, larger values of M and N can be set to facilitate the retrieval of text matching the identified text in the first or second interval; if the user's reading speed is detected to be slow, smaller values of M and N can be set to facilitate the retrieval of text matching the identified text quickly in the first or second interval.
[0206] In the embodiments of this application, when searching for the first search area, priority is given to searching the page containing the current text position and the M pages following the current text position. If no text matching the identified text is found by searching the page containing the current text position and the M pages following the current text position, then the N pages preceding the previous text position are searched. This search method conforms to the reading habits of most users, making it easier to determine the text matching the identified text in a shorter time, thus improving search efficiency.
[0207] In one optional embodiment, the page containing the current text position, and each of the M pages following the current text position, corresponds to a different hit threshold; such as Figure 6 As shown, the steps in the above embodiments for retrieving text that matches the identified text from the first interval of the target text specifically include the following steps:
[0208] S601. Retrieve and identify text that matches the text from each page of the first interval.
[0209] In the embodiments of this application, the page containing the current text position, and each of the M pages following the current text position, corresponds to a different hit threshold. In this embodiment, text matching the identified text is retrieved from each page of the first region. That is, the similarity between the text corresponding to each identified region in each page of the first region and the identified text is calculated.
[0210] S602. Determine whether a text with a similarity greater than the corresponding hit threshold is found in any page of the first interval. If a text with a similarity greater than the corresponding hit threshold is found in any page of the first interval, proceed to S603. If no text with a similarity greater than the corresponding hit threshold is found in any page of the first interval, this step ends.
[0211] In this step, it is detected whether any text with a similarity greater than the hit threshold corresponding to the identified text is retrieved from any page in the first interval.
[0212] S603. Determine the text that matches the identified text retrieved from this page.
[0213] In this embodiment, the page containing the current text position, and each of the M pages following the current text position, corresponds to a different hit threshold.
[0214] The aforementioned hit thresholds can be set based on the user's reading habits. For example, when a user locates text, the target location they need to locate is very likely to be near their previous reading position. Therefore, the closer a page is to the current text position, the lower its corresponding hit threshold can be set, making it easier to hit the target page. If text with a similarity greater than the hit threshold for that page is found on any page in the first interval, then it is determined that a matching text has been retrieved from that page.
[0215] For example, if the current text location is on page 15, the value of M is 3, and the subsequent M pages are pages 16, 17, and 18 respectively. The hit threshold can be set to be the lowest for page 15, gradually increasing from page 16 to page 18. For example, the hit threshold can be set to a minimum of 80% for page 15, 85% for page 16, 90% for page 17, and 95% for page 18.
[0216] When calculating similarity, if the similarity between the text on page 15 and the identified text is 82%, which is greater than the hit threshold for page 15, then it is determined that text matching the identified text was retrieved on page 15. If the similarity between the text on page 16 and the identified text is also 82%, but less than the hit threshold for page 16, then it is determined that no text matching the identified text was retrieved on page 16. If the similarity between the text on page 17 and the identified text is 89%, which is less than the hit threshold for page 17, then it is determined that no text matching the identified text was retrieved on page 17. If the similarity between the text on page 18 and the identified text is 91%, which is greater than the hit threshold for page 18, then it is determined that text matching the identified text was retrieved on page 18. In this example, since text matching the identified text was retrieved from both pages 15 and 18, the positions of each retrieved text matching the identified text need to be output, and the text location result is determined based on the user's selection instructions.
[0217] If a text with a similarity greater than the corresponding hit threshold is found on any page in the first interval, it is determined that no text matching the identified text was found on that page, and this step ends.
[0218] In the embodiments of this application, different hit thresholds are set for each page of the first interval based on the user's reading habits, making it easier to determine the text that matches the identified text in a shorter time and improving retrieval efficiency.
[0219] Similarly, when searching in the second region and the second search region, different hit thresholds can be set for each page according to the user's reading habits. When the similarity between the identified text and the text on that page is greater than the hit threshold of that page, it means that a text matching the identified text has been retrieved on that page.
[0220] In an optional embodiment, the text location method of the above embodiments further includes:
[0221] Obtain a voice wake-up command; based on the voice wake-up command, control the recording device to start recording.
[0222] Specifically, in this embodiment, a voice wake-up command can be obtained, and then the recording device can be automatically turned on to record according to the voice wake-up command to obtain voice data, avoiding the need for the user to manually control the recording switch and improving convenience.
[0223] In an optional embodiment, based on the above embodiments, a first engine for detecting whether the identified text contains text location information and for retrieving the location of text matching the identified text from the target text can be deployed locally on the electronic device applying the text location method of this embodiment, while a second engine for performing semantic understanding on the identified text and detecting the location of text matching the text jump instruction if a text jump instruction is obtained can be deployed in the cloud.
[0224] After obtaining the input data, the input data needs to be concatenated and transformed to obtain the recognized text. The recognized text is then sent to the first engine and the second engine for processing.
[0225] The first engine determines whether the identified text includes text location information. If the identified text includes text location information, it determines that the identified text includes a text jump instruction, and the text location in the target text that matches the text jump instruction is determined as the text location result. If it determines that the identified text does not include text location information, it needs to retrieve text that matches the identified text from the target text, and the text location in the target text that matches the text jump instruction is determined as the text location result. If it determines that the identified text does not include text location information, and it is also impossible to retrieve text that matches the identified text from the target text, the first engine will not output a text location result or will output a text location result that is identified.
[0226] The second engine is used to perform semantic understanding on the identified text to determine whether the identified text includes instruction information. If the identified text includes instruction information, it is determined that the identified text contains a text jump instruction, and the text position in the target text that matches the text jump instruction is determined as the text positioning result. If it is determined that the identified text does not contain instruction information, the second engine will not be able to output the text positioning result or will output the text positioning result of the positioning identification.
[0227] In this embodiment, the first engine is located locally, and the second engine is located in the cloud. Compared to the second engine, the first engine does not require long-distance signal transmission. Therefore, under normal circumstances, the calculation result of the first engine is obtained first. In this embodiment, a preset time can be set to detect whether the calculation result of the second engine is obtained within the preset time. If the calculation result of the second engine is obtained within the preset time and the calculation result of the second engine is valid, then the calculation result of the second engine is determined as the text location result. If the calculation result of the second engine is not obtained within the preset time, or the calculation result of the second engine is invalid, then the calculation result of the first engine is determined as the text location result. In addition, if neither the calculation result of the first engine nor the calculation result of the second engine is obtained within the preset time, the user can be prompted to re-enter the information.
[0228] It should also be noted that during the calculation process of the first engine, if the text jump indication information and the target text are in the same language, there is a possibility that the content detected from the recognized text has a similar structure to the text jump indication information, but its corresponding content is content in the target text and does not indicate a specific text location. If the recognized text is determined to contain text jump indication information in this case, the second engine will identify the detected text jump indication information as a text jump instruction. If the calculation result of the second engine is not identified as the text location result, it will lead to false jumps.
[0229] Therefore, in the embodiments of this application, after obtaining the calculation results of the first engine and the second engine, that is, after the second engine detects the text position in the target text that matches the text jump instruction, and the first engine retrieves the text that matches the identified text from the target text, it further detects whether the text jump instruction information is the same language as the target text. If the text jump instruction information is the same language as the target text, the calculation result of the first engine is determined as the text positioning result; if the text jump instruction information is not the same language as the target text, the calculation result of the second engine is determined as the text positioning result.
[0230] Corresponding to the above-described text localization method, this application also discloses a text localization device, see [link to relevant documentation]. Figure 7As shown, the device includes:
[0231] The detection module 100 is used to detect whether the recognized text corresponding to the input data content contains a text jump instruction; wherein, the input data content includes text image data and / or voice data; the text jump instruction is used to indicate a jump to a specific text position in the target text;
[0232] The first determining module 110 is used to determine the text position in the target text that matches the text jump instruction as the text positioning result if the identified text contains a text jump instruction;
[0233] The second determining module 120 is used to determine the position of the text that matches the identified text retrieved from the target text as the text location result if the identified text does not contain a text jump instruction.
[0234] With the aforementioned device, when a user reads to a certain position in a paper book, they can quickly locate the same position in the e-book based on the input data, making it convenient and effectively improving reading efficiency. Furthermore, this application allows for voice control, further enhancing ease of use. Applying this solution to a scanning pen, when a user alternates between using the scanning pen and a paper book to read the same book, the scanning pen can quickly locate the same position in the paper book, effectively improving reading efficiency. Moreover, when using voice as input data, the user does not need to scan text, thus reducing the repetitive process of "holding the pen to scan - laying it flat to read," further enhancing convenience.
[0235] Optionally, in another embodiment of this application, the detection module 100 includes:
[0236] The first detection unit is used to detect text jump indication information from the recognized text by performing semantic understanding on the recognized text.
[0237] The first determining unit is configured to determine that the identified text contains a text jump instruction if text jump instruction information is detected in the identified text.
[0238] Optionally, in another embodiment of this application, the detection module 100 further includes:
[0239] The judgment unit is used to determine whether the text jump instruction information meets the scene instruction conditions; the scene instruction conditions include the conditions that the text jump instruction information should meet as a text jump instruction in the current scene.
[0240] The second determining unit is used to determine that the identified text contains a text jump instruction if the text jump instruction information meets the scene instruction conditions, and to determine the detected text jump instruction information as a text jump instruction.
[0241] The third determining unit is used to determine that the identified text does not contain a text jump instruction if the text jump instruction information does not meet the scene instruction conditions.
[0242] Optionally, in another embodiment of this application, the determining unit includes:
[0243] The first judgment subunit is used to determine whether the language of the text jump instruction information is the same as that of the target text;
[0244] The first determining subunit is used to determine if the text jump instruction information conforms to the scene instruction conditions if the language of the text jump instruction information is different from that of the target text.
[0245] Optionally, in another embodiment of this application, the detection module 100 includes:
[0246] The second detection unit is used to detect whether the text contains text location information.
[0247] The fourth determining unit is used to determine that the identified text contains a text jump instruction if the identified text contains text location information.
[0248] Optionally, in another embodiment of this application, the second detection unit includes:
[0249] The second judgment subunit is used to determine whether the recognized text is a page number;
[0250] The second determining subunit is used to determine that the identified text contains text location information if the identified text is a page number.
[0251] Optionally, in another embodiment of this application, the second determining subunit is specifically used for:
[0252] Determine whether the length of the identified text is within the page number length threshold of the target text;
[0253] If the length of the identified text is within the page number length threshold of the target text, then determine whether the identified text contains only numerical text.
[0254] If the identified text contains only numerical text, then determine whether the numerical value corresponding to the identified text is within the page number value threshold of the target text;
[0255] If the numerical value corresponding to the identified text is within the threshold of the page number value of the target text, then the identified text is determined to be a page number.
[0256] Optionally, in another embodiment of this application, the second determining module 120 includes:
[0257] The retrieval unit is used to retrieve text that matches the identified text from a first retrieval area of the target text; the first retrieval area includes the text area where the current text position is located and the text area adjacent to the current text position, and the current text position includes the text positioning result obtained from the previous text positioning or a preset position;
[0258] The fourth determining unit is used to determine the position of the text that matches the identified text retrieved from the first retrieval area of the target text as the text location result if a text matching the identified text is retrieved from the first retrieval area of the target text.
[0259] The fifth determining unit is used to determine the position of the text that matches the identified text retrieved from the second retrieval area of the target text as the text location result if no text matching the identified text is retrieved from the first retrieval area of the target text; the second retrieval area is adjacent to the first retrieval area.
[0260] Optionally, in another embodiment of this application, the fourth determining unit includes:
[0261] The third determining subunit is used to determine the position of the text that matches the identified text retrieved from the first retrieval area of the target text as the text location result if the number of positions of the text that matches the identified text retrieved from the first retrieval area of the target text is one.
[0262] The fourth determining subunit is used to output the positions of each text that matches the identified text if the number of positions of the texts retrieved from the first retrieval area of the target text is at least two, and to determine the text location result according to the selection instructions provided by the user.
[0263] The selection instructions include instructions for the user to select a text location from at least two locations of text that match the identified text.
[0264] Optionally, in another embodiment of this application, the fifth determining unit includes:
[0265] The first retrieval subunit is used to retrieve text that matches the identified text from the second retrieval area of the target text;
[0266] The fifth determining subunit is used to determine the text location result based on the position of the text that matches the identified text retrieved from the second retrieval area of the target text if a text matching the identified text is retrieved from the second retrieval area of the target text.
[0267] The prompt subunit is used to output a prompt message if no text matching the identified text is found in the second search area of the target text. The prompt message is used to prompt the user to re-enter the input data.
[0268] Optionally, in another embodiment of this application, the first search area includes a first interval and a second interval;
[0269] The retrieval unit includes:
[0270] The second retrieval subunit is used to retrieve text that matches the identified text from the first interval of the target text; the first interval includes the page where the current text position is located and M pages after the current text position;
[0271] The third retrieval subunit is used to retrieve a text that matches the identified text from the second interval of the target text if no text matching the identified text is retrieved from the first interval of the target text. The second interval includes N pages before the current text position, where M and N are both positive integers.
[0272] Optionally, in another embodiment of this application, the page where the current text position is located, and each of the M pages following the current text position, corresponds to a different hit threshold;
[0273] The second retrieval subunit is used for:
[0274] Retrieve and identify text that matches the text from each page of the first interval;
[0275] If a text with a similarity greater than the corresponding hit threshold is found on any page of the first interval, then it is determined that a text matching the identified text has been retrieved from that page.
[0276] For details on the specific operation of each unit of the aforementioned text positioning device, please refer to the above method embodiments; they will not be repeated here.
[0277] Another embodiment of this application also provides an electronic device, see [link to relevant documentation] Figure 8 As shown, the device includes:
[0278] Memory 200 and first processor 210;
[0279] The memory 200 is connected to the first processor 210 and is used to store programs;
[0280] The first processor 210 is configured to implement the text positioning method disclosed in any of the above embodiments by running a program stored in the memory 200.
[0281] Specifically, the aforementioned electronic device may also include: a bus, a communication interface 220, an input device 230, and an output device 240.
[0282] The first processor 210, memory 200, communication interface 220, input device 230, and output device 240 are interconnected via a bus. Wherein:
[0283] A bus can include a pathway for transmitting information between various components of a computer system.
[0284] The first processor 210 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present application. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0285] The first processor 210 may include a main processor, as well as a baseband chip, modem, etc.
[0286] The memory 200 stores a program for executing the technical solution of this application, and may also store an operating system and other critical business functions. Specifically, the program may include program code, which includes computer operation instructions. More specifically, the memory 200 may include read-only memory (ROM), other types of static storage devices capable of storing static information and instructions, random access memory (RAM), other types of dynamic storage devices capable of storing information and instructions, disk storage, flash memory, etc.
[0287] Input device 230 may include a device for receiving user input data and information, such as a keyboard, mouse, camera, scanner, light pen, voice input device, touch screen, pedometer, or gravity sensor.
[0288] Output device 240 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0289] The communication interface 220 may include a device that uses any transceiver to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0290] The first processor 210 executes the program stored in the memory 200 and calls other devices, and can be used to implement the various steps of the text positioning method provided in the above embodiments of this application.
[0291] Another embodiment of this application also provides a scanning pen, such as Figure 9 As shown, the scanning pen includes a second processor 300, a display screen 310 connected to the second processor 300, and a voice acquisition unit 320 and / or a text image acquisition unit 330 connected to the second processor 300. Figure 9 The scanning pen corresponding to the illustrated embodiment includes a voice acquisition component 320 and a text image acquisition component 330.
[0292] Voice acquisition component 320 is used to acquire voice data;
[0293] Text image acquisition component 330 is used to acquire text image data;
[0294] The second processor 300 is used to detect whether the recognized text corresponding to the input data content contains a text jump instruction; wherein, the input data content includes text image data and / or voice data; the text jump instruction is used to indicate a jump to a specific text position in the target text; if the recognized text contains a text jump instruction, the text position in the target text that matches the text jump instruction is determined as the text positioning result; if the recognized text does not contain a text jump instruction, the position of the text retrieved from the target text that matches the recognized text is determined as the text positioning result.
[0295] Display screen 310 is used to display text content corresponding to the text location result sent by the first processor.
[0296] The voice acquisition component 320 can be a voice input device.
[0297] The text image acquisition component 330 can be a keyboard, mouse, camera, scanner, light pen, touch screen, etc.
[0298] The second processor 300 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present application. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0299] When users use the scanning pen and paper book in the above embodiments to read the same book, they can quickly locate the same position on the paper book on the scanning pen, which effectively improves the user's reading efficiency. Moreover, when using voice as input data, users do not need to scan the text, thereby reducing the user's repeated "holding the pen to scan - laying it flat to read" process and further improving convenience.
[0300] Optionally, in another embodiment of this application, the second processor 300 detects whether the recognized text corresponding to the input data content contains a text jump instruction, including:
[0301] By performing semantic understanding on the identified text, text jump indication information can be detected from the identified text;
[0302] If a text jump instruction is detected in the identified text, it is determined that the identified text contains a text jump instruction.
[0303] Optionally, in another embodiment of this application, when the second processor 300 detects text jump indication information from the identified text, it further includes:
[0304] Determine whether the text jump instruction information meets the scene instruction conditions; the scene instruction conditions include the conditions that the text jump instruction information should meet as a text jump instruction in the current scene;
[0305] If the text jump instruction information meets the scene instruction conditions, then it is determined that the identified text contains a text jump instruction, and the detected text jump instruction information is determined as a text jump instruction;
[0306] If the text jump instruction information does not meet the scene instruction conditions, then it is determined that the identified text does not contain a text jump instruction.
[0307] Optionally, in another embodiment of this application, the second processor 300 determines whether the text jump instruction information meets the scene instruction conditions, including:
[0308] Determine whether the language of the text jump instruction information is the same as that of the target text;
[0309] If the text jump instruction information is in a different language than the target text, then the text jump instruction information is determined to meet the scene instruction conditions.
[0310] Optionally, in another embodiment of this application, the second processor 300 detects whether the recognized text corresponding to the input data content contains a text jump instruction, including:
[0311] Detect whether the identified text contains text location information;
[0312] If the identified text contains text location information, then it is determined that the identified text contains a text jump instruction.
[0313] Optionally, in another embodiment of this application, the second processor 300 detects whether the identified text contains text location information, including:
[0314] Determine whether the identified text is a page number;
[0315] If the identified text is a page number, then it is determined that the identified text contains text location information.
[0316] Optionally, in another embodiment of this application, the second processor 300 determines whether the identified text is a page number, including:
[0317] Determine whether the length of the identified text is within the page number length threshold of the target text;
[0318] If the length of the identified text is within the page number length threshold of the target text, then it is determined whether the identified text contains only numerical text.
[0319] If the identified text contains only numerical text, then determine whether the numerical value corresponding to the identified text is within the page number value threshold of the target text;
[0320] If the numerical value corresponding to the identified text is within the page number value threshold of the target text, then the identified text is determined to be a page number.
[0321] Optionally, in another embodiment of this application, the second processor 300 determines the position of the text that matches the identified text retrieved from the target text as the text location result, including:
[0322] Retrieve text that matches the identified text from the first retrieval area of the target text; the first retrieval area includes the text area where the current text position is located and the text area adjacent to the current text position, the current text position includes the text positioning result obtained from the previous text positioning or a preset position;
[0323] If a text matching the identified text is retrieved from the first retrieval area of the target text, the position of the text matching the identified text retrieved from the first retrieval area of the target text is determined as the text location result;
[0324] If no text matching the identified text is found in the first search area of the target text, the position of the text matching the identified text found in the second search area of the target text is determined as the text location result; the second search area includes the text area in the target text other than the first search area.
[0325] Optionally, in another embodiment of this application, the second processor 300 determines the position of the text matching the identified text retrieved from the first retrieval area of the target text as the text location result, including:
[0326] If the number of positions of texts that match the identified text retrieved from the first retrieval area of the target text is one, then the position of the text that matches the identified text retrieved from the first retrieval area of the target text is determined as the text location result;
[0327] If the number of positions of texts matching the identified text retrieved from the first retrieval area of the target text is at least two, then the positions of each of the retrieved texts matching the identified text are output, and the text location result is determined according to the selection instruction provided by the user.
[0328] The selection instruction includes an instruction for the user to select a text location from at least two locations of text that match the identified text.
[0329] Optionally, in another embodiment of this application, the second processor 300 determines the position of the text matching the identified text retrieved from the second retrieval area of the target text as the text location result, including:
[0330] Retrieve text that matches the identified text from the second retrieval area of the target text;
[0331] If a text matching the identified text is retrieved from the second retrieval area of the target text, the text location result is determined based on the position of the text matching the identified text retrieved from the second retrieval area of the target text;
[0332] If no matching text is found in the second search area of the target text, a prompt message is output to prompt the user to re-enter the input data.
[0333] Optionally, in another embodiment of this application, the first retrieval area includes a first interval and a second interval, and the second processor 300 retrieves text matching the identified text from the first retrieval area of the target text, including:
[0334] Retrieve text that matches the identified text from a first interval of the target text; the first interval includes the page where the current text is located and M pages after the current text location;
[0335] If no text matching the identified text is found in the first interval of the target text, then the text matching the identified text is retrieved from the second interval of the target text, which includes N pages before the current text position, where M and N are both positive integers.
[0336] Optionally, in another embodiment of this application, the page containing the current text position and each of the M pages following the current text position correspond to different hit thresholds; the second processor 300 retrieves text matching the identified text from the first interval of the target text, including:
[0337] Retrieve text that matches the identified text from each page of the first interval;
[0338] If a text with a similarity greater than the identified text is found on any page of the first interval, then it is determined that a text matching the identified text has been retrieved from that page.
[0339] The scanning pen provided in this embodiment belongs to the same concept as the text positioning method provided in the above embodiments of this application. It can execute the text positioning method provided in any of the above embodiments of this application and has the corresponding functional modules and beneficial effects of executing the above text positioning method. Technical details not described in detail in this embodiment can be found in the specific processing content of the text positioning method provided in the above embodiments of this application, and will not be repeated here.
[0340] Another embodiment of this application provides a storage medium storing a computer program, which, when executed by a processor, implements the various steps of the text positioning method provided in any of the above embodiments.
[0341] Specifically, the specific working content of each part of the aforementioned electronic device and scanning pen, as well as the specific processing content of the computer program on the aforementioned storage medium when run by the processor, can be found in the various embodiments of the aforementioned text positioning method, and will not be repeated here.
[0342] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0343] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0344] The steps in the methods of the various embodiments of this application can be adjusted, merged, or deleted in order according to actual needs, and the technical features described in each embodiment can be replaced or combined.
[0345] The modules and sub-modules in the various embodiments of the present application's devices and terminals can be merged, divided, and deleted according to actual needs.
[0346] It should be understood that the disclosed terminals, devices, and methods can be implemented in other ways, given the several embodiments provided in this application. For example, the terminal embodiments described above are merely illustrative. For instance, the division of modules or sub-modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple sub-modules or modules may be combined or integrated into another module, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0347] The modules or submodules described as separate components may or may not be physically separate. The components that constitute a module or submodule may or may not be physical modules or submodules; that is, they may be located in one place or distributed across multiple network modules or submodules. Some or all of the modules or submodules can be selected to achieve the purpose of this embodiment's solution, depending on actual needs.
[0348] Furthermore, the functional modules or sub-modules in the various embodiments of this application can be integrated into one processing module, or each module or sub-module can exist physically separately, or two or more modules or sub-modules can be integrated into one module. The integrated modules or sub-modules described above can be implemented in hardware or in the form of software functional modules or sub-modules.
[0349] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0350] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software unit executed by a processor, or a combination of both. The software unit can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0351] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0352] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A text positioning method, characterized by, The method comprises the following steps: detecting whether a text jump instruction is contained in recognized text corresponding to input data content; wherein, the input data content comprises text image data and / or voice data; the text jump instruction is used to indicate jumping to a specific text position of target text; if the recognized text contains the text jump instruction, determining a text position in the target text that matches the text jump instruction as a text positioning result; the text jump instruction comprises text jump instruction information that is detected from the recognized text and is different from a language type of the target text; if the recognized text does not contain the text jump instruction, determining a position of text that matches the recognized text and is retrieved from the target text as the text positioning result.
2. The method of claim 1, wherein, The step of detecting whether the text jump instruction is contained in the recognized text corresponding to the input data content comprises the following steps: detecting text jump instruction information from the recognized text by performing semantic understanding on the recognized text; if the text jump instruction information is detected from the recognized text, it is determined that the recognized text contains the text jump instruction.
3. The method of claim 2, wherein, When the text jump instruction information is detected from the recognized text, the method further comprises the following steps: judging whether the text jump instruction information meets a scene instruction condition; the scene instruction condition comprises a condition that the text jump instruction information should meet as a text jump instruction in a current scene; if the text jump instruction information meets the scene instruction condition, it is determined that the recognized text contains the text jump instruction, and the detected text jump instruction information is determined as the text jump instruction; if the text jump instruction information does not meet the scene instruction condition, it is determined that the recognized text does not contain the text jump instruction.
4. The method of claim 1, wherein, The step of detecting whether the text jump instruction is contained in the recognized text corresponding to the input data content comprises the following steps: detecting whether text position information is contained in the recognized text; if the text position information is contained in the recognized text, it is determined that the recognized text contains the text jump instruction.
5. The method of claim 4, wherein, The step of detecting whether the text position information is contained in the recognized text comprises the following steps: judging whether the recognized text is a page number; if the recognized text is a page number, it is determined that the recognized text contains the text position information.
6. The method of claim 5, wherein, The step of judging whether the recognized text is a page number comprises the following steps: judging whether a text length of the recognized text is within a page number length threshold of the target text; if the text length of the recognized text is within the page number length threshold of the target text, judging whether the recognized text only comprises numerical text; if the recognized text only comprises the numerical text, judging whether a value corresponding to the recognized text is within a page number value threshold of the target text; if the value corresponding to the recognized text is within the page number value threshold of the target text, it is determined that the recognized text is a page number.
7. The method of claim 1, wherein, The step of determining the position of the text that matches the recognized text and is retrieved from the target text as the text positioning result comprises the following steps: retrieving the text matching the recognized text from a first search region of the target text; the first search region comprises a text region where the current text position is located and a text region adjacent to the current text position, the current text position comprises a text positioning result obtained by last text positioning or a preset position; if the text matching the recognized text is retrieved from the first search region of the target text, determining the position of the text matching the recognized text retrieved from the first search region of the target text as the text positioning result; if the text matching the recognized text is not retrieved from the first search region of the target text, determining the position of the text matching the recognized text retrieved from a second search region of the target text as the text positioning result; the second search region comprises a text region other than the first search region in the target text.
8. The method of claim 7, wherein, The method further comprises: if the number of the positions of the text matching the recognized text retrieved from the first search region of the target text is one, determining the position of the text matching the recognized text retrieved from the first search region of the target text as the text positioning result; if the number of the positions of the text matching the recognized text retrieved from the first search region of the target text is at least two, outputting the positions of the text matching the recognized text, and determining the text positioning result according to a selection instruction fed back by a user; the selection instruction comprises an instruction that the user selects a text position from the positions of the text matching the recognized text.
9. The method of claim 7, wherein, The method further comprises: retrieving the text matching the recognized text from the second search region of the target text; if the text matching the recognized text is retrieved from the second search region of the target text, determining the text positioning result according to the position of the text matching the recognized text retrieved from the second search region of the target text; if the text matching the recognized text is not retrieved from the second search region of the target text, outputting prompt information for prompting the user to re-input the input data content.
10. The method of claim 7, wherein, The first search region comprises a first interval and a second interval. The method further comprises: retrieving the text matching the recognized text from the first interval of the target text; the first interval comprises a page where the current text position is located and M pages after the current text position; M is a positive integer. if the text matching the recognized text is not retrieved from the first interval of the target text, retrieving the text matching the recognized text from the second interval of the target text; the second interval comprises N pages before the current text position; M and N are positive integers.
11. A text positioning apparatus, characterized by The method further comprises: detecting whether the identified text corresponding to the input data content contains a text jump instruction; wherein the input data content comprises text image data and / or voice data; the text jump instruction is used to indicate jumping to a specific text position of a target text; a first determining module, configured to determine, if the identified text contains the text jump instruction, a text position in the target text that matches the text jump instruction as the text positioning result; the text jump instruction comprises text jump instruction information detected from the identified text and different from a language type of the target text; a second determining module, configured to determine, if the identified text does not contain the text jump instruction, a text position in the target text that matches the identified text as the text positioning result.
12. An electronic device, comprising: comprising: a memory and a first processor; wherein the memory is configured to store a program; the first processor is configured to realize the text positioning method according to any one of claims 1 to 10 by running the program in the memory.
13. A scanning pen, characterized by comprising: a second processor, a display screen connected to the second processor, and a voice acquisition component and / or a text image acquisition component connected to the second processor; the voice acquisition component is configured to acquire voice data; the text image acquisition component is configured to acquire text image data; the second processor is configured to detect whether the identified text corresponding to the input data content contains a text jump instruction; wherein the input data content comprises text image data and / or voice data; the text jump instruction is used to indicate jumping to a specific text position of a target text; if the identified text contains the text jump instruction, a text position in the target text that matches the text jump instruction is determined as the text positioning result; the text jump instruction comprises text jump instruction information detected from the identified text and different from a language type of the target text; if the identified text does not contain the text jump instruction, a text position in the target text that matches the identified text is determined as the text positioning result; the display screen is configured to display text content corresponding to the text positioning result sent by the second processor.
14. A storage medium, characterized by comprising: the storage medium has a computer program stored thereon, and the computer program is executed by the processor to realize each step of the text positioning method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Method, device and equipment for determining reading position
CN110795918A
Content synchronization method and device, electronic equipment and storage medium
CN113762018A