Code Your Own AI Assistant Using Python Language with Easy Steps, An AI Like JARVIS
As his 2016’s challenge, Facebook co-founder and CEO Mark Zuckerberg announced that he’ll be coding his own AI personal assistant. While I don’t know about the progress made by him in this endeavour, there are many existing resources that you can use to create something similar for yourself.
Python is one of the most popular programming languages that people should consider learning and it comes with several choices to get started on your own Jarvis project. There are many open libraries for speech recognition and synthesis available in Python. Note that you should choose them wisely as many of them don’t function anymore with newer versions of Python.
In a blog post, programmer Gurwinder Gulati shared his quest to make a Python-powered personal assistant for himself in 2016. He calls his AI assistant Samwise and explains the coding process in three parts: Jarvis’s Mouth, Jarvis’s Ears, and Jarvis’s Brain.
As the name suggests, Jarvis’s Mouth deals with text-to-speech conversion process. While many Python libraries are available that offer voice recognition and speech synthesis, Mr. Gulati chose to move ahead with pyttsx — an offline, free and open source resource. It’s also updated to work with Python 3. To use it, you need to install JPercent’s version of pyttsx by running the command pip install pyttsx. For Windows, you should install PyWin32 and Microsoft Speech API.
ALSO READ: Make Your Own Twitter Bot In 5 Minutes
For speech recognition/Jarvis’s ears, you need to use SpeechRecognition. This great resource offers the freedom to use Sphinx project to convert the audio input into a text. You can also use Google services and Wit.ai to do the same with the help of SpeechRecognition.
Now that you’ve got everything you need, let’s take a look at Jarvis’s Brain which is basically the code written by Mr. Gulati. You can assemble the above-mentioned resources and libraries to create your own AI assistant.
The code shared below is pretty straightforward and you can get things done after few hours of work and research. Take a look: