kaitos255 commited on
Commit
c6f4dd0
·
1 Parent(s): cd9ca7c

update README

Browse files
Files changed (1) hide show
  1. README.md +26 -6
README.md CHANGED
@@ -1,6 +1,15 @@
1
  ---
 
 
 
2
  license: apache-2.0
 
 
 
 
 
3
  ---
 
4
  # PLaMo-Embedding-1B
5
 
6
  ## モデルの概要
@@ -8,7 +17,7 @@ PLaMo-Embedding-1Bは、Preferred Networks, Inc. によって開発された日
8
 
9
  日本語の文章を入力することで数値ベクトルに変換することができ、情報検索、テキスト分類、クラスタリングなどをはじめとした幅広い用途でお使い頂けます。
10
 
11
- 日本語テキスト埋め込みのためのベンチマークである[JMTEB](https://github.com/sbintuitions/JMTEB)において、2025/4/*時点で最高水準のスコアを達成しました。
12
  特に検索タスクにおいて一際優れた性能を示しています。
13
 
14
  PLaMo-Embedding-1Bは [Apache v2.0](https://www.apache.org/licenses/LICENSE-2.0) ライセンスで公開されており、商用利用を含めて自由にお使い頂けます。
@@ -16,6 +25,15 @@ PLaMo-Embedding-1Bは [Apache v2.0](https://www.apache.org/licenses/LICENSE-2.0)
16
  技術的詳細については次のTech Blogをご参照ください: [link]
17
 
18
  ## 使用方法
 
 
 
 
 
 
 
 
 
19
  ```python
20
  import torch
21
  import torch.nn.functional as F
@@ -25,6 +43,9 @@ from transformers import AutoModel, AutoTokenizer
25
  tokenizer = AutoTokenizer.from_pretrained("pfnet/plamo-embedding-1b", trust_remote_code=True)
26
  model = AutoModel.from_pretrained("pfnet/plamo-embedding-1b", trust_remote_code=True)
27
 
 
 
 
28
  query = "PLaMo-Embedding-1Bとは何ですか?"
29
  documents = [
30
  "PLaMo-Embedding-1Bは、Preferred Networks, Inc. によって開発された日本語テキスト埋め込みモデルです。",
@@ -46,23 +67,22 @@ print(similarities)
46
  # tensor([0.8812, 0.5533])
47
  ```
48
 
 
 
49
  ## ベンチマーク結果
50
  日本語テキスト埋め込みのためのベンチマークである[JMTEB](https://github.com/sbintuitions/JMTEB)を用いて性能評価を行いました。
51
 
52
  Model |Avg. | Retrieval | STS | Classification | Reranking | Clustering | PairClassification |
53
  |:----------------------------------------------|:----------|:------------|:----------|:-----------------|:------------|:-------------|:---------------------|
54
  | [intfloat/multilingual-e5-large](https://huggingface.co/intfloat/multilingual-e5-large) |70.90 | 70.98 | 79.70 | 72.89 | 92.96 | 51.24 | 62.15 |
55
- | [pkshatech/RoSEtta-base-ja](https://huggingface.co/pkshatech/RoSEtta-base-ja) |72.04 | 73.21 | 81.39 | 72.41 | 92.69 | 53.23 | 61.74 |
56
- | [retrieva-jp/amber-large](https://huggingface.co/retrieva-jp/amber-large) |72.06 | 71.71 | 80.87 | 72.45 | 93.29 | 51.59 | **62.42** |
57
  | [pkshatech/GLuCoSE-base-ja-v2](https://huggingface.co/pkshatech/GLuCoSE-base-ja-v2) |72.23 | 73.36 | 82.96 | 74.21 | 93.01 | 48.65 | 62.37 |
58
- | [jinaai/jina-embeddings-v3](https://huggingface.co/jinaai/jina-embeddings-v3) |73.44 | 75.22 | 80.05 | 76.39 | 92.71 | 52.46 | 62.37 |
59
  | [OpenAI/text-embedding-3-large](https://openai.com/index/new-embedding-models-and-api-updates/) |74.05 | 74.48 | 82.52 | 77.58 | 93.58 | 53.32 | 62.35 |
60
  | [cl-nagoya/ruri-large-v2](https://huggingface.co/cl-nagoya/ruri-large-v2) |74.55 | 76.34 | 83.17 | 77.18 | 93.21 | 52.14 | 62.27 |
61
  |[Sarashina-Embedding-v1-1B](https://huggingface.co/sbintuitions/sarashina-embedding-v1-1b)|75.50|77.61|82.71|**78.37**|**93.74**|**53.86**|62.00|
62
  |||
63
- |[**PLaMo-Embedding-1B**](https://huggingface.co/pfnet/plamo-embedding-1b) (This model) [^1]|**76.10**|**79.94**|**83.14**|77.20|93.57|53.47|62.37|
64
 
65
- [^1]: コンテキスト長1024で計測。モデルとしてはコンテキスト長4096まで対応していますが、学習時に入れているコンテキスト長が1024までのため、1024で計測しています。ただし、4096で評価してもそこまでスコア平均に影響がないことがわかっています (Tech Blog参照)
66
 
67
  ## モデル詳細
68
 
 
1
  ---
2
+ language:
3
+ - ja
4
+ library_name: transformers
5
  license: apache-2.0
6
+ pipeline_tag: sentence-similarity
7
+ tags:
8
+ - feature-extraction
9
+ - sentence-similarity
10
+ - transformers
11
  ---
12
+
13
  # PLaMo-Embedding-1B
14
 
15
  ## モデルの概要
 
17
 
18
  日本語の文章を入力することで数値ベクトルに変換することができ、情報検索、テキスト分類、クラスタリングなどをはじめとした幅広い用途でお使い頂けます。
19
 
20
+ 日本語テキスト埋め込みのためのベンチマークである[JMTEB](https://github.com/sbintuitions/JMTEB)において、20254月初頭時点で最高水準のスコアを達成しました。
21
  特に検索タスクにおいて一際優れた性能を示しています。
22
 
23
  PLaMo-Embedding-1Bは [Apache v2.0](https://www.apache.org/licenses/LICENSE-2.0) ライセンスで公開されており、商用利用を含めて自由にお使い頂けます。
 
25
  技術的詳細については次のTech Blogをご参照ください: [link]
26
 
27
  ## 使用方法
28
+
29
+ ### Requirements
30
+ ```
31
+ sentencepiece
32
+ torch
33
+ transformers
34
+ ```
35
+
36
+ ### サンプルコード
37
  ```python
38
  import torch
39
  import torch.nn.functional as F
 
43
  tokenizer = AutoTokenizer.from_pretrained("pfnet/plamo-embedding-1b", trust_remote_code=True)
44
  model = AutoModel.from_pretrained("pfnet/plamo-embedding-1b", trust_remote_code=True)
45
 
46
+ device = "cuda" if torch.cuda.is_available() else "cpu"
47
+ model = model.to(device)
48
+
49
  query = "PLaMo-Embedding-1Bとは何ですか?"
50
  documents = [
51
  "PLaMo-Embedding-1Bは、Preferred Networks, Inc. によって開発された日本語テキスト埋め込みモデルです。",
 
67
  # tensor([0.8812, 0.5533])
68
  ```
69
 
70
+ ※ `encode_document`, `encode_query` では、モデルの最大コンテキスト長である4096を超えた文章は切り捨てられるのでご注意ください。特に `encode_query` では、内部でprefixが付与されており、この分僅かに最大コンテキスト長が短くなっています。
71
+
72
  ## ベンチマーク結果
73
  日本語テキスト埋め込みのためのベンチマークである[JMTEB](https://github.com/sbintuitions/JMTEB)を用いて性能評価を行いました。
74
 
75
  Model |Avg. | Retrieval | STS | Classification | Reranking | Clustering | PairClassification |
76
  |:----------------------------------------------|:----------|:------------|:----------|:-----------------|:------------|:-------------|:---------------------|
77
  | [intfloat/multilingual-e5-large](https://huggingface.co/intfloat/multilingual-e5-large) |70.90 | 70.98 | 79.70 | 72.89 | 92.96 | 51.24 | 62.15 |
 
 
78
  | [pkshatech/GLuCoSE-base-ja-v2](https://huggingface.co/pkshatech/GLuCoSE-base-ja-v2) |72.23 | 73.36 | 82.96 | 74.21 | 93.01 | 48.65 | 62.37 |
 
79
  | [OpenAI/text-embedding-3-large](https://openai.com/index/new-embedding-models-and-api-updates/) |74.05 | 74.48 | 82.52 | 77.58 | 93.58 | 53.32 | 62.35 |
80
  | [cl-nagoya/ruri-large-v2](https://huggingface.co/cl-nagoya/ruri-large-v2) |74.55 | 76.34 | 83.17 | 77.18 | 93.21 | 52.14 | 62.27 |
81
  |[Sarashina-Embedding-v1-1B](https://huggingface.co/sbintuitions/sarashina-embedding-v1-1b)|75.50|77.61|82.71|**78.37**|**93.74**|**53.86**|62.00|
82
  |||
83
+ |[**PLaMo-Embedding-1B**](https://huggingface.co/pfnet/plamo-embedding-1b) (This model) (*)|**76.10**|**79.94**|**83.14**|77.20|93.57|53.47|62.37|
84
 
85
+ (*): コンテキスト長1024で計測。モデルとしてはコンテキスト長4096まで対応していますが、学習時に入れているコンテキスト長が1024までのため、1024で計測しています。ただし、4096で評価してもそこまでスコア平均に影響がないことがわかっています(Tech Blog参照)
86
 
87
  ## モデル詳細
88