GLuCoSE (General Luke-based Contrastive Sentence Embedding)-base-Japanese

日本語のREADME/Japanese README

GLuCoSE (General LUke-based COntrastive Sentence Embedding, "glucose") is a Japanese text embedding model based on LUKE. In order to create a general-purpose, user-friendly Japanese text embedding model, GLuCoSE has been trained on a mix of web data and various datasets associated with natural language inference and search. This model is not only suitable for sentence vector similarity tasks but also for semantic search tasks.

  • Maximum token count: 512
  • Output dimension: 768
  • Pooling: mean pooling
  • Supported language: Japanese

Usage

You can use this model easily with sentence-transformers.

First, install sentence-transformers with pip as follows:

pip install -U sentence-transformers

You can load the model and convert sentences into dense vectors as shown below:

from sentence_transformers import SentenceTransformer
sentences = [
    "PKSHA Technologyは機械学習/深層学習技術に関わるアルゴリズムソリューションを展開している。",
    "この深層学習モデルはPKSHA Technologyによって学習され、公開された。",
    "広目天は、仏教における四天王の一尊であり、サンスクリット語の「種々の眼をした者」を名前の由来とする。",
]

model = SentenceTransformer('pkshatech/GLuCoSE-base-ja')
embeddings = model.encode(sentences)
print(embeddings)

Since the loss function used during training is cosine similarity, we recommend using cosine similarity for downstream tasks.

This text embedding model can also be used in LangChain. Please refer to this page for more information.

Resources Used

The following resources were used to train this model.

Pre-trained model

Datasets

Benchmarks

Semantic Similarity Calculation (JSTS dev set)

Evaluation by Spearman's correlation coefficient and Pearson's correlation coefficient.

Model Spearman Pearson
text-embedding-ada-002 0.837[^2] 0.790[^2]
pkshatech/simcse-ja-bert-base-clcmlp[^3] 0.850 0.801
pkshatech/GLuCoSE-base-ja 0.864 0.818

Zero-shot Search (AIO3 dev set)

Evaluation by top-k retrieval accuracy[^4] (the fraction of questions that have a correct answer in the top-k retrieved documents at least once.)

Model Top-1 Top-5 Top-10 Top-50
text-embedding-ada-002 33.50 57.80 65.10 76.60
pkshatech/simcse-ja-bert-base-clcmlp[^3] 30.60 54.50 62.50 76.70
pkshatech/GLuCoSE-base-ja 36.10 59.40 66.40 78.30

Authors

Akihiko Fukuchi, Yuichiro Hoshino, Yotarow Watanabe

License

This model is published under the Apache License, Version 2.0.

[^1]: When we trained this model, the test data of JGLUE was not released, so we used the dev set of JGLUE as a private evaluation data. Therefore, we selected the checkpoint on the train set of JGLUE insted of its dev set.
[^2]: https://qiita.com/akeyhero/items/ce371bfed64399027c23
[^3]: This is the model we have released before.
[^4]: For more details, please refer to https://arxiv.org/pdf/2004.04906.pdf.

Downloads last month
44,517
Inference Examples
Inference API (serverless) has been turned off for this model.

Model tree for pkshatech/GLuCoSE-base-ja

Finetuned
(14)
this model
Finetunes
1 model

Datasets used to train pkshatech/GLuCoSE-base-ja

Space using pkshatech/GLuCoSE-base-ja 1