Skip to content

Instantly share code, notes, and snippets.

@nialloriordan
Forked from nbertagnolli/bert_emotions.ipynb
Last active February 7, 2022 12:41
Show Gist options
  • Save nialloriordan/4deec5ad99613f02201b65f26d66cf48 to your computer and use it in GitHub Desktop.
Save nialloriordan/4deec5ad99613f02201b65f26d66cf48 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MVreijling
Copy link

Thanks for your response. It's not so much that I'm looking for a better model. I was just wondering if we implemented it wrong. The idea of using embeddings without any finetuning is very interesting to me, but we can't get better than an overall accuracy of 25% on this dataset. This, compared to the originally reported results is very poor.

@oriordanniall
Copy link

You might also be interested in zero shot classification if you don't want to fine-tune your embeddings.

@MVreijling
Copy link

You might also be interested in zero shot classification if you don't want to fine-tune your embeddings.

Thanks for the tip. We're looking into that. But, am I correct to deduce from your replies that you weren't able to get any useful results from this code either?

@oriordanniall
Copy link

oriordanniall commented Feb 7, 2022

Thanks for the tip. We're looking into that. But, am I correct to deduce from your replies that you weren't able to get any useful results from this code either?

For my specific use case using embeddings as features were very valuable. This code example shows the simplest method of extracting embeddings as features but you might be able to extract more value from the embeddings by:

  • using another Transformer model other than bert e.g XLNet, RoBERTa, T5 etc.
  • explore alternative methods for extracting embeddings (embedding_func) rather than only using the last layer. More information in this Github issue discussion
  • fine-tuning your model before creating embeddings as features

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment