Project: Acoustic Sentimental Analysis: Our project uses an open library pyAudioAnalysis for feature Extraction. The features extracted are:
- Zero Crossing Rate
- Energy
- Entropy of Energy
- Spectral Centroid
- Spectral Spread
- Spectral Entropy
- Spectral Flux
- Spectral rolloff 9-21. MFCC 22-33. Chroma Vector
- Chroma Deviation
We explcitly convert the .mp3 files to .wav files using pydub.
The trained data set is loaded in a pickle file so as to avoid training everytime.
The Classifier used for prediction is Random Forest Classifier with No of estimators: 30 No of Features: 6
Requirements:
Operating system Ubuntu-14.04 and above Python 2.7 and above
Code Structure:
- execute.py: python program for training and predicting the sentiment of files from input.txt
- setup.py: python program that installs required packages and libraries to run the project.
- run.sh: executes setup.py and execute.py
- dataset.pickle , classifier.pickle: pickle file with trained dataset and classifier set.
Steps to execute project:
- Extract our zip file.
- In order to be able to call the pyAudioAnalysis library from any path you need to add the folder that contains it in the ~/.bashrc file. In particular, add a line as the follow in ~/.bashrc:
export PYTHONPATH=$PYTHONPATH:"/home/bla/bla"
(use the exact path where the pyAudioAnalysis folder is contained - without the pyAudioAnalysis name, e.g. if the library is contained in /home/tyiannak/Research/libraries/pyAudioAnalysis, then use /home/tyiannak/Research/libraries in the bashrc file)
Then, you need to update the path details:
source ~/.bashrc
- Add the files to be predicted in given folder and their name in input.txt.
- Execute " bash run.sh "
Note:
If you wish to change the training dataset just uncomment the line 'train_classifier()' in main in execute.py. This will create new classifier and save it in classifier.pickle.
For any queries , please connect us through: