A highly customisable Personal Assistant name Tzara which helps in daily tasks written in Python 2.7.
####Tasks:
-
Send emails
-
Search the internet
-
Open and close websites
-
Set reminders
-
Play movies and songs
-
Open documents and pdfs
-
Open any application
-
Update the system
-
Open the terminal
-
Converse - basic
-
Tell date and time
-
Shutdown the system
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Debian or Ubuntu based system.
An Internet connection is recommended.
Environment Setup.
-
Python 2.7 - Installation instructions can be found here.
-
Pip
sudo apt-get update
sudo apt-get install python-pip
You could also install Pip following these instructions.
- gTTS
sudo pip install gTTS
- mpg123
sudo apt-get install mpg123
- NLTK package
sudo pip install -U nltk
Or follow these instructions.
- Firefox
sudo apt-get install firefox
- Audacious music Player
sudo apt-get install audacious
- xdotool
sudo apt-get install xdotool
- wmctrl
sudo apt-get install wmctrl
- Guake dropdown terminal
sudo apt-get install guake
- xdg-utils
sudo apt-get install xdg-utils
###Note:
I have nearly automated the complete installation. Few details remain. But until I update the code, the manual installation described below is recommended.
####1) Path setup:
After having downloaded all files, open EACH ONE and modify according to the instructions provided in the file.
For example, you may find:
f_reminder = open("/path/to/the/file/reminder.txt", "r+")
Replace "/path/to/the/file" with the actual pathname to the file called "reminder.txt".
Thus, in my system, this particular pathname was:
f_reminder = open("/media/suman/New Volume1/Artificial Intelligence/Personal Assistant/Text_files/reminder.txt", "r+")
This will ensure the Personal Assistant is customised only to you.
####2) Email:
This is particular for Gmail accounts.
To send emails and read emails, you will need access to your Gmail account. But Gmail will block your email if you don't get a password, as it doesn't recognise the application.
To obtain a password for Tzara, follow these instructions.
Then, open a plain text document in the Home Directory.
Copy paste the following code.
#!/bin/bash
username = "your_email_here"
password = "your_password_here"
echo
curl -u $username:$password --silent "https://mail.google.com/mail/feed/atom" > /path/to/the/file/inbox_details.txt
Replace "your_email_here" with your email-id. E.g. [email protected]
Replace "your_password_here" with the new password respectively. Note: the password is NOT your general email account password. It is specific to this application.
Replace "/path/to/the/file/" with the pathname to the file "inbox_detail.txt"
Rename the document to: "check_email.sh"
####3) Setting up .txt files:
You can modify the following .txt files to personalise Tzara further:
a) bye.txt - Add ways to say goodbye.
b) comn_sites.txt - Add sites you visit.
c) confirmations.txt - Add ways to confirm.
d) corporat.txt - List of corpora from where Tzara develops her sentences. Currently from Brown Corpus
e) email_id.txt - Add email-ids. E.g. [email protected] - Simply say: "Mail John", and Tzara will mail [email protected]
f) folder.txt - Add folder names and paths you frequently use. E.g. Suppose you go to /home/username/Documents often. Add "Documents - /home/username/Documents" to "folder.txt", and then you can simply tell Tzara: "Open folder documents", and she will open the correct folder.
g) greetings.txt - Add ways for Tzara to greet you.
-
Open the guake terminal.
-
Input the following code:
python /path/to/the/file/main.py
Replace "/path/to/the/file" with the pathname to the file "main.py". This file initialises Tzara.
Tzara will greet you with something like: "Hi, my name is Tzara. How may I help you?"
Go on and chat with your newfound friend.
-
To give commands, simply chat. For example, if you want Tzara to search for the word "cat" on the Internet, simply type something like: "Hey Tzara, could you please search for cat." or "Hi, could you please google cat." or simply "google cat".
-
To end chat, type anything like:
Bye Tzara
or
Cya Tzara
or simply
bye
Suman Pal