Browse Source
[DOC] Refine Readme
Signed-off-by: LocoRichard <lichen.wang@zilliz.com>
main
LocoRichard
3 years ago
1 changed files with
6 additions and
6 deletions
-
README.md
|
|
@ -4,7 +4,7 @@ |
|
|
|
|
|
|
|
<br /> |
|
|
|
|
|
|
|
## Desription |
|
|
|
## Description |
|
|
|
|
|
|
|
A text embedding operator takes a sentence, paragraph, or document in string as an input |
|
|
|
and output an embedding vector in ndarray which captures the input's core semantic elements. |
|
|
@ -21,7 +21,7 @@ The original model was proposed in REALM: Retrieval-Augmented Language Model Pre |
|
|
|
|
|
|
|
## Code Example |
|
|
|
|
|
|
|
Use the pretrained model "google/realm-cc-news-pretrained-embedder" |
|
|
|
Use the pre-trained model "google/realm-cc-news-pretrained-embedder" |
|
|
|
to generate a text embedding for the sentence "Hello, world.". |
|
|
|
|
|
|
|
*Write the pipeline*: |
|
|
@ -37,7 +37,7 @@ towhee.dc(["Hello, world."]) \ |
|
|
|
|
|
|
|
## Factory Constructor |
|
|
|
|
|
|
|
Create the operator via the following factory method |
|
|
|
Create the operator via the following factory method: |
|
|
|
|
|
|
|
***text_embedding.transformers(model_name="google/realm-cc-news-pretrained-embedder")*** |
|
|
|
|
|
|
@ -48,15 +48,15 @@ Create the operator via the following factory method |
|
|
|
The model name in string. |
|
|
|
The default value is "google/realm-cc-news-pretrained-embedder". |
|
|
|
|
|
|
|
Supported model names: |
|
|
|
Supported model name: |
|
|
|
- google/realm-cc-news-pretrained-embedder |
|
|
|
|
|
|
|
<br /> |
|
|
|
|
|
|
|
## Interface |
|
|
|
|
|
|
|
The operator takes a text in string as input. |
|
|
|
It loads tokenizer and pre-trained model using model name. |
|
|
|
The operator takes a piece of text in string as input. |
|
|
|
It loads tokenizer and pre-trained model using model name |
|
|
|
and then return text embedding in ndarray. |
|
|
|
|
|
|
|
|
|
|
|