Update the README
Browse files
README.md
CHANGED
|
@@ -1,38 +1,43 @@
|
|
| 1 |
---
|
| 2 |
-
language:
|
| 3 |
-
- cs
|
| 4 |
-
license:
|
| 5 |
-
- cc-by-sa-3.0
|
| 6 |
-
- gfdl
|
| 7 |
-
size_categories:
|
| 8 |
-
- 100K<n<1M
|
| 9 |
-
task_categories:
|
| 10 |
-
- text-generation
|
| 11 |
-
- fill-mask
|
| 12 |
dataset_info:
|
| 13 |
features:
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
splits:
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
download_size:
|
| 30 |
dataset_size: 2580729273
|
|
|
|
| 31 |
configs:
|
| 32 |
-
- config_name: default
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
---
|
| 37 |
|
| 38 |
This dataset contains the Czech subset of the [`wikimedia/wikipedia`](https://huggingface.co/datasets/wikimedia/wikipedia) dataset. Each page is divided into paragraphs, stored as a list in the `chunks` column. For every paragraph, embeddings are created using the [`Seznam/simcse-dist-mpnet-paracrawl-cs-en`](https://huggingface.co/Seznam/simcse-dist-mpnet-paracrawl-cs-en) model.
|
|
@@ -107,8 +112,14 @@ import os
|
|
| 107 |
import textwrap
|
| 108 |
|
| 109 |
import sentence_transformers
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
-
|
|
|
|
|
|
|
| 112 |
|
| 113 |
ds.set_format(type="torch", columns=["embeddings"], output_all_columns=True)
|
| 114 |
|
|
@@ -147,13 +158,13 @@ for hit in hits[0]:
|
|
| 147 |
chunk = ds_flat[hit['corpus_id']]['chunk']
|
| 148 |
print(f"[{hit['score']:0.2f}] {textwrap.shorten(chunk, width=100, placeholder='…')} [{title}]")
|
| 149 |
|
| 150 |
-
# [0.
|
| 151 |
-
# [0.
|
| 152 |
# ...
|
| 153 |
```
|
| 154 |
</details>
|
| 155 |
|
| 156 |
-
The embeddings generation took about
|
| 157 |
|
| 158 |
## License
|
| 159 |
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
dataset_info:
|
| 3 |
features:
|
| 4 |
+
- name: id
|
| 5 |
+
dtype: string
|
| 6 |
+
- name: url
|
| 7 |
+
dtype: string
|
| 8 |
+
- name: title
|
| 9 |
+
dtype: string
|
| 10 |
+
- name: chunks
|
| 11 |
+
sequence: string
|
| 12 |
+
- name: embeddings
|
| 13 |
+
sequence:
|
| 14 |
+
sequence: float32
|
| 15 |
splits:
|
| 16 |
+
- name: train
|
| 17 |
+
num_bytes: 2580729273
|
| 18 |
+
num_examples: 534044
|
| 19 |
+
download_size: 2307703671
|
| 20 |
dataset_size: 2580729273
|
| 21 |
+
|
| 22 |
configs:
|
| 23 |
+
- config_name: default
|
| 24 |
+
data_files:
|
| 25 |
+
- split: train
|
| 26 |
+
path: data/train-*
|
| 27 |
+
|
| 28 |
+
language:
|
| 29 |
+
- cs
|
| 30 |
+
|
| 31 |
+
size_categories:
|
| 32 |
+
- 100K<n<1M
|
| 33 |
+
|
| 34 |
+
task_categories:
|
| 35 |
+
- text-generation
|
| 36 |
+
- fill-mask
|
| 37 |
+
|
| 38 |
+
license:
|
| 39 |
+
- cc-by-sa-3.0
|
| 40 |
+
- gfdl
|
| 41 |
---
|
| 42 |
|
| 43 |
This dataset contains the Czech subset of the [`wikimedia/wikipedia`](https://huggingface.co/datasets/wikimedia/wikipedia) dataset. Each page is divided into paragraphs, stored as a list in the `chunks` column. For every paragraph, embeddings are created using the [`Seznam/simcse-dist-mpnet-paracrawl-cs-en`](https://huggingface.co/Seznam/simcse-dist-mpnet-paracrawl-cs-en) model.
|
|
|
|
| 112 |
import textwrap
|
| 113 |
|
| 114 |
import sentence_transformers
|
| 115 |
+
from sentence_transformers.models import Transformer, Pooling
|
| 116 |
+
|
| 117 |
+
from sentence_transformers import SentenceTransformer
|
| 118 |
+
from sentence_transformers.models import Transformer, Pooling
|
| 119 |
|
| 120 |
+
embedding_model = Transformer("Seznam/simcse-dist-mpnet-paracrawl-cs-en")
|
| 121 |
+
pooling = Pooling(word_embedding_dimension=embedding_model.get_word_embedding_dimension(), pooling_mode="cls")
|
| 122 |
+
model = SentenceTransformer(modules=[embedding_model, pooling])
|
| 123 |
|
| 124 |
ds.set_format(type="torch", columns=["embeddings"], output_all_columns=True)
|
| 125 |
|
|
|
|
| 158 |
chunk = ds_flat[hit['corpus_id']]['chunk']
|
| 159 |
print(f"[{hit['score']:0.2f}] {textwrap.shorten(chunk, width=100, placeholder='…')} [{title}]")
|
| 160 |
|
| 161 |
+
# [0.72] Molekulová fyzika ( též molekulární fyzika ) je část fyziky, která zkoumá látky na úrovni atomů a… [Molekulová fyzika]
|
| 162 |
+
# [0.70] Fyzika ( z řeckého φυσικός ( fysikos ): přírodní, ze základu φύσις ( fysis ): příroda, archaicky… [Fyzika]
|
| 163 |
# ...
|
| 164 |
```
|
| 165 |
</details>
|
| 166 |
|
| 167 |
+
The embeddings generation took about 35 minutes on an NVIDIA A100 80GB.
|
| 168 |
|
| 169 |
## License
|
| 170 |
|