Commit
·
2e73ddf
1
Parent(s):
3e60708
Update README.md
Browse files
README.md
CHANGED
@@ -50,15 +50,16 @@ The code will automatically normalize your audio (i.e., resampling + mono channe
|
|
50 |
First of all, please install the **development** version of SpeechBrain with the following command:
|
51 |
|
52 |
```
|
53 |
-
|
|
|
|
|
|
|
54 |
```
|
55 |
|
56 |
Please notice that we encourage you to read our tutorials and learn more about
|
57 |
[SpeechBrain](https://speechbrain.github.io).
|
58 |
|
59 |
-
### Perform Speech Emotion Diarization
|
60 |
-
|
61 |
-
An external `py_module_file=custom.py` is used as an external Predictor class into this HF repos. We use `foreign_class` function from `speechbrain.pretrained.interfaces` that allows you to load your custom model.
|
62 |
|
63 |
```python
|
64 |
from speechbrain.pretrained.interfaces import Speech_Emotion_Diarization
|
@@ -75,6 +76,17 @@ print(diary)
|
|
75 |
# {'start': 1.94, 'end': 4.48, 'emotion': 'h'} # h -> happy
|
76 |
# ]
|
77 |
# }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
```
|
79 |
The output will contain a dictionary of emotion components and their boundaries.
|
80 |
|
|
|
50 |
First of all, please install the **development** version of SpeechBrain with the following command:
|
51 |
|
52 |
```
|
53 |
+
git clone https://github.com/speechbrain/speechbrain.git
|
54 |
+
cd speechbrain
|
55 |
+
pip install -r requirements.txt
|
56 |
+
pip install --editable .
|
57 |
```
|
58 |
|
59 |
Please notice that we encourage you to read our tutorials and learn more about
|
60 |
[SpeechBrain](https://speechbrain.github.io).
|
61 |
|
62 |
+
### Perform Speech Emotion Diarization
|
|
|
|
|
63 |
|
64 |
```python
|
65 |
from speechbrain.pretrained.interfaces import Speech_Emotion_Diarization
|
|
|
76 |
# {'start': 1.94, 'end': 4.48, 'emotion': 'h'} # h -> happy
|
77 |
# ]
|
78 |
# }
|
79 |
+
|
80 |
+
diary = classifier.diarize_file("speechbrain/emotion-diarization-wavlm-large/example_sad.wav")
|
81 |
+
print(diary)
|
82 |
+
|
83 |
+
# {
|
84 |
+
# 'speechbrain/emotion-diarization-wavlm-large/example_sad.wav':
|
85 |
+
# [
|
86 |
+
# {'start': 0.0, 'end': 3.54, 'emotion': 's'}, # s -> sad
|
87 |
+
# {'start': 3.54, 'end': 5.26, 'emotion': 'n'} # n -> neutral
|
88 |
+
# ]
|
89 |
+
# }
|
90 |
```
|
91 |
The output will contain a dictionary of emotion components and their boundaries.
|
92 |
|