Phazel commited on
Commit
350d202
·
verified ·
1 Parent(s): 8ceaaa3

Add/refresh README.md

Browse files
Files changed (1) hide show
  1. README.md +73 -13
README.md CHANGED
@@ -1,19 +1,79 @@
1
  ---
2
- tags:
3
- - spacy
4
  language:
5
  - fa
 
 
 
 
 
 
 
 
 
 
6
  ---
7
- Floret vectors for Persian: fastText-style subwords hashed into a fixed 50,000-row Bloom table (300 dimensions, `minn=maxn=5`, `hash_count=2`), trained on 400,000 Persian documents. Vectors-only package, no pipeline components — load with `spacy.load` or unpack and point `--paths.vectors` at it to train against.
8
 
9
- | Feature | Description |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  | --- | --- |
11
- | **Name** | `fa_floret` |
12
- | **Version** | `0.1.0` |
13
- | **spaCy** | `>=3.8.14,<3.9.0` |
14
- | **Default Pipeline** | |
15
- | **Components** | |
16
- | **Vectors** | -1 keys, 50000 unique vectors (300 dimensions) |
17
- | **Sources** | n/a |
18
- | **License** | n/a |
19
- | **Author** | [n/a]() |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
 
 
2
  language:
3
  - fa
4
+ license: cc-by-sa-4.0
5
+ library_name: spacy
6
+ pipeline_tag: feature-extraction
7
+ tags:
8
+ - spacy
9
+ - feature-extraction
10
+ - floret
11
+ - word-embeddings
12
+ - persian
13
+ - farsi
14
  ---
 
15
 
16
+ # fa_floret_400k
17
+
18
+ Persian floret static vector table: 50,000 rows x 300 dimensions, `minn=maxn=5`,
19
+ `hash_count=2`, trained on 400,000 Persian documents. Vectors only, no pipeline components.
20
+
21
+ This is the table used by the `fa_dep_news_md` / `fa_core_news_md` / `fa_ent_news_md` tier.
22
+ Because floret hashes subwords rather than storing whole-word keys, there are no OOV tokens:
23
+ every string gets a vector, which is what makes it usable on Persian text where inconsistent
24
+ ZWNJ placement otherwise explodes the vocabulary.
25
+
26
+ ## Install
27
+
28
+ ```bash
29
+ pip install https://huggingface.co/Phazel/fa_floret_400k/resolve/main/fa_floret_400k-0.1.0-py3-none-any.whl
30
+ ```
31
+
32
+ ## Use
33
+
34
+ ```python
35
+ import spacy
36
+
37
+ nlp = spacy.load("fa_floret_400k") # vectors only: nlp.pipe_names == []
38
+ print(nlp.vocab.vectors.shape) # (50000, 300)
39
+ print(nlp("کتاب‌های").vector.shape) # (300,)
40
+ ```
41
+
42
+ To train a pipeline against this table, pass it to spaCy's `--paths.vectors` and set
43
+ `components.tok2vec.model.embed.include_static_vectors = true`:
44
+
45
+ ```bash
46
+ python -m spacy train config.cfg --paths.vectors fa_floret_400k
47
+ ```
48
+
49
+ ## Vector table
50
+
51
+ | Property | Value |
52
  | --- | --- |
53
+ | Rows | 50,000 |
54
+ | Dimensions | 300 |
55
+ | Mode | floret (subword, Bloom-hashed) |
56
+ | `minn` / `maxn` | 5 / 5 |
57
+ | `hash_count` | 2 |
58
+ | Training corpus | 400,000 Persian documents |
59
+
60
+ ## Related
61
+
62
+ | Package | Rows | Corpus | Used by |
63
+ | --- | ---: | --- | --- |
64
+ | [`fa_floret_400k`](https://huggingface.co/Phazel/fa_floret_400k) | 50k | 400k Persian documents | `md` tier |
65
+ | [`fa_floret_full_wiki`](https://huggingface.co/Phazel/fa_floret_full_wiki) | 50k | full Persian Wikipedia dump | — |
66
+ | [`fa_floret_wiki_200k`](https://huggingface.co/Phazel/fa-floret-wiki-vectors) | 200k | full Persian Wikipedia dump, 5 epochs | `lg` tier |
67
+
68
+ Trained pipelines that consume these tables, plus the measured accuracy deltas each table
69
+ buys, are in [`spacy-persian`](https://github.com/Fazel94/spacy-persian) (`docs/MODELS.md`
70
+ §6-7).
71
+
72
+ ## Sources and licence
73
+
74
+ | Source | Author | Licence |
75
+ | --- | --- | --- |
76
+ | [`fa_floret` static vectors, 50k rows x 300d, 400k Persian documents](https://github.com/Fazel94/spacy-persian) | Kiyarash Fazeli | CC BY-SA 4.0 |
77
+
78
+ Released under **CC BY-SA 4.0**, the same licence the `md` pipelines that embed this table
79
+ carry.