From 21236e19dc98acff77224c114ea7ff65f072837e Mon Sep 17 00:00:00 2001 From: paul Date: Tue, 7 Nov 2023 10:10:32 +0100 Subject: [PATCH] Update README on normalize_embeddings option --- laser_encoders/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/laser_encoders/README.md b/laser_encoders/README.md index 52fc5a5d..4c508824 100644 --- a/laser_encoders/README.md +++ b/laser_encoders/README.md @@ -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: