A sentence scanning method and device and a storage medium
By obtaining the word element information table of the textbook file from the scanning pen, processing the scanning fields through word segmentation, and determining the sentence information of keywords, the problem that the scanning pen could not play the complete sentence based on partial sentences was solved, thus improving the user experience.
Patent Information
- Application Number
- CN202110745542.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-30
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2041-06-30
AI Technical Summary
Existing scanning pens cannot instantly play or translate complete sentences based on partial fields, forcing users to scan long sentences from beginning to end, which affects the user experience.
By obtaining the element information table of word elements and their mapping relationships from the textbook file, the word segmentation process scans the field, retrieves the sentence information of the keywords, determines the sentence to which the scanned field belongs based on the sentence information of the keywords, and then plays or displays it.
It enables precise positioning of scanned fields, simplifies the playback of long sentences, and improves the user experience.
Smart Images

Figure CN113486650B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of intelligent learning, and in particular to a sentence scanning method and device and a storage medium. BACKGROUND
[0002] Nowadays, primary and secondary school students are required to read aloud English texts, but for English texts that they are just starting to learn, students cannot read some sentences fluently. At this time, students need to use the textbook scanning and reading function in the scanning pen to scan the sentences in the English text, and the scanning pen plays the scanned sentences.
[0003] However, the existing scanning pen can only play the scanned sentences, that is, the student needs to scan the sentences from the beginning to the end, and the scanning pen can play the complete sentence. For some long sentences, if the student wants the scanning pen to play or translate the long sentence completely, the student needs to spend some effort to scan the long sentence from the beginning to the end, which affects the user experience of the student. SUMMARY
[0004] Embodiments of the present application provide a sentence scanning method and device and a storage medium, which solve the problem that the existing scanning pen cannot play or translate a complete sentence according to a part of a field of the sentence.
[0005] In a first aspect, embodiments of the present application provide a sentence scanning method of a scanning pen, comprising:
[0006] According to the current learning material file of the user, the word elements of the learning material file and the element information table establishing a mapping relationship with the single word element are obtained, and the element information table includes the sentence information of all sentences containing a single word element in the learning material file;
[0007] The scanning field recognized by the scanning pen is obtained, the scanning field is processed by word segmentation, and one or more key words contained in the scanning field are obtained;
[0008] The element information table of the same word element as the key word is called, and the sentence information of the key word is obtained;
[0009] According to the sentence information of the key word, the sentence to which the scanning field belongs is determined, and the sentence is played or displayed.
[0010] Further, the element information table of the learning material file obtained according to the current learning material file of the user includes:
[0011] The word elements of the learning material file and the element information table establishing a mapping relationship with the single word element obtained according to the current learning material file of the user include:
[0012] Obtaining a textbook name recognized by the scanning pen, and determining a corresponding textbook file according to the textbook name;
[0013] Obtaining a word element saved in association with the textbook file and an element information table establishing a mapping relationship with a single word element.
[0014] Further, the obtaining of the word element saved in association with the textbook file and the element information table establishing a mapping relationship with a single word element includes:
[0015] According to the textbook name recognized by the scanning pen, downloading the textbook file corresponding to the textbook name;
[0016] Performing word segmentation processing on a sentence of each page in the textbook file, and extracting a word element contained in the sentence;
[0017] Performing deduplication processing on all extracted word elements, and retaining different word elements in the textbook file;
[0018] Saving the retained word elements and sentence information of the belonging sentence as the element information table, and saving the element information table in association with the textbook file, wherein the sentence information includes an order of the word element in the belonging sentence and a textbook page number of the sentence to which the word element belongs.
[0019] Further, the word segmentation processing on the scanning field to obtain one or more key words contained in the scanning field includes:
[0020] If the same character in the scanning field matches different word elements, the word element containing the most characters is determined as the key word contained in the scanning field.
[0021] Further, the determining of the sentence to which the scanning field belongs according to the sentence information of the key word includes:
[0022] Comparing each sentence to which the key word belongs to determine an intersection sentence containing all key words;
[0023] When an intersection sentence containing all key words is determined, the intersection sentence is determined as the sentence to which the scanning field belongs.
[0024] Further, the determining of the sentence to which the scanning field belongs according to the sentence information of the key word includes:
[0025] When multiple intersection sentences containing all key words are determined, a weight sentence containing the scanning field is determined according to the order of the key word in the intersection sentence and the order of the key word in the scanning field;
[0026] In determining a weight sentence containing the scanning field, the weight sentence is determined as the sentence to which the scanning field belongs.
[0027] Further, the determining the weight sentence containing the scanning field according to the order of the keyword in the intersection sentence and the order of the keyword in the scanning field comprises:
[0028] According to the order of the word elements in the intersection sentence, the word elements in the intersection sentence are matched with the keywords of the scanning field in sequence;
[0029] When the same keyword is matched, the unit weight score of the intersection sentence is accumulated, and the next word element is compared with the next keyword;
[0030] When the same keyword is continuously matched, the weight score accumulated last time is multiplied by N (N>1), and when the discontinuous keyword is matched, the unit weight score is accumulated;
[0031] After all the keywords of the scanning field are matched, the weight score of the intersection sentence is calculated;
[0032] The intersection sentence whose weight score meets a preset weight threshold is determined as the weight sentence containing the scanning field.
[0033] Further, the determining the sentence to which the scanning field belongs according to the sentence information of the keyword comprises:
[0034] When multiple weight sentences containing the scanning field are determined, a historical scanning record of the teaching material file is obtained, and the page number of the scanning content recognized by the scanning pen is obtained from the historical scanning record;
[0035] The page number of the scanning content is compared with the page number of the weight sentence, and the weight sentence closest to the scanning content is determined as the sentence to which the scanning field belongs.
[0036] In a second aspect, an embodiment of the present application provides a sentence scanning device of a scanning pen, comprising:
[0037] An information obtaining module is configured to obtain word elements of a teaching material file currently learned by a user and an element information table mapping the single word elements according to the teaching material file, wherein the element information table comprises sentence information of all sentences containing single word elements in the teaching material file;
[0038] A word segmentation extraction module is configured to obtain a scanning field recognized by a scanning pen, perform word segmentation processing on the scanning field, and obtain one or more keywords contained in the scanning field;
[0039] a sentence obtaining module configured to obtain sentence information of the keyword according to the element information table of the same word element as the keyword;
[0040] a sentence determining module configured to determine a sentence to which the scanning field belongs according to the sentence information of the keyword, and play or display the sentence.
[0041] In a third aspect, an embodiment of the present application provides a scanning pen, comprising:
[0042] one or more processors;
[0043] a memory configured to store one or more programs;
[0044] When the one or more programs are executed by the one or more processors, the one or more processors implement the sentence scanning method of the scanning pen according to the first aspect.
[0045] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the sentence scanning method of the scanning pen according to the first aspect.
[0046] The sentence scanning method, device, equipment and storage medium of the scanning pen described above, according to the teaching material file currently learned by the user, obtain the word element of the teaching material file and the element information table establishing a mapping relationship with the single word element, the element information table includes the sentence information of all sentences containing the single word element in the teaching material file; obtain the scanning field recognized by the scanning pen, perform word segmentation processing on the scanning field, and obtain one or more keywords contained in the scanning field; call the element information table of the same word element as the keyword, and obtain the sentence information of the keyword; according to the sentence information of the keyword, determine the sentence to which the scanning field belongs, and play or display the sentence. Through the above technical means, the word segmentation processing is performed on the scanning field, the keywords constituting the scanning field are obtained, the keywords are queried in the element information table of the teaching material file currently learned, so as to determine the sentence to which each keyword belongs. The sentences to which each keyword belongs are compared, the sentence containing all keywords is determined, and according to the sorting of the keywords in the scanning field and the teaching material page code currently learned, the sentence to which the scanning field belongs is uniquely determined from the sentence containing all keywords, the long sentence that the user wants the scanning pen to play or display is accurately positioned, the problem that the existing scanning pen cannot play the complete sentence according to the sentence part field is solved, and the use experience of the user is improved. BRIEF DESCRIPTION OF DRAWINGS
[0047] Figure 1 is a flowchart of a sentence scanning method of a scanning pen provided by an embodiment of the present application;
[0048] Figure 2 is a schematic diagram of a teaching material page provided by an embodiment of the present application;
[0049] Figure 3 is a schematic diagram of a display screen of a scanning pen provided by an embodiment of the present application;
[0050] Figure 4 is a structural schematic diagram of a sentence scanning device of a scanning pen provided by an embodiment of the present application;
[0051] Figure 5 is a structural schematic diagram of a scanning pen provided by an embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to make the objects, technical solutions and advantages of the present application clearer, the following further describes the specific embodiments of the present application with reference to the drawings. It can be understood that the specific embodiments described herein are only used to explain the present application, but not limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, but not all the contents. Before discussing the example embodiments in more detail, it should be mentioned that some example embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The processes can be terminated when the operations are completed, but can also have additional steps not included in the drawings. The processes can correspond to methods, functions, procedures, subroutines, subprograms, etc.
[0053] The sentence scanning method of the scanning pen provided in the embodiments of the present application can be executed by the sentence scanning device of the scanning pen, which can be realized by software and / or hardware, and can be composed of two or more physical entities or one physical entity. For example, the sentence scanning device of the scanning pen can be the scanning pen itself, or a software program running in the processor of the scanning pen.
[0054] For the convenience of understanding, the scanning pen is exemplarily described as the sentence scanning device of the scanning pen in the embodiments.
[0055] Figure 1 is a flowchart of a sentence scanning method of a scanning pen provided by an embodiment of the present application. Referring to Figure 1 , the sentence scanning method of the scanning pen comprises:
[0056] S110, according to the teaching material file currently learned by the user, obtaining a word element of the teaching material file and an element information table establishing a mapping relationship with a single word element, the element information table including sentence information of all sentences containing a single word element in the teaching material file.
[0057] Exemplarily, an English teacher of a primary and secondary school will let students preview the textbook in advance, and read the text to be familiar with the text. The text may contain some long sentences. Students who are just learning the text are not familiar with the pauses in the long sentences and the pronunciation of the words, so that students cannot read the long sentences fluently. Therefore, when students preview the text, they can use the scanning pen to scan the long sentence in the text, and the scanning pen plays the long sentence. The student can read the long sentence played by the scanning pen. However, when the existing scanning pen plays the complete sentence, the user needs to spend some effort to scan the long sentence from beginning to end, which affects the user experience. In view of this, the sentence scanning method of the scanning pen provided in the embodiment does not require the user to scan the long sentence from beginning to end. Only the user needs to use the scanning pen to scan the part of the field of the long sentence that the user wants to play, and the long sentence to which the scanned field belongs can be accurately positioned according to the field scanned by the student, so as to simplify the long sentence playing operation and improve the operation convenience.
[0058] The teaching material file is an electronic textbook corresponding to a paper textbook currently learned by the user. The scanning pen pre-records various versions of the electronic textbook of primary and secondary schools, and the user can select a suitable version of the electronic textbook in the scanning pen for downloading. The electronic textbook and the paper textbook contain the same page number and page content. The sentence in the page content of a certain page number in the electronic textbook is the same as the sentence in the page content of the same page number in the paper textbook. Figure 2 The page content of the 19th page in the paper textbook contains a scanning field, and accordingly, the page content of the 19th page in the electronic textbook also contains the scanning field. Therefore, the sentence containing the scanning field can be determined through the teaching material page content in the electronic textbook. Further, the word element of the teaching material file refers to all non-repeated character elements and word elements in the teaching material file. The element information table establishing a mapping relationship with a single word element refers to the sentence information set of the sentence containing a character element or a word element. The sentence information includes the order of the character element or the word element in the belonging sentence and the teaching material page number of the belonging sentence. The word element can be a Chinese character or a foreign language word.
[0059] In one embodiment, an element information table of word elements of a teaching material file is made in advance, a mapping relationship between a word element and a corresponding element information table is established, and the word element and the corresponding element information table are stored in association with the teaching material file. After determining the teaching material file currently learned by the user, the element information table stored in association with the teaching material file can be directly obtained. Accordingly, the step of obtaining the word element of the teaching material file and the corresponding element information table includes S1101-S1102:
[0060] S1101, obtain the teaching material name recognized by the scanning pen, and determine the corresponding teaching material file according to the teaching material name.
[0061] For example, when the user wants to use the scanning pen to play or display a long sentence of the current learning teaching material, the teaching material name of the paper textbook teaching material is scanned in advance using the scanning pen. The scanning pen recognizes the teaching material name and queries the corresponding electronic textbook teaching material from the pre-recorded textbook teaching material. In addition, the user can also input the scanning pen by voice to query the corresponding electronic textbook teaching material of the paper textbook teaching material currently learned. If the user scans the teaching material for the first time using the scanning pen, the scanning pen will query and download the corresponding electronic textbook teaching material from the pre-recorded textbook teaching material according to the recognized teaching material name.
[0062] S1102, obtain the element information table stored in association with the teaching material file.
[0063] For example, after obtaining the teaching material file currently learned, the element information table stored in association with the teaching material file is obtained. The element information table can be made by a computer according to the content of the textbook in the electronic textbook teaching material when the electronic textbook teaching material is recorded in advance, and the element information table corresponding to the word element of the electronic textbook teaching material is imported into the scanning pen and stored in association with the electronic textbook teaching material in the scanning pen. The element information table can also be obtained by the scanning pen according to the content of the textbook in the teaching material file when the teaching material file is downloaded, and stored in association with the teaching material file. The steps of making the element information table by the scanning pen and establishing the mapping relationship between the word element and the element information table include S11021-S11024:
[0064] S11021, download the teaching material file corresponding to the teaching material name according to the teaching material name recognized by the scanning pen.
[0065] For example, since the element information table of the teaching material file currently learned is used every time the sentence scanning method is executed in this embodiment, when the user scans the teaching material for the first time using the scanning pen, the teaching material name of the teaching material is obtained, the corresponding electronic textbook teaching material is queried from the pre-recorded textbook teaching material according to the teaching material name, and downloaded. After downloading the teaching material file, the content of the textbook of all teaching material pages in the teaching material file is obtained.
[0066] S11022, perform word segmentation processing on each sentence of each page of the teaching material file, and extract word elements contained in the sentence.
[0067] For example, the sentence in the text content of each teaching material page is matched with the preset word library to perform word segmentation processing on the sentence according to the words in the word library, the continuous characters matched to the words are determined as the word elements of the sentence, and the characters not matched to the words are determined as the word elements of the sentence. Wherein, when performing word segmentation processing, if the same character in the sentence is matched to two word elements, the word element containing the most characters is determined as the word element contained in the sentence. For example, the sentence "this is a keyword", when the sentence is matched with the preset word library, if the word library includes "key" and "keyword", it can be determined that the sentence matches two word elements "key" and "keyword", then "keyword" is determined as the word element contained in the sentence.
[0068] S11023, perform deduplication processing on all extracted word elements, and retain different word elements in the teaching material file.
[0069] For example, the word elements contained in all sentences are deduplicated, and the retained word elements are collected into an element set of all different word elements in the teaching material file. Wherein, even if the word elements have some same characters, they are different elements. In this embodiment, when generating the element set, the word elements are binary coded and sorted, so as to subsequently more quickly query and scan the word elements matching the field.
[0070] S11024, save the retained word elements and the sentence information of the corresponding sentences as an element information table, and save the element information table and the teaching material file, the sentence information including the order of the word elements in the corresponding sentences and the teaching page number of the word elements.
[0071] For example, the sentence information of the sentence to which each word element in the element set belongs is saved to make an element information table. The element information table is saved in association with the corresponding word element, and a mapping relationship between the word element and the corresponding element information table is established. The element set and all element information tables are saved in association with the teaching material file.
[0072] In this embodiment, the reserved element refers to a word element in the element set, and the sentence information includes the order of the word element in the sentence to which the word element belongs and the page number of the textbook in which the sentence to which the word element belongs. After the sentence to which the reserved element belongs is sorted out, the sequence number of the reserved element in the sentence to which the reserved element belongs is determined according to the order of the reserved element in each of the sentences to which the reserved element belongs, so as to represent the order of the reserved element in the sentence to which the reserved element belongs by the sequence number. For example, taking the word element as an English word as an example. Each sentence in the textbook file is numbered, and each word in the element information table is associated and stored with the corresponding word in the form of a number. For example, the long sentence "It's also probably a good idea for parents to allow teenagers to study in groups during the evening" is numbered as 20, and the words "teenagers" and "allow" associated with the number 20 are saved in the element information table. In addition, each word in the element information table is associated and saved with the sequence number of the word in the sentence to which the word belongs. For example, the word "teenagers" is ranked 11th in the sentence numbered 20, and the word "teenagers" is associated and saved with the number 20 and the order 11 in the element information table. In addition, the page number of the sentence numbered 20 in the textbook file is 19, and the page number 19 is associated and saved with the number 20. Table 1 is an element information table provided by the embodiment of the application.
[0073] Table 1
[0074]
[0075] As shown in Table 1, the sentence number of the sentence to which "teenagers" belongs, the sequence number of the sentence to which "teenagers" belongs, and "teenagers" are stored side by side in the element information table.
[0076] In S120, a scanned field recognized by the scanning pen is obtained, and the scanned field is subjected to word segmentation processing to obtain one or more keywords contained in the scanned field.
[0077] The scanned field is a sentence field in a current learning text scanned by the user using the scanning pen. The current learning text belongs to the content in a certain textbook page in the textbook currently learned by the user, Figure 2 is a schematic diagram of a textbook page provided by the embodiment of the application. As Figure 2As shown, it is assumed that the user wants to scan the long sentence played by the pen as "It't also probably a good idea for parents to allow teenagers to study in groups during the evening", and "allow teenagers to study" in the long sentence is the sentence field scanned by the user using the scanning pen. When the user scans the sentence field using the scanning pen, the camera installed on the pen head of the scanning pen captures an image containing the sentence field, and performs character recognition on the image to obtain the scanning field. The keyword refers to each word constituting the scanning field. For example, the scanning field "allow teenagers to study" is segmented to obtain the words constituting the scanning field as "allow", "teenagers", "to" and "study".
[0078] In one embodiment, if the same character in the scanning field matches different word elements, the word element containing the most characters is determined as the keyword contained in the scanning field. For example, taking the word element as Chinese characters as an example, the characters in the scanning field are matched with the words in the preset Chinese word library, and the continuous characters matched with the words are determined as the word elements of the sentence, and the characters not matched with the words are determined as the word elements of the sentence. During the segmentation processing, if the same character in the sentence is matched with two word elements, the word element containing the most characters is determined as the word element contained in the sentence. For example, the sentence "This is a keyword", when the sentence is matched with the preset word library, if the word library includes "key" and "keyword", it can be determined that the sentence matches "key" and "keyword" two word elements, and "keyword" is determined as the word element contained in the sentence.
[0079] S130, retrieve the element information table of the word element same as the keyword, and obtain the sentence information of the keyword.
[0080] For example, referring to Table 1, the corresponding word of the scanning field keyword "teenagers" is queried in the element information table to obtain that the keyword "teenagers" belongs to the sentence with number 20 and number 50, and further obtain that the keyword "teenagers" is ranked 11th in the sentence with number 20, 15th in the sentence with number 50, and the sentence with number 20 belongs to page 19 and the sentence with number 50 belongs to page 45.
[0081] Further, the corresponding word elements of the scanning field are queried in the element information table according to all the keywords to obtain the number, sequence number and page number of the sentence to which each keyword belongs.
[0082] S140, determining the sentence to which the scanned field belongs according to the sentence information of the keyword, and playing or displaying the sentence.
[0083] The sentence to which the scanned field belongs refers to the sentence to which the scanned field belongs in the text content of the paper textbook, i.e., the sentence to which the scanned field belongs has uniqueness and only exists in the material page currently studied by the user. For example, the sentence to which the scanned field belongs contains the scanned field, i.e., the sentence to which the scanned field belongs contains all the keywords in the scanned field. Accordingly, the sentence to which the scanned field belongs is the sentence to which the keywords in the scanned field belong. Based on this, the embodiment determines the sentence containing all the keywords by comparing the sentence information of each keyword, so as to determine the sentence to which the scanned field belongs according to the sentence information of the sentence containing all the keywords. The step of determining the sentence to which the scanned field belongs according to the keywords includes S1401-S1402:
[0084] S1401, comparing the sentences to which each keyword belongs to determine the intersection sentence containing all the keywords.
[0085] For example, the sentence numbers of the sentences to which all the keywords belong are compared according to the sentence numbers of the sentences to which the keywords belong in the element information table to determine the intersection sentence number as the sentence containing all the keywords. For example, the sentence numbers of the sentences to which the keywords "allow", "teenagers", "to" and "study" in the scanned field "allow teenagers to study" belong include the number 20. Comparing all the sentence numbers corresponding to "allow", "teenagers", "to" and "study" can obtain the intersection number 20, and then it is determined that the sentence corresponding to the number 20 contains all the keywords of the scanned field.
[0086] S1402, when determining an intersection sentence containing all the keywords, determining the intersection sentence as the sentence to which the scanned field belongs.
[0087] For example, if only one intersection number is obtained, it is determined that the sentence corresponding to the intersection number is the long sentence to which the scanned field belongs.
[0088] Further, if multiple intersection numbers are obtained, the long sentence to which the scanned field belongs is determined according to the order of the keywords in the sentence corresponding to the intersection number and the order of the keywords in the scanned field. The step of determining the sentence to which the scanned field belongs according to the order of the keywords includes S1403-S1404:
[0089] S1403、In the step of determining the intersection sentences containing all the keywords, the weight sentence containing the scanning field is determined according to the order of the keywords in the intersection sentences and the order of the keywords in the scanning field.
[0090] For example, the scanning field belongs to the part continuous field in the long sentence, the order of the keywords in the scanning field is consistent with the order of the corresponding keywords in the long sentence, so the intersection sentence can be matched with the scanning field, and the weight score of each intersection sentence matched with the scanning field is calculated. For this, the step of calculating the weight score includes S14031-S14034:
[0091] S14031、According to the order of the word elements in the intersection sentence, the word elements in the intersection sentence are matched with the keywords in the scanning field in turn.
[0092] S14032、When the same keyword is matched, the unit weight score of the intersection sentence is accumulated, and the next word element is compared with the next keyword.
[0093] S14033、When the same keyword is matched continuously, the weight score accumulated last time is multiplied by N (N>1), and when the keywords are not continuous, the unit weight score is accumulated.
[0094] S14034、After all the keywords in the scanning field are matched, the weight score of the intersection sentence is calculated.
[0095] S14035、The intersection sentence whose weight score meets the preset weight threshold is determined as the weight sentence containing the scanning field.
[0096] For example, if the matched intersection sentence is "It's also probably a good idea for parents to allow teenagers to study in groups during the evening", the first matching is between "It's" and "allow" in the scan field. Since the two elements are not the same, the next matching is between "also" and "allow". The matching continues until "allow" in the intersection sentence matches "allow" in the scan field. The same keyword is matched, and the initial weight score of the intersection sentence is added by a unit weight score, for example, 8. When the keyword in the scan field matches the same word element, the next keyword in the scan field is matched. The matching continues between "teenagers" in the intersection sentence and "teenagers" in the scan field. Since the same keyword is matched twice in a row, the weight score of the intersection sentence is doubled, for example, 16. The weight score of the intersection sentence is 24. If the same keyword is matched three times in a row, the weight score of the intersection sentence is quadrupled, for example, 32. The weight score of the intersection sentence is 56. If the fourth matching is not the same, and the fifth matching is the same, the weight score of the previous matching is added by a unit weight score. After all the word elements are matched or the scan field is matched, the last matching weight score is the weight score of the intersection sentence. For example, the weight score of "It's also probably a good idea for parents to allow teenagers to study in groups during the evening" is 120. The weight threshold is the score that the intersection sentence containing the scan field can get, which is the highest score that the intersection sentence can get. When the weight score of the intersection sentence is equal to the weight threshold of the scan field, it is determined that the keyword sequence composed of the keywords in the intersection sentence is the same as the scan field, and it is further determined that the intersection sentence contains the scan field.
[0097] In one embodiment, the keyword sequence of the intersection sentence is determined according to the order of each keyword in the intersection sentence, the keyword sequence in the scanning field is compared with the keyword sequence of the intersection sentence, and the intersection sentence with the same keyword sequence as the scanning field is determined as the weight matrix containing the scanning field. For example, in this embodiment, the keyword sequence of the scanning field "allow teenagers to study" is "allow", "teenagers", "to" and "study", and the sequence numbers of the keywords in the sentence No. 20 are 10, 11, 12 and 13, respectively. According to the sequence numbers of the corresponding keywords in the intersection sentence, the keywords are sorted from small to large, and the keyword sequence is obtained. For example, the keywords "allow", "teenagers", "to" and "study" are sorted from small to large according to the sequence numbers, i.e. the keyword sequence "allow teenagers to study" is obtained. If there are other words between the two keywords in some sentences, i.e. the sequence numbers of the corresponding keywords in the intersection sentence are not continuous, it can be directly determined that the intersection sentence does not contain the scanning field.
[0098] S1404, when a weight sentence containing the scanning field is determined, the weight sentence is determined as the sentence to which the scanning field belongs.
[0099] For example, if only one weight sentence is obtained, it can be determined that the weight sentence is the long sentence to which the scanning field belongs.
[0100] Further, if multiple weight sentences are obtained, it indicates that the scanning field is contained in these weight sentences, but the sentence to which the scanning field belongs belongs to the textbook page currently learned by the user, and the other weight sentences containing the scanning field do not belong to the textbook page currently learned by the user. Therefore, according to the page number of the textbook page learned by the user, the sentence to which the scanning field belongs is accurately scanned. Wherein, the step of determining the sentence to which the scanning field belongs according to the textbook page number comprises S1405-S1407:
[0101] S1405, when multiple weight sentences containing the scanning field are determined, the page number of the weight sentence is obtained.
[0102] For example, referring to Table 1, the page number of the weight sentence can be directly obtained according to the element information table.
[0103] S1406, the history scanning record of the textbook file is obtained, and the page number of the scanning content recognized by the scanning pen is obtained from the history scanning record.
[0104] For example, the historical scanning record of the textbook file refers to the historical scanning data of the sentence or field scanned by the scanning pen when the user learns the paper textbook corresponding to the textbook file, and the historical scanning data records the textbook page number to which the scanned sentence or field belongs. The scanned content is the sentence or field recognized by the scanning pen and saved in the historical scanning record of the currently learned textbook file. Since students usually learn according to the school learning schedule when using paper textbooks, for example, they learn the content on page 6 today, and tomorrow they will probably not learn the content on page 26, but will probably learn the content on page 7. The user uses the scanning pen to scan the textbook page number to which the sentence or field of the currently learned textbook belongs, which can be regarded as the learning schedule of the user learning the textbook. In this regard, the embodiment associates and saves the page number of the sentence or field recognized by the scanning pen in the historical scanning record of the textbook file to record the learning schedule of the user learning the textbook file.
[0105] In S1407, the page number of the scanned content is compared with the page number of the weight sentence, and the weight sentence closest to the scanned content is determined as the sentence to which the scanned field belongs.
[0106] For example, the page number of the last recognized scanned content is obtained from the historical scanning record associated with the currently learned textbook file, so as to determine the learning schedule of the user learning the textbook file according to the page number. According to the school learning schedule rule, the textbook content learned by the user at this time should be close to the last scanned content, so the page number of the scanned content is compared with the page number of the weight sentence, and the textbook page with the weight sentence page number closest to the scanned content page number is determined as the currently learned textbook page, and the weight sentence closest to the scanned content is determined as the sentence to which the scanned field belongs, that is, the sentence that the user wants the scanning pen to play or display.
[0107] In one embodiment, Figure 3 is a schematic diagram of the display screen of the scanning pen provided by the embodiment of the present application. As Figure 3 shown, after determining the sentence to which the scanned field belongs, the Chinese translation of the sentence is queried and displayed in the display screen 11 together with the sentence. A play control 12 is arranged on one side of the sentence displayed in the display screen 11. The scanning pen automatically plays the sentence in voice when the sentence to which the scanned field belongs is determined, and if the user wants to repeatedly play the sentence, the play control 12 can be clicked to make the scanning pen play the sentence again.
[0108] In summary, the sentence scanning method of the scanning pen provided in the embodiment is as follows: according to the teaching material file currently learned by the user, the word elements of the teaching material file and the element information table establishing a mapping relationship with the single word element are obtained, the element information table includes the sentence information of all sentences containing the single word element in the teaching material file; the scanning field recognized by the scanning pen is obtained, the scanning field is processed by word segmentation, and one or more keywords contained in the scanning field are obtained; the element information table of the same word element as the keyword is called, and the sentence information of the keyword is obtained; according to the sentence information of the keyword, the sentence to which the scanning field belongs is determined, and the sentence is played or displayed. Through the above technical means, the scanning field is processed by word segmentation, the keywords constituting the scanning field are obtained, the keywords are queried in the element information table of the teaching material file currently learned, so as to determine the sentence to which each keyword belongs. The sentences to which each keyword belongs are compared, the sentence containing all keywords is determined, and according to the sorting of the keywords in the scanning field and the teaching material page code currently learned, the sentence to which the scanning field belongs is uniquely determined from the sentence containing all keywords, the long sentence that the user wants the scanning pen to play or display is accurately positioned, the problem that the existing scanning pen cannot play the complete sentence according to the sentence part field is solved, and the use experience of the user is improved.
[0109] Figure 4 is a structural schematic diagram of a sentence scanning device of a scanning pen provided in an embodiment of the present application. Referring to Figure 4 The sentence scanning device of the scanning pen includes a word segmentation extraction module 201, an information acquisition module 202, a sentence acquisition module 203, and a sentence determination module 204.
[0110] The information acquisition module is configured to obtain, according to the teaching material file currently learned by the user, the word elements of the teaching material file and the element information table establishing a mapping relationship with the single word element, and the element information table includes the sentence information of all sentences containing the single word element in the teaching material file.
[0111] The word segmentation extraction module is configured to obtain the scanning field recognized by the scanning pen, process the scanning field by word segmentation, and obtain one or more keywords contained in the scanning field.
[0112] The sentence acquisition module is configured to call the element information table of the same word element as the keyword, and obtain the sentence information of the keyword.
[0113] The sentence determination module is configured to determine the sentence to which the scanning field belongs according to the sentence information of the keyword, and play or display the sentence.
[0114] On the basis of the above-mentioned embodiments, the information acquisition module comprises: a teaching material determination sub-module configured to acquire the teaching material name recognized by the scanning pen, and determine the corresponding teaching material file according to the teaching material name; and an information table acquisition sub-module configured to acquire the word elements associated with the teaching material file and the element information table establishing a mapping relationship with the single word element.
[0115] On the basis of the above-mentioned embodiments, the information table acquisition sub-module comprises: a teaching material download unit configured to download the teaching material file corresponding to the teaching material name according to the teaching material name recognized by the scanning pen; a word segmentation processing unit configured to perform word segmentation processing on the sentences of each page in the teaching material file, and extract the word elements contained in the sentences; a deduplication processing unit configured to perform deduplication processing on all the extracted word elements, and retain the different word elements in the teaching material file; and an information table saving unit configured to save the retained word elements and the sentence information of the belonging sentences as the element information table, and save the element information table and the teaching material file in association, wherein the sentence information comprises the ordering of the word elements in the belonging sentences and the teaching material page number of the word elements belonging to the sentences.
[0116] On the basis of the above-mentioned embodiments, the word segmentation extraction module comprises: a word element determination sub-module configured to, if the same character in the scanning field matches different word elements, determine the word element containing the most characters as the keyword contained in the scanning field.
[0117] On the basis of the above-mentioned embodiments, the sentence determination module comprises: a first matching sub-module configured to compare the sentences to which each keyword belongs, and determine the intersection sentence containing all the keywords; and a first determination sub-module configured to, when one intersection sentence containing all the keywords is determined, determine the intersection sentence as the sentence to which the scanning field belongs.
[0118] On the basis of the above-mentioned embodiments, the sentence determination module comprises: a second matching sub-module configured to, when multiple intersection sentences containing all the keywords are determined, determine the weight sentence containing the scanning field according to the ordering of the keywords in the intersection sentences and the ordering of the keywords in the scanning field; and a second determination sub-module configured to, when one weight sentence containing the scanning field is determined, determine the weight sentence as the sentence to which the scanning field belongs.
[0119] On the basis of the above-mentioned embodiments, the second matching sub-module comprises: a keyword matching unit configured to match the word elements in the intersection sentence with the keywords of the scanned field in turn according to the order of the word elements in the intersection sentence; a first accumulation unit configured to accumulate the unit weight score of the intersection sentence when the same keyword is matched, and compare the next word element with the next keyword; a second accumulation unit configured to accumulate N times (N>1) of the weight score accumulated last time when the same keyword is continuously matched, and accumulate the unit weight score when the keywords are discontinuous; a score determination unit configured to calculate the weight score of the intersection sentence after all the keywords of the scanned field are matched; and a score comparison unit configured to determine the intersection sentence whose weight score meets the preset weight threshold as the weight sentence containing the scanned field.
[0120] On the basis of the above-mentioned embodiments, the sentence determination module comprises: a sentence page number acquisition sub-module configured to acquire the page number of the weight sentence when a plurality of weight sentences containing the scanned field are determined; a historical page number acquisition sub-module configured to acquire the historical scanning records of the teaching material file, and acquire the page number of the scanned content recognized by the scanning pen from the historical scanning records; and a page number comparison sub-unit configured to compare the page number of the scanned content with the page number of the weight sentence, and determine the weight sentence closest to the scanned content as the sentence to which the scanned field belongs.
[0121] In summary, the sentence scanning device of the scanning pen provided in the embodiment acquires the word elements of the teaching material file currently learned by the user and the element information table establishing a mapping relationship with the single word element according to the teaching material file, the element information table including the sentence information of all sentences containing the single word element in the teaching material file; acquires the scanned field recognized by the scanning pen, performs word segmentation processing on the scanned field, and acquires one or more keywords contained in the scanned field; calls the element information table of the same word element as the keyword, and acquires the sentence information of the keyword; determines the sentence to which the scanned field belongs according to the sentence information of the keyword, and plays or displays the sentence. Through the above technical means, the scanned field is subjected to word segmentation processing, the keywords constituting the scanned field are acquired, the keywords are queried in the element information table of the teaching material file currently learned, and the sentences to which the keywords belong are determined. The sentences to which the keywords belong are compared, the sentence containing all the keywords is determined, and the sentence to which the scanned field belongs is uniquely determined from the sentence containing all the keywords according to the order of the keywords in the scanned field and the page number of the teaching material currently learned, so as to accurately locate the long sentence that the user wants the scanning pen to play or display, solve the problem that the existing scanning pen cannot play the complete sentence according to the sentence part field, and improve the user experience.
[0122] It is worth noting that in the above embodiments of the sentence scanning device based on the scanning pen, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of this application.
[0123] The sentence scanning device of the scanning pen provided in this application embodiment is included in the scanning pen and can be used to execute the sentence scanning method of the scanning pen provided in any of the above embodiments, and has corresponding functions and beneficial effects.
[0124] Figure 5 This is a schematic diagram of the structure of a scanning pen provided in one embodiment of this application. Figure 5 As shown, the scanner includes a processor 30, a memory 31, an input device 32, an output device 33, and a display screen 34; the number of processors 30 in the scanner can be one or more. Figure 5 Taking a single processor 30 as an example; the number of displays 34 in the scanning pen can be one or more. Figure 5 Taking a display screen 34 as an example; the processor 30, memory 31, input device 32, output device 33, and display screen 34 in the scanning pen can be connected via a bus or other means. Figure 5 Taking the example of a connection between China and Israel via a bus.
[0125] The memory 31, as a storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the sentence scanning method of the scanning pen in this embodiment of the application (e.g., the word segmentation extraction module 201, information acquisition module 202, sentence acquisition module 203, and sentence determination module 204 in the sentence scanning device of the scanning pen). The processor 30 executes various functional applications and data processing of the scanning pen by running the software programs, instructions, and modules stored in the memory 31, thereby realizing the sentence scanning method of the scanning pen described above.
[0126] The memory 31 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on the use of the scanning pen. Furthermore, the memory 31 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 31 may further include memory remotely located relative to the processor 30, which can be connected to the scanning pen via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0127] The input device 32 can be used to receive inputted digital or character information, and to generate key signal inputs related to user settings and function controls of the scanning pen. The output device 33 can include an audio output device such as a speaker.
[0128] The scanning pen described above includes a sentence scanning device of the scanning pen, and can be used to perform any scanning pen sentence scanning method, and has corresponding functions and beneficial effects.
[0129] The embodiment of the present application further provides a storage medium containing computer executable instructions, which are used to perform a scanning pen sentence scanning method when executed by a computer processor. The scanning pen sentence scanning method comprises the following steps: obtaining word elements of a teaching material file and an element information table which is mapped with a single word element according to a teaching material file currently learned by a user, the element information table comprising sentence information of all sentences containing the single word element in the teaching material file; obtaining a scanning field recognized by the scanning pen, performing word segmentation processing on the scanning field, and obtaining one or more key words contained in the scanning field; calling the element information table of the same word element as the key word, and obtaining sentence information of the key word; determining a sentence to which the scanning field belongs according to the sentence information of the key word, and playing or displaying the sentence.
[0130] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include an installation medium, e.g., a CD-ROM, floppy disks, or tape device; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; or a non-volatile memory such as a magnetic medium (e.g., a hard disk or optical storage); registers, or other similar types of memory elements. The storage medium can also include other types of storage medium or combinations thereof. Moreover, the storage medium can be located in a first computer system in which the programs are executed, or the second computer system that connects through a network (such as the Internet) to the first computer system. The second computer system can provide program instructions to the first computer system for execution. The term "storage medium" can include two or more storage mediums that reside in different locations, e.g., in different computer systems that are connected through a network. The storage medium can store program instructions (e.g., as an installed program) that can be executed by one or more processors.
[0131] Of course, the storage medium containing computer executable instructions provided by the embodiment of the present application is not limited to the scanning pen sentence scanning method described above, and can also perform the related operations in the scanning pen sentence scanning method provided by any embodiment of the present application.
[0132] The sentence scanning device of the scanning pen, the scanning pen and the storage medium provided in the above embodiments can execute the sentence scanning method of the scanning pen provided in any of the embodiments of the present application. Technical details not described in detail in the above embodiments can be referred to the sentence scanning method of the scanning pen provided in any of the embodiments of the present application.
[0133] The above are only the preferred embodiments of the present application and the technical principles applied. The present application is not limited to the specific embodiments herein. Various obvious changes, re-adjustments and replacements made by those skilled in the art will not deviate from the protection scope of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments. More other equivalent embodiments can be included without deviating from the concept of the present application, and the scope of the present application is determined by the scope of the claims.
Claims
1. A sentence scanning method for a scanning pen, characterized in that, include: Based on the textbook file currently being studied by the user, obtain the word elements of the textbook file and the element information table that establishes a mapping relationship with each individual word element. The element information table includes sentence information of all sentences in the textbook file that contain individual word elements. Obtain the scanning field identified by the scanning pen, perform word segmentation on the scanning field, and obtain one or more keywords contained in the scanning field; Retrieve the element information table of the word elements that are the same as the keyword, and obtain the sentence information of the keyword; The sentences containing each keyword are compared to determine the intersection sentence containing all keywords. When an intersection sentence containing all keywords is determined, it is determined to be the sentence to which the scanning field belongs. When multiple intersection sentences containing all keywords are determined, the word elements in the intersection sentences are matched sequentially with the keywords in the scanning field according to the order of the word elements. When the same keyword is matched, the unit weight score of the intersection sentence is accumulated, and the next word element is compared with the next keyword. When the same keyword is matched consecutively, the accumulated weight score is multiplied by N, where N>1. When non-consecutive keywords are matched, the unit weight score is accumulated. After matching all keywords in the scanning field, the weight score of the intersection sentence is calculated. The intersection sentence whose weight score meets the preset weight threshold is determined to be the weighted sentence containing the scanning field. When a weighted sentence containing the scanning field is determined, it is determined to be the sentence to which the scanning field belongs, and the sentence is played or displayed.
2. The method according to claim 1, characterized in that, obtaining the word elements of the textbook file and the element information table that establishes a mapping relationship with individual word elements based on the textbook file currently being studied by the user includes: Obtain the textbook name recognized by the scanning pen, and determine the corresponding textbook file based on the textbook name; Obtain the word and phrase elements associated with the textbook file and the element information table that establishes a mapping relationship with each individual word and phrase element.
3. The method according to claim 2, characterized in that, The process of obtaining the word and phrase elements associated with the textbook file and the element information table that establishes a mapping relationship with each individual word and phrase element includes: Download the textbook file corresponding to the textbook name identified by the scanning pen; The sentences on each page of the textbook file are segmented into words, and the word elements contained in the sentences are extracted. All extracted word elements are deduplicated, retaining the unique word elements from the textbook file; The retained word elements and their corresponding sentence information are associated and saved as the element information table, and the element information table is associated and saved with the textbook file. The sentence information includes the order of the word elements in their corresponding sentences and the textbook page number of the sentence to which the word elements belong.
4. The method according to claim 1, characterized in that, The step of performing word segmentation on the scanned field to obtain one or more keywords contained in the scanned field includes: If the same character in the scanned field matches different word elements, the word element containing the most characters is determined as the keyword contained in the scanned field.
5. The method according to claim 1, characterized in that, The step of determining the sentence to which the scanned field belongs based on the sentence information of the keywords includes: When multiple weighted sentences containing the scanned field are identified, the page number of the weighted sentence is obtained; Obtain the historical scanning records of the teaching material document, and extract the page numbers of the scanned content recognized by the scanning pen from the historical scanning records; The page number of the scanned content is compared with the page number of the weighted sentence to determine the weighted sentence that is closest to the scanned content as the sentence to which the scanned field belongs.
6. A sentence scanning device for a scanning pen, characterized in that, include: The information acquisition module is configured to acquire, based on the textbook file currently being studied by the user, the word elements of the textbook file and an element information table that establishes a mapping relationship with each individual word element. The element information table includes sentence information of all sentences in the textbook file that contain individual word elements. The word segmentation and extraction module is configured to obtain the scanning field recognized by the scanning pen, perform word segmentation processing on the scanning field, and obtain one or more keywords contained in the scanning field; The sentence acquisition module is configured to retrieve the element information table of the word elements that are the same as the keyword, and obtain the sentence information of the keyword; The sentence determination module is configured to compare the sentences to which each keyword belongs, determine the intersection sentences containing all keywords, and when an intersection sentence containing all keywords is determined, determine that the intersection sentence belongs to the scanned field. When multiple intersection sentences containing all keywords are determined, match the word elements in the intersection sentences with the keywords in the scanned field according to the order of the word elements in the intersection sentences. When the same keyword is matched, accumulate the unit weight score of the intersection sentence, and compare the next word element with the next keyword. When the same keyword is matched consecutively, accumulate N times the accumulated weight score, where N>1. When non-consecutive keywords are matched, accumulate the unit weight score. After matching all keywords in the scanned field, calculate the weight score of the intersection sentences, and determine the intersection sentences whose weight scores meet the preset weight threshold as weighted sentences containing the scanned field. When a weighted sentence containing the scanned field is determined, determine that the weighted sentence belongs to the scanned field, and play or display the sentence.
7. A scanning pen, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the sentence scanning method of the scanning pen as described in any one of claims 1-5.
8. A storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the sentence scanning method of the scanning pen as described in any one of claims 1-5.
Citation Information
Patent Citations
Book content searching method, terminal equipment and storage medium
CN111639209A
Textbook scanning reading and query matching method
CN112989073A