Skip to content

Commit

Permalink
Update README on normalize_embeddings option
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulooh007 committed Nov 7, 2023
1 parent 2cc5434 commit 21236e1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions laser_encoders/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ encoder = LaserEncoderPipeline(lang="igbo")

# Encode sentences into embeddings
embeddings = encoder.encode_sentences(["nnọọ, kedu ka ị mere"])
# If you want the output embeddings to be L2-normalized, set normalize_embeddings to True
normalized_embeddings = encoder.encode_sentences(["nnọọ, kedu ka ị mere"], normalize_embeddings=True)

```

If you prefer more control over the tokenization and encoding process, you can initialize the tokenizer and encoder separately:
Expand Down

0 comments on commit 21236e1

Please sign in to comment.