Personal AI with Python



An AI private assistant is a bit of software program that is aware verbal or written instructions and completes task assigned with the aid of the client. It is an example of susceptible AI that is it may most effective execute and perform quest designed by the person.
Want to construct your personal non-public AI assistant like Apple Siri, Microsoft Cortana and Google assistant?
You can test out this blog to construct one in a few easy steps!
With the python programming language, a script maximum usually used by the developers can be used to build your non-public AI assistant to perform mission designed through the users.

Now, let’s write a script for our personal voice assistant using python.


Packages required:

To construct a non-public voice assistant it’s important to install the subsequent programs to your machine the usage of the pip command.







1) Speech reputation — Speech popularity is an crucial feature used in residence automation and in artificial intelligence gadgets. The main function of this library is it tries to recognize regardless of the human beings talk and converts the speech to text.

2) pyttsx3 — pyttxs3 is a text to speech conversion library in python. This package deal helps text to speech engines on Mac os x, Windows and on Linux.

3) wikipedia — Wikipedia is a multilingual online encyclopedia utilized by many human beings from educational community starting from newbies to college students to professors who wants to gain information over a specific topic. This package deal in python extracts facts’s required from Wikipedia.

4) ecapture — This module is used to capture pictures from your digicam

5) datetime — This is an inbuilt module in python and it works on date and time

6) os — This module is a general library in python and it presents the feature to interact with running gadget

7) time — The time module enables us to display time

8) Web browser — This is an in-constructed package in python. It extracts records from the internet

9) Subprocess — This is a fashionable library use to manner diverse machine commands want to log off or to restart your PC.

10) Json- The json module is used for storing and exchanging information.

11) request- The request module is used to send all styles of HTTP request. Its accepts URL as parameters and gives get entry to to the given URL’S.

12) wolfram alpha — Wolfram Alpha is an API that may compute professional-stage answers the use of Wolfram’s algorithms, understanding base and AI era. It is made possible by way of the Wolfram Language.


Setting up the speech engine:






Now define a function communicate which converts textual content to speech. The speak feature takes the text as its argument,similarly initialize the engine.

RunAndWait: This feature Blocks whilst processing all presently queued instructions. It Invokes callbacks for engine notifications as it should be and returns back while all instructions queued earlier than this call are emptied from the queue.


Initiate a function to greet the user:




Define a function wishMe for the AI assistant to greet the user.

The now().hour function abstract’s the hour from the current time.

If the hour is greater than zero and less than 12, the voice assistant wishes you with the message “Good Morning”.

If the hour is greater than 12 and less than 18, the voice assistant wishes you with the following message “Good Afternoon”.

Else it voices out the message “Good evening”


And to many command to make your assistant upgrade !!








Post a Comment

0 Comments