All projects

Live-spoken Statement Recognition

Multiprocessing pipe around OpenAI's whisper model for live transcription. symbolic reasoning recognises spoken sentences.

Date
August 2024
Area
LogicDataAI/ML
Skills
PythonMLEnough Safety
Live-spoken Statement Recognition

Ask about Live-spoken Statement Recognition

AI answers based only on the projects on this site. It can make mistakes, so check the linked project.

01Background

I was in charge of developing an AI system that could detect when certain kinds of statements were made. This was difficult because of the short timeframe and lack of direct labelled data for the speech I needed to recognise. My solution was to use a pre-trained transcription model and then use symbolic reasoning to learn an expression that describes the target speech patterns in terms that the regular expression interpreter can evaluate.

02Details

I used OpenAI’s whisper library, which can take sound data and transcribe it into text from a range of languages. I created a process pipe to process sound packets in parallel in order to maintain real-time processing speeds. I also attached a VAD model to break down the constant feedback into the sound packets. This greatly reduced the rate at which data may be sent to OpenAI to process, or to our cloud compute servers to run the eventual dedicated neural network on. After obtaining the text, I developed a regular expression syntax modelled after Latin grammar to recognise families of statements to sufficient generality to capture the majority of the target speech patterns. I was then able add a version space learning feature where the system could automatically update the regular expressions given new labelled (speech) data. Due to the generalised form of the regular expressions, one single example could lead the model to include an entire family of speech patterns as fitting the pattern.

A natural language processing model separates out the sentences, and then the tags on each word are incorporated into the regular expressions. Collections of words bear an AND relation. Words that fall under a given abstract term bear an OR relation. Such a regular expression might be “_I’d-like _food_cheap#noun_healthy#adjective _softener” for a restaurant order.

03Outcome

The software worked as intended, although the symbolic reasoning feature had some small bugs that reduced the generality of the symbolic reasoning model.

Demo