cointegrated
commited on
Commit
•
fc74260
1
Parent(s):
6a07f61
Update README.md
Browse files
README.md
CHANGED
@@ -1,208 +1,208 @@
|
|
1 |
---
|
2 |
license: cc-by-nc-4.0
|
3 |
language:
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
language_details: >-
|
207 |
ace_Arab, ace_Latn, acm_Arab, acq_Arab, aeb_Arab, afr_Latn, ajp_Arab,
|
208 |
aka_Latn, amh_Ethi, apc_Arab, arb_Arab, ars_Arab, ary_Arab, arz_Arab,
|
@@ -233,16 +233,18 @@ language_details: >-
|
|
233 |
tur_Latn, twi_Latn, tzm_Tfng, uig_Arab, ukr_Cyrl, umb_Latn, urd_Arab,
|
234 |
uzn_Latn, vec_Latn, vie_Latn, war_Latn, wol_Latn, xho_Latn, ydd_Hebr,
|
235 |
yor_Latn, yue_Hant, zho_Hans, zho_Hant, zul_Latn
|
|
|
236 |
---
|
237 |
-
This is a port of the multilingual text encoder
|
238 |
|
239 |
-
|
|
|
|
|
240 |
(see also [the source model card](https://github.com/facebookresearch/SONAR/blob/main/sonar/store/cards/text_sonar_basic_encoder.yaml#L14)
|
241 |
and [FLORES-200 lang code mapping](https://github.com/facebookresearch/flores/blob/main/flores200/README.md#languages-in-flores-200)).
|
242 |
|
243 |
-
For advanced examples of usage, please take a look at https://github.com/facebookresearch/SONAR.
|
244 |
|
245 |
-
How to
|
246 |
```Python
|
247 |
# !pip install transformers sentencepiece -q
|
248 |
|
@@ -272,4 +274,6 @@ print(embs.shape)
|
|
272 |
print(embs)
|
273 |
# tensor([[-0.0053, 0.0020, -0.0006, ..., 0.0094, -0.0009, 0.0070],
|
274 |
# [-0.0003, -0.0071, 0.0076, ..., 0.0055, 0.0022, -0.0083]])
|
275 |
-
```
|
|
|
|
|
|
1 |
---
|
2 |
license: cc-by-nc-4.0
|
3 |
language:
|
4 |
+
- ace
|
5 |
+
- ace
|
6 |
+
- acm
|
7 |
+
- acq
|
8 |
+
- aeb
|
9 |
+
- af
|
10 |
+
- ajp
|
11 |
+
- ak
|
12 |
+
- am
|
13 |
+
- apc
|
14 |
+
- ar
|
15 |
+
- ars
|
16 |
+
- ary
|
17 |
+
- arz
|
18 |
+
- as
|
19 |
+
- ast
|
20 |
+
- awa
|
21 |
+
- ay
|
22 |
+
- azb
|
23 |
+
- azj
|
24 |
+
- ba
|
25 |
+
- bm
|
26 |
+
- ban
|
27 |
+
- be
|
28 |
+
- bem
|
29 |
+
- bn
|
30 |
+
- bho
|
31 |
+
- bjn
|
32 |
+
- bjn
|
33 |
+
- bo
|
34 |
+
- bs
|
35 |
+
- bug
|
36 |
+
- bg
|
37 |
+
- ca
|
38 |
+
- ceb
|
39 |
+
- cs
|
40 |
+
- cjk
|
41 |
+
- ckb
|
42 |
+
- crh
|
43 |
+
- cy
|
44 |
+
- da
|
45 |
+
- de
|
46 |
+
- dik
|
47 |
+
- dyu
|
48 |
+
- dz
|
49 |
+
- el
|
50 |
+
- en
|
51 |
+
- eo
|
52 |
+
- et
|
53 |
+
- eu
|
54 |
+
- ee
|
55 |
+
- fo
|
56 |
+
- fa
|
57 |
+
- fj
|
58 |
+
- fi
|
59 |
+
- fon
|
60 |
+
- fr
|
61 |
+
- fur
|
62 |
+
- ff
|
63 |
+
- gd
|
64 |
+
- ga
|
65 |
+
- gl
|
66 |
+
- gn
|
67 |
+
- gu
|
68 |
+
- ht
|
69 |
+
- ha
|
70 |
+
- he
|
71 |
+
- hi
|
72 |
+
- hne
|
73 |
+
- hr
|
74 |
+
- hu
|
75 |
+
- hy
|
76 |
+
- ig
|
77 |
+
- ilo
|
78 |
+
- id
|
79 |
+
- is
|
80 |
+
- it
|
81 |
+
- jv
|
82 |
+
- ja
|
83 |
+
- kab
|
84 |
+
- kac
|
85 |
+
- kam
|
86 |
+
- kn
|
87 |
+
- ks
|
88 |
+
- ks
|
89 |
+
- ka
|
90 |
+
- kr
|
91 |
+
- kr
|
92 |
+
- kk
|
93 |
+
- kbp
|
94 |
+
- kea
|
95 |
+
- km
|
96 |
+
- ki
|
97 |
+
- rw
|
98 |
+
- ky
|
99 |
+
- kmb
|
100 |
+
- kg
|
101 |
+
- ko
|
102 |
+
- kmr
|
103 |
+
- lo
|
104 |
+
- lv
|
105 |
+
- lij
|
106 |
+
- li
|
107 |
+
- ln
|
108 |
+
- lt
|
109 |
+
- lmo
|
110 |
+
- ltg
|
111 |
+
- lb
|
112 |
+
- lua
|
113 |
+
- lg
|
114 |
+
- luo
|
115 |
+
- lus
|
116 |
+
- mag
|
117 |
+
- mai
|
118 |
+
- ml
|
119 |
+
- mr
|
120 |
+
- min
|
121 |
+
- mk
|
122 |
+
- plt
|
123 |
+
- mt
|
124 |
+
- mni
|
125 |
+
- mn
|
126 |
+
- mos
|
127 |
+
- mi
|
128 |
+
- ms
|
129 |
+
- my
|
130 |
+
- nl
|
131 |
+
- nn
|
132 |
+
- nb
|
133 |
+
- ne
|
134 |
+
- nso
|
135 |
+
- nus
|
136 |
+
- ny
|
137 |
+
- oc
|
138 |
+
- gaz
|
139 |
+
- ory
|
140 |
+
- pag
|
141 |
+
- pa
|
142 |
+
- pap
|
143 |
+
- pl
|
144 |
+
- pt
|
145 |
+
- prs
|
146 |
+
- pbt
|
147 |
+
- qu
|
148 |
+
- ro
|
149 |
+
- rn
|
150 |
+
- ru
|
151 |
+
- sg
|
152 |
+
- sa
|
153 |
+
- sat
|
154 |
+
- scn
|
155 |
+
- shn
|
156 |
+
- si
|
157 |
+
- sk
|
158 |
+
- sl
|
159 |
+
- sm
|
160 |
+
- sn
|
161 |
+
- sd
|
162 |
+
- so
|
163 |
+
- st
|
164 |
+
- es
|
165 |
+
- als
|
166 |
+
- sc
|
167 |
+
- sr
|
168 |
+
- ss
|
169 |
+
- su
|
170 |
+
- sv
|
171 |
+
- sw
|
172 |
+
- szl
|
173 |
+
- ta
|
174 |
+
- tt
|
175 |
+
- te
|
176 |
+
- tg
|
177 |
+
- tl
|
178 |
+
- th
|
179 |
+
- ti
|
180 |
+
- taq
|
181 |
+
- taq
|
182 |
+
- tpi
|
183 |
+
- tn
|
184 |
+
- ts
|
185 |
+
- tk
|
186 |
+
- tum
|
187 |
+
- tr
|
188 |
+
- tw
|
189 |
+
- tzm
|
190 |
+
- ug
|
191 |
+
- uk
|
192 |
+
- umb
|
193 |
+
- ur
|
194 |
+
- uz
|
195 |
+
- vec
|
196 |
+
- vi
|
197 |
+
- war
|
198 |
+
- wo
|
199 |
+
- xh
|
200 |
+
- yi
|
201 |
+
- yo
|
202 |
+
- yue
|
203 |
+
- zh
|
204 |
+
- zh
|
205 |
+
- zu
|
206 |
language_details: >-
|
207 |
ace_Arab, ace_Latn, acm_Arab, acq_Arab, aeb_Arab, afr_Latn, ajp_Arab,
|
208 |
aka_Latn, amh_Ethi, apc_Arab, arb_Arab, ars_Arab, ary_Arab, arz_Arab,
|
|
|
233 |
tur_Latn, twi_Latn, tzm_Tfng, uig_Arab, ukr_Cyrl, umb_Latn, urd_Arab,
|
234 |
uzn_Latn, vec_Latn, vie_Latn, war_Latn, wol_Latn, xho_Latn, ydd_Hebr,
|
235 |
yor_Latn, yue_Hant, zho_Hans, zho_Hant, zul_Latn
|
236 |
+
pipeline_tag: sentence-similarity
|
237 |
---
|
238 |
+
This is a port of the multilingual SONAR text encoder (https://huggingface.co/facebook/SONAR) to the `transformers` format from `fairseq2`.
|
239 |
|
240 |
+
Its embeddings are expected be equal to those the official implementation (https://github.com/facebookresearch/SONAR), but the latter stays the source of truth.
|
241 |
+
|
242 |
+
The encoder supports the same 202 languages as [NLLB-200](https://huggingface.co/facebook/nllb-200-distilled-600M)
|
243 |
(see also [the source model card](https://github.com/facebookresearch/SONAR/blob/main/sonar/store/cards/text_sonar_basic_encoder.yaml#L14)
|
244 |
and [FLORES-200 lang code mapping](https://github.com/facebookresearch/flores/blob/main/flores200/README.md#languages-in-flores-200)).
|
245 |
|
|
|
246 |
|
247 |
+
How to compute embeddings:
|
248 |
```Python
|
249 |
# !pip install transformers sentencepiece -q
|
250 |
|
|
|
274 |
print(embs)
|
275 |
# tensor([[-0.0053, 0.0020, -0.0006, ..., 0.0094, -0.0009, 0.0070],
|
276 |
# [-0.0003, -0.0071, 0.0076, ..., 0.0055, 0.0022, -0.0083]])
|
277 |
+
```
|
278 |
+
|
279 |
+
For advanced examples of usage, please take a look at the readme in https://github.com/facebookresearch/SONAR.
|