Sentence Similarity
sentence-transformers
PyTorch
Transformers
English
roberta
feature-extraction
text-embeddings-inference
Instructions to use AlgorithmicResearchGroup/arxiv-distilroberta-base-GenQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use AlgorithmicResearchGroup/arxiv-distilroberta-base-GenQ with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("AlgorithmicResearchGroup/arxiv-distilroberta-base-GenQ") 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 AlgorithmicResearchGroup/arxiv-distilroberta-base-GenQ with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("AlgorithmicResearchGroup/arxiv-distilroberta-base-GenQ") model = AutoModel.from_pretrained("AlgorithmicResearchGroup/arxiv-distilroberta-base-GenQ") - Notebooks
- Google Colab
- Kaggle
ArtifactAI commited on
Commit ·
894e318
1
Parent(s): 5113f0a
Update README.md
Browse files
README.md
CHANGED
|
@@ -30,7 +30,7 @@ Then you can use the model like this:
|
|
| 30 |
from sentence_transformers import SentenceTransformer
|
| 31 |
sentences = ["This is an example sentence", "Each sentence is converted"]
|
| 32 |
|
| 33 |
-
model = SentenceTransformer('
|
| 34 |
embeddings = model.encode(sentences)
|
| 35 |
print(embeddings)
|
| 36 |
```
|
|
@@ -56,8 +56,8 @@ def mean_pooling(model_output, attention_mask):
|
|
| 56 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
| 57 |
|
| 58 |
# Load model from HuggingFace Hub
|
| 59 |
-
tokenizer = AutoTokenizer.from_pretrained('
|
| 60 |
-
model = AutoModel.from_pretrained('
|
| 61 |
|
| 62 |
# Tokenize sentences
|
| 63 |
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|
|
|
|
| 30 |
from sentence_transformers import SentenceTransformer
|
| 31 |
sentences = ["This is an example sentence", "Each sentence is converted"]
|
| 32 |
|
| 33 |
+
model = SentenceTransformer('ArtifactAI/arxiv-distilroberta-base-GenQ')
|
| 34 |
embeddings = model.encode(sentences)
|
| 35 |
print(embeddings)
|
| 36 |
```
|
|
|
|
| 56 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
| 57 |
|
| 58 |
# Load model from HuggingFace Hub
|
| 59 |
+
tokenizer = AutoTokenizer.from_pretrained('ArtifactAI/arxiv-distilroberta-base-GenQ')
|
| 60 |
+
model = AutoModel.from_pretrained('ArtifactAI/arxiv-distilroberta-base-GenQ')
|
| 61 |
|
| 62 |
# Tokenize sentences
|
| 63 |
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|