Instructions to use imvladikon/sentence-transformers-alephbert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use imvladikon/sentence-transformers-alephbert with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("imvladikon/sentence-transformers-alephbert") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Transformers
How to use imvladikon/sentence-transformers-alephbert with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("imvladikon/sentence-transformers-alephbert") model = AutoModel.from_pretrained("imvladikon/sentence-transformers-alephbert", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
How does the model behaves in sentences that contains both English and Hebrew words?
I tested the model with Hebrew sentences and the similarity results were great. I was wondering, will I be able to use the vectors to calculate similary if the sentences are composed from both English and Hebrew words?
Hi Shani,
Thank you!
Unfortunately, I believe that for a cross-lingual setup, it would not work well because I initially used AlephBert as the backbone model and fine-tuned it on a pairwise Hebrew sentence similarity downstream task. However, it's an interesting idea, and I might consider producing such a model in the future. For now, I would suggest checking out some cross-lingual models like LaBSE, e5-multilingual, etc., for that purpose.