Browse Source
Update
Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
2 changed files with
9 additions and
3 deletions
-
README.md
-
BIN
result.png
|
|
@ -27,11 +27,17 @@ to generate a text embedding for the sentence "Hello, world.". |
|
|
|
*Write the pipeline*: |
|
|
|
|
|
|
|
```python |
|
|
|
import towhee |
|
|
|
from towhee.dc2 import pipe, ops, DataCollection |
|
|
|
|
|
|
|
towhee.dc(["Hello, world."]) \ |
|
|
|
.text_embedding.realm(model_name="google/realm-cc-news-pretrained-embedder") |
|
|
|
p = ( |
|
|
|
pipe.input('text') |
|
|
|
.map('text', 'vec', ops.text_embedding.realm(model_name="google/realm-cc-news-pretrained-embedder")) |
|
|
|
.output('text', 'vec') |
|
|
|
) |
|
|
|
|
|
|
|
DataCollection(p('Hello, world.')).show() |
|
|
|
``` |
|
|
|
<img src="./result.png" width="800px"/> |
|
|
|
|
|
|
|
<br /> |
|
|
|
|
|
|
|
Width:
|
Height:
|
Size: 5.6 KiB
|