logo
Browse Source

Update README

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

22
README.md

@ -2,7 +2,7 @@
*author: Jael Gu*
<br />
## Desription
@ -10,12 +10,14 @@ 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.
This operator is implemented with pretrained models from [Huggingface Transformers](https://huggingface.co/docs/transformers).
<br />
## Code Example
Use the pretrained model 'distilbert-base-cased'
to generate a text embedding for the sentence "Hello, world.".
*Write the pipeline*:
*Write the pipeline*:
```python
from towhee import dc
@ -26,6 +28,8 @@ dc.stream(["Hello, world."]) \
.to_list()
```
<br />
## Factory Constructor
Create the operator via the following factory method
@ -34,11 +38,12 @@ Create the operator via the following factory method
**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).
<br />
## Interface
@ -49,15 +54,14 @@ and then return text embedding in ndarray.
**Parameters:**
***text***: *str*
​ The text in string.
***text***: *str*
The text in string.
**Returns**:
*numpy.ndarray*
*numpy.ndarray*
The text embedding extracted by model.
The text embedding extracted by model.

Loading…
Cancel
Save