返回模型
说明文档
(https://huggingface.co/WhereIsAI/UAE-Large-V1) 带有 sentence-transformers 标签,用于执行平均池化
使用方法
python -m pip install -U angle-emb
- 非检索任务
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)
- 检索任务
用于检索目的时,请使用提示 Prompts.C。
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)
引用
如果您使用我们的预训练模型,欢迎通过引用我们的工作来支持我们:
@article{li2023angle,
title={AnglE-optimized Text Embeddings},
author={Li, Xianming and Li, Jing},
journal={arXiv preprint arXiv:2309.12871},
year={2023}
}
karrar-alwaili/UAE-Large-V1
作者 karrar-alwaili
feature-extraction
sentence-transformers
↓ 1
♥ 0
创建时间: 2023-12-22 04:49:19+00:00
更新时间: 2023-12-22 09:20:50+00:00
在 Hugging Face 上查看文件 (10)
.gitattributes
README.md
config.json
model.safetensors
onnx/model.onnx
ONNX
onnx/model_quantized.onnx
ONNX
special_tokens_map.json
tokenizer.json
tokenizer_config.json
vocab.txt