Browse Source
Update readme
Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
1 changed files with
2 additions and
15 deletions
-
README.md
|
|
@ -15,7 +15,7 @@ This operator is implemented with pretrained models from [Huggingface Transforme |
|
|
|
Use the pretrained model 'distilbert-base-cased' |
|
|
|
to generate a text embedding for the sentence "Hello, world.". |
|
|
|
|
|
|
|
*Write the pipeline in simplified style*: |
|
|
|
*Write the pipeline*: |
|
|
|
|
|
|
|
```python |
|
|
|
from towhee import dc |
|
|
@ -26,19 +26,6 @@ dc.stream(["Hello, world."]) |
|
|
|
.show() |
|
|
|
``` |
|
|
|
|
|
|
|
*Write a same pipeline with explicit inputs/outputs name specifications:* |
|
|
|
|
|
|
|
```python |
|
|
|
from towhee import dc |
|
|
|
|
|
|
|
|
|
|
|
dc.stream['txt'](["Hello, world."]) |
|
|
|
.text_embedding.transformers['txt', 'vec']('distilbert-base-cased') |
|
|
|
.select('txt', 'vec') |
|
|
|
.show() |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
## Factory Constructor |
|
|
|
|
|
|
|
Create the operator via the following factory method |
|
|
@ -57,7 +44,7 @@ You can get the list of supported model names by calling `get_model_list` from [ |
|
|
|
|
|
|
|
The operator takes a text in string as input. |
|
|
|
It loads tokenizer and pre-trained model using model name. |
|
|
|
Text embeddings are returned in ndarray. |
|
|
|
and then return text embedding in ndarray. |
|
|
|
|
|
|
|
|
|
|
|
**Parameters:** |
|
|
|