Sentence Similarity
sentence-transformers
Safetensors
French
xlm-roberta
passage-retrieval
pruned
text-embeddings-inference
Instructions to use antoinelouis/french-me5-large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use antoinelouis/french-me5-large with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("antoinelouis/french-me5-large") sentences = [ "C'est une personne heureuse", "C'est un chien heureux", "C'est une personne très heureuse", "Aujourd'hui est une journée ensoleillée" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
| pipeline_tag: sentence-similarity | |
| language: fr | |
| license: mit | |
| tags: | |
| - passage-retrieval | |
| - sentence-similarity | |
| - pruned | |
| library_name: sentence-transformers | |
| base_model: intfloat/multilingual-e5-large | |
| base_model_relation: quantized | |
| # 🇫🇷 french-me5-large | |
| This model is a 38.9% smaller version of [intfloat/multilingual-e5-large](https://huggingface.co/intfloat/multilingual-e5-large) | |
| for the French language, created using the [mtem-pruner](https://huggingface.co/spaces/antoinelouis/mtem-pruner) space. | |
| This pruned model should perform similarly to the original model for French language tasks with a much smaller | |
| memory footprint. However, it may not perform well for other languages present in the original multilingual model as tokens not | |
| commonly used in French were removed from the original multilingual model's vocabulary. | |
| ## Usage | |
| You can use this model with the Transformers library: | |
| ```python | |
| from transformers import AutoModel, AutoTokenizer | |
| model_name = "antoinelouis/french-multilingual-e5-large" | |
| model = AutoModel.from_pretrained(model_name, trust_remote_code=True) | |
| tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True, use_fast=True) | |
| ``` | |
| Or with the sentence-transformers library: | |
| ```python | |
| from sentence_transformers import SentenceTransformer | |
| model = SentenceTransformer("antoinelouis/french-multilingual-e5-large") | |
| ``` | |
| **Credits**: cc [@antoinelouis](https://huggingface.co/antoinelouis) | |