Downloads · 30 days
9
2% of all-time downloads
tuhailong/bi_encoder_roberta-wwm-ext
bi_encoder_roberta-wwm-ext is a feature extraction model from tuhailong. Use it when you need embeddings to search or compare text. It is set up for transformers.
train data is similarity sentence data from E-commerce dialogue, about 50w sentence pairs.
Downloads · 30 days
9
2% of all-time downloads
All-time downloads
431
Public
Repo size
410 MB
Likes
0
Public
Click a slice to open those files.
.bin410 MB · 100%
From the Hugging Face model README
train data is similarity sentence data from E-commerce dialogue, about 50w sentence pairs.
model created by sentence-tansformers,model struct is bi-encoder
>>> from sentence_transformers import SentenceTransformer, util
>>> model = SentenceTransformer("tuhailong/bi_encoder_roberta-wwm-ext", device="cuda:1")
>>> model.max_seq_length=32
>>> sentences = ["今天天气不错", "今天心情不错"]
>>> embeddings1 = model.encode([sentences[0]], convert_to_tensor=True)
>>> embeddings2 = model.encode([sentences[1]], convert_to_tensor=True)
>>> scores = util.cos_sim(embeddings1, embeddings2).cpu().numpy()
>>> print(scores)
train code from https://github.com/TTurn/bi-encoder
Because add the pooling layer and dense layer after model,has folders in model files. So here will be additional files "1_Pooling-config.json", "2_Dense-config.json" and "2_Dense-pytorch_model.bin". after download these files, rename them as "1_Pooling/config.json", "2_Dense/config.json" and "2_Dense/pytorch_model.bin".