# Utilizing Machine Learning for Detecting Harmful Situations by Audio and Text
## 3 Dataset Details
### Dataset Analysis  
Next, we analyzed the common words for each category in the dataset. Figures 2-4 presents the frequency of the 20 most common words for each category, while omitting stop words that were often common. \begin{table}
\begin{tabular}{c l l} \hline \hline
**Category Name** & **Example** & **Total Number** \\ \hline Neutral Sentences & How are you? & 700 \\ \hline Insulting (1 st and 2 nd person) sentences & She is fat & 719 \\ \hline Unsafe (risky) sentences & It’s dangerous! & 472 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Category example and distribution. Figure 4: Frequency of unsafe words—no stop words. Figure 3: Frequency of insulting words—no stop words. Figure 2: Frequency of neutral words—no stop words. As can be seen, each category exhibited its own set of popular terms and words, with some overlap between common terms. Figure 5 shows the distribution of the common terms. This figure demonstrates the uniqueness of each category with respect to its own popular terms, with some overlap between terms that are popular in two or even three categories. However, identifying unique text characteristics for each category, which will allow us to accurately classify sentences based on their texts, is possible. Next, we describe the five audio properties of the dataset [57]. 1. MFCC [58] is a set of fundamental audio features, using a 20 ms audio frame unit. It also includes the noise, speech rate, speech acceleration etc. 2. Mel-scale spectrogram converts the frequencies to the mel scale, which is similar to human ear as they are equidistant from one another. 3. Spectral contrast [44] is the difference in amplitude between the spectral peaks and valleys for six sub-bands for each time frame. It can be used to highlight regions of the frequency spectrum. 4. Short-time Fourier transform (STFT) [59] takes place around a short time and evaluates the Fourier return on the time-dependent segment. The Chroma feature relates to the twelve different pitch classes and provides a robust way to describe a similarity measure between audio pieces. 5. Tonnetz is a tonal space representation introduced by [PERSON] [60] and is used for detecting Harmonic Change in Musical Audio [61]. Table 2 and Figure 6 show the average values of each characteristic for each category. \begin{table}
\begin{tabular}{l l l l} \hline \hline
**Feature** & **Neutral** & **Insulting** & **Unsafe** \\ \hline MFCC & \(-5.76\) (2.344) & \(-5.07\) (2.9) & \(-5.07\) (2.75) \\ Mel & 1.45 (2.12) & 1.612 (2.41) & 1.91 (2.72) \\ STFT Chroma & 0.55 (0.07) & 0.556 (0.07) & 0.56 (0.08) \\ Contrast & 22.021 (1.95) & 21.83 (1.73) & 21.71 (1.82) \\ Tonnetz & 0.0078 (0.03) & 0.0067 (0.03) & 0.0093 (0.02) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Average value (and standard deviation) of each parameters for each category. Figure 5: Common terms for each Category. As can be seen in the table, both the Tonnetz and Mel-scale spectrograms have the highest value in unsafe speech. This indicates that, in unsafe speech, more variety existed in the audio and exhibited a more varied tone. MFCC exhibited the lowest value in neutral speech, probably because it is related to the normal human ear. The contrast exhibited the highest average value for neutral sentences. The average value of the Chrome feature was very similar among the three classes. Finally, we attempted to extract a vector of the eight popular emotions based on audio signs. As classified by the Wav2 Vec2 Feature Extractor ([[https://huggingface.co/ehcalabres/wav2](https://huggingface.co/ehcalabres/wav2) vec2-lg-xlsr-en-speech-emotion-recognition]([https://huggingface.co/ehcalabres/wav2](https://huggingface.co/ehcalabres/wav2) vec2-lg-xlsr-en-speech-emotion-recognition), accessed on 15 March 2023). Table 3 shows the emotion level specified by each categories, for each of the following emotions: \"angry\", \"calm\", \"disgust\", \"fearful\", \"happy\", \"neutral\", \"sad\", and \"surprised\".