logo
Browse Source

[DOC] Refine Readme

Signed-off-by: LocoRichard <lichen.wang@zilliz.com>
main
LocoRichard 3 years ago
parent
commit
db16b5d3c2
  1. 12
      README.md

12
README.md

@ -4,7 +4,7 @@
<br /> <br />
## Desription
## Description
A text embedding operator takes a sentence, paragraph, or document in string as an input 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. 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 ## 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.". to generate a text embedding for the sentence "Hello, world.".
*Write the pipeline*: *Write the pipeline*:
@ -37,7 +37,7 @@ towhee.dc(["Hello, world."]) \
## Factory Constructor ## 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")*** ***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 model name in string.
The default value is "google/realm-cc-news-pretrained-embedder". The default value is "google/realm-cc-news-pretrained-embedder".
Supported model names:
Supported model name:
- google/realm-cc-news-pretrained-embedder - google/realm-cc-news-pretrained-embedder
<br /> <br />
## Interface ## 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. and then return text embedding in ndarray.

Loading…
Cancel
Save