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
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.
The following resources were used to train this model.
- JSTS (used for validation) [^1]
Semantic Similarity Calculation (JSTS dev set)
Evaluation by Spearman's correlation coefficient and Pearson's correlation coefficient.
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.)
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.
[^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