Skip to content

Commit

Permalink
fix: docstring for normalization (deepset-ai#8604)
Browse files Browse the repository at this point in the history
* fix: docstring for normalization

* chore: add reno

* fixing docstrings and adding pylint disable too many args

---------

Co-authored-by: David S. Batista <[email protected]>
  • Loading branch information
ArzelaAscoIi and davidsbatista authored Dec 6, 2024
1 parent b32f85c commit ed2f37d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class SentenceTransformersDocumentEmbedder:
```
"""

def __init__( # noqa: PLR0913
def __init__( # noqa: PLR0913 # pylint: disable=too-many-positional-arguments
self,
model: str = "sentence-transformers/all-mpnet-base-v2",
device: Optional[ComponentDevice] = None,
Expand Down Expand Up @@ -79,7 +79,7 @@ def __init__( # noqa: PLR0913
:param progress_bar:
If `True`, shows a progress bar when embedding documents.
:param normalize_embeddings:
If `True`, returns vectors with length 1.
If `True`, the embeddings are normalized using L2 normalization, so that each embedding has a norm of 1.
:param meta_fields_to_embed:
List of metadata fields to embed along with the document text.
:param embedding_separator:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class SentenceTransformersTextEmbedder:
```
"""

def __init__( # noqa: PLR0913
def __init__( # noqa: PLR0913 # pylint: disable=too-many-positional-arguments
self,
model: str = "sentence-transformers/all-mpnet-base-v2",
device: Optional[ComponentDevice] = None,
Expand Down Expand Up @@ -73,7 +73,7 @@ def __init__( # noqa: PLR0913
If `True`, shows a progress bar for calculating embeddings.
If `False`, disables the progress bar.
:param normalize_embeddings:
If `True`, returned vectors have a length of 1.
If `True`, the embeddings are normalized using L2 normalization, so that the embeddings have a norm of 1.
:param trust_remote_code:
If `False`, permits only Hugging Face verified model architectures.
If `True`, permits custom models and scripts.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
fixes:
- fix docstrings for normalize_embeddings in sentence_transformers_text_embedder and sentence_transformers_document_embedder

0 comments on commit ed2f37d

Please sign in to comment.