The AI voice assistant is created as "part of the Hands on python workshop conducted in 2021-2022" for high-school students of U.A.E in Ajman University to train on python language starting from basics to advanced topics which is used to develop The chatbot. The application is a web app
The application is designed to listen to user commands once the record button is clicked on the Use it page which is confirmed by the chatbot voice-output "recording". The Communication with the chatbot is always confirmed by the chatbot such that when the command is not clear,noisy, lower volume or the user was at distance from the microphone it will speak back to user "I did not get that". The interaction with the chatbot continues untill user exists the conversation with one of the exit commands. The full conversation with the chatbot is documented on the webpage as chat conversation/dialog.
You can greet the assistant by using from of greetings : hi
, hello
,hey
and the chatbot great you back.
Worth noting, the voice recognition feature is trained on the english language hence the english names prefered.
You can set the assistant name using the command :your name should be
< insert assistant name >
The chatbot confirms the assistant name captured in the microphone as : okay, i will remember that my name is < insert assistant name >
You can set the user name using the command :my name is
<insert user name>
The chatbot confirms the user name captured in the microphone as : okay, i will remember that < insert user name >
Obtaining the current time activated using any of the commands :what's the time
,tell me the time
,what time is it
,what is the time
then the chatbot will response with The time is
<current time>
The chatbot is designed to search for key terms and sentences on google such as gold prices, stock status
Search for keywords/sentences on google e.g. search for
<insert search term/sentence >
and the chatbot will response
with Here is what I found for machine learning on google
followed by automatically opening internet browser with the results
of the search
The chatbot is designed to search for key terms and sentences on youtube
Search for keywords/sentences on youtube e.g. search for
<insert search term/sentence >
on youtube
and the chatbot will response
with Here is what I found for machine learning on youtube
followed by automatically opening internet browser with the results
of the search on youtube
What is the weather today e.g. <sentence>
weather
for the chatbot will automatically open information about the weather today at your location
The chatbot retrieves the user location when user uses the command what is my exact location
Using the following terms indicate the end of the conversation with the bot: bye
,quit
,done
,exit
The developement is mainly using python language for front-end and back-end as the workshop discusses the python-based development.
Recognizing the voice commands of users is implemeneted using speech recognition API library, and [pyttsx3](pip install pyttsx3) for speaking the output audio. Moreover, the web app is built using streamlit open-source app framework.
The following table summarizes the technologies/libraries used along with its versions:
Libarary | Version |
---|---|
PyAudio | 3.8.1 |
speech_recognition | 3.8.1 |
pyttsx3 | 2.90 |
streamlit | 1.19.0 |
streamlit_chat | 0.0.2.2 |
folium | 0.14.0 |
streamlit_folium | 0.11.1 |
st_annotated_text | 4.0.0 |
pandas | 1.5.3 |
Make sure all libraries included in the above table and their dependencies are installed using pip or conda command on your virtual environment.
pip install PyAudio
pip install SpeechRecognition
pip install pyttsx3
pip install streamlit
pip install streamlit-chat
pip install folium
pip install streamlit-folium
pip install st-annotated-text
pip install pandas
To run the application, open the terminal in the root directory and exexcute the following command
streamlit run HomePage.py
The application consists of mainly four pages:
- HomePage : is the landing page , mainly describes the Workshop
- User Guide: documentations of the implementation, where users undertand the valid interactions between users and the web app
- Use it : playground page of the chatbot , where user can try/test the voice assistant chatbot
- AIRC : Artificial Intelligence Research Center page
AI-voice-assistant
├── HomePage
│ ├── User Guide
│ ├── Use it
└── └── AIRC