Instructions to use sentence-transformers/all-mpnet-base-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use sentence-transformers/all-mpnet-base-v2 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("sentence-transformers/all-mpnet-base-v2") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Transformers
How to use sentence-transformers/all-mpnet-base-v2 with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-mpnet-base-v2") model = AutoModelForMaskedLM.from_pretrained("sentence-transformers/all-mpnet-base-v2") - Inference
- Notebooks
- Google Colab
- Kaggle
Request: DOI
I want to cite this model in my paper, but there is no proper BibTeX version for citation. Is there any way the information can be updated?
Hey there,
In my case, I have cited the original model MPNET from Microsoft and Sentence Transformers :
@article {song2020mpnet,
title={Mpnet: Masked and permuted pre-training for language understanding},
author={Song, Kaitao and Tan, Xu and Qin, Tao and Lu, Jianfeng and Liu, Tie-Yan},
journal={Advances in neural information processing systems},
volume={33},
pages={16857--16867},
year={2020}
}
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
And then referenced the model I was using via a footnote.
Cheers, hope this helps
Yuriy Perezhohin
Thank you!