Downloads · 30 days
10
7% of all-time downloads
thekop79/dexml_movielens-25M
dexml_movielens-25M is a sentence similarity model from thekop79. Use it when you need a score for how close two texts are. It is set up for sentence-transformers. The card lists the license as apache-2.0.
Distilbert encoder models trained on Movielens Ratings dataset (MovieLens-25M) using DEXML (Dual Encoder for eXtreme Multi-Label classification, ICLR'24) method.
Downloads · 30 days
10
7% of all-time downloads
All-time downloads
137
Public
Parameters
66.4M
265 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors265 MB · 100%
From the Hugging Face model README
Distilbert encoder models trained on Movielens Ratings dataset (MovieLens-25M) using DEXML (Dual Encoder for eXtreme Multi-Label classification, ICLR'24) method.
With sentence-transformers installed you can use this model as following:
from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentence", "Each sentence is converted"]
model = SentenceTransformer('quicktensor/dexml_movielens-25m')
embeddings = model.encode(sentences)
print(embeddings)
With huggingface transformers you only need to be a bit careful with how you pool the transformer output to get the embedding, you can use this model as following;
from transformers import AutoTokenizer, AutoModel
import torch
import torch.nn.functional as F
pooler = lambda x: F.normalize(x[:, 0, :], dim=-1) # Choose CLS token and normalize
sentences = ["This is an example sentence", "Each sentence is converted"]
tokenizer = AutoTokenizer.from_pretrained('quicktensor/dexml_movielens-25m')
model = AutoModel.from_pretrained('quicktensor/dexml_movielens-25m')
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
with torch.no_grad():
embeddings = pooler(model(**encoded_input))
print(embeddings)
If you found this model helpful, please cite our work as:
@InProceedings{DEXML,
author = "Gupta, N. and Khatri, D. and Rawat, A-S. and Bhojanapalli, S. and Jain, P. and Dhillon, I.",
title = "Dual-encoders for Extreme Multi-label Classification",
booktitle = "International Conference on Learning Representations",
month = "May",
year = "2024"
}