x4nth055 / emotion-recognition-using-speech Goto Github PK
View Code? Open in Web Editor NEWBuilding and training Speech Emotion Recognizer that predicts human emotions using Python, Sci-kit learn and Keras
License: MIT License
Building and training Speech Emotion Recognizer that predicts human emotions using Python, Sci-kit learn and Keras
License: MIT License
Hi,
I wanted to replicate Example 1 from the README. I didn’t make any changes to the code, but got the output much different from yours:
Also, the best model selection seems rather strange as I used SVC in the first place. I would appreciate it if you could comment on this issue.
Kind Regards,
Eduards
I ran the pip install requirements.txt and it finished successfully. However when I try to run "python test.py" it gives a invalid syntax issue ->
Rakeshs-MacBook-Air:emotion-recognition-using-speech-master rakeshmohan$ python test.py
File "test.py", line 180
print(f"\t{emotion.capitalize()}: {proba*100:.2f}%")
^
SyntaxError: invalid syntax
Rakeshs-MacBook-Air:emotion-recognition-using-speech-master rakeshmohan$
Can you please help? I am very new to Python and ML etc.
When I run:
from deep_emotion_recognition import DeepEmotionRecognizer
deeprec = DeepEmotionRecognizer(emotions=['angry', 'sad', 'neutral', 'ps', 'happy'], n_rnn_layers=2, n_dense_layers=2, rnn_units=128, dense_units=128)
deeprec.train()
print(deeprec.test_score())
prediction = deeprec.predict('data/validation/Actor_10/03-02-05-02-02-02-10_angry.wav')
print(f"Prediction: {prediction}")
[+] Model created
[*] Model weights loaded
1/1 [==============================] - 0s 400ms/step
0.7538461538461538
extract_feature, did not work.
Hi
First of all, Thanks a lot for providing such a valuable material. I am new to Python and may be its a silly question.
I am trying to run the Speech Emotion Recognition code. I followed all the instructions provided but when I try to run the test.py, it gives me below error.
ModuleNotFoundError: No module named 'numba.decorators'
numba is already installed,
any bit of help will be really Appreciated,
Thanks in advance
Hello, I don't konw where I am start.
Hello,
I think your project is very good, but I have a question, what is the connection between traditional classifier and LSTM
thanks
Hello,
Hope you are doing very well.
I run the model in order to determine the best model (with GridSearch). But it runs with the following problem:
'GradientBoostingClassifier' object has no attribute 'presort'
I couldn't fix it. please help me.
Thank you
I want to understand why SVR parameters are commented in the parameters.py file
Hi,
I am very new to working with Python, so this Issue might not be specific to the package, but I could not find anything online, so decided to ask. When I try to install import DeepEmotionRecognizer, I get the following error:
`---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in
----> 1 from deep_emotion_recognition import DeepEmotionRecognizer
2~/Documents/UCONN/GE/Data/Adam/emotion-recognition-using-speech/deep_emotion_recognition.py in
16 from data_extractor import load_data
17 from create_csv import write_custom_csv, write_emodb_csv, write_tess_ravdess_csv
---> 18 from emotion_recognition import EmotionRecognizer
19 from utils import get_first_letters, AVAILABLE_EMOTIONS, extract_feature, get_dropout_str
20~/Documents/UCONN/GE/Data/Adam/emotion-recognition-using-speech/emotion_recognition.py in
7 from sklearn.model_selection import GridSearchCV
8
----> 9 import matplotlib.pyplot as pl
10 from time import time
11 from utils import get_best_estimators, get_audio_config~/anaconda3/lib/python3.7/site-packages/matplotlib/pyplot.py in
36 import matplotlib.colorbar
37 import matplotlib.image
---> 38 from matplotlib import rcsetup, style
39 from matplotlib import _pylab_helpers, interactive
40 from matplotlib import cbook~/anaconda3/lib/python3.7/site-packages/matplotlib/style/init.py in
----> 1 from .core import use, context, available, library, reload_library~/anaconda3/lib/python3.7/site-packages/matplotlib/style/core.py in
222 # Load style library
223 # ==================
--> 224 _base_library = load_base_library()
225
226 library = None~/anaconda3/lib/python3.7/site-packages/matplotlib/style/core.py in load_base_library()
164 def load_base_library():
165 """Load style library defined in this package."""
--> 166 library = read_style_directory(BASE_LIBRARY_PATH)
167 return library
168~/anaconda3/lib/python3.7/site-packages/matplotlib/style/core.py in read_style_directory(style_dir)
200 with warnings.catch_warnings(record=True) as warns:
201 styles[path.stem] = rc_params_from_file(
--> 202 path, use_default_template=False)
203 for w in warns:
204 _log.warning('In %s: %s', path, w.message)~/anaconda3/lib/python3.7/site-packages/matplotlib/init.py in rc_params_from_file(fname, fail_on_error, use_default_template)
983 'c': 'color',
984 'fc': 'facecolor',
--> 985 'ec': 'edgecolor',
986 'mew': 'markeredgewidth',
987 'aa': 'antialiased',~/anaconda3/lib/python3.7/site-packages/matplotlib/init.py in _rc_params_in_file(fname, fail_on_error)
914 rcParamsOrig = RcParams(rcParams.copy())
915 # This also checks that all rcParams are indeed listed in the template.
--> 916 # Assiging to rcsetup.defaultParams is left only for backcompat.
917 defaultParams = rcsetup.defaultParams = {
918 # We want to resolve deprecated rcParams, but not backend...~/anaconda3/lib/python3.7/contextlib.py in enter(self)
110 del self.args, self.kwds, self.func
111 try:
--> 112 return next(self.gen)
113 except StopIteration:
114 raise RuntimeError("generator didn't yield") from None~/anaconda3/lib/python3.7/site-packages/matplotlib/init.py in _open_file_or_url(fname)
891 You have the following UNSUPPORTED LaTeX preamble customizations:
892 %s
--> 893 Please do not ask for support with these customizations active.
894 *****************************************************************
895 """, '\n'.join(config['text.latex.preamble']))~/anaconda3/lib/python3.7/site-packages/matplotlib/init.py in is_url(filename)
886 config['datapath'] = get_data_path(_from_rc=config['datapath'])
887
--> 888 if "".join(config['text.latex.preamble']):
889 _log.info("""
890 *****************************************************************TypeError: expected string or bytes-like object`
Do you have any idea what is the problem?
I appreciate any insight:)
How can I configure it for my native language?& if I want to test yours, how would I start the training & test the model?
Hi, please tell me where the SVC () model is saved after training?
I tried to save rec. model_trained, but I get an error with it :(
AttributeError: 'EmotionRecognizer' object has no attribute 'X_test'
When I try, following example 2, an extract of 5 sec I receive the following error:
all the input arrays must have same number of dimensions, but the array at index 0 has 1 dimension(s) and the array at index 1 has 2 dimension(s)
.
Any suggestion? Thanks
FileNotFoundError Traceback (most recent call last)
in ()
7 rec = EmotionRecognizer(model=my_model, emotions=['sad', 'neutral', 'happy'], balance=True, verbose=0)
8 # train the model
----> 9 rec.train()
10 # check the test accuracy for that model
11 print("Test score:", rec.test_score())
10 frames
/usr/local/lib/python3.7/dist-packages/pandas/io/parsers.py in init(self, src, **kwds)
2008 kwds["usecols"] = self.usecols
2009
-> 2010 self._reader = parsers.TextReader(src, **kwds)
2011 self.unnamed_cols = self._reader.unnamed_cols
2012
pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader.cinit()
pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader._setup_parser_source()
FileNotFoundError: [Errno 2] No such file or directory: 'train_custom.csv'
{'angry': 1.0, 'sad': 1.0595564e-14, 'neutral': 3.413421e-14, 'ps': 2.9746183e-09, 'happy': 1.6824228e-19}
predicted_angry predicted_sad ... predicted_ps predicted_happy
true_angry 87.179489 6.410257 ... 5.128205 0.000000
true_sad 14.102565 75.641022 ... 7.692308 1.282051
true_neutral 3.846154 6.410257 ... 1.282051 5.128205
true_ps 5.128205 7.692308 ... 80.769226 0.000000
true_happy 10.256411 6.410257 ... 10.256411 66.666672
[5 rows x 5 columns]
Hello, Could you please help me in this?
3 rec = EmotionRecognizer(None, emotions=["boredom", "neutral"], features=["mfcc"])
4 # evaluate all models in `grid` folder and determine the best one in terms of test accuracy
----> 5 rec.determine_best_model()
6 # now you can make inference on the model
7 rec.predict("data/emodb/wav/15b09La.wav") # 'boredom'
10 frames
/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py in init(self, src, **kwds)
2008 kwds["usecols"] = self.usecols
2009
-> 2010 self._reader = parsers.TextReader(src, **kwds)
2011 self.unnamed_cols = self._reader.unnamed_cols
2012
pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader.cinit()
pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader._setup_parser_source()
FileNotFoundError: [Errno 2] No such file or directory: 'train_custom.csv'
Hi,
RAVDESS data consists of 24 actors as far as i know.
In your code, you utilize additional actors...
How did you get these dataset...?
Best,
Jangho
Hello,
I want to use a pre trained model to detect boredom in speech? How can I do that? Can you please share your pre trained model for it?
When I run this sentence rec.determine_best_model(train=True), the code gives error:ModuleNotFoundError: No module named 'sklearn.ensemble._gb_losses'. How to slove it?Is it about the scikit-learn's version?
Hi, This is a good job, thank you for your open source!
Is this work has any references paper to this work?
Hi, I git clone the repo and install the dependency. Then I new a pyhton script which is written as the readme does. But it did not print anything and no error messages. How could this be fixed?
When using predict_proba (emotion_recognizer), I get different results based on the order of the chosen emotions.
i.e. if I write "sad","neutral","happy" and then "happy","neutral","sad", my results are different.
because the sample rate of call recordings is 8000hz and if i cahnge it into 16000hz then it will make a difference
ImportError: numpy.core.multiarray failed to import
Hi,
Can I use your model to detect any other emotion like rudeness using my own custom-dataset? If yes, please guide.
Originally posted by @Tanish18 in #4 (comment)
Can i get a tutorial means how to set up this project , i am using jupyter notebook can any one give me any tutorial how to run this project.
melspectrogram() takes 0 positional arguments but 1 positional argument (and 1 keyword-only argument) were given
Hello,
I wanted to use this repository for calling predictions and prediction probabilities on .wav files I'm getting from the internet. I've been using converted youtube audio clips (in the final form of .wav). For some reason, basic predictions aren't being done on these files. I wanted to know if you could explain how one should properly test these new WAV files. For the time being, I've just been following example 2 in the README, downloading the files, and putting them in their own folder within the emotion-recognition-using-speech one. Is there anything in the code I should modify to be able to use this program on wav files converted from Youtube?
How can I just run the model and test emotions of audio file without training the model again?
Hi,
Based on this, I tried to convert speech to text, but whatever I do in the test file is the same print every time, even if I delete from the test file "print ('please talk')", so nothing changes it prints me "please talk" in output. I run the program in order but the output is the same. Also I try to delete some code to make mistake, I thought it wll be an error, but the output is the same.
[+] Model trained
Test accuracy score: 48.677%
Please talk
calm
Thank You in advance.
Best regards.
Bekir
Hi, in the utils.py file, there is an import statement for module soundfile. But it's missing in the repository, can you please check it.
Looking at this blog, this tutorial, the Wikipedia entery, and any other material, shows us that RNNs are experts at extracting the time-sequential information in our data.
The features you extract are averaged across the time domain. Wouldn't it be better to feed the network with temporal information when using LSTM or GRUs?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.