Nigma.ru has added a new feature for users to its piggy bank. Now, right through the search bar, you can solve various math problems, for example,
x2-3x + 2 = 0 ,
sin2 x + cos2 x ,
2 h * 30 m / min = x , systems of equations like
2x-y = 4, 3y + x = 9 ,
x2 + y = 1, x * y = 0 , etc. (detailed list
here ). The service is designed for schoolchildren of 6-10 classes.
More information about the system can be found by reading the
documentation and news on our website.
To create this feature, we interviewed real students - asked to enter mathematical expressions in the most convenient way for them in the search box. Of course, few of them know the syntax of programming languages ββ- no one even could close to write something that looks like a normal syntax. Therefore, the most important task for us was the recognition of free syntax - in fact, this is the task of any search engine - to give the user the opportunity to receive an answer to his question without studying the documentation for the system.
How does our algorithm work?
')
First, we recognize mathematical queries among the entire flow of queries. In carrying out this task, we are faced with a lot of problems. Since queries can be very different, therefore, solving it requires many complex heuristics. In addition, the analysis of expressions in natural language is required, since user input can be not only in the form of formulas, but also in natural language, that is, in an unformalized form. With the help of a set of heuristic rules (the list of which was compiled on the basis of the analysis of the actual pupils entering the search string), we convert textual queries into a formal description of the problem with a strict syntax. Due to the ambiguity of converting from loose syntax to strict, you have to consider several options for recording the task, and then you need to eliminate the least probable parsing options, since their number can grow exponentially relative to the complexity of the entered expression, and, accordingly, the solution of such a number of tasks will take too long and it will be too difficult for the user to find a solution among hundreds of options. Problem solving is carried out in symbolic form, when it is possible, which allows the system to be used to obtain a rigorous solution of the problem, which is useful in school problems, in various proofs and much more important for educational purposes than numerical solution. A numerical solution is also offered as one of the options, or as the main option, if the task involves an answer in a form such as, for example, conversion of values ββor currencies.
In the course of the work, we faced the problem that for many queries it is extremely difficult to determine their maturity, especially when there are queries containing various models of technology (which often contain numbers and mathematical signs), as well as various phrases in which there are many mathematical terms. Unfortunately, in the general case, the problem of separating such queries is algorithmically difficult to solve, especially considering that among mathematical queries there can be queries with errors. Nevertheless, a fairly lengthy analysis of user requests and input of schoolchildren made it possible to reduce the error level of the first kind in determining the mathematics of the request, while the error rate of the second kind almost remained close to zero (in this case, the error of the first kind is less important).
To solve the problem of parsing expressions, a system was developed consisting of a finite state machine of the analyzer and a set of regular expressions for normalizing user input, which allowed generating a set of formalized variants of user input interpretations, as well as a set of methods for assessing the proximity of user input to the formal record type. At the same time, very different factors are taken into account - even the space between characters is significant - not only as a separator between lexemes, but also as a separator between blocks, if spaces are not displayed everywhere in the formula.
The system is in alpha testing state, i.e. We are aware of a number of limitations and system errors, over which we are working to correct. We are pleased to hear your comments and opinions regarding this system. We would also like to note that this system is only one of our projects to increase the amount of intelligence at Nigma.ru, and we will be happy to welcome programmers to our team who want to develop new intelligent search technologies.