summerstars commited on
Commit
c1f40fa
·
verified ·
1 Parent(s): 8da2291

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +49 -109
README.md CHANGED
@@ -1,3 +1,4 @@
 
1
  ---
2
  tags:
3
  - sentence-transformers
@@ -48,42 +49,35 @@ model-index:
48
  results:
49
  - task:
50
  type: semantic-similarity
51
- name: Semantic Similarity
52
- dataset:
53
- name: Unknown
54
- type: unknown
55
  metrics:
56
  - type: pearson_cosine
57
  value: 0.4639747212598005
58
- name: Pearson Cosine
59
  - type: spearman_cosine
60
  value: 0.4595105448711385
61
- name: Spearman Cosine
62
  ---
63
 
64
  # SentenceTransformer
65
 
66
- This is a [sentence-transformers](https://www.SBERT.net) model trained. It maps sentences & paragraphs to a 256-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
67
 
68
- ## Model Details
69
 
70
- ### Model Description
71
- - **Model Type:** Sentence Transformer
72
- <!-- - **Base model:** [Unknown](https://huggingface.co/unknown) -->
73
- - **Maximum Sequence Length:** 2048 tokens
74
- - **Output Dimensionality:** 256 dimensions
75
- - **Similarity Function:** Cosine Similarity
76
- <!-- - **Training Dataset:** Unknown -->
77
- <!-- - **Language:** Unknown -->
78
- <!-- - **License:** Unknown -->
79
 
80
- ### Model Sources
81
 
82
- - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
83
- - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
84
  - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
85
 
86
- ### Full Model Architecture
87
 
88
  ```
89
  SentenceTransformer(
@@ -92,23 +86,23 @@ SentenceTransformer(
92
  )
93
  ```
94
 
95
- ## Usage
96
 
97
- ### Direct Usage (Sentence Transformers)
98
 
99
- First install the Sentence Transformers library:
100
 
101
  ```bash
102
  pip install -U sentence-transformers
103
  ```
104
 
105
- Then you can load this model and run inference.
106
  ```python
107
  from sentence_transformers import SentenceTransformer
108
 
109
- # Download from the 🤗 Hub
110
  model = SentenceTransformer("sentence_transformers_model_id")
111
- # Run inference
112
  sentences = [
113
  'Comcast Class A shares were up 8 cents at $30.50 in morning trading on the Nasdaq Stock Market.',
114
  'The stock rose 48 cents to $30 yesterday in Nasdaq Stock Market trading.',
@@ -118,7 +112,7 @@ embeddings = model.encode(sentences)
118
  print(embeddings.shape)
119
  # [3, 256]
120
 
121
- # Get the similarity scores for the embeddings
122
  similarities = model.similarity(embeddings, embeddings)
123
  print(similarities)
124
  # tensor([[1.0000, 0.5752, 0.2980],
@@ -126,91 +120,55 @@ print(similarities)
126
  # [0.2980, 0.2161, 1.0000]])
127
  ```
128
 
129
- <!--
130
- ### Direct Usage (Transformers)
131
-
132
- <details><summary>Click to see the direct usage in Transformers</summary>
133
-
134
- </details>
135
- -->
136
-
137
- <!--
138
- ### Downstream Usage (Sentence Transformers)
139
-
140
- You can finetune this model on your own dataset.
141
-
142
- <details><summary>Click to expand</summary>
143
-
144
- </details>
145
- -->
146
-
147
- <!--
148
- ### Out-of-Scope Use
149
-
150
- *List how the model may foreseeably be misused and address what users ought not to do with the model.*
151
- -->
152
-
153
- ## Evaluation
154
 
155
- ### Metrics
156
 
157
- #### Semantic Similarity
158
 
159
- * Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
160
 
161
- | Metric | Value |
162
  |:--------------------|:-----------|
163
  | pearson_cosine | 0.464 |
164
  | **spearman_cosine** | **0.4595** |
165
 
166
- <!--
167
- ## Bias, Risks and Limitations
168
 
169
- *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
170
- -->
171
 
172
- <!--
173
- ### Recommendations
174
 
175
- *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
176
- -->
177
-
178
- ## Training Details
179
-
180
- ### Training Dataset
181
-
182
- #### Unnamed Dataset
183
-
184
- * Size: 5,749 training samples
185
- * Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>label</code>
186
- * Approximate statistics based on the first 1000 samples:
187
  | | sentence_0 | sentence_1 | label |
188
  |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
189
- | type | string | string | float |
190
- | details | <ul><li>min: 6 tokens</li><li>mean: 14.76 tokens</li><li>max: 55 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 14.73 tokens</li><li>max: 57 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.55</li><li>max: 1.0</li></ul> |
191
- * Samples:
192
  | sentence_0 | sentence_1 | label |
193
  |:----------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|:--------------------------------|
194
- | <code>Forecasters said warnings might go up for Cuba later Thursday.</code> | <code>Watches or warnings could be issued for eastern Cuba later on Thursday.</code> | <code>0.8</code> |
195
- | <code>Death toll in Lebanon bombings rises to 47</code> | <code>1 suspect arrested after Lebanon car bombings kill 45</code> | <code>0.5599999904632569</code> |
196
- | <code>Three dogs running on a racetrack.</code> | <code>Three dogs round a bend at a racetrack.</code> | <code>0.9600000381469727</code> |
197
- * Loss: [<code>CosineSimilarityLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters:
198
  ```json
199
  {
200
  "loss_fct": "torch.nn.modules.loss.MSELoss"
201
  }
202
  ```
203
 
204
- ### Training Hyperparameters
205
- #### Non-Default Hyperparameters
206
 
207
  - `eval_strategy`: steps
208
  - `per_device_train_batch_size`: 16
209
  - `per_device_eval_batch_size`: 16
210
  - `multi_dataset_batch_sampler`: round_robin
211
 
212
- #### All Hyperparameters
213
- <details><summary>Click to expand</summary>
214
 
215
  - `overwrite_output_dir`: False
216
  - `do_predict`: False
@@ -333,8 +291,8 @@ You can finetune this model on your own dataset.
333
 
334
  </details>
335
 
336
- ### Training Logs
337
- | Epoch | Step | Training Loss | spearman_cosine |
338
  |:------:|:----:|:-------------:|:---------------:|
339
  | 1.0 | 360 | - | 0.2967 |
340
  | 1.3889 | 500 | 0.11 | 0.3338 |
@@ -343,7 +301,7 @@ You can finetune this model on your own dataset.
343
  | 3.0 | 1080 | - | 0.4595 |
344
 
345
 
346
- ### Framework Versions
347
  - Python: 3.12.11
348
  - Sentence Transformers: 5.1.0
349
  - Transformers: 4.56.1
@@ -352,7 +310,7 @@ You can finetune this model on your own dataset.
352
  - Datasets: 4.0.0
353
  - Tokenizers: 0.22.0
354
 
355
- ## Citation
356
 
357
  ### BibTeX
358
 
@@ -367,22 +325,4 @@ You can finetune this model on your own dataset.
367
  publisher = "Association for Computational Linguistics",
368
  url = "https://arxiv.org/abs/1908.10084",
369
  }
370
- ```
371
-
372
- <!--
373
- ## Glossary
374
-
375
- *Clearly define terms in order to be accessible across audiences.*
376
- -->
377
-
378
- <!--
379
- ## Model Card Authors
380
-
381
- *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
382
- -->
383
-
384
- <!--
385
- ## Model Card Contact
386
-
387
- *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
388
- -->
 
1
+
2
  ---
3
  tags:
4
  - sentence-transformers
 
49
  results:
50
  - task:
51
  type: semantic-similarity
52
+ name: 意味的類似性 (Semantic Similarity)
 
 
 
53
  metrics:
54
  - type: pearson_cosine
55
  value: 0.4639747212598005
56
+ name: ピアソン相関係数 (コサイン類似度)
57
  - type: spearman_cosine
58
  value: 0.4595105448711385
59
+ name: スピアマン相関係数 (コサイン類似度)
60
  ---
61
 
62
  # SentenceTransformer
63
 
64
+ これは、訓練済みの[sentence-transformers](https://www.SBERT.net)モデルです。このモデルは、文と段落を256次元の密なベクトル空間にマッピングし、意味的テキスト類似性、意味検索、言い換えマイニング、テキスト分類、クラスタリングなどに使用できます。
65
 
66
+ ## モデル詳細
67
 
68
+ ### モデルの説明
69
+ - **モデルタイプ:** Sentence Transformer
70
+ - **最大シーケンス長:** 2048トークン
71
+ - **出力次元数:** 256次元
72
+ - **類似度関数:** コサイン類似度
 
 
 
 
73
 
74
+ ### モデルのソース
75
 
76
+ - **ドキュメント:** [Sentence Transformers Documentation](https://sbert.net)
77
+ - **リポジトリ:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
78
  - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
79
 
80
+ ### 完全なモデルアーキテクチャ
81
 
82
  ```
83
  SentenceTransformer(
 
86
  )
87
  ```
88
 
89
+ ## 使用方法
90
 
91
+ ### 直接使用 (Sentence Transformers)
92
 
93
+ まず、Sentence Transformersライブラリをインストールします:
94
 
95
  ```bash
96
  pip install -U sentence-transformers
97
  ```
98
 
99
+ 次に、このモデルをロードして推論を実行できます。
100
  ```python
101
  from sentence_transformers import SentenceTransformer
102
 
103
+ # 🤗 Hubからダウンロード
104
  model = SentenceTransformer("sentence_transformers_model_id")
105
+ # 推論を実行
106
  sentences = [
107
  'Comcast Class A shares were up 8 cents at $30.50 in morning trading on the Nasdaq Stock Market.',
108
  'The stock rose 48 cents to $30 yesterday in Nasdaq Stock Market trading.',
 
112
  print(embeddings.shape)
113
  # [3, 256]
114
 
115
+ # 埋め込みベクトルの類似度スコアを取得
116
  similarities = model.similarity(embeddings, embeddings)
117
  print(similarities)
118
  # tensor([[1.0000, 0.5752, 0.2980],
 
120
  # [0.2980, 0.2161, 1.0000]])
121
  ```
122
 
123
+ ## 評価
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
 
125
+ ### メトリクス
126
 
127
+ #### 意味的類似性
128
 
129
+ * [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)で評価
130
 
131
+ | メトリクス | |
132
  |:--------------------|:-----------|
133
  | pearson_cosine | 0.464 |
134
  | **spearman_cosine** | **0.4595** |
135
 
136
+ ## 訓練詳細
 
137
 
138
+ ### 訓練データセット
 
139
 
140
+ #### 名称未設定のデータセット
 
141
 
142
+ * サイズ: 5,749 訓練サンプル
143
+ * カラム: `sentence_0`, `sentence_1`, `label`
144
+ * 最初の1000サンプルに基づくおおよその統計:
 
 
 
 
 
 
 
 
 
145
  | | sentence_0 | sentence_1 | label |
146
  |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
147
+ | | string | string | float |
148
+ | 詳細 | <ul><li>最小: 6 トークン</li><li>平均: 14.76 トークン</li><li>最大: 55 トークン</li></ul> | <ul><li>最小: 6 トークン</li><li>平均: 14.73 トークン</li><li>最大: 57 トークン</li></ul> | <ul><li>最小: 0.0</li><li>平均: 0.55</li><li>最大: 1.0</li></ul> |
149
+ * サンプル:
150
  | sentence_0 | sentence_1 | label |
151
  |:----------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|:--------------------------------|
152
+ | `Forecasters said warnings might go up for Cuba later Thursday.` | `Watches or warnings could be issued for eastern Cuba later on Thursday.` | `0.8` |
153
+ | `Death toll in Lebanon bombings rises to 47` | `1 suspect arrested after Lebanon car bombings kill 45` | `0.5599999904632569` |
154
+ | `Three dogs running on a racetrack.` | `Three dogs round a bend at a racetrack.` | `0.9600000381469727` |
155
+ * 損失関数: [<code>CosineSimilarityLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) 以下のパラメータを使用:
156
  ```json
157
  {
158
  "loss_fct": "torch.nn.modules.loss.MSELoss"
159
  }
160
  ```
161
 
162
+ ### 訓練ハイパーパラメータ
163
+ #### デフォルト以外のハイパーパラメータ
164
 
165
  - `eval_strategy`: steps
166
  - `per_device_train_batch_size`: 16
167
  - `per_device_eval_batch_size`: 16
168
  - `multi_dataset_batch_sampler`: round_robin
169
 
170
+ #### すべてのハイパーパラメータ
171
+ <details><summary>クリックして展開</summary>
172
 
173
  - `overwrite_output_dir`: False
174
  - `do_predict`: False
 
291
 
292
  </details>
293
 
294
+ ### 訓練ログ
295
+ | エポック | ステップ | 訓練損失 | spearman_cosine |
296
  |:------:|:----:|:-------------:|:---------------:|
297
  | 1.0 | 360 | - | 0.2967 |
298
  | 1.3889 | 500 | 0.11 | 0.3338 |
 
301
  | 3.0 | 1080 | - | 0.4595 |
302
 
303
 
304
+ ### フレームワークのバージョン
305
  - Python: 3.12.11
306
  - Sentence Transformers: 5.1.0
307
  - Transformers: 4.56.1
 
310
  - Datasets: 4.0.0
311
  - Tokenizers: 0.22.0
312
 
313
+ ## 引用
314
 
315
  ### BibTeX
316
 
 
325
  publisher = "Association for Computational Linguistics",
326
  url = "https://arxiv.org/abs/1908.10084",
327
  }
328
+ ```