You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: redisvl/utils/vectorize/text/custom.py
+13-8Lines changed: 13 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
8
8
9
9
classCustomTextVectorizer(BaseVectorizer):
10
-
"""The CustomTextVectorizer class wraps user-defined embeding methods to create
10
+
"""The CustomTextVectorizer class wraps user-defined embedding methods to create
11
11
embeddings for text data.
12
12
13
13
This vectorizer is designed to accept a provided callable text vectorizer and
@@ -44,6 +44,7 @@ def __init__(
44
44
embed_many: Optional[Callable] =None,
45
45
aembed: Optional[Callable] =None,
46
46
aembed_many: Optional[Callable] =None,
47
+
dtype: str="float32",
47
48
):
48
49
"""Initialize the Custom vectorizer.
49
50
@@ -52,10 +53,14 @@ def __init__(
52
53
embed_many (Optional[Callable)]: a Callable function that accepts a list of string objects and returns a list containing lists of floats. Defaults to None.
53
54
aembed (Optional[Callable]): an asyncronous Callable function that accepts a string object and returns a lists of floats. Defaults to None.
54
55
aembed_many (Optional[Callable]): an asyncronous Callable function that accepts a list of string objects and returns a list containing lists of floats. Defaults to None.
56
+
dtype (str): the default datatype to use when embedding text as byte arrays.
57
+
Used when setting `as_buffer=True` in calls to embed() and embed_many().
58
+
Defaults to 'float32'.
55
59
56
60
Raises:
57
-
ValueError if any of the provided functions accept or return incorrect types.
58
-
TypeError if any of the provided functions are not Callable objects.
61
+
ValueError: if any of the provided functions accept or return incorrect types.
62
+
TypeError: if any of the provided functions are not Callable objects.
0 commit comments