jamescalam commited on
Commit
fd8d228
1 Parent(s): 85b60ef

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +13 -19
README.md CHANGED
@@ -5,12 +5,19 @@ tags:
5
  - feature-extraction
6
  - sentence-similarity
7
  - transformers
8
-
 
 
 
 
 
9
  ---
10
 
11
- # {MODEL_NAME}
 
 
12
 
13
- This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.
14
 
15
  <!--- Describe your model here -->
16
 
@@ -28,7 +35,7 @@ Then you can use the model like this:
28
  from sentence_transformers import SentenceTransformer
29
  sentences = ["This is an example sentence", "Each sentence is converted"]
30
 
31
- model = SentenceTransformer('{MODEL_NAME}')
32
  embeddings = model.encode(sentences)
33
  print(embeddings)
34
  ```
@@ -54,8 +61,8 @@ def mean_pooling(model_output, attention_mask):
54
  sentences = ['This is an example sentence', 'Each sentence is converted']
55
 
56
  # Load model from HuggingFace Hub
57
- tokenizer = AutoTokenizer.from_pretrained('{MODEL_NAME}')
58
- model = AutoModel.from_pretrained('{MODEL_NAME}')
59
 
60
  # Tokenize sentences
61
  encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
@@ -72,14 +79,6 @@ print(sentence_embeddings)
72
  ```
73
 
74
 
75
-
76
- ## Evaluation Results
77
-
78
- <!--- Describe how your model was evaluated -->
79
-
80
- For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name={MODEL_NAME})
81
-
82
-
83
  ## Training
84
  The model was trained with the parameters:
85
 
@@ -112,7 +111,6 @@ Parameters of the fit()-Method:
112
  }
113
  ```
114
 
115
-
116
  ## Full Model Architecture
117
  ```
118
  SentenceTransformer(
@@ -120,7 +118,3 @@ SentenceTransformer(
120
  (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False})
121
  )
122
  ```
123
-
124
- ## Citing & Authors
125
-
126
- <!--- Describe where people can find more information -->
 
5
  - feature-extraction
6
  - sentence-similarity
7
  - transformers
8
+ language:
9
+ - en
10
+ license: mit
11
+ datasets:
12
+ - snli
13
+ - stsb
14
  ---
15
 
16
+ # MPNet NLI and STS
17
+
18
+ This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search. It uses the [jamescalam/mpnet-snli-negatives](https://huggingface.co/jamescalam/mpnet-snli-negatives) model as a starting point, and is fine-tuned further on the **S**emantic **T**extual **S**imilarity **b**enchmark (STSb) dataset. Returning evaluation scores of ~0.9 cosine Pearson correlation using the STSb test set.
19
 
20
+ Find more info from [James Briggs on YouTube](https://youtube.com/c/jamesbriggs) or in the [**free** NLP for Semantic Search ebook](https://pinecone.io/learn/nlp).
21
 
22
  <!--- Describe your model here -->
23
 
 
35
  from sentence_transformers import SentenceTransformer
36
  sentences = ["This is an example sentence", "Each sentence is converted"]
37
 
38
+ model = SentenceTransformer('jamescalam/mpnet-nli-sts')
39
  embeddings = model.encode(sentences)
40
  print(embeddings)
41
  ```
 
61
  sentences = ['This is an example sentence', 'Each sentence is converted']
62
 
63
  # Load model from HuggingFace Hub
64
+ tokenizer = AutoTokenizer.from_pretrained('jamescalam/mpnet-nli-sts')
65
+ model = AutoModel.from_pretrained('jamescalam/mpnet-nli-sts')
66
 
67
  # Tokenize sentences
68
  encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
 
79
  ```
80
 
81
 
 
 
 
 
 
 
 
 
82
  ## Training
83
  The model was trained with the parameters:
84
 
 
111
  }
112
  ```
113
 
 
114
  ## Full Model Architecture
115
  ```
116
  SentenceTransformer(
 
118
  (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False})
119
  )
120
  ```