logo
Browse Source

Update README

Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
Jael Gu 3 years ago
parent
commit
518c0b8737
  1. 20
      README.md

20
README.md

@ -2,7 +2,7 @@
*author: Jael Gu* *author: Jael Gu*
<br />
## Desription ## Desription
@ -10,6 +10,8 @@ A text embedding operator takes a sentence, paragraph, or document in string as
and output an embedding vector in ndarray which captures the input's core semantic elements. and output an embedding vector in ndarray which captures the input's core semantic elements.
This operator is implemented with pretrained models from [Huggingface Transformers](https://huggingface.co/docs/transformers). This operator is implemented with pretrained models from [Huggingface Transformers](https://huggingface.co/docs/transformers).
<br />
## Code Example ## Code Example
Use the pretrained model 'distilbert-base-cased' Use the pretrained model 'distilbert-base-cased'
@ -26,6 +28,8 @@ dc.stream(["Hello, world."]) \
.to_list() .to_list()
``` ```
<br />
## Factory Constructor ## Factory Constructor
Create the operator via the following factory method Create the operator via the following factory method
@ -34,11 +38,12 @@ Create the operator via the following factory method
**Parameters:** **Parameters:**
***model_name***: *str*
***model_name***: *str*
The model name in string.
The model name in string.
You can get the list of supported model names by calling `get_model_list` from [auto_transformers.py](https://towhee.io/text-embedding/transformers/src/branch/main/auto_transformers.py). You can get the list of supported model names by calling `get_model_list` from [auto_transformers.py](https://towhee.io/text-embedding/transformers/src/branch/main/auto_transformers.py).
<br />
## Interface ## Interface
@ -49,15 +54,14 @@ and then return text embedding in ndarray.
**Parameters:** **Parameters:**
***text***: *str*
​ The text in string.
***text***: *str*
The text in string.
**Returns**: **Returns**:
*numpy.ndarray*
*numpy.ndarray*
The text embedding extracted by model.
The text embedding extracted by model.

Loading…
Cancel
Save