Portfolio 1 Week 7: Voice Recognition, ZMQ & Machine Learning
- J J
- Nov 29, 2019
- 2 min read
Updated: Jan 4, 2020
So this week our class is learning voice recognition and making use of the library speech_recognition to record what is said on the mic and transfer the data from one program to another.
At the very beginning, I had issues with the program not being able to detect what I was saying. but after reading forums and looking for solutions, I found out that the issue was not with the program, but the computer itself, and that could be solved by setting up speech recognition on the computer first, otherwise windows will not be able to use the mic for this program.
After the setting up of speech recognition, I was able to complete the practical and learnt how to use speech_recognition.microphone() to store the audio as a variable, and using the Google API to translate whatever audio into English or any language by using the command translator.recognize_google(). this command is able to recognize what I said into any language.

I have also learnt how to send data from one program to another using the zmq library. The zmq library allows me to set sockets through a TCP address. In this particular exercise, the sockets were set to the publisher as well as a subscriber on 2 different programs, with the subscriber being the one receiving data from the publisher. But the 2 programs must be linked to the same TCP address. Firstly, I must set the sockets and give them a context of whether they are for publishing or subscribing. the subscribing socket will be connected to the TCP address before the publishing socket gets bound to it.


The publishing program will then send something to the TCP address, and the subscribing program will receive the sent data.


As for the second part of this practical, we learnt how to use Azure learning studio to try out machine learning.
The first thing done is to take data from a prewritten set of data, and then select some important columns needed for the machine learning. Then the missing data is cleaned. While doing this step, I realised that the missing data has the value set to 0 automatically.
the following step is to split the data into 2, firstly the data is edited, and then split into 75% and 25% groups. based on the 2 groups of data, we need to use a learning algorithm. 75% of the data is linked to the train model.

This basically means that the 75% of the data is used for linear regression, and the remaining 25% is used to compare with the predicted price. Then the evaluate model is added, to see how far off the predictions were compared to the actual prices.

Afterwards, I will set this experiment as a web service for predictions, and after deploying this web service, I can then use this experiment to predict prices based on my own inputs.

The scored label is the predicted price for this vehicle.
Comments