lbourdois commited on
Commit
c3c3354
·
verified ·
1 Parent(s): 503bedb

Update model card for Breton

Browse files
Files changed (1) hide show
  1. README.md +53 -22
README.md CHANGED
@@ -1,39 +1,70 @@
1
-
2
  ---
3
- pipeline_tag: fill-mask
4
  language: bre
5
  license: mit
6
  tags:
7
- - trimmed
8
- library_name: transformers
9
  base_model: intfloat/multilingual-e5-small
10
  base_model_relation: quantized
11
  datasets:
12
- - Lumberjackk/fineweb-2-trimming
13
  ---
14
- # multilingual-e5-small-breton-16384
15
-
16
- This model is a 76.3% smaller version of [intfloat/multilingual-e5-small](https://huggingface.co/intfloat/multilingual-e5-small)
17
- for the **bre** language, created using vocabulary pruning.
18
 
19
- **Vocabulary size**: 16384 tokens (reduced from 250002)
20
- **Tokenizer type**: Unigram
21
- **Training samples**: 200000 texts
22
- **Dataset**: Lumberjackk/fineweb-2-trimming
23
 
24
- This pruned model should perform similarly to the original model for bre language tasks with a much smaller
25
- memory footprint. However, it may not perform well for other languages present in the original multilingual model as tokens not
26
- commonly used in bre were removed from the original multilingual model's vocabulary.
 
 
27
 
28
- ## Usage
29
 
30
- You can use this model with the Transformers library:
 
 
31
 
 
32
  ```python
33
- from transformers import AutoModel, AutoTokenizer
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
- model_name = "lbourdois/multilingual-e5-small-breton-16384"
36
- model = AutoModel.from_pretrained(model_name)
37
- tokenizer = AutoTokenizer.from_pretrained(model_name)
 
 
 
 
 
38
  ```
39
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ pipeline_tag: sentence-similarity
3
  language: bre
4
  license: mit
5
  tags:
6
+ - trimmed
7
+ library_name: sentence-transformers
8
  base_model: intfloat/multilingual-e5-small
9
  base_model_relation: quantized
10
  datasets:
11
+ - lbourdois/fineweb-2-trimming
12
  ---
 
 
 
 
13
 
14
+ # multilingual-e5-small-bre-16384
15
+ This model is a **76.26% smaller** version of [intfloat/multilingual-e5-small](https://huggingface.co/intfloat/multilingual-e5-small) optimized for **Breton** language via vocabulary size reduction using the [trimming](https://huggingface.co/blog/lbourdois/introduction-to-trimming) method.
16
+ This trimmed model should perform similarly to the original model with only 16,384 tokens and a much smaller memory footprint. However, it may not perform well for other languages as tokens not commonly used in the selected languages were removed from the vocabulary.
 
17
 
18
+ ## Model Statistics
19
+ | Metric | Original | Trimmed | Reduction |
20
+ |--------|----------|---------|-----------|
21
+ | **Vocabulary size** | 250,037 tokens | 16,384 tokens | **93.44%** |
22
+ | **Model size** | 117,653,760 params | 27,931,008 params | **76.26%** |
23
 
24
+ ![image](https://raw.githubusercontent.com/lbourdois/blog/refs/heads/master/assets/images/Trimming/me5-small-16384.png)
25
 
26
+ ## Mining Dataset Statistics
27
+ - **Number of texts used for mining**: 54,409 texts
28
+ - **Dataset**: [lbourdois/fineweb-2-trimming](https://huggingface.co/datasets/lbourdois/fineweb-2-trimming)
29
 
30
+ ## Usage
31
  ```python
32
+ from sentence_transformers import SentenceTransformer
33
+ # Download from the 🤗 Hub
34
+ model = SentenceTransformer("alphaedge-ai/multilingual-e5-small-bre-16384")
35
+ # Run inference with queries and documents
36
+ query = "My query in Breton"
37
+ documents = [
38
+ "Chunk in Breton",
39
+ "Chunk in Breton",
40
+ "Chunk in Breton",
41
+ ]
42
+ query_embeddings = model.encode_query(query)
43
+ document_embeddings = model.encode_document(documents)
44
+ print(query_embeddings.shape, document_embeddings.shape)
45
+ # Compute similarities to determine a ranking
46
+ similarities = model.similarity(query_embeddings, document_embeddings)
47
+ print(similarities)
48
+ ```
49
+
50
+ ## Citations
51
 
52
+ #### Multilingual E5
53
+ ```
54
+ @article{wang2024multilingual,
55
+ title={Multilingual E5 Text Embeddings: A Technical Report},
56
+ author={Wang, Liang and Yang, Nan and Huang, Xiaolong and Yang, Linjun and Majumder, Rangan and Wei, Furu},
57
+ journal={arXiv preprint arXiv:2402.05672},
58
+ year={2024}
59
+ }
60
  ```
61
 
62
+ #### Trimming blog post
63
+ ```
64
+ @misc{hf_blogpost_trimming,
65
+ title={Introduction to Trimming},
66
+ author={Loïck BOURDOIS and Tom AARSEN and Bram VANROY and Christopher AKIKI and Woojun JUNG and Manuel ROMERO and Prithiv SAKTHI},
67
+ year={2026},
68
+ url={https://huggingface.co/blog/lbourdois/introduction-to-trimming},
69
+ }
70
+ ```