logo
Browse Source

Update README

Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
Jael Gu 3 years ago
parent
commit
75499219ef
  1. 17
      README.md

17
README.md

@ -2,6 +2,7 @@
*author: Kyle He*
<br />
## Desription
@ -22,12 +23,14 @@ length, making it easy to process documents of thousands of tokens or longer[2].
[2].https://arxiv.org/pdf/2004.05150.pdf
<br />
## Code Example
Use the pretrained model "facebook/dpr-ctx_encoder-single-nq-base"
to generate a text embedding for the sentence "Hello, world.".
*Write the pipeline*:
*Write the pipeline*:
```python
from towhee import dc
@ -38,6 +41,8 @@ dc.stream(["Hello, world."]) \
.to_list()
```
<br />
## Factory Constructor
Create the operator via the following factory method
@ -46,12 +51,13 @@ Create the operator via the following factory method
**Parameters:**
***model_name***: *str*
***model_name***: *str*
The model name in string.
The model name in string.
The default value is "allenai/longformer-base-4096".
You can get the list of supported model names by calling `get_model_list` from [longformer.py](https://towhee.io/text-embedding/longformer/src/branch/main/longformer.py).
<br />
## Interface
@ -61,10 +67,9 @@ and then return text embedding in ndarray.
**Parameters:**
***text***: *str*
​ The text in string.
***text***: *str*
The text in string.
**Returns**:

Loading…
Cancel
Save