ArchitRastogi
commited on
Commit
•
7a086c0
1
Parent(s):
6137d84
v1 readme
Browse files
README.md
CHANGED
@@ -1,3 +1,88 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- ArchitRastogi/Italian-BERT-FineTuning-Embeddings
|
5 |
+
language:
|
6 |
+
- it
|
7 |
+
base_model:
|
8 |
+
- dbmdz/bert-base-italian-xxl-uncased
|
9 |
+
---
|
10 |
+
|
11 |
+
# bert-base-italian-embeddings: A Fine-Tuned Italian BERT Model for IR and RAG Applications
|
12 |
+
|
13 |
+
## Model Overview
|
14 |
+
|
15 |
+
This model is a fine-tuned version of [dbmdz/bert-base-italian-xxl-uncased](https://huggingface.co/dbmdz/bert-base-italian-xxl-uncased) tailored for Italian language Information Retrieval (IR) and Retrieval-Augmented Generation (RAG) tasks. It leverages contrastive learning to generate high-quality embeddings suitable for both industry and academic applications.
|
16 |
+
|
17 |
+
## Model Size
|
18 |
+
|
19 |
+
- **Size**: Approximately 450 MB
|
20 |
+
|
21 |
+
## Training Details
|
22 |
+
|
23 |
+
- **Base Model**: [dbmdz/bert-base-italian-xxl-uncased](https://huggingface.co/dbmdz/bert-base-italian-xxl-uncased)
|
24 |
+
- **Dataset**: [Italian-BERT-FineTuning-Embeddings](https://huggingface.co/datasets/ArchitRastogi/Italian-BERT-FineTuning-Embeddings)
|
25 |
+
- Derived from the C4 dataset using sliding window segmentation and in-document sampling.
|
26 |
+
- **Size**: ~5GB (4.5GB train, 0.5GB test)
|
27 |
+
- **Training Configuration**:
|
28 |
+
- **Hardware**: NVIDIA A40 GPU
|
29 |
+
- **Epochs**: 3
|
30 |
+
- **Total Steps**: 922,958
|
31 |
+
- **Training Time**: Approximately 5 days, 2 hours, and 23 minutes
|
32 |
+
- **Training Objective**: Contrastive Learning
|
33 |
+
|
34 |
+
## Evaluation Metrics
|
35 |
+
|
36 |
+
Evaluations were performed using the [mMARCO](https://github.com/unicamp-dl/mMARCO) dataset, a multilingual version of MS MARCO. The model was assessed on 6,980 queries.
|
37 |
+
|
38 |
+
### Results Comparison
|
39 |
+
|
40 |
+
| Metric | Base Model (`dbmdz/bert-base-italian-xxl-uncased`) | `facebook/mcontriever-msmarco` | **Fine-Tuned Model** |
|
41 |
+
|---------------------|----------------------------------------------------|--------------------------------|----------------------|
|
42 |
+
| **Recall@1** | 0.0026 | 0.0828 | **0.2106** |
|
43 |
+
| **Recall@100** | 0.0417 | 0.5028 | **0.8356** |
|
44 |
+
| **Recall@1000** | 0.2061 | 0.8049 | **0.9719** |
|
45 |
+
| **Average Precision** | 0.0050 | 0.1397 | **0.3173** |
|
46 |
+
| **NDCG@10** | 0.0043 | 0.1591 | **0.3601** |
|
47 |
+
| **NDCG@100** | 0.0108 | 0.2086 | **0.4218** |
|
48 |
+
| **NDCG@1000** | 0.0299 | 0.2454 | **0.4391** |
|
49 |
+
| **MRR@10** | 0.0036 | 0.1299 | **0.3047** |
|
50 |
+
| **MRR@100** | 0.0045 | 0.1385 | **0.3167** |
|
51 |
+
| **MRR@1000** | 0.0050 | 0.1397 | **0.3173** |
|
52 |
+
|
53 |
+
**Note**: The fine-tuned model significantly outperforms both the base model and `facebook/mcontriever-msmarco` across all metrics.
|
54 |
+
|
55 |
+
## Usage
|
56 |
+
|
57 |
+
You can load and use the model directly with the Hugging Face Transformers library:
|
58 |
+
```python
|
59 |
+
# Load model directly
|
60 |
+
from transformers import AutoTokenizer, AutoModelForMaskedLM
|
61 |
+
|
62 |
+
tokenizer = AutoTokenizer.from_pretrained("ArchitRastogi/bert-base-italian-embeddings")
|
63 |
+
model = AutoModelForMaskedLM.from_pretrained("ArchitRastogi/bert-base-italian-embeddings")
|
64 |
+
|
65 |
+
# Example usage
|
66 |
+
text = "Stanchi di non riuscire a trovare il partner perfetto?"
|
67 |
+
inputs = tokenizer(text, return_tensors="pt")
|
68 |
+
outputs = model(**inputs)
|
69 |
+
```
|
70 |
+
|
71 |
+
## Intended Use
|
72 |
+
This model is intended for:
|
73 |
+
|
74 |
+
- Information Retrieval (IR): Enhancing search engines and retrieval systems in the Italian language.
|
75 |
+
- Retrieval-Augmented Generation (RAG): Improving the quality of generated content by providing relevant context.
|
76 |
+
|
77 |
+
Suitable for both industry applications and academic research.
|
78 |
+
|
79 |
+
## Limitations
|
80 |
+
- The model may inherit biases present in the C4 dataset.
|
81 |
+
- Performance is primarily evaluated on mMARCO; results may vary with other datasets.
|
82 |
+
|
83 |
+
---
|
84 |
+
|
85 |
+
## Contact
|
86 |
+
|
87 |
+
**Archit Rastogi**
|
88 |