Last active
April 8, 2021 07:17
-
-
Save AyishaR/dc806be20d2730a1233b4e5e71961d1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_noise = False # add different words, null samples and random noise | |
n_classes = len(hotwords) + int(add_noise) | |
class_nSamples = 1000 # number of samples in the hotword classes | |
other_nSamples = float(class_nSamples)/(len(word_dirs) - n_classes) # number of samples to be picked from each of the non-hotword classes | |
def nLabel(word): | |
return n_classes-1 if ( word not in hotwords ) else hotwords.index(word) | |
def textLabel(index): | |
return hotwords[index] if index <len(hotwords) else "background" | |
def sampleBackGround(): | |
return add_noise |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment