
(https://huggingface.co/WhereIsAI/UAE-Large-V1) with sentence-transformers tag to do Average Pooling

# Usage


```bash
python -m pip install -U angle-emb
```

1) Non-Retrieval Tasks

```python
from angle_emb import AnglE

angle = AnglE.from_pretrained('WhereIsAI/UAE-Large-V1', pooling_strategy='cls').cuda()
vec = angle.encode('hello world', to_numpy=True)
print(vec)
vecs = angle.encode(['hello world1', 'hello world2'], to_numpy=True)
print(vecs)
```

2) Retrieval Tasks

For retrieval purposes, please use the prompt `Prompts.C`.

```python
from angle_emb import AnglE, Prompts

angle = AnglE.from_pretrained('WhereIsAI/UAE-Large-V1', pooling_strategy='cls').cuda()
angle.set_prompt(prompt=Prompts.C)
vec = angle.encode({'text': 'hello world'}, to_numpy=True)
print(vec)
vecs = angle.encode([{'text': 'hello world1'}, {'text': 'hello world2'}], to_numpy=True)
print(vecs)
```

# Citation 

If you use our pre-trained models, welcome to support us by citing our work:

```
@article{li2023angle,
  title={AnglE-optimized Text Embeddings},
  author={Li, Xianming and Li, Jing},
  journal={arXiv preprint arXiv:2309.12871},
  year={2023}
}
```
{"language": ["en"], "license": "apache-2.0", "tags": ["sentence-transformers", "feature-extraction", "mteb", "sentence_embedding", "transformers", "transformers.js"]}
sentence-transformers onnx safetensors bert feature-extraction mteb sentence_embedding transformers transformers.js en license:apache-2.0 endpoints_compatible has_space region:us