Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/akshanshchaudhry/Speech-Accent-Recognition
/ functions
Functions
26 in github.com/akshanshchaudhry/Speech-Accent-Recognition
⨍
Functions
26
◇
Types & classes
1
↓ 2 callers
Function
create_dataframe
:param languages (str): language from which you want to get html :return df (DataFrame): DataFrame that contains all audio metadata from sea
src/fromwebsite.py:80
↓ 2 callers
Function
get_htmls
Retrieves html in text form from ROOT_URL :param urls (list): List of urls from which to retrieve html :return (list): list of HTML strin
src/fromwebsite.py:13
↓ 2 callers
Function
make_segments
Makes segments of mfccs and attaches them to the labels :param mfccs: list of mfccs :param labels: list of labels :return (tuple): Se
src/trainmodel.py:85
↓ 2 callers
Function
to_categorical
Converts list of languages into a binary class matrix :param y (list): list of languages :return (numpy array): binary class matrix
src/trainmodel.py:29
↓ 1 callers
Function
build_search_urls
creates url from ROOT_URL and languages :param languages (list): List of languages :return (list): List of urls
src/fromwebsite.py:29
↓ 1 callers
Method
check_path
Checks if self.distination_folder exists. If not, a folder called self.destination_folder is created
src/getaudio.py:23
↓ 1 callers
Function
confusion_matrix
Create confusion matrix :param y_predicted: list of predictions :param y_test: numpy array of shape (len(y_test), number of classes). 1.'
src/accuracy.py:39
↓ 1 callers
Function
create_segmented_mfccs
Creates segmented MFCCs from X_train :param X_train: list of MFCCs :return: segmented mfccs
src/trainmodel.py:111
↓ 1 callers
Function
filter_df
Function to filter audio files based on df columns df column options: [age,age_of_english_onset,age_sex,birth_place,english_learning_method,
src/getsplit.py:31
↓ 1 callers
Method
get_audio
Retrieves all audio files from 'language_num' column of self.audio_df If audio file already exists, move on to the next :retu
src/getaudio.py:32
↓ 1 callers
Function
get_bio
Retrieves HTML from list of hrefs and returns bio information :param hrefs (list): list of hrefs :return (DataFrame): Pandas DataFrame wi
src/fromwebsite.py:46
↓ 1 callers
Function
parse_bio
Parse bio data from row string :param row (str): Unparsed bio string :return (list): Bio columns
src/fromwebsite.py:64
↓ 1 callers
Function
parse_p
Extracts href property from HTML <p> tag string :param p_tag (str): HTML string :return (str): string of link
src/fromwebsite.py:37
↓ 1 callers
Function
predict_class_audio
Predict class based on MFCC samples :param MFCCs: Numpy array of MFCCs :param model: Trained model :return: Predicted class of MFCC s
src/accuracy.py:4
↓ 1 callers
Function
save_model
Save model to file :param model: Trained model to be saved :param model_filename: Filename :return: None
src/trainmodel.py:186
↓ 1 callers
Function
segment_one
Creates segments from on mfcc image. If last segments is not long enough to be length of columns divided by COL_SIZE :param mfcc (numpy array
src/trainmodel.py:100
↓ 1 callers
Function
split_people
Create train test split of DataFrame :param df (DataFrame): Pandas DataFrame of audio files to be split :param test_size (float): Percent
src/getsplit.py:53
↓ 1 callers
Function
train_model
Trains 2D convolutional neural network :param X_train: Numpy array of mfccs :param y_train: Binary matrix based on labels :return: Tr
src/trainmodel.py:123
Method
__init__
Initializes GetAudio class object :param destination_folder (str): Folder where audio files will be saved :param wait (float)
src/getaudio.py:9
Function
get_accuracy
Get accuracy :param y_predicted: numpy array of predictions :param y_test: numpy array of actual :return: accuracy
src/accuracy.py:51
Function
get_wav
Load wav file from disk and down-samples to RATE :param language_num (list): list of file names :return (numpy array): Down-sampled wav f
src/trainmodel.py:41
Function
normalize_mfcc
Normalize mfcc :param mfcc: :return:
src/trainmodel.py:76
Function
predict_class_all
:param X_train: List of segmented mfccs :param model: trained model :return: list of predictions
src/accuracy.py:27
Function
predict_prob_class_audio
Predict class based on MFCC samples' probabilities :param MFCCs: Numpy array of MFCCs :param model: Trained model :return: Predicted
src/accuracy.py:16
Function
remove_silence
Searches wav form for segments of silence. If wav form values are lower than 'thresh' for 'chunk' samples, the values will be removed :param
src/trainmodel.py:59
Function
to_mfcc
Converts wav file to Mel Frequency Ceptral Coefficients :param wav (numpy array): Wav form :return (2d numpy array: MFCC
src/trainmodel.py:51