Browse Source
Add results
Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
2 changed files with
18 additions and
2 deletions
-
README.md
-
BIN
result.png
|
|
@ -22,10 +22,26 @@ to generate a text embedding for the sentence "Hello, world.". |
|
|
|
```python |
|
|
|
import towhee |
|
|
|
|
|
|
|
towhee.dc(["Hello, world."]) \ |
|
|
|
.text_embedding.transformers(model_name="distilbert-base-cased") |
|
|
|
( |
|
|
|
towhee.dc(["Hello, world."]) |
|
|
|
.text_embedding.transformers(model_name="distilbert-base-cased") |
|
|
|
) |
|
|
|
``` |
|
|
|
|
|
|
|
*Write a same pipeline with explicit inputs/outputs name specifications:* |
|
|
|
|
|
|
|
```python |
|
|
|
import towhee |
|
|
|
|
|
|
|
( |
|
|
|
towhee.dc['text'](["Hello, world."]) |
|
|
|
.text_embedding.transformers['text', 'vec'](model_name="distilbert-base-cased") |
|
|
|
.show() |
|
|
|
) |
|
|
|
``` |
|
|
|
|
|
|
|
<img src="./result.png" width="800px"/> |
|
|
|
|
|
|
|
<br /> |
|
|
|
|
|
|
|
## Factory Constructor |
|
|
|
Width:
|
Height:
|
Size: 5.8 KiB
|