Use deepspeech model as a pretrained feature extractor for another task

Hi! I’d like to apply deepspeech speech-to-text model to another task: speech emotion recognition. Therefore I need to extract feature from the intermediate layer of deepspeech model. Any suggestion on how to do it?