# Get output embedding of FeatureExtractor

**URL:** <https://discuss.huggingface.co/t/get-output-embedding-of-featureextractor/5636>\
**Category:** 🤗Transformers\
**Created:** [April 20, 2021, 1:14pm UTC](https://discuss.huggingface.co/t/get-output-embedding-of-featureextractor/5636 "2021-04-20T13:14:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gorkemgoknar](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@gorkemgoknar](https://discuss.huggingface.co/u/gorkemgoknar)\
**Post date:** [April 20, 2021, 1:14pm UTC](https://discuss.huggingface.co/t/get-output-embedding-of-featureextractor/5636/1 "2021-04-20T13:14:11Z")

</div>

Can anyone route me to get output of Feature extractor out of a transformers model?  
Specific case for me here is I want to prepare a voiceprint identification (with n-shot) maybe wav2vec2 embeddings (for auto identification of speaker) , since it is already trained on large data should at least get a proper voice embedding for audio data (Feature extractor is mainly used in finetuning pipeline Wav2Vec2FeatureExtractor).  
Especially I want to get a 1x512 or 1x768 embedding before converting that to text mapping.  
Maybe it is an overkill for Siamese network but at least may try for smaller version.  
Thanks.

---

<div class="post-metadata">

**Author:** ![gorkemgoknar](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@gorkemgoknar](https://discuss.huggingface.co/u/gorkemgoknar)\
**Post date:** [April 20, 2021, 1:22pm UTC](https://discuss.huggingface.co/t/get-output-embedding-of-featureextractor/5636/2 "2021-04-20T13:22:07Z")

</div>

Maybe solution is somewhat similar to this (without tokenizer) yet it will probably have no information on pretrained model.

```auto
feature_extraction = pipeline('feature-extraction', model="distilroberta-base", tokenizer="distilroberta-base")
features = feature_extraction("i am sentence")

```

Source: [machine learning - Getting sentence embedding from huggingface Feature Extraction Pipeline - Stack Overflow](https://stackoverflow.com/questions/64685243/getting-sentence-embedding-from-huggingface-feature-extraction-pipeline)
