python code for speech models