Sentence Similarity
sentence-transformers
PyTorch
Transformers
bert
feature-extraction
text-embeddings-inference
Instructions to use YangsHao/RecBERT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use YangsHao/RecBERT with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("YangsHao/RecBERT") sentences = [ "汪汪队立大功第1季动画动画冒险剧情本领高强的狗狗巡逻队精通科技的10岁男孩", "超人总动员2喜剧动作动画冒险家庭亲情超级英雄励志超能先生变奶爸超人家族时隔14年强势回归", "星汉灿烂·月升沧海剧情爱情星汉灿烂·月升沧海该剧讲述了程家女名少商", "外星人事件2喜剧科幻剧情山炮大战爆笑来袭传闻,几十年前外星人曾开着飞船造访过下井沟" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Transformers
How to use YangsHao/RecBERT with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("YangsHao/RecBERT") model = AutoModel.from_pretrained("YangsHao/RecBERT") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -69,16 +69,6 @@ print("Sentence embeddings:")
|
|
| 69 |
print(sentence_embeddings)
|
| 70 |
```
|
| 71 |
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
## Evaluation Results
|
| 75 |
-
|
| 76 |
-
<!--- Describe how your model was evaluated -->
|
| 77 |
-
|
| 78 |
-
For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name={MODEL_NAME})
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
## Full Model Architecture
|
| 83 |
```
|
| 84 |
SentenceTransformer(
|
|
@@ -86,7 +76,3 @@ SentenceTransformer(
|
|
| 86 |
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False})
|
| 87 |
)
|
| 88 |
```
|
| 89 |
-
|
| 90 |
-
## Citing & Authors
|
| 91 |
-
|
| 92 |
-
<!--- Describe where people can find more information -->
|
|
|
|
| 69 |
print(sentence_embeddings)
|
| 70 |
```
|
| 71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
## Full Model Architecture
|
| 73 |
```
|
| 74 |
SentenceTransformer(
|
|
|
|
| 76 |
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False})
|
| 77 |
)
|
| 78 |
```
|
|
|
|
|
|
|
|
|
|
|
|