Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get sentence embeddings using gpt2 #322

Open
Pranav082001 opened this issue Jun 1, 2023 · 0 comments
Open

How to get sentence embeddings using gpt2 #322

Pranav082001 opened this issue Jun 1, 2023 · 0 comments

Comments

@Pranav082001
Copy link

Hi, I have been doing some experimentation for getting sentence embedding using gpt2 for semantic similarity task. But failing to get desired results.
Gpt is left to right autoregressive language model, so thought it might be good at picking up context of the whole sentence.

I tried 2 approaches for getting representation of the sentence.

  1. Mean pooling of embeddings of all input words present in sentence
  2. Embedding of last word

But nothing seems to work well.
On the other hand have also tried the same with gpt3 API and the quality of embeddings seems good.
Evaluated the embeddings subjectively on the task of semantic similarity.

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant