arduinoProjects

How To Convert ChatGPT Into An Superior Voice Assistant

How To Convert ChatGPT Into An Superior Voice AssistantChatGPT-3 wants no introduction. You ask it any query and it replies in a flash. However the reply comes within the type of textual content. What for those who may discuss with it, identical to you do with any voice assistant like Siri?

It’s no secret that ChatGPT has revolutionised the world of AI. In contrast to different AI bots, it is ready to perceive the context of a dialog and reply, and it makes you are feeling like you’re chatting with a human and never a machine.

However as it’s nonetheless a type of chatbot, you should sort a query and also you get the reply within the type of textual content. That’s not as thrilling as speaking to a bot.

This thought gave me the concept of programming ChatGPT in order that it might be used as a voice assistant referred to as VoiceGPT. I started through the use of pure language processing (NLP) to recognise the voice, after which transferring the recognised voice to the ChatGPT engine as a question utilizing the API. After getting an clever reply from ChatGPT, I once more used NLP to transform it right into a human voice.

VoiceGPT working principle
Fig. 1: VoiceGPT working precept

I wanted a superb NLP software for this and OpenAI itself offers one, that’s, Whisper. However because of restricted time and house, I ended up utilizing Google Pure Language API.

A step-by-step information to creating VoiceGPT

We have to start by combining the NLP for the ttX service with ChatGPT. For this we’d like a machine to run the open API, switch the question gathered from NLP, and reprocess the reply given by ChatGPT right into a human voice utilizing NLP.

You need to use any laptop computer, however I selected the Raspberry Pi to run all this. For capturing the voice for recognition, I connected the voice bonnet; a USB microphone may also be used with Raspberry Pi. Nevertheless, in case you are utilizing a laptop computer to run the VoiceGPT code, there isn’t a want for a USB microphone; you need to use the laptop computer’s inbuilt microphone.

We now must create an account and log into ChatGPT (see Fig. 2).

ChatGPT login page
Fig. 2: ChatGPT login web page

Subsequent, we have to get the API key for doing analysis and experimenting with the ChatGPT code, as proven in Fig. 3.

Getting the OpenAI API menu
Fig. 3: Getting the OpenAI API menu
ChatGPT API keys
Fig. 4: ChatGPT API keys

You may create the API key utilizing the right-corner choice for API in your OpenAI account (Fig. 4).

After producing the OpenAI API key, copy it and reserve it. We’d like it later in our code for growing VoiceGPT.

Now we have to set up the open AI on the system the place we’re going to run the VoiceGPT. Right here you need to use a pc with any Linux model put in. I used Raspberry Pi for it.

Subsequent, open the terminal and set up the open AI and different Python modules that assist us in pure language processing. Right here you need to use Whisper from OpenAI or another NLP module. I used Google NLP and mixed it with ChatGPT.

Fig. 5: Cloning OpenAi ChatGPT code
Cloning OpenAi ChatGPT code

You may set up these modules utilizing the next command. After that, you may both create your open customized speaking content material in OpenAI or use easy chatting within the playground. Right here, you can too set the temperature, frequency, and different parameters on your VoiceGPT assistant.

sudo pip3 set up openai
sudo pip3 set up SpeechRecognition
sudo pip3 set up gTTS

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button