Serbian
procesaur commited on
Commit
0c7f2e5
·
verified ·
1 Parent(s): cc914b0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -7
README.md CHANGED
@@ -31,17 +31,14 @@ language:
31
 
32
  ```python
33
  from gensim.models import KeyedVectors
 
34
 
35
- local_dir = snapshot_download(repo_id="te-sla/GloVeSr", cache_dir=cfg["cache_loc"])
36
- vectors = KeyedVectors.load([dir + "/" + x for x in listdir(local_dir) if ".git" not in x and ".md" not in x and ".npy" not in x][0])
37
  print(vectors.most_similar("klijent", topn=5))
38
  ```
39
  ```
40
- 0.5193785
41
- 0.5763144
42
- 0.59982747
43
- 0.6022524
44
- 0.7117646
45
  ```
46
 
47
  <div class="inline-flex flex-col" style="line-height: 1.5;padding-right:50px">
 
31
 
32
  ```python
33
  from gensim.models import KeyedVectors
34
+ from huggingface_hub import snapshot_download
35
 
36
+ local_dir = snapshot_download(repo_id="te-sla/GloVeSr", allow_patterns=["*.kv", "*npy"])
37
+ vectors = KeyedVectors.load(local_dir + "/glove_keyed_vectors.kv")
38
  print(vectors.most_similar("klijent", topn=5))
39
  ```
40
  ```
41
+ [('prethodnik', 0.8428025245666504), ('saputnik', 0.8391610383987427), ('suprug', 0.8257851004600525), ('premijerov', 0.8162577748298645), ('maleni', 0.8144716620445251)]
 
 
 
 
42
  ```
43
 
44
  <div class="inline-flex flex-col" style="line-height: 1.5;padding-right:50px">