DEV Community

Maxwell
Maxwell

Posted on • Updated on

Speech calculator Interface through Transformer Model

Since the rising of Transformers Models in 2017, numerous applications are observed from different domains from Natural Language Processing(NLP) to Automatic Speech Recognition (ASR). In this article, We will propose a tool based on Transformer Model to solve Mathematical Word Problems (MWP). Concretely the designed tool proposed will be for arithmetic expression evaluation, a subclass of MWP.
We call this tool Voice Calculator Interface (VCI). The design of VCI is given in the figure below.

Image description

Voice Calculator Interface flowVCI processes arithmetic expressions from a speech. Similar to a physical calculator the user can order calcul by its voice. no more needed to type just speak :).

It uses a transformer-based technology to transcribe a voice from a speech. The related transformer is Openai/Whisper this large language model permit extraction of a text from a speech, at considerable precision. Openai/Whisper was obtained from the Hugging Face model repository, you can access the model here https://huggingface.co/openai/whisper-medium Thanks for this community.
The transcribed text should be an arithhmetic expression. or example, as five plus three times five became (5 + 3*5), if the transcribed text doesn't have sens in terms of calcculation VCI rejects.
the transcribed text is then parsed to extract atoms of the calculus expression from its alphabet. The atoms are organized into categories:

  1. - Operators: Represent basic arithmetic expressions +, -,*, /
  2. - Functions: Represent a set of functions based command
  3. - Unit: Represent the set of natural numbers from 1 to 9
  4. - Tense: Union of the set of natural number multiples of 10 and the set of numbers from 10 to 19.
  5. - Others: Set of numbers in hundred, thousand, million

After atoms are extracted in the expression, VCI evaluates the expression and gives the result.
The aim of VCI tool is to act as a Brain-Computer Interface for calculus, to solve decidable Maths Word Problems.

The repository of the project can be found here https://github.com/MaxwellNM/voice-calculator-interface

Top comments (0)