Mathematics detection in handwriting

A three-tiered analysis method using predefined rules and neural networks effectively distinguishes mathematical and textual content in handwriting, enhancing recognition accuracy.

JP7573246B2Active Publication Date: 2024-10-25MYSCRIPT
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2022543161
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-01-28
Filing Date
2021-01-27
Publication Date
2024-10-25
Estimated Expiration
2041-01-27

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately distinguish and recognize both mathematical and textual content in handwriting, lacking an efficient solution for reliable differentiation.

Method used

A method involving three levels of analysis - symbolic, syntactic, and semantic - is employed to classify symbols as either text or mathematical, using predefined rules and neural networks to establish spatial and semantic connections, ensuring high confidence in differentiation.

Benefits of technology

The method achieves efficient and reliable recognition of mathematical and textual content in handwriting by accurately classifying symbols, enabling precise differentiation and improved handwriting recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007573246000002
    Figure 0007573246000002
  • Figure 0007573246000003
    Figure 0007573246000003
  • Figure 0007573246000004
    Figure 0007573246000004
Patent Text Reader

Abstract

The present invention relates to a method implemented by a computing device (100) for processing mathematics and text in handwriting, the method including: identifying symbols by performing handwriting recognition on a plurality of strokes (SK); classifying the first symbol as either a text symbol candidate or a mathematical symbol candidate with a confidence score that reaches at least a first threshold as a first classification; classifying a second symbol other than the first symbol as either a text symbol candidate or a mathematical symbol candidate with respective confidence scores as a second classification by applying predefined spatial-syntactic rules (RL2); updating or confirming the result of the second classification by establishing semantic connections between the symbols and comparing the semantic connections with the result of the second classification as a third classification; and recognizing each symbol as either text or mathematics based on the result of the third classification.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present disclosure relates generally to the field of handwriting recognition and processing, and more particularly to computing devices capable of recognizing mathematical and textual content in handwriting. [Background technology]

[0002] Various computing devices have been developed over the years for handwriting input and recognition, i.e., for input elements handwritten or handwritten by a user, such as textual content (e.g., alphabetic characters) or non-textual content (e.g., shapes, drawings), etc. For this purpose, known computing devices are usually equipped with a touch-sensitive screen or the like that enables a user to input handwritten content in the form of strokes of digital ink that can be displayed on a display screen.

[0003] The user handwriting input may be interpreted using an online handwriting recognition system that allows real-time recognition as the handwriting is entered by the user. The handwriting recognition may be performed, for example, using a cloud-based solution or the like. Alternatively, offline systems are also known. Once recognized, the computing device may perform any appropriate processing task, such as converting the input strokes into, for example, a typeset version or implementing editing functions.

[0004] In order to provide a user with a good experience, including displaying, manipulating, and editing handwriting, it is important that handwritten input from a user is recognized as accurately as possible. Text classifiers are known and used to recognize handwritten text, such as handwritten letters, numbers, symbols, accents, etc. However, handwritten input may be of various natures, which sometimes makes the task of handwriting recognition difficult.

[0005] Handwriting recognition can be a challenge, especially when the handwriting contains mathematical content or a mixture of textual and mathematical content. As of today, there are no efficient solutions that recognize both mathematics and text. In particular, there is a need for a solution that distinguishes between mathematical and textual content in handwriting in an accurate and reliable manner. Summary of the Invention

[0006] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The embodiments of the present invention described herein below provide computing devices, methods, and corresponding computer programs for processing mathematics and text in handwriting.

[0007] According to a particular aspect, the present invention provides a method implemented by a computing device for processing mathematics and text in handwriting, the method comprising: - identifying a symbol by performing handwriting recognition on a plurality of strokes of digital ink; - classifying at least one first symbol from the symbols identified as either text symbol candidates or mathematical symbol candidates having a confidence score reaching at least a first threshold as a first classification by applying predefined symbol recognition rules to the symbols individually; - classifying, as a second classification, the at least one second symbol as either a text symbol candidate or a mathematical symbol candidate with a respective confidence score by applying, to the at least one first symbol and to at least one second symbol other than the at least one first symbol, predefined spatial-syntactic rules defining a spatial relationship between the at least one first symbol and the at least one second symbol; - updating or confirming the result of said second classification as a third classification by establishing a semantic connection between at least two symbols from the identified symbols and comparing said semantic connection with the result of said second classification; recognizing each symbol as either a text symbol or a mathematical symbol based at least on the result of said third classification; The present invention provides a method comprising:

[0008] The present invention enables the recognition of mathematics and text in handwriting in an efficient and reliable manner. It is possible to determine with a high degree of confidence which strokes (or symbols) of the handwritten input are textual content and which are mathematical content. In particular, efficient mathematics / text differentiation is achieved by performing a three-level analysis of the handwritten input: symbolic analysis, syntactic analysis, and semantic analysis.

[0009] In certain embodiments, the method includes obtaining a plurality of strokes of digital ink forming symbols prior to identifying said symbols, wherein said identified symbols include at least one text symbol and at least one mathematical symbol.

[0010] In certain embodiments, during the aforementioned symbol identification, the plurality of strokes are compared to a set of predefined symbols, and each symbol formed by the plurality of strokes is identified as a respective one in the set of predefined symbols.

[0011] In a particular embodiment, the method includes calculating ink-related information for each identified symbol based on each stroke forming said symbol, said ink-related information comprising: - symbol information characterizing unique characteristics of one or more strokes forming said symbol; - context information characterizing at least one adjacent stroke spatially associated with one or more strokes forming said symbol according to a respective ordering of at least one of the plurality of strokes, The ink-related information described above is used in at least the second and third classifications described above to classify each symbol as either a mathematical symbol candidate or a text symbol candidate.

[0012] In a particular embodiment, the strokes are captured as online handwritten with temporal information indicating the temporal order in which the strokes were handwritten relative to one another; The context information characterizes, for each symbol, at least one adjacent stroke that is spatially associated with one or more strokes forming said symbol at least according to a temporal ordering of the strokes.

[0013] In certain embodiments, the first category mentioned above is: - for each identified symbol, determining embedding information attributed to said symbol by a symbol recognition rule, said embedding information including a respective confidence score that said predefined symbol is either text or math; - comparing the respective confidence scores of each identified symbol as defined in the embedding information to a first threshold so as to identify at least one first symbol as either a text symbol candidate or a mathematical symbol candidate having a confidence score that reaches at least the aforementioned first threshold; Includes.

[0014] In a particular embodiment, during the first classification, each symbol is classified as either a text symbol candidate or a mathematical symbol candidate with a respective confidence score by individually applying predefined symbol recognition rules.

[0015] In a particular embodiment, each symbol identified in the first classification is assigned an embedding that includes a respective confidence score that said symbol is either text or math based on predefined symbol recognition rules.

[0016] In a particular embodiment, during said second classification, said spatial syntactic rules are applied to said at least one first symbol to identify at least one other symbol having a predefined spatial relationship with one or more of the first symbols as either a mathematical symbol candidate or a textual symbol candidate.

[0017] In a particular embodiment, during said second classification, each symbol other than said at least one first symbol is classified as either a text symbol candidate or a mathematical symbol candidate.

[0018] In certain embodiments, the spatial syntax rule is: - a mathematical spatial syntax rule that defines the spatial relationship between at least two mathematical symbols; - a text spatial syntactic rule defining a spatial relationship between at least two text symbols; Includes.

[0019] In certain embodiments, the mathematical spatial syntax rules are as follows: - a fraction including a fraction rule separating the numerator and denominator components; - superscripts and subscripts associated with one or more symbols located to the top left and bottom left, respectively, of one or more basic symbols; - overscripts and underscripts associated with one or more symbols positioned respectively above and below one or more base symbols; a matrix associated with a number of rows and columns of symbols arranged in a tabular format; The method includes at least a mathematical spatial syntax rule that defines:

[0020] In certain embodiments, the second category is: - applying the mathematical spatial syntax rules as described above to identify, for each mathematical symbol candidate, at least one other symbol having a predefined spatial relationship with the at least one (or zero to multiple) first symbol identified as a mathematical symbol candidate in the first classification; - applying said text-spatial-syntactic rules to identify, as each mathematical symbol candidate, at least one other symbol having a predefined spatial relationship with at least one first symbol identified as a mathematical symbol candidate in the first classification; Includes at least one of the following:

[0021] In certain embodiments, if the result of the second classification is confirmed during the third classification based on semantic connectivity, the result produced in the third classification is identical to the result of the second classification.

[0022] In certain embodiments, when the results of the second classification are updated during the third classification based on semantic connections, the results produced in the third classification include revised classifications of symbols as text candidates and symbol candidates for the second classification along with their respective updated confidence scores; The method further includes repeating the second classification on the results of the third classification to either confirm or update the aforementioned results.

[0023] In certain embodiments, an iterative classification process including the above-mentioned second and third classifications is repeated until the second and third classifications converge to the same result.

[0024] In a particular embodiment, if a predefined number N of iterations of the classification process is reached before the second and third classifications converge to an identical result, the most recently updated result of the second classification obtained in the third classification is used to recognize each symbol as either a text symbol or a mathematical symbol, where N is an integer of at least 2.

[0025] In certain embodiments, recognizing each symbol as either a text symbol or a mathematical symbol includes assigning to each stroke a classification as either mathematical or text along with an associated confidence score based at least on the results of the third classification.

[0026] In certain embodiments, the method includes grouping the strokes into one or more blocks of strokes based on the results of the aforementioned recognizing, each block being either a text block or a math block, each stroke contained in a text block being part of a text symbol, and each stroke contained in a math block being part of a math symbol.

[0027] In certain embodiments, the groups are determined based on the classification of each symbol as mathematical or textual as defined in the third classification result above, and based on the spatial proximity of the strokes to each other.

[0028] In a particular embodiment, the method includes displaying a number of strokes along with a box representing a respective block to which each stroke belongs.

[0029] Certain embodiments involve recognizing the mathematical and textual content in the aforementioned strokes by applying a mathematical language model to each mathematical block and a textual language model to each text block.

[0030] According to another aspect, the present invention relates to a non-transitory computer readable medium having recorded thereon a computer readable program code (or computer program) comprising instructions for performing the steps of the method of the present invention as defined herein.

[0031] The computer program of the present invention may be expressed in any programming language and may be in the form of source code, object code or any intermediate code between source code and object code, for example in a partially compiled form, or in any other suitable form.

[0032] The present invention also provides a computer program as mentioned above.

[0033] The non-transitory computer readable medium mentioned above may be any entity or device capable of storing a computer program. For example, the recording medium may include a storage means such as a ROM memory (CD-ROM or ROM implemented in a microelectronic circuit) or a magnetic storage means such as a floppy disk or a hard disk.

[0034] The non-transitory computer-readable medium of the present invention may correspond to a transmissible medium, such as an electrical or optical signal, which may be conveyed via electrical or optical cable, or by radio or any other suitable means. A computer program according to the present disclosure may in particular be downloaded from the Internet or a similar network.

[0035] Alternatively, the non-transitory computer readable medium may correspond to an integrated circuit into which the computer program is loaded, the circuitry being adapted to perform, or for use in the performance of, the methods of the invention.

[0036] In a particular embodiment, the present invention relates to a non-transitory computer readable medium having computer readable program code embedded therein, said computer readable program code adapted to be executed on a computing device to implement a method for processing mathematics and text in handwriting as defined herein, the computing device including a processor for performing the steps of said method.

[0037] The invention also relates to a computing device suitable for implementing the method as defined in the present disclosure. More specifically, the invention relates to a computing device for processing mathematics and text in handwriting, comprising: a first recognition module for identifying a symbol by performing handwriting recognition on a plurality of strokes of digital ink; a symbol processing module for classifying at least one first symbol from the symbols identified as either text symbol candidates or mathematical symbol candidates having a confidence score reaching at least a first threshold as a first classification by applying predefined symbol recognition rules to the symbols individually; a syntactic processing module for classifying, as a second classification, the at least one second symbol as either a text symbol candidate or a mathematical symbol candidate with a respective confidence score by applying predefined spatial syntactic rules to the at least one first symbol and to at least one second symbol other than the at least one first symbol, the predefined spatial syntactic rules defining a spatial relationship between the at least one first symbol and the at least one second symbol; a semantic processing module for establishing a semantic connection between at least two symbols from the identified symbols and for updating or confirming the result of said second classification as a third classification by comparing said semantic connection with the result of said second classification, wherein said computing device is configured to recognize each symbol as either a text symbol or a mathematical symbol based at least on a result of said third classification. A computing device is provided.

[0038] The various embodiments defined in connection with the methods of the present invention apply in an analogous manner to the computing devices, computer programs and non-transitory computer readable media of the present disclosure.

[0039] For each step of the method of the present invention as defined in this disclosure, the computing device may include a corresponding module configured to perform the aforementioned step.

[0040] In certain embodiments, the present disclosure may be implemented using software and / or hardware components. In this context, the term "module" in this disclosure can refer to a hardware component or multiple software and / or hardware components as well as a software component.

[0041] Other characteristics and advantages of the present disclosure will emerge from the following description, made with reference to the accompanying drawings, which show embodiments of a non-limiting nature. [Brief description of the drawings]

[0042] [Figure 1] 1 is a block diagram of a computing device in accordance with certain embodiments of the present invention. [Diagram 2] FIG. 2 is a block diagram representing functional modules implemented by a computing device in accordance with certain embodiments of the present invention. [Diagram 3] 4 is a flow chart illustrating method steps for processing mathematics and text in handwriting in accordance with certain embodiments of the present invention. [Figure 4] 3 illustrates different steps of a method for processing mathematics and text in handwriting according to certain embodiments of the present disclosure; [Diagram 5] 3 illustrates different steps of a method for processing mathematics and text in handwriting according to certain embodiments of the present disclosure; [Figure 6]4 illustrates a set of predefined symbols in accordance with certain embodiments of the present invention. [Figure 7] 2 represents the different steps of a method for processing mathematics and text in handwriting according to a particular embodiment of the invention; [Figure 8] 2 represents the different steps of a method for processing mathematics and text in handwriting according to a particular embodiment of the invention; [Figure 9] 2 represents the different steps of a method for processing mathematics and text in handwriting according to a particular embodiment of the invention; [Figure 10] 2 represents the different steps of a method for processing mathematics and text in handwriting according to a particular embodiment of the invention; [Figure 11] 2 represents the different steps of a method for processing mathematics and text in handwriting according to a particular embodiment of the invention; [Figure 12A] 2 represents the different steps of a method for processing mathematics and text in handwriting according to a particular embodiment of the invention; [Figure 12B] 2 represents the different steps of a method for processing mathematics and text in handwriting according to a particular embodiment of the invention; [Figure 12C] 2 represents the different steps of a method for processing mathematics and text in handwriting according to a particular embodiment of the invention; [Figure 13] 2 represents the different steps of a method for processing mathematics and text in handwriting according to a particular embodiment of the invention; [Figure 14] 2 represents the different steps of a method for processing mathematics and text in handwriting according to a particular embodiment of the invention; [Figure 15] 2 represents the different steps of a method for processing mathematics and text in handwriting according to a particular embodiment of the invention; [Figure 16] 1 illustrates a schematic representation of the structure and operation of a recurrent neural network in accordance with certain embodiments of the present invention; [Figure 17]1 illustrates a schematic representation of the structure and operation of a recurrent neural network in accordance with certain embodiments of the present invention; [Figure 18] FIG. 1 is a block diagram that generally represents a method for processing mathematics and text in handwriting according to a particular embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0043] The components in the drawings are not necessarily to scale, emphasis instead being placed upon illustrating the principles of the invention.

[0044] For simplicity and clarity of illustration, the same reference numbers will be used throughout the figures to refer to the same or similar parts, unless otherwise indicated.

[0045] In the following detailed description, numerous specific details are set forth by way of example to provide a thorough understanding of the relevant teachings. However, it should be apparent to those skilled in the art that the present teachings may be practiced without such details. In other instances, well-known methods, procedures, and / or components are described at a relatively high level, rather than in detail, to avoid unnecessarily obscuring aspects of the present teachings.

[0046] The following description of exemplary embodiments refers to the accompanying drawings. The following detailed description does not limit the invention. Indeed, the scope of the invention is defined by the appended claims. In various embodiments as illustrated in the drawings, computing devices, corresponding methods, and corresponding computer programs are discussed.

[0047] The terms "hand-drawing" and "handwriting" are used interchangeably herein to define the creation of digital content (handwritten input) by a user through the use of their hands (or fingers) or input devices (handheld stylus or digital pen, mouse...) on or with an input screen. The term "hand" or similar is used herein to provide a concise description of the input technique, however, the use of other parts of the user's body for similar input, such as feet, mouth, and eyes, is included in this definition.

[0048] Handwriting is formed by strokes of digital ink input by a user. A stroke (or input stroke) is characterized by a stroke start position (corresponding to a "pen down" event), a stroke end position (corresponding to a "pen up" event), and a path connecting the stroke start position and the stroke end position.

[0049] The term "text" in this disclosure is understood to encompass all characters (e.g., alphabetic characters or the like) in any written language, and strings thereof, and more generally, any symbols used in written text. Thus, text includes base characters and accents from any script, such as Latin, Cyrillic, and Kanji.

[0050] The term “math” (or mathematics) is understood in this disclosure to encompass any mathematical symbol in any language, or a string of mathematical symbols, i.e., any symbols used to express any mathematical content, mathematical expression, or mathematical property.

[0051] Specific examples of textual and mathematical content are provided in further detail below.

[0052] Furthermore, the embodiments shown in those figures are in a left-to-right written language context, and therefore any references to positions may be adapted for written languages ​​having different directional formats.

[0053] Various techniques described herein relate generally to processing handwriting on portable and non-portable computing devices, and more specifically for the purposes of recognizing mathematics and text. While various embodiments are described with respect to recognizing digital ink handwriting input using so-called online recognition techniques, it will be understood that other forms of input for recognition may also be applied, such as offline recognition involving a remote device or server to perform the recognition.

[0054] The systems and methods described herein can utilize recognition of a user's natural handwriting style input into a computing device via an input screen, such as a touch-sensitive screen (as discussed below).

[0055] As will be explained in more detail below, aspects of the invention relate to processing mathematics and text in handwriting. The method is based on three symbol classifications of different nature, namely classification at the symbolic representation level, at the syntactic level and at the semantic level, that enable accurate and reliable recognition of textual and mathematical symbols in handwriting.

[0056] More specifically, the method may involve identifying symbols by performing handwriting recognition on a plurality of strokes of digital ink; performing a first classification at a symbol level to classify at least one first symbol as either a text symbol candidate or a mathematical symbol candidate having a confidence score that reaches at least a first threshold; performing a second classification at a syntactic level to classify at least one second symbol other than the at least one first symbol as either a text symbol candidate or a mathematical symbol candidate having a respective confidence score based on a spatial relationship between the at least one first symbol and the at least one second symbol; performing a third classification at a semantic level to update or confirm a result of the second classification based on a semantic connection established between the at least two symbols; and recognizing each symbol as either a text symbol or a mathematical symbol based at least on a result of the third classification.

[0057] 1 shows a block diagram of a computing device DV1 according to a specific embodiment of the present invention. The computing device (or digital device) DV1 may be a computer desktop, a laptop computer, a tablet computer, an e-reader, a mobile phone, a smartphone, a wearable computer, a digital watch, an interactive whiteboard, a global positioning system (GPS) unit, an enterprise digital assistant (EDA), a personal digital assistant (PDA), or a game console, etc. The computing device DV1 may include at least one processing element component, some form of memory, and input-output (I / O) devices. The components communicate with each other through inputs and outputs, such as connectors, lines, buses, link networks, or others known to those skilled in the art.

[0058] More specifically, the computing device DV1 includes an input screen 4 for handwritten (or hand-drawn) content IN, which may be textual content, mathematical context, or a mixture of textual and mathematical content, as will be further explained below. The input screen 4 is suitable for detecting a plurality of strokes of digital ink SK inputted on (or using) the aforementioned input screen.

[0059] The input screen 104 may employ any suitable technology for receiving user input in the form of a touch-sensitive or proximity-sensitive screen, such as resistive, surface acoustic wave, capacitive, infrared grid, infrared acrylic projection, optical imaging, dispersive signal technology, acoustic pulse recognition, or any other suitable technology known to those skilled in the art. The input screen 4 may also be a non-touch sensitive screen monitored by a position detection system.

[0060] The computing device 100 also includes at least one display unit (or display device) 2 for outputting data such as handwritten IN from the computing device DV1. The display unit 2 may be a screen or the like of any suitable technology (LCD, plasma...). The display unit 2 is suitable for displaying digital ink strokes SK entered by a user.

[0061] The input screen 4 may be co-located with the display unit 2 or may be remotely connected to it. In a particular embodiment, the display unit 2 and the input screen 4 are part of a touch screen.

[0062] 1, the computing device DV1 further includes a processor 6 and a memory 8. The computing device DV1 may also include one or more volatile memory elements (RAM) as part of the memory 8 or separately therefrom.

[0063] The processor 6 is a hardware device for executing software, in particular software stored in the memory 8. The processor 8 may be any custom-made or general-purpose processor, a central processing unit (CPU), a semiconductor-based microprocessor (in the form of a microchip or chipset), a microcontroller, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic circuit, or any combination thereof, and more generally, any suitable processor component designed to execute software instructions, as known to those skilled in the art.

[0064] Memory 8 is a non-transitory (or non-volatile) computer-readable medium (or recording medium) according to certain embodiments of the present disclosure. Memory 8 may include any combination of non-volatile storage elements (e.g., ROM, EPROM, Flash PROM, EEPROM, hard drive, magnetic or optical tape, memory registers, CD-ROM, WORM, or DVD, etc.).

[0065] The memory 8 may be remote from the computing device DV1, such as being located on a server or cloud-based system that is remotely accessible by the computing device DV1. The non-volatile memory 8 is coupled to the processor 6 such that the processor 6 is able to read information from and write information to the memory 8. Alternatively, the memory 8 is integrated into the computing device 8.

[0066] The memory 8 includes an operating system (OS) 10 and a handwriting application (or computer program) 12. The operating system 10 controls the execution of the application 12. The present application constitutes (or includes) a computer program (or computer readable program code) according to certain embodiments of the invention, the computer program including instructions for implementing a method according to certain embodiments of the invention.

[0067] In this embodiment, the application 12 includes instructions for processing the mathematics and text in the captured handwritten IN in an appropriate manner. In this example, the handwritten IN to be processed may be strokes of digital ink SK handwritten by a user using the input screen 4 of the computing device 100, as will be discussed further below. In a variant, the handwritten IN is captured by the computing device DV1 but is not entered through the input screen 4.

[0068] 1, the non-volatile memory 8 is suitable for storing various data acquired by the computing device 2, including a set of predefined symbols (or data set) ST1, a set of predefined symbol recognition rules RL1, a set of predefined spatial-syntactic rules RL2, and a set of predefined semantic rules RL3. The memory 8 may also store ink-related information IF1 and / or embedded information IF2, the nature and use of which are described in further detail below.

[0069] As shown in FIG. 2 according to a particular embodiment, when running an application 12 (FIG. 1) stored in memory 108, the processor 6 implements modules, namely a first recognition module MD2, a symbolic processing module MD4, a syntactic processing module MD6, a semantic processing module MD8 and, optionally, a post-processing module MD12.

[0070] The first recognition module MD2 may be configured to identify the symbol SB by performing handwriting recognition on a plurality of strokes SK of the digital ink.

[0071] The symbol processing module MD4 may be configured to classify, as a first classification, at least one first symbol SBa from the symbols SB identified as either text symbol candidates or mathematical symbol candidates having a confidence score reaching at least a first threshold value. This first classification may be performed by applying predefined symbol recognition rules RL1 individually to the symbols SB identified by the first recognition module MD2.

[0072] The syntactic processing module MD6 may be configured to classify as a second classification at least one second symbol SBb other than said at least one first symbol SBa as either a text symbol candidate or a mathematical symbol candidate with a respective confidence score, said second classification being performed by applying to said at least one first symbol SBa and said at least one second symbol SBb predefined spatial syntactic rules RL2 defining a spatial relationship between said at least one first symbol SBa and said at least one second symbol SBb.

[0073] The semantic processing module MD8 may be configured to establish, as a third classification, a semantic connection between at least two symbols from the identified symbols SB and to update or verify the result of said second classification by comparing said semantic connection with the result of said second classification.

[0074] The computing device DV1 may be configured to recognise each symbol SB as either a text symbol or a mathematical symbol based on (or at least based on) the result of the aforementioned third classification.

[0075] A post-processing module MD12 may be configured to perform post-processing operations on the strokes SK once recognition by the processing modules MD4, MD6 and MD8 is complete.

[0076] The application 12 comprises instructions configuring the processor 6 to implement the above mentioned modules MD2 to MD12 in order to carry out the steps of the method of the invention, as will be explained later in specific embodiments.

[0077] Each of the modules MD2 to MD12 may be or include one or more neural networks. In this embodiment, each of the modules MD4, MD6, and MD8 is implemented by a neural network.

[0078] The configuration and operation of the modules MD2 to MD12 of the computing device DV1 will become clearer in a particular embodiment described below with reference to the drawings. It will be understood that the modules MD2 to MD12 as shown in Figure 2 only represent an example embodiment of the invention and that other implementations are possible.

[0079] For each step of the method of the invention, the computing device DV1 may include a corresponding module configured to perform the aforementioned step.

[0080] A method implemented by the computing device DV1 illustrated in Figures 1 and 2 will now be described with reference to Figures 3 to 15, according to a particular embodiment of the invention. More specifically, the computing device DV1 implements the method by executing an application 12 stored in memory 8.

[0081] Consider an example scenario in which a computing device DV1 acquires handwritten IN, detects mathematics in the acquired handwritten IN, and more specifically implements a handwriting recognition application 12 to recognize mathematical and textual contexts in the aforementioned handwritten IN.

[0082] More specifically, in an acquisition step S2 (FIG. 3), the computing device DV1 acquires handwritten input IN in the form of digital ink. The acquired handwritten input IN is formed by a plurality of strokes SK of digital ink. The strokes SK constitute a digital representation of the handwritten input IN. The set of acquired strokes SK forms at least one handwritten line extending along a respective baseline 20.

[0083] Thus, the computing device DV1 displays the acquired strokes ST on the display 2, as shown in FIG.

[0084] As already indicated, each input stroke SK is characterized by at least a stroke start position, a stroke end position, and a path connecting the stroke start position and the stroke end position. Thus, for example, a dot placed on top of the letter "i" (in the word "point") constitutes a single stroke by itself.

[0085] In this example, the input strokes SK captured at S2 form the following handwritten phrase, as shown in FIG. ``let pb the point (1 / 2, 1 / 2) ∈ R 2 , and let L(c)」

[0086] As can be seen, the captured handwriting IN extends along (or substantially along) a baseline 20. The captured handwriting IN is, in this case, an expression or phrase in a written language (English), forming handwritten lines and including various symbols as will be further described below. In this example, it is assumed that the textual content is a single baseline and the mathematical content is a single or multiple baselines. However, this constitutes only an example and it should be considered that many other types, contents and forms of handwriting are possible in terms of language, style, format, etc. In particular, various spatial arrangements of the strokes SK relative to one another may be considered (e.g., various handwriting directions, sizes).

[0087] In the present case, it is assumed that a number of strokes ST of digital ink are input by a user in an input area of ​​the display 2 using the input screen 104 of the computing device DV1. The user can input the input strokes SK by some input device such as a hand or a finger, or a digital pen or stylus suitable for use on the input screen 4. The user can also input the input strokes SK by making gestures on the input screen 4, or by a peripheral device of the computing device DV1, such as a mouse or a joystick, if means configured to detect movements in the vicinity of the input screen 4 are used.

[0088] However, it should be understood that the computing device DV1 may acquire the handwritten IN in any other suitable manner.

[0089] In this embodiment, the computing device DV1 captures strokes SK as they are input by the user on the input screen 4 to perform online handwriting recognition. The computing device DV1 detects and processes handwriting (textual and mathematical content) at the line level, although various implementations are possible. As will be explained further below, temporal information characterizing how strokes SK are input relative to each other over time is thus captured by the computing device DV1 for later processing.

[0090] However, it should be noted that the present invention may also be applied in a manner similar to offline handwriting recognition, i.e. by performing the inventive concepts on images of handwriting, thereby forming a static representation of the handwriting. Thus, temporal information about how strokes are input relative to each other over time is not directly available. Thus, the inventive concepts may be applied without using such temporal information, or instead, by recovering strokes from images and generating the temporal information in any suitable artificial way, for example by training a neural network using handwritten images and their known temporal information.

[0091] In an identification step S4 (FIGS. 3 and 5), the computing device DV1 identifies the symbol SB by performing handwriting recognition on the acquired strokes SK of the digital ink. The handwriting recognition S4 is performed by a first recognition module MD2, which may be or include a recognition classifier.

[0092] FIG. 5 shows a sequence of symbols SB identified by the computing device DV1 (S4) based on the strokes SK in this example.

[0093] Each symbol SB is formed by one or more input strokes, or by at least a part of a stroke SK. In addition, each symbol SB may be either a text symbol or a mathematical symbol, depending on the nature of the symbol and the context in which it is used.

[0094] The aim of the method is to distinguish mathematical symbols from textual symbols among the identified symbols SB. In the present case, it is considered that the identified symbols SB comprise at least one textual symbol and at least one mathematical symbol. However, it should be noted that the invention may also be applied in cases where only mathematical content or only textual content is to be recognized in the acquired handwritten IN.

[0095] To perform the handwriting recognition S4, a set (or data set) ST of predefined symbols PSB as mentioned before is used. More specifically, the strokes SK obtained in S2 are compared with the set ST of predefined symbols PSB, and each symbol SB formed by a plurality of strokes SK is identified in S4 as a respective one in the set ST of predefined symbols PSB. In other words, the computing device DV1 matches the various strokes SK obtained in S2 (taking either a part of a stroke, a whole stroke, or a group of strokes) with any predefined symbol PSB as defined in the data set ST. For this purpose, the computing device DV1 consults the pre-stored data set ST and performs various comparisons between the data set ST and the obtained strokes SK.

[0096] It follows that each symbol SB that can be obtained in S4 has a learnable representation from the data set ST.

[0097] Each predefined symbol PSB occurs only once in the data set ST. Each predefined symbol PSB may be a so-called pure text symbol (i.e. a symbol used only or mostly as text), a so-called pure mathematical symbol (i.e. a symbol used only or mostly as mathematics), or a mixed text / mathematical symbol that can be used as mathematics or text depending on the context. As will be shown further below, each predefined symbol PSB may be assigned embedding information IF2 by a symbol recognition rule RL1, the embedding information IF2 including a confidence score that the aforementioned predefined symbol PSB is either text or mathematics.

[0098] Any suitable non-empty dataset ST may be used, keeping in mind that this may vary depending on each case. The dataset ST may be custom constructed to take into account mathematics and text characteristics. The dataset ST is preferably constructed to facilitate the distinction between mathematics and text by including symbols from mathematics and multiple scripts. The dataset ST may include symbols, numbers, accents, accent variants of multiple letters, mathematical operators, mathematical symbols, Greek letters that are often used in mathematical expressions, etc. from any language or script.

[0099] This data set ST may be designed to make the system robust to human ink manipulation and noise, for example, by including new symbols therein to detect delayed strokes, symbol character strokes (e.g., accents, multi-stroke characters, and / or spurious strokes).

[0100] In this embodiment, the data set ST used for symbol recognition in S4 is shown in Fig. 6. In particular, the data set ST may contain the following symbols (or at least one or some of the following symbol types): -Numbers (e.g., "0" to "9") -Characters from any language or script, such as alphabetic characters (e.g., "a" through "z" and "A" through "Z"), Cyrillic, or Chinese characters; - mathematical operators (e.g. n-ary mathematical operators) and mathematical symbols (e.g. "+", "=", "-", "*", "(", ")", "[", "]", "{", "}"), -Character-based symbols, e.g. Greek and Hebrew -Text modifiers such as bars and arrows, - Any combination of at least two of the above symbols, such as: Alphabetical letter combinations that define standard mathematical functions such as sin, cos, tan, lim, etc. Combinations that preserve some mathematical properties in a given context, such as variable names, units, etc., and Symbols that participate in spatial arrangements such as matrices, fractions, superscripts / subscripts, polylines, etc.

[0101] As can be seen in the dataset ST of FIG. 6, some predefined symbols PSB may be considered as pure mathematical symbols in this dataset ST (e.g., “∈”, “=”, “+”) since they are commonly used in mathematical contexts.

[0102] To identify the symbols SB in the identifying step S4, the computing device DV1 may perform handwriting recognition on the acquired strokes SK in any suitable manner, for example using a sequential classifier. Each recognized symbol SB in S4 may be associated with a respective recognition cost, which represents the level of confidence or relevance of the recognition, for further use in the method. The results produced in the handwriting recognition in S4 are not always certain, since different users may naturally write the same symbol with slight variations. The symbol classifier is preferably adaptable to various methods in which each symbol can be input and still be recognized as the correct or intended symbol.

[0103] In the present case, the application 12 includes a first recognition module MD2 operating as a symbol classifier at S4 to perform handwriting recognition. Alternatively, the first recognition module MD2 may be a module for communicating with a remote handwriting recognition system from the computing device DV1, such as a server SV1 as represented in Fig. 1, remotely accessible by the computing device DV1 through a suitable communication link.

[0104] The nature and implementation of the handwriting recognition process performed by the first recognition module MD2 may vary depending on the respective case: the handwriting recognition may be performed entirely locally on the computing device DV1 or at least partly remotely, for example using a remote server SV1 (FIG. 1).

[0105] In a feature extraction step S6, the computing device DV1 performs feature extraction on the identified symbols so as to obtain ink-related information F1 representative of the digital ink forming each symbol SK. In other words, the ink-related information IF1 represents, in the present case, how the associated symbol SB is handwritten. This feature extraction step S6 may be performed as part of the identifying step S4 or at least partially before the identifying step S4. The ink-related information IF1 is obtained in S6 for later use during the following classification process S10 (FIG. 3).

[0106] In this embodiment, during the feature extraction step S6, the computing device DV1 calculates, for each symbol SB identified in S4, ink-related information IF1 based on each stroke SK forming said symbol. For each symbol SB, the associated ink-related information IF1 is - symbol information IF1a characterizing the specific properties of one or more strokes SK forming the aforementioned symbol SB; - context information IF1b characterizing at least one other (or adjacent) stroke SK that is spatially related to one or more strokes SK forming said symbol SB according to a respective ordering of at least one of said strokes SK; may include:

[0107] The ink-related information IF1 obtained in S6 may be used in at least the subsequent second classification S16 and third classification S18, and possibly also in the first classification S12, to classify each symbol SB as either a mathematical symbol candidate or a text symbol candidate (as discussed further below).

[0108] More specifically, symbol information IF1a characterizes the associated symbol SK itself, i.e., its inherent qualities of one or more constituent strokes SK, regardless of the surrounding ink in the handwriting IN. Symbol information IF1a may include any one (or all) of the following categories: classification features, symbol positional features, and symbol descriptive features.

[0109] The classification features referred to above include the recognition cost(s) assigned to each symbol SB by the recognition classifier (first recognition module MD2) during handwriting recognition S2. If additional classifiers are used to process the ink or symbols (such as baseline vs. non-baseline stroke labeling), further costs may be added to the classification features associated with each symbol SB.

[0110] The symbol positional (or spatial) features referred to above include information related to the position of the associated symbol SB relative to the baseline 20 (e.g., height distance from the baseline, distance from the beginning of the baseline, ...). For example, in this embodiment (FIGS. 5-6), the expression "R 2 The symbol "2" in "" may be characterized and recognized as a superscript because it is above a threshold distance from the baseline 20. The baseline 20 may be calculated in any suitable manner, for example by analyzing all the strokes SK in the handwritten line. A local baseline may also be calculated within a particular region of the handwritten line, i.e., by analyzing only some of the strokes SK proximate to the stroke or symbol of interest. This local baseline may facilitate capturing local variations that better detect deviations such as subscripts and superscripts within a line, especially within lines with a large number of strokes. It is possible to use an algorithm to calculate the baseline 20 or local baseline by calculating a line that is the average of the centroids of all strokes within a particular region of interest.

[0111] The symbol describing features referred to above include descriptive features for each stroke SK contained in a given symbol SK. Such information may include, for example, a binary bitmap or a point count bitmap of the associated symbol SK and its surroundings. The symbol describing features may also include handcraft features calculated by the computing device DV1 from the digital ink of the symbol, for example, minimum, maximum and mean of the stroke or part of the stroke.

[0112] Furthermore, as indicated previously, the context information IF1b characterizes at least one other (or adjacent) stroke SK that is spatially associated with one or more strokes SK forming the aforementioned symbol SB according to a respective ordering of at least one of the plurality of strokes SK. The context information IF1b may also include symbol context features that characterize a relative characteristic of the symbol of interest SK with one or more other adjacent symbols SK.

[0113] Various orderings of strokes SK may be used to generate the context information IF1b. For example, the computing device DV1 may select any one of the following orderings to define the context information IF1b for each symbol SK: a symbol classification default ordering (i.e., a symbol output order according to which symbol SB is recognized in S4 by the first recognition module MD2), a spatial ordering representing the relative position of each symbol SB with the acquired handwriting IN (e.g., X-position along the baseline 20), and a temporal ordering representing the relative time or relative order in which each symbol SB was input (e.g., using the nearest strokes SK of each symbol SK to index and sort the symbols). For any selected ordering, the symbol context features mentioned above may be calculated for each symbol SB with respect to at least one other adjacent feature (e.g., considering the immediately preceding and following strokes of the symbol of interest).

[0114] As indicated before, in the present case it is assumed that the strokes SK have been previously acquired in S2 (FIG. 3) as online handwriting together with temporal information indicating the temporal order in which the strokes SK were handwritten with respect to each other. Thus, the above mentioned context information makes it possible to characterize, for each symbol SB recognized in S4, at least one adjacent stroke SK that is spatially related to one or more strokes SK forming said symbol SB according to at least the temporal order of the strokes SK.

[0115] Symbol context features include, for example: - shared stroke information representing shared strokes between the symbol of interest and at least one adjacent symbol; - displacement information representative of a relative displacement of the symbol of interest with respect to at least one adjacent symbol (e.g. along a direction X of the baseline 20 and / or along a direction Y perpendicular to X); - overlap information representative of an overlap of the symbol of interest with at least one adjacent symbol (e.g. along a direction X of the baseline 20 and / or along a direction Y perpendicular to X); - distance information representative of the distance between the center of mass of the symbol of interest and at least one respective adjacent symbol; It may include any one (or all) of the following:

[0116] Symbol context features can capture different types of symbols and handwriting styles, such as cursive text, spaces between symbols, spatial relationships such as subscripts and superscripts, fractions between mathematical symbols, and the like.

[0117] As can be seen from the above, the ink-related information IF1 extracted in step S6 (FIG. 3) from each identified symbol SB on the basis of the corresponding stroke SK may be of different nature depending on each case. Thus, the symbol information IF1a and the context information IF1b are provided only as examples and other implementations are possible.

[0118] In a classification process S10 (FIGS. 3 and 7), as will be further explained below, the computing device DV1 then classifies each symbol SB identified in S4 as either a textual symbol candidate or a mathematical symbol candidate based on the ink-related information IF1 calculated in S6 and based on the embedded information IF2 attributed to each obtained symbol SB. The classification process S10 employs three different expert modules, namely processing modules MD4, M6 and MD8, to perform classification at three different levels, namely a first classification S12 at the symbolic representation level, a second classification S14 at the syntactic level and a third classification S18 at the semantic level, respectively.

[0119] More specifically, in the first classification S12, the computing device DV1 classifies at least one first symbol, said SB1, from the symbols SB identified as either text symbol candidates or mathematical symbol candidates having a confidence score reaching at least a first threshold TH1 by individually applying predefined symbol recognition rules RL1 to the symbols SB.

[0120] The first classification S12 is based on a symbol level analysis that does not require an analysis of the context of each symbol SB of interest. Therefore, the symbol context information calculated in S6 is not used in the first classification S12. The symbols SB are classified based on their inherent characteristics, for example based on the symbol information IF1a obtained in S6. In a particular embodiment, the ink-related information IF obtained in S6 is not used in the first classification S12.

[0121] Essentially, the computing device DV1 searches in step S12 for each symbol SB that can be classified as either a text symbol candidate or a mathematical symbol candidate with a relatively good degree of confidence.

[0122] As indicated before, each symbol SB identified in S4 is recognized as one of the predefined symbols PSB (FIG. 6) of the data set ST. Thus, each identified symbol SB may be a pure mathematical symbol SB most likely to be used as mathematics, a pure textual symbol SB most likely to be used as text, or an ambiguous mixed mathematical / textual symbol that can be used either as mathematics or as text depending on the context. The first classification S12 makes it possible to identify, among the identified symbols SB, each symbol that will be a pure textual symbol or a pure mathematical symbol, i.e. each symbol that has a likelihood equal to or greater than a first threshold TH1 that it is text or that it is mathematics. It should be noted that a pure mathematical symbol may still have a very low, non-zero likelihood that it will be used as text in some very specific context, and vice versa for a pure textual symbol. Thus, the first threshold TH1 may be predefined at any suitable probability value, for example between 90% and 100%, for example about 95%.

[0123] Thus, the first classification S12 produces, as a first result RS1, an initial text / mathematical labeling (or classification) of one or more symbols, referred to as first symbols SB1 having relatively good confidence scores, by applying predefined symbol recognition rules RL1 prestored in memory 8. In this first result RS1, each of those first symbols SB1 is thus classified as either a mathematical symbol candidate or a text symbol candidate having a respective confidence score that is relatively high, i.e. reaching at least a predefined first threshold TH1. As will be explained further below, those initial classifications and their respective confidence scores may be updated later in the classification process S10.

[0124] In this embodiment, the predefined symbol recognition rule RL1 attributes (or assigns) to each one of the set of predefined symbols PSB an embedding information IF2 including a respective confidence score that said predefined symbol is either text or math. In other words, the embedding information IF2 defines, for each predefined symbol PSB of the data set ST, an embedding information IF2 including a classification as either text or math along with an associated confidence score. Those embedding information IF2 may be pre-trained using a recurrent neural network. The confidence score of each predefined symbol PSB of the data set ST may be pre-calculated based on the symbol's own frequency of occurrence in text or mathematical expressions and based on the intrinsic properties of the symbol. During the training process, the text / math classification and the associated confidence score may be iteratively updated with handwritten ink samples, for example based on the back-propagated gradients of the neural network.

[0125] The predefined symbol recognition rules RL1 may attribute to each predefined symbol PSB of the data set ST additional information in the embedded information IF2 that is useful for classification as text or mathematics. Such additional complementary information may include any suitable distinguishing linguistic information for mathematical symbols and text symbols.

[0126] Similar predefined symbols PSB may be defined as part of the same symbol group sharing the same embedding information IF2, or at least the same text / mathematical classification and the same associated confidence score. For example, symbols "(", "[", and "{", which are of a similar nature, may share the same embedding information IF2. The size of the embedding information IF2 may be adjusted for each case to maximize the performance of the neural network and minimize computation time and resources.

[0127] Thus, in this embodiment, during the first classification S12 (FIG. 3), the computing device DV1 may determine, for each symbol SB identified in S4, embedded information IF2 attributed to said symbol by the symbol recognition rules RL1, said embedded information IF2 including respective confidence scores that said predefined symbols are either text or mathematical. The computing device DV1 may then compare the respective confidence scores of each identified symbol SB as defined in the embedded information IF2 with a first threshold TH1, so as to identify at least one first symbol SB1 as either a text symbol candidate or a mathematical symbol candidate having a confidence score that achieves (or exceeds) the first threshold TH1.

[0128] In a particular embodiment, the ink-related information IF1 and the embedded information IF2 are fed together as an information set or information vector to processing modules MD4, MD6, and MD8 to perform the respective first, second, and third classifications S12-S18.

[0129] Since the first classification S12 makes it possible to identify symbols SB that occur only in mathematics (or mostly in mathematics) or only in text (or mostly in text), a partial text / math labeling with good confidence can be achieved. In most cases, some symbols SB are mixed math / text symbols and therefore are not assigned a text / math classification with a respective confidence score at this stage.

[0130] In the embodiment shown in Fig. 7, during the first classification S12, the symbols "∈" and "R" are classified as mathematical symbol candidates having respective confidence scores reaching at least the first threshold TH1 by individually applying the predefined symbol recognition rule RL1 to those symbols. Thus, those symbols "∈" and "R" constitute a first symbol SB1 in the sense of the present invention. Those symbols "∈" and "R" are well-known mathematical symbols used in mathematical meanings in most cases and therefore have a relatively high confidence score to be a mathematical symbol candidate.

[0131] FIG. 8 represents another example of a purely mathematical symbol that can be classified as the first symbol SB1 during the first classification S12.

[0132] Symbols that can be considered as purely textual symbols are not typically used in mathematics, e.g. currency symbols ("$", "

number

[0133] In a variant, during the first classification S12 (FIG. 3), each symbol SB identified in S4 is classified as either a text symbol candidate or a mathematical symbol candidate with a respective confidence score by individually applying the predefined symbol recognition rule RL1. In other words, a temporal text / mathematical classification with a temporal confidence score may be attributed to each symbol SB including ambiguous mixed text / mathematical symbols and may be updated later during the next classification process S10. Thus, ambiguous mixed text / mathematical symbols are assigned a weaker text / mathematical classification confidence score at this stage compared to pure text and pure mathematical symbols. Thus, the first result RS1 produced by the first classification S12 may include, in addition to at least one first symbol SB1 identified as either a text symbol candidate or a mathematical symbol candidate with a respective confidence score reaching at least the first threshold TH1, a temporal text / mathematical classification with a respective confidence score for each other symbol SB.

[0134] In this variant, each symbol SB identified in S4 is thus assigned embedded information IF2 which contains a respective confidence score that said symbol is either text or mathematics, based on predefined symbol recognition rules RL1.

[0135] An iterative process S14 (FIG. 3) is then performed as part of the classification process S10 based on the result RS1 of the first classification to determine an appropriate classification as either a text symbol or a mathematical symbol for each of the identified symbols SB with associated confidence scores. The initial text / mathematical classification or labeling obtained in S12 is now used to extend (or improve) the text / mathematical classification in the handwritten IN based on syntactic and semantic analysis.

[0136] More specifically, the second classification S16 and the third classification S18 are based on an analysis that takes into account the context of each symbol SB of interest, although in a different manner. Thus, the symbol context information IF1b calculated in S6 is used as input in the second classification S16 and the third classification S18.

[0137] This iterative process S14 includes a second classification S16 and a third classification S18, each of which may be performed only once or may be repeated any suitable number of times, as will be further explained below.

[0138] As shown in FIG. 3, the result RS1, which includes at least the initial text / mathematical classification of each first symbol SB1 identified in S12, and their respective confidence scores, is fed to a syntactic processing module MD6 to perform a second classification S16.

[0139] In a second classification S16, the computing device DV1 classifies, from among the identified symbols SB, in addition to the at least one first symbol SB1, at least one second symbol denoted SB2 as a textual symbol candidate or a mathematical symbol candidate with a respective confidence score by applying to the at least one first symbol SB1 and the at least one second symbol SB2 predefined spatial syntactic rules RL2 defining a spatial relationship between the at least one first symbol SB1 and the at least one second symbol SB2.

[0140] In effect, the computing device DV1 searches for a symbol SB2 that has a predefined spatial relationship with one or more of the first symbols SB1 identified in S12 as a result of the syntactic connections they share together based on predefined spatial syntactic rules RL2 (S16). Based on this syntactic analysis, one or more so-called second symbols other than the aforementioned first symbol SB1 may be classified as either a text symbol candidate or a mathematical symbol candidate.

[0141] The spatial syntax rules RL2 define spatial relations between the mathematical and / or textual symbols and at least one other symbol according to syntactic connections. More specifically, each spatial syntax rule RL2 can define a spatial relation between a predefined mathematical or textual symbol and at least one other symbol, as will be explained further below in the examples.

[0142] During the second classification S16, spatial-syntactic rules RL2 are thus applied to each first symbol SB1 so as to identify at least one other second symbol SB2 having a predefined spatial relationship with one or more first symbols as either a mathematical symbol candidate or a textual symbol candidate. More specifically, the spatial-syntactic rules RL2 may be applied to all symbols SB taking into account the temporal confidence scores assigned to the first symbols SB1 in the first classification S12 and updating them if necessary.

[0143] A spatial syntactic rule RL2 may be applied to a single first symbol SB1 or to a group of first symbols SB1 depending on the type of rule at hand, thus allowing for collectively identifying and classifying groups of spatially related symbols.

[0144] This second classification S16 thus makes it possible to extend or consolidate the partial (or at least partial) text / mathematical classification obtained in S12 by focusing mainly on the first symbols SB1 identified with a relatively good degree of confidence so as to identify and classify other symbols SB2 that share syntactic connections with it. Thus, a text / mathematical labeling of more ambiguous symbols (other than pure text and mathematical symbols) can be achieved in an efficient and reliable manner.

[0145] Spatial syntax rule RL2 is a mathematical spatial syntax rule RL2a defining a spatial relationship between at least two mathematical symbols; a textual spatial syntactic rule RL2b defining a spatial relationship between at least two textual symbols; may include at least one of the following:

[0146] In the present case, it will be assumed that the spatial syntax rules RL2 include mathematical spatial syntax rules and textual spatial syntax rules.

[0147] In the case of mathematical symbols, various spatial relationships may be considered: spatial syntax rules RL2 may define, for example, between base symbols and subscripts (e.g., below and to the right of the base symbol), between base symbols and superscripts (e.g., above and to the right of the base symbol), fractions with numerator / denominator parts above and below the fraction line, parentheses occurring within pairs representing sets, etc.

[0148] In a particular embodiment, the spatial syntax rule RL2a is: - a fraction including a fraction rule separating the numerator and denominator components; - superscripts and subscripts associated with one or more symbols located to the top left and bottom left, respectively, of one or more basic symbols; - overscripts and underscripts associated with one or more symbols positioned respectively above and below one or more base symbols; a matrix associated with a number of rows and columns of symbols arranged in a tabular form (the matrix may or may not have braces grouping the symbols depending on the respective case); Define spatial relationships such as:

[0149] To enhance further syntax processing module (syntax expert) MD6 to accommodate further spatial relations between symbols, e.g. by lowering them from Latex math scripting, further mathematical spatial syntax rules RL2a like pre-subscript, pre-superscript, surrounding rules like square root symbol etc may be considered.

[0150] In the case of text, the spatial syntax rules RL2 may define spatial relations between text symbols based on, for example, punctuation marks, midpoints, reference signs, etc., although other implementations are possible.

[0151] To perform the second classification S16, the syntactic processing module (syntax expert) MD6 identifies each first symbol SB1 classified as mathematical by the symbol processing module MD4 in S12 and labels at least one other adjacent (or spatially related) symbol SB2 as mathematical if they satisfy the mathematical spatial syntactic rule RL2a. Similarly, the syntactic processing module (syntax expert) MD6 identifies each first symbol SB1 classified as text by the symbol processing module MD4 in S12 and labels at least one other adjacent (or spatially related) symbol SB2 as text if they satisfy the text spatial syntactic rule RL2b.

[0152] In other words, the second classification S16 is: - applying mathematical spatial syntax rules RL2a to identify, as each mathematical symbol candidate, at least one other second symbol SB2 having a predefined spatial relationship with at least one first symbol SB1 identified as a mathematical symbol candidate in the first classification S12; - applying text-spatial-syntactic rules RL2b to identify, as each mathematical symbol candidate, at least one other second symbol SB2 having a predefined spatial relationship with at least one first symbol SB1 identified as a mathematical symbol candidate in the first classification; Includes at least one of the following:

[0153] In the second classification S16, a syntactic processing module (syntax expert) MD6 actually examines all symbols SB, identifies each set of two or more symbols which satisfy one of the predefined (mathematical or textual) spatial syntactic rules RL2 and labels those symbols accordingly.

[0154] As shown in FIG. 9 in this embodiment, during the first classification S12, the spatial syntax rule RL2 is applied to the first symbols "∈" and "R" previously classified as mathematical symbol candidates in the first classification S12. As specified in the spatial syntax rule RL1, there is usually a mathematical symbol before and after (belonging to) the symbol "∈", and there is usually a mathematical superscript associated with the symbol "R" (a set of real numbers). Thus, the computing device DV1 classifies in S16 as mathematical symbol candidates the closing bracket ")" preceding the symbol "∈" and the superscript "2" at the top right of the symbol "R". In particular, the symbol "2" appears as a superscript to a mathematical symbol. Hence, it is labeled as mathematical thanks to the superscript rule RL1. By applying the predefined spatial syntax rule RL2 to this closing bracket ")", the open bracket "(" that is spatially related before the closing bracket ")" is also classified as a matching symbol candidate in S16. Since the closing bracket ")" may not be normally "(" independently, the applicable syntax rule RL2 defines the open bracket "(" as spatially related to the closing bracket ")".

[0155] Similarly, by applying another spatial syntax rule RL2, the computing device DV1 classifies the numerator, denominator, and fraction rule of each of the fractions within those brackets as a mathematical symbol candidate in S16. Respective confidence scores are calculated and assigned to each second symbol SB2 classified in S16.

[0156] 10 shows, as another illustrative example, the case where the syntactic processing module MD6 identifies symbols that are spatially related to syntactic connections, i.e. mathematical superscripts of mathematical base symbols, which can consistently tag all symbols along that superscript as mathematical, but which are not necessarily mathematical symbols (not purely mathematical symbols) when examined individually.

[0157] Thus, as depicted in Fig. 3, the second classification S12 produces a second result RS2 including an extended text / mathematical labeling (classification) of the first symbol SB1 and the second symbol SB2 with their respective confidence scores by applying the predefined spatial-syntactic rules RL2. In this second result RS2, the text / mathematical classification and associated confidence score of each first symbol SB1 obtained in S12 are maintained. Thus, a text / mathematical labeling and a confidence score may be assigned to each second symbol SB2 identified in S16.

[0158] In a particular embodiment, each symbol SB other than the one or more first symbols SB1 classified in S12 is treated as a second symbol SB2 and is thus classified as either a text symbol candidate or a mathematical symbol candidate and assigned a respective confidence score based on the spatial-syntactic rule RL2. In another embodiment, one or more symbols remain unclassified at this stage and are later classified during the next third classification S18 or during another iteration of the iterative process S14 (if any). In other words, the second classification S16 may be an extended, though still partial, text / mathematical labeling of the handwritten IN or may be a temporally complete text / mathematical labeling of the handwritten IN.

[0159] For each second symbol SB2 (if any) that has already been assigned a temporal text / mathematical labelling and a confidence score in the first classification S12, it may be updated or confirmed during the second classification S16.

[0160] The syntactic processing module MD6 then feeds the second result RS2 to a semantic processing module MD8 so as to perform a third classification S18.

[0161] During the third classification S18 (Figure 3), the syntactic processing module MD8 updates or verifies the received result RS2 of the second classification S16 by establishing semantic connections (or semantic relations or semantic associations) between at least two symbols SB from the symbols SB identified in S4 and then compares those semantic connections with the result RS2 of the second classification S16.

[0162] In effect, the syntactic processing module MD8 applies the predefined semantic rules RL3 to perform a deeper analysis of all symbols SB based on semantically significant connections (or semantically significant relations) between the symbols so as to discover mathematical and / or textual content. In other words, during the third classification S18, the computing device DV1 analyzes the symbols at a semantic level based on the meanings of the symbols SB so as to establish semantic relations between the symbols SB. Those semantic connections may be used to generate a more human-level, realistic and intelligent mathematics vs. text distinction. The identified semantic connections (or semantic relations) may extend over lines, paragraphs or even the entire handwritten content IN, depending on each case.

[0163] A semantic connection (or semantic relationship) may define a relationship at the semantic level between two (or more) symbols SB, which may be consecutive or non-adjacent in any particular type of order (spatial, temporal, or any compound ordering). A semantic connection may be established at the level of a symbol, a word, a phrase, a sentence, or a larger document unit. For example, two given symbols SB may be considered as semantically connected based on their actual meaning in the document if they have the same origin or conceptual root according to a given language. For example, in FIG. 12A (discussed further below), the first isolated "n" (symbol SB3) is the same symbol as the "n" in the last mathematical expression at the end of the phrase, and therefore, those symbols "n" are semantically connected or related by the concept of the same identity.

[0164] Semantic connections may be identified by performing long-range dependencies within a handwritten line or passage. The dependencies are marked as ink-related information IF1 for characteristics such as similarity, adjacency, complementarity, etc. of all relevant features previously computed in S6.

[0165] This third classification S18 thus makes it possible to discover mathematical or textual symbols that are semantically related, possibly via relatively long-range relations (handwritten lines, long-range dependencies within a paragraph...), thus achieving a precise analysis of phrase structures.

[0166] Predefined semantic rules RL3 may be applied to all symbols SB or subparts thereof identified in S4, taking into account the temporal confidence scores assigned to the symbols SB in the second classification S16.

[0167] In the example shown in Figure 11, the syntactic processing module MD8 identifies the word "let", which leads to classifying a subsequent group of at least one symbol SB3 as a mathematical symbol candidate. In this case, the symbol "p" following the first word "let" and the term "L(c)" following the second word "let" are classified as mathematical based on the applicable semantic rule RL3.

[0168] FIG. 12A shows another example in which the semantic processing module MD8 is able to recognize the symbol "n" as a mathematical symbol and label the symbol "n" from the word "naturel" as text, even when those symbols "n" individually look very similar in appearance.

[0169] In another alternative embodiment depicted in Fig. 12B, the semantic processing module MD8 is able to recognize that "E" is a variable defined in a mathematics block and is therefore able to label all its instances in the handwritten IN as mathematics. Even when modifying a further stroke SK to add a new symbol "E", as shown in Fig. 12C, the semantic processing module MD8 is still able to recognize this new symbol as mathematics and avoids being confused by the modified "E" in the expressions "est" and "ensemble", thereby ensuring that semantic relations are only used to improve the labeling of true mathematics symbols.

[0170] FIG. 13 shows yet another example in which the semantic processing module MD8 captures the symbol "y" as a mathematical symbol in the handwritten line based on semantic relations.

[0171] The semantic analysis in S18 even allows the text / mathematical labeling to be further extended in case it is not yet complete at this stage. In addition, for symbols already labeled as mathematical or text in the received second result RS2, the labeling may be updated and thus improved. The confidence score assigned to each classified symbol is updated to represent the degree of confidence in the obtained classification. Symbols SB previously labeled as text in the second result RS2 may for example be reclassified as mathematical with an updated confidence score based on the semantic connections detected between the symbols SB.

[0172] The text / mathematical classification of the symbol and the associated confidence score are produced by the semantic processing module MD8 as a third result RS3 (Figure 3).

[0173] In some cases, the semantic processing module MD8 may determine that the second result RS2 obtained in the second classification S16 is accurate based on predefined semantic rules RL3, in other cases the second result RS2 may be updated by correcting the text / mathematical label of at least one symbol SB and / or by updating at least one confidence score associated with the classified symbol.

[0174] If the result RS2 of the second classification S16 is verified during the third classification S18 based on semantic connections, the result RS3 produced in the third classification S18 is identical to the result RS2 of the second classification S16. Based on the verified result RS3 (also referred to as the final result RS3), the computing device 100 thus recognizes (S20) each symbol SB as either a text symbol or a mathematical symbol.

[0175] The final result RS3 may then be fed (S20) to a post-processing module MD12 to perform an optional recognition post-processing step S24 (FIG. 3) as described below.

[0176] However, if the results RS2 of the second classification S16 are updated during the third classification S18 based on semantic connections, the results RS3 produced in the third classification S18 include revised classifications of symbols as text candidates and symbol candidates for the second classification RS2 along with their respective updated confidence scores.

[0177] In a particular embodiment, at least one symbol candidate varies from / to text to / from math, and the respective confidence scores are adapted in S18 accordingly.

[0178] In this embodiment, the iterative process S14 repeats at least once (or multiple times) if the second result RS2 is updated during the third classification S18. In other words, upon detecting (S20, FIG. 3) that the second result RS2 is updated in the third classification S18 (or at least that a symbol is reclassified from text to mathematics or vice versa), the method continues by performing the second classification S16 again based on the result RS3 of the third classification S18 in order to either confirm or update the result RS3 (S20).

[0179] If the syntactic processing module MD6 validates the result RS3, then a final result RS3, distinguishing between mathematical and textual symbols SB, is obtained and may later be fed (S20) to the post-processing module MD12 to perform an optional post-processing step S24 (described below). However, the re-labeling of some symbols SB by the semantic processing module MD8 may cause the syntactic processing module MD6 to re-label other symbols. Thus, when the result RS3 is updated by the syntactic processing module MD6 based on a new syntactic analysis, the new second result RS2 is fed to the semantic processing module MD8 to perform again the third classification S18 based on this updated result RS2.

[0180] The iterative process S14 may be repeated multiple times until the second classification S16 and the third classification S18 converge to the same result, i.e., either until the result RS2 of the second classification S16 is confirmed in the third classification S18 or the result RS3 of the third classification S18 is confirmed in the second classification S12.

[0181] Each of the second classification S16 and the third classification S18 is carried out as previously described. Their iterations around the syntactic and semantic processing modules S6, S8 allow them to converge together towards an accurate and reliable classification result RS3.

[0182] Once the processing modules MD6 and MD8 agree on the classification result, a final result RS3 of the third classification S18 is obtained, which enables the computing device 100 to recognize each symbol SB as either a text symbol or a mathematical symbol. As indicated before, this final result RS3 may later be fed to a post-processing module MD12 so as to perform an optional post-processing step S24.

[0183] In a particular embodiment, if a predefined number N of iterations of the classification process S14 is reached before the second classification S16 and the third classification S18 converge to an identical result, the most recent updated result RS3 obtained in the third classification S18 may be transmitted (S20) to the post-processing module MD12 to constitute the final result RS3 and continue with the post-processing step S24 (N being an integer of at least 2). It has been observed that semantic analysis should be given priority over syntactic analysis so as to produce the most accurate results.

[0184] Based on the final recognition result RS3 obtained in S20, the computing device DV1 may then perform a post-processing step S24.

[0185] The processing during post-processing step S24 may be of various natures. In this embodiment, post-processing step S24 includes steps S26, S28 and S30, which are further described below.

[0186] More specifically, during a grouping step S26 represented in Fig. 14, the computing device DV1 groups all strokes SK based on the final result RS3 obtained in S20 into one or more blocks 30 of strokes SK, each block 30 being either a mathematical block 30a or a text block 30b. Each stroke SK contained in a text block 30b is part of a text symbol SB and each stroke SK contained in a mathematical block 30a is part of a mathematical symbol SB.

[0187] Thus, the computing device DV1 determines, based on all the symbols SB, a string of blocks 30 labelling each stroke SK as part of either a textual symbol or a mathematical symbol.

[0188] Each stroke SK contained in a block 30 belongs to the same category (text or math), which is the category assigned to the entire block 30. Specifically, each sequence of consecutive strokes SK assigned to the same type between math and text may be grouped into the same block 30 (S26).

[0189] In particular embodiments, each text block 30b is single-baseline and each math block may be either single-baseline or multi-baseline.

[0190] This grouping step S26 allows generating the strokes into coherent single labelled blocks, i.e. math and / or text blocks. Different strategies for aggregating the classification results per stroke may be implemented.

[0191] Block 30 may be determined based on the classification of each symbol SB as mathematical or textual as defined in the received result RS3 of the third classification RS3 and also based on the spatial proximity of the strokes SK to each other.

[0192] The generation S26 of block 30 may also be based on other predefined constraints, such as stroke level constraints, spatial constraints, etc., to make it more understandable, robust and useful for subsequent recognition. In a particular embodiment, these constraints include: - overlapping strokes SK are grouped into a single block 30; -strokes SK are grouped into horizontally spaced math or text blocks 30; - thresholds are set for the minimum and / or maximum strokes SK per block, etc. It may include any one (or all) of the following:

[0193] During the display step S26 (FIG. 3), the computing device DV1 displays (using the display device 2 or any other suitable display) the strokes SK along with boxes 35 representing the respective blocks 30 to which each stroke SK belongs. FIG. 15 shows an embodiment in which such boxes 35 are displayed highlighting mathematical blocks 30a, thereby allowing the user to easily identify which parts of the handwriting IN have been recognized as text or mathematics.

[0194] In a recognition step S30 (FIG. 3), the computing device DV1 recognizes the mathematical and textual content in the strokes SK by applying a mathematical language model to each mathematical block 30a and a textual language model to each text block 30b. This handwriting recognition is performed based on the stroke grouping achieved in S26.

[0195] Now that the computing device DV1 has determined with a high degree of confidence which strokes SK (or symbols) are textual or mathematical, more accurate handwriting recognition can be performed (30) with respective recognizers that can be specifically trained to identify different sets of symbols with appropriate language models and grammars, thus achieving proper formatting and better handwriting recognition.

[0196] However, other embodiments of the implementation are possible without performing at least one of steps S26 to S30 during the post-processing S24. For example, the post-processing S24 may be performed without displaying box 35 in S28.

[0197] As indicated previously, each of the modules MD2 to MD12 (FIG. 2) may be or include one or more neural networks. In the example described above in relation to FIG. 3, each of the modules MD4, MD6, and MD8 is implemented by at least one neural network, for example a long short-term memory (LSTM) neural network. A more detailed description of how an LSTM neural network can be used to perform the method of the present invention is now provided below with reference to FIGS. 16 to 18, according to a specific embodiment.

[0198] An LSTM neural network (also referred to as an LSTM network or simply "LSTM") is a recurrent neural network that analyzes a sequence of inputs one by one (in a predefined order) and generates an output for each input. Introduced by Hochreiter and Schmidhuber in 1997, LSTM is capable of learning long-term dependencies. LSTM is a recurrent neural network (RNN) architecture that remembers values ​​over an arbitrary interval. An LSTM network contains a chain of LSTM cells CL1 (as described later), each of which passes information to its successor in the chain.

[0199] LSTMs are well suited for classifying, processing and predicting time series, assuming time differences of unknown duration. The properties and operation of LSTMs are generally known to those skilled in the art. For ease of reference, some details are provided below with respect to Figures 16 and 17. However, those skilled in the art will understand how LSTMs work and thus, based on the present disclosure, it is possible to adapt the configuration of an LSTM network to perform steps S2-20, and possibly even steps S2-S30, as previously described with reference to Figure 3.

[0200] More specifically, Fig. 16 illustrates a schematic representation of the overall architecture of a bidirectional LSTM network, NT1, according to a particular embodiment. The bidirectional LSTM network NT1 includes a forward layer 56, a backward layer 58, and an activation layer 60. The forward layer 56 and the backward layer 58 are configured to sequentially analyze each symbol SB recognized in S4 (Fig. 3) according to two opposite directions, i.e., in a forward direction DR1 and a backward direction DR2. The forward layer 56 and the backward layer 58 each include a number of LSTM cells (or LSTM modules) CL1 (Figs. 16-17) configured to analyze the symbols SB of the handwritten input IN acquired in S2 (Fig. 3). Each LSTM cell CL1 is configured to generate an input x t , and the LSTM hidden state h(t-1) generated as a result of the analysis of the previous symbol SB in a given direction (DR1 or DR2). t Based on h(t-1) and h(t-1), each LSTM cell CL1 generates a cell state C that is provided to the activation layer 60. The activation layer 60 generates the final output y t The cell states C obtained for a given symbol SB in the two directions DR1 and DR2 are combined to yield:

[0201] 17 also shows a schematic representation of the overall architecture of an LSTM cell CL1 according to a particular embodiment. Each LSTM cell CL1 receives an input x t , the LSTM cell CL1 sequentially uses the hidden state h(t-1) and the cell state C(t-1) for the previous symbol to compute an output at the current time step based on . Both the hidden state h(t-1) and the cell state C(t-1) store relevant information from the past, i.e., from the processing of the previous symbol in sequence. Each LSTM cell CL1 produces as output a current cell state C(t) that is sent to the activation layer 60, and a current hidden state h(t) that is provided to the next LSTM cell CL1 to process the next symbol SB in sequence.

[0202] More specifically, as shown in FIG. 17, each line carries an entire vector from the output of one node to the input of another node. The LSTM cell CL1 includes pointwise operations such as vector addition ("+") and a trained neural network layer (e.g., function tanh). Line integration represents concatenation, and similar forking means that the content is duplicated and the duplicates are in different positions. An important aspect of the LSTM cell CL1 is the cell state h, represented by a horizontal line that runs through the top of the LSTM cell. This cell state h is consistent throughout the chain of LSTM cells CL1, where some linear iteration is applied repeatedly. Each LSTM cell CL1 has the ability to remove information from or add information to the cell state h received from the previous LSTM cell (i.e., the previous cell state h(t-1)) under the control of three gates. Each of those three gates includes a sigmoid neural network layer ("σ") and a pointwise multiplication operation. Each sigmoid layer σ outputs a number between 0 and 1, defining how much of each component should be passed through. A value of zero means "pass nothing" and a value of 1 means "pass all".

[0203] 17, the LSTM cell CL1 includes an input gate RE, an output gate SE, a write gate WR, and a forget gate 52. The hidden state h(t-1) received as input and the cell state C(t-1) are t The updated hidden state h(t) and cell state C(t) are then input to the next LSTM cell CL1 to perform the next time step calculation of the next symbol SB, thereby taking into account the previous symbol SB in the symbol sequence.

[0204] The hidden state h is a working memory used to transmit relevant information to the LSTM cell CL1 for processing the next symbol SB in sequence. Generally, the hidden state h suffers from the vanishing gradient problem and the exploding gradient problem (see, for reference, for example, https: / / en.wikipedia.org / wiki / Vanishing_gradient_problem), and is therefore only capable of storing local syntactic and semantic information. In contrast, the cell state C is capable of storing long-range or global syntactic and semantic information and allowing their retrieval. The cell state C is a long-term memory used as input by the LSTM cell CL1. The cell state C is modified by the forget gate 52 (to remove information that is to be forgotten). The forget gate 52 implements a sigmoid function σ, which defines what information should be forgotten from the previous cell state C(t-1) in the sequence of the symbol SB. The input gate RE implements a sigmoid function σ, which cooperates with the tanh layer (write gate WR) to generate new information to be added to the cell state C(t-1). The output gate SE implements a sigmoid function that defines what information should be integrated into the next hidden state h(t).

[0205] The current cell state C(t), produced as output by LSTM cell CL1, is filtered by applying a sigmoid layer implemented by output gate SE, then run through a tanh function (to set a value between -1 and 1) and multiplied by the output of the sigmoid output gate to produce the current hidden state h(t) (Figure 17).

[0206] An LSTM network may be bidirectional, as shown in Figure 16, by combining two LSTM architectures (i.e., two chains of LSTM cells) in both directions. A more detailed explanation of LSTM architectures can be found in the following reference: LSTM Network Reference (Tutorial): https: / / colah.github.io / posts / 2015-08-Understanding-LSTMs / .

[0207] The expert modules MD4, MD6 and MD8 of the computing device DV1 (FIGS. 1-2) may all be implemented based on the LSTM architecture as described above, in particular with reference to FIGS. 16-17.

[0208] 18 represents as a schematic diagram the steps performed by an LSTM network to analyze a symbol SB of interest at a given time step according to a particular embodiment. As an example, consider the case where the LSTM network analyzes the symbol SB "2" as the current symbol and processes a symbol sequence one symbol at a time in the forward direction DR1. It should be understood that in both directions DR1 and DR2, a similar processing is performed by the LSTM for each symbol SB of the sequence.

[0209] As shown in FIG. 18, the LSTM may first consider selecting the symbol “2” as the current symbol SB to be processed and obtaining as input the relevant information, i.e., the ink-related information IF1 associated with the current symbol “2” (symbol information IF1a and context information IF1b) and the embedded information IF2 associated with the current symbol “2” (S6).

[0210] As explained before, based on each stroke SK forming the current symbol "2" (i.e. in this case a single stroke SK), symbol positional (or spatial) features may be extracted as part of the symbol information IF1a (S6; Fig. 3). The symbol positional features may include information related to the position of the current symbol "2" with respect to the baseline 20 (e.g. height distance from the baseline, distance from the start of the baseline...). In this embodiment (Figs. 5-6), the expression "R 2 The current symbol "2" in " " is characterized and recognized as a superscript because it is above a threshold distance from the baseline 20. Furthermore, in this embodiment, the extracted context information IF1b characterizes the spatially related strokes SK, i.e., the strokes of the adjacent symbols "∈", "R", "," and "a", as shown in Figure 18. The embedding information IF2 may be obtained based on predefined symbol recognition rules RL1 that assign a respective embedding information IF2 to each one of a set of predefined symbols PSB.

[0211] The information inputs IF1 and IF2 are fed (S12) to the input gates RE of an LSTM cell (or LSTM module) CL1 (Figure 17), which serves as a symbol processing module MD4 (representation expert). The symbol processing module MD4 computes a vector of values ​​containing partial mathematical / textual label information as previously described with reference to the first classification step S12 (Figure 3).

[0212] The input gate RE also receives and uses the LSTM hidden state h(t-1) calculated by the LSTM cell CL1 for the previous symbol SB according to the direction DR1, i.e. in this case the symbol "R" preceding the current symbol "2" (S40, FIG. 18). The input gate RE thus also serves as a syntactic processing module MD6 (syntactic expert).

[0213] Thus, both processing modules MD4 and MD6 are called in steps S12 and S40.

[0214] The LSTM cell state C of LSTM cell CL1 (FIGS. 17-18) captures and stores (S42) all syntactic and semantic information from the symbol SB before or after the current symbol "2" (or both in the case of a bidirectional LSTM) as cell state C(t-1). Their various inputs are also passed (S44) to the forget gate 52 and updated (update gate) through the cell state line (FIG. 17) to the current cell state C(t).

[0215] The partial label information output by the input gate RE in S12 is then passed (S14) to the output gate SE (FIG. 17), which serves as a syntactic processing module MD6 and a semantic processing module MD8 (i.e., a syntactic expert module and a semantic expert module, see FIG. 2). Based on the received partial label information, the processing modules MD6 and MD8 perform the second classification S16 and the third classification S18 as previously described, so as to generate the final label information for the current symbol "2". The processing modules MD6 and MD8 use the hidden state h(t-1) to perform the second classification step S16 and the third classification step S18.

[0216] The output of the output gate SE (i.e., the final label information) is used to update the previous hidden state h(t-1) to an updated hidden state h(t) for the current symbol "2" (S50). The updated hidden state h(t) is then transferred to the activation layer 60 (FIG. 16) to generate a final label for the current symbol "2" (S52) as part of the classification result RS3 (see FIG. 3). In the present case where a bidirectional LSTM is used, two sets of final label information (from the output gate SE of the two respective LSTM cells CL1) are produced by processing the symbol sequence in each of the backward DR2 and forward DR1 directions. The two sets of final label information are evaluated and combined together to generate a final mathematical / textual label for the current symbol "2" (FIG. 16) (S52). This evaluation may be performed by concatenating the final label information from both LSTM cells CL1 and passing them through an activation layer 60 to produce an array of probabilities, in this case an array of length 2, one position for math and the other for text. The activation layer 60 may involve multiplying the concatenated final label information (of final size 2L) with a weight matrix of size 2L×2, and then applying a softmax function (also known as softargmax or normalized exponential function) to ensure that the resulting output array of probabilities sums to 1.

[0217] By processing the symbol sequence in the two directions DR1, DR2 as explained above, a final label is produced in the same manner for each symbol SB of the sequence.

[0218] In this embodiment, the LSTM architecture consists of a fixed number of calls to the various processing modules (experts) MD4, MD6 and MD8. The LSTM network calls these processing modules in two stages: in the first stage, the symbol processing module MD4 (expression expert) and the syntactic processing module MD6 (syntax expert) are called simultaneously, and in the second stage, the syntactic processing module MD6 (syntax expert) and the semantic processing module MD8 (semantic expert) are called simultaneously. Overall, the syntactic processing module MD6 (syntax expert) is called twice like that (S12 and S14). The second call (S14) is to verify and propagate the result from the output of the semantic processing module MD6. As mentioned before, the bidirectional variant of LSTM takes care of the context from the previous and next symbols in order to the current one symbol.

[0219] Moreover, one skilled in the art can train the LSTM network in any suitable manner to implement the present invention. The LSTM network can learn to detect mathematics in handwriting by updating the weights and biases of various gates (i.e., for each sigmoid and tanh function in FIG. 17) with a backpropagated algorithm (see the references mentioned above for further details). In particular, the weights and biases of the input gate RE and the embedding information IF2 are used to implement the symbol processing module MD4 (representation expert). The embedding information IF2 stores the prior knowledge about each predefined symbol PSB, and the input gate RE learns how to process all of its inputs together (embedding information IF2, symbol information IF1a, contact information IF1b, hidden state). The weights and biases of the output gate SE, the forget gate 52 and the write gate WR are used together to implement the syntactic processing module MD6 and the semantic processing module MD8 (i.e. the syntactic expert module and the semantic expert module) that are able to utilize and modify the information stored in the cell state C(t-1) and the hidden state h(t-1) to recover the various syntactic rules and semantic connections present in a given sequence.

[0220] The LSTM network may be trained with a dataset that includes multiple sequences of symbols that contain both math and text, as well as sequences of symbols that contain only text or only math. Training may be performed over multiple iterations and minimizes the overall symbol misclassification rate for the dataset, informing the network to learn to 1) distinguish math from text symbols, 2) identify and apply math and text specific syntactic rules, and 3) establish semantic connections between symbols in a given sequence.

[0221] It should be noted that in some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, depending on the functionality involved, two blocks shown in succession may in fact be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, or the blocks may be executed in an alternative order.

[0222] Although not expressly described, the present embodiments may be employed in any combination or subcombination thereof.

[0223] While this disclosure has described specific embodiments, it is apparent that the disclosure is susceptible to numerous modifications and embodiments within the ability of those skilled in the art without the exercise of their inventive faculty. Accordingly, the scope of the invention is intended to be defined by the following claims.

Claims

1. 1. A method implemented by a computing device (100) for processing mathematics and text in handwriting (IN), comprising: - Identifying (S4) a symbol (SB) by performing handwriting recognition on a plurality of strokes (SK) of digital ink; - classifying at least one first symbol (SB1) from said identified symbols as either a text symbol candidate or a mathematical symbol candidate having a confidence score reaching at least a first threshold value (TH1) as a first classification (S12) by applying predefined symbol recognition rules (RL1) individually to said symbols; - classifying, as a second classification (S16), the at least one second symbol (SB2) as either a text symbol candidate or a mathematical symbol candidate with respective confidence scores by applying, to the at least one first symbol (SB1) and to at least one second symbol (SB2) other than the at least one first symbol, predefined spatial syntactic rules (RL2) defining a spatial relationship between the at least one first symbol and the at least one second symbol; - updating or confirming the result of the second classification as a third classification (S18) by establishing a semantic connection between at least two symbols (SB) from the identified symbols and comparing said semantic connection with the result of the second classification; - recognising (S20) each symbol as either a text symbol or a mathematical symbol, based at least on the result of said third classification; Including, The method further comprising: and calculating, for each identified symbol (SB), ink-related information (IF1) based on each stroke forming said symbol, said ink-related information comprising: - symbol information (IF1a) characterising the intrinsic qualities of one or more strokes forming said symbol; - context information (IF1b) characterizing at least one adjacent stroke, spatially associated with said one or more strokes forming said symbol, according to a respective ordering of at least one of said plurality of strokes; Including, the ink-related information is used in at least the second classification and the third classification to classify each symbol as either a mathematical symbol candidate or a text symbol candidate. The method according to claim 1,

2. obtaining the plurality of strokes of digital ink forming the symbol prior to identifying the symbol; the identified symbols include at least one text symbol and at least one mathematical symbol; The method of claim 1.

3. 3. The method according to claim 1 or 2, wherein during identifying the symbols, the plurality of strokes (SK) are compared with a set of predefined symbols (PSB), and each symbol formed by the plurality of strokes is identified as a respective one in the set of predefined symbols.

4. The first category is: - determining, for each identified symbol, embedding information (IF2) attributed to said symbol by said symbol recognition rules, said embedding information comprising a respective confidence score that said predefined symbol is either text or math; - comparing said respective confidence scores of each identified symbol as defined in said embedding information with said first threshold value so as to identify at least one first symbol as either a text symbol candidate or a mathematical symbol candidate having a confidence score that reaches at least said first threshold value; The method according to any one of claims 1 to 3, comprising:

5. 5. The method according to claim 1, wherein during the second classification, the spatial syntactic rules (RL2) are applied to the at least one first symbol (SB1) in order to identify at least one other symbol (SB2) having a predefined spatial relationship with one or more first symbols as either a mathematical symbol candidate or a textual symbol candidate.

6. The method according to any one of claims 1 to 5, wherein during said second classification, each symbol other than said at least one first symbol is classified as either a text symbol candidate or a mathematical symbol candidate.

7. The spatial syntax rule (RL2) is - mathematical spatial syntax rules defining spatial relationships between at least two mathematical symbols; - textual spatial syntactic rules defining spatial relations between at least two textual symbols; The method according to any one of claims 1 to 6, comprising:

8. if the results of the second classification are updated during the third classification based on semantic connections, the results produced in the third classification include revised classifications of the symbols as text symbol candidates and mathematical symbol candidates for the second classification along with their respective updated confidence scores; The method further comprises repeating the second classification against the results of the third classification to either confirm or update the results. The method according to any one of claims 1 to 7.

9. 9. The method of claim 8, wherein an iterative classification process (S14) including the second and third classifications (S16, S18) is repeated until the second and third classifications converge to an identical result.

10. 10. The method of claim 9, wherein if a predefined number N of iterations of the iterative classification process (S14) is reached before the second and third classifications converge to an identical result, the most recent updated result of the second classification obtained in the third classification (S18) is used to recognize each symbol (SB) as either a text symbol or a mathematical symbol, N being an integer of at least 2.

11. The method according to any one of claims 1 to 10, wherein recognising (S20) each symbol (SB) as either a text symbol or a mathematical symbol comprises assigning to each stroke a classification as either mathematical or text along with an associated confidence score based at least on the result of the third classification (S18).

12. The method according to any one of claims 1 to 11, further comprising grouping (S26) the plurality of strokes into one or more blocks of strokes based on the result of the recognizing, each block being either a text block or a mathematical block, each stroke contained in a text block being part of a text symbol, and each stroke contained in a mathematical block being part of a mathematical symbol.

13. 13. The method of claim 12, comprising recognizing mathematical and textual content in the strokes by applying a mathematical language model to each mathematical block and a text language model to each text block.

14. A computing device (100) for processing mathematics and text in handwriting (IN), comprising: a first recognition module (MD2) for identifying a symbol (SB) by performing handwriting recognition on a number of strokes (SK) of digital ink; a symbol processing module (MD4) for classifying at least one first symbol (SB1) from said identified symbols as either a text symbol candidate or a mathematical symbol candidate having, as a first classification, a confidence score reaching at least a first threshold value by applying predefined symbol recognition rules individually to said symbols; a syntactic processing module (MD6) for classifying, as a second classification, the at least one second symbol (SB2) as either a text symbol candidate or a mathematical symbol candidate with a respective confidence score by applying, to the at least one first symbol (SB1) and to at least one second symbol (SB2) other than the at least one first symbol, a predefined spatial syntactic rule (RL2) defining a spatial relationship between the at least one first symbol and the at least one second symbol; a semantic processing module (MD8) for establishing a semantic connection between at least two symbols (SB) from the identified symbols and for updating or confirming the result of the second classification as a third classification by comparing said semantic connection with the result of the second classification, The computing device comprises: configured to recognize each symbol as a text symbol or a mathematical symbol based on at least a result of said third classification; The computing device is configured to calculate, for each identified symbol (SB), ink-related information (IF1) based on each stroke forming the symbol, the ink-related information comprising: - symbol information (IF1a) characterising the intrinsic qualities of one or more strokes forming said symbol; - context information (IF1b) characterising at least one neighbouring stroke, spatially associated with said one or more strokes forming said symbol, according to a respective ordering of at least one of said plurality of strokes, the ink-related information is used in at least the second classification and the third classification to classify each symbol as either a mathematical symbol candidate or a text symbol candidate. A computing device comprising:

Citation Information

Patent Citations

  • Mathematical expression recognition

    US20060062466A1

  • Program, information storage medium, and recognition device

    WO2016117564A1