Update README.md
Browse files
README.md
CHANGED
@@ -5,14 +5,18 @@ tags:
|
|
5 |
- feature-extraction
|
6 |
- sentence-similarity
|
7 |
- transformers
|
8 |
-
|
|
|
|
|
|
|
|
|
9 |
---
|
10 |
|
11 |
-
#
|
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 |
-
|
16 |
|
17 |
## Usage (Sentence-Transformers)
|
18 |
|
@@ -28,7 +32,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('
|
32 |
embeddings = model.encode(sentences)
|
33 |
print(embeddings)
|
34 |
```
|
@@ -54,8 +58,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('
|
58 |
-
model = AutoModel.from_pretrained('
|
59 |
|
60 |
# Tokenize sentences
|
61 |
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|
@@ -75,12 +79,13 @@ print(sentence_embeddings)
|
|
75 |
|
76 |
## Evaluation Results
|
77 |
|
78 |
-
|
79 |
|
80 |
-
|
81 |
|
|
|
|
|
82 |
|
83 |
-
## Training
|
84 |
The model was trained with the parameters:
|
85 |
|
86 |
**DataLoader**:
|
@@ -122,8 +127,4 @@ SentenceTransformer(
|
|
122 |
(0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: LukeModel
|
123 |
(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})
|
124 |
)
|
125 |
-
```
|
126 |
-
|
127 |
-
## Citing & Authors
|
128 |
-
|
129 |
-
<!--- Describe where people can find more information -->
|
|
|
5 |
- feature-extraction
|
6 |
- sentence-similarity
|
7 |
- transformers
|
8 |
+
license: apache-2.0
|
9 |
+
datasets:
|
10 |
+
- shunk031/jsnli
|
11 |
+
language:
|
12 |
+
- ja
|
13 |
---
|
14 |
|
15 |
+
# sbert-jsnli-luke-japanese-base-lite
|
16 |
|
17 |
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.
|
18 |
|
19 |
+
The base model is [studio-ousia/luke-japanese-base-lite](studio-ousia/luke-japanese-base-lite) and was trained one epoch with [JSNLI](https://huggingface.co/datasets/shunk031/jsnli).
|
20 |
|
21 |
## Usage (Sentence-Transformers)
|
22 |
|
|
|
32 |
from sentence_transformers import SentenceTransformer
|
33 |
sentences = ["This is an example sentence", "Each sentence is converted"]
|
34 |
|
35 |
+
model = SentenceTransformer('oshizo/sbert-jsnli-luke-japanese-base-lite')
|
36 |
embeddings = model.encode(sentences)
|
37 |
print(embeddings)
|
38 |
```
|
|
|
58 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
59 |
|
60 |
# Load model from HuggingFace Hub
|
61 |
+
tokenizer = AutoTokenizer.from_pretrained('oshizo/sbert-jsnli-luke-japanese-base-lite')
|
62 |
+
model = AutoModel.from_pretrained('oshizo/sbert-jsnli-luke-japanese-base-lite')
|
63 |
|
64 |
# Tokenize sentences
|
65 |
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|
|
|
79 |
|
80 |
## Evaluation Results
|
81 |
|
82 |
+
The results of the evaluation by JSTS and JSICK are available [here](https://github.com/oshizo/JapaneseEmbeddingEval).
|
83 |
|
84 |
+
## Training
|
85 |
|
86 |
+
Training scripts are available in [this repository](https://github.com/oshizo/JapaneseEmbeddingTrain).
|
87 |
+
This model was trained 1 epoch on Google Colab Pro A100 and took approximately 35 minutes.
|
88 |
|
|
|
89 |
The model was trained with the parameters:
|
90 |
|
91 |
**DataLoader**:
|
|
|
127 |
(0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: LukeModel
|
128 |
(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})
|
129 |
)
|
130 |
+
```
|
|
|
|
|
|
|
|