79429782

Date: 2025-02-11 11:24:06
Score: 1.5
Natty:
Report link

The code snippet provided by OP looks unnecessarily complicated for getting document embeddings.

To get document embeddings, I'd start with using the last hidden state of the [CLS] token. Specifically, OP's text_to_embedding() routine can be replaced with less than 5 lines of code. See this post for how.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Fijoy Vadakkumpadan