96abhishekarora
commited on
Commit
•
50657a8
1
Parent(s):
5e817f8
Modified validation and training for linktransformer model
Browse files- .gitattributes +2 -0
- 1_Pooling/config.json +3 -1
- LT_training_config.json +6 -4
- README.md +18 -8
- config.json +2 -2
- config_sentence_transformers.json +3 -3
- model.safetensors +3 -0
- special_tokens_map.json +42 -6
- tokenizer.json +2 -1
- tokenizer_config.json +66 -8
.gitattributes
CHANGED
@@ -35,3 +35,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
pytorch_model.bin filter=lfs diff=lfs merge=lfs -text
|
37 |
.git/lfs/objects/ba/b5/bab5027dc8900ac7e6e1dbb0a25f0a03f98dbd9d15e7e6993c43cb06b3be4491 filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
pytorch_model.bin filter=lfs diff=lfs merge=lfs -text
|
37 |
.git/lfs/objects/ba/b5/bab5027dc8900ac7e6e1dbb0a25f0a03f98dbd9d15e7e6993c43cb06b3be4491 filter=lfs diff=lfs merge=lfs -text
|
38 |
+
model.safetensors filter=lfs diff=lfs merge=lfs -text
|
39 |
+
.git/lfs/objects/76/76/7676d4e2119e61cc764e6f199c9797331b7bc5b2ce518bc47feace49d47db587 filter=lfs diff=lfs merge=lfs -text
|
1_Pooling/config.json
CHANGED
@@ -3,5 +3,7 @@
|
|
3 |
"pooling_mode_cls_token": false,
|
4 |
"pooling_mode_mean_tokens": true,
|
5 |
"pooling_mode_max_tokens": false,
|
6 |
-
"pooling_mode_mean_sqrt_len_tokens": false
|
|
|
|
|
7 |
}
|
|
|
3 |
"pooling_mode_cls_token": false,
|
4 |
"pooling_mode_mean_tokens": true,
|
5 |
"pooling_mode_max_tokens": false,
|
6 |
+
"pooling_mode_mean_sqrt_len_tokens": false,
|
7 |
+
"pooling_mode_weightedmean_tokens": false,
|
8 |
+
"pooling_mode_lasttoken": false
|
9 |
}
|
LT_training_config.json
CHANGED
@@ -1,12 +1,13 @@
|
|
1 |
{
|
2 |
"model_save_dir": "models",
|
3 |
"model_save_name": "linkage_un_data_fr_fine_fine",
|
4 |
-
"opt_model_description": "This model was trained on a dataset prepared by linking product classifications from [UN stats](https://unstats.un.org/unsd/classifications/Econ). \n This model is designed to link different products together - trained on variation brought on by product level correspondance. It was trained for
|
5 |
"opt_model_lang": "fr",
|
6 |
"train_batch_size": 64,
|
7 |
-
"num_epochs":
|
8 |
"warm_up_perc": 1,
|
9 |
-
"learning_rate": 2e-
|
|
|
10 |
"val_perc": 0.2,
|
11 |
"wandb_names": {
|
12 |
"project": "linkage",
|
@@ -16,10 +17,11 @@
|
|
16 |
},
|
17 |
"add_pooling_layer": false,
|
18 |
"large_val": true,
|
19 |
-
"eval_steps_perc": 0.
|
20 |
"test_at_end": true,
|
21 |
"save_val_test_pickles": true,
|
22 |
"val_query_prop": 0.5,
|
|
|
23 |
"eval_type": "retrieval",
|
24 |
"training_dataset": "dataframe",
|
25 |
"base_model_path": "dangvantuan/sentence-camembert-large",
|
|
|
1 |
{
|
2 |
"model_save_dir": "models",
|
3 |
"model_save_name": "linkage_un_data_fr_fine_fine",
|
4 |
+
"opt_model_description": "This model was trained on a dataset prepared by linking product classifications from [UN stats](https://unstats.un.org/unsd/classifications/Econ). \n This model is designed to link different products together - trained on variation brought on by product level correspondance. It was trained for 50 epochs using other defaults that can be found in the repo's LinkTransformer config file - LT_training_config.json \n ",
|
5 |
"opt_model_lang": "fr",
|
6 |
"train_batch_size": 64,
|
7 |
+
"num_epochs": 50,
|
8 |
"warm_up_perc": 1,
|
9 |
+
"learning_rate": 2e-05,
|
10 |
+
"loss_type": "supcon",
|
11 |
"val_perc": 0.2,
|
12 |
"wandb_names": {
|
13 |
"project": "linkage",
|
|
|
17 |
},
|
18 |
"add_pooling_layer": false,
|
19 |
"large_val": true,
|
20 |
+
"eval_steps_perc": 0.5,
|
21 |
"test_at_end": true,
|
22 |
"save_val_test_pickles": true,
|
23 |
"val_query_prop": 0.5,
|
24 |
+
"loss_params": {},
|
25 |
"eval_type": "retrieval",
|
26 |
"training_dataset": "dataframe",
|
27 |
"base_model_path": "dangvantuan/sentence-camembert-large",
|
README.md
CHANGED
@@ -12,7 +12,7 @@ tags:
|
|
12 |
|
13 |
# dell-research-harvard/lt-un-data-fine-fine-fr
|
14 |
|
15 |
-
This is a [LinkTransformer](https://github.
|
16 |
It is designed for quick and easy record linkage (entity-matching) through the LinkTransformer package. The tasks include clustering, deduplication, linking, aggregation and more.
|
17 |
Notwithstanding that, it can be used for any sentence similarity task within the sentence-transformers framework as well.
|
18 |
It maps sentences & paragraphs to a 1024 dimensional dense vector space and can be used for tasks like clustering or semantic search.
|
@@ -23,7 +23,7 @@ This model has been fine-tuned on the model : dangvantuan/sentence-camembert-lar
|
|
23 |
|
24 |
|
25 |
This model was trained on a dataset prepared by linking product classifications from [UN stats](https://unstats.un.org/unsd/classifications/Econ).
|
26 |
-
This model is designed to link different products together - trained on variation brought on by product level correspondance. It was trained for
|
27 |
|
28 |
|
29 |
## Usage (LinkTransformer)
|
@@ -109,17 +109,17 @@ The model was trained with the parameters:
|
|
109 |
Parameters of the fit()-Method:
|
110 |
```
|
111 |
{
|
112 |
-
"epochs":
|
113 |
-
"evaluation_steps":
|
114 |
"evaluator": "sentence_transformers.evaluation.SequentialEvaluator.SequentialEvaluator",
|
115 |
"max_grad_norm": 1,
|
116 |
"optimizer_class": "<class 'torch.optim.adamw.AdamW'>",
|
117 |
"optimizer_params": {
|
118 |
-
"lr": 2e-
|
119 |
},
|
120 |
"scheduler": "WarmupLinear",
|
121 |
"steps_per_epoch": null,
|
122 |
-
"warmup_steps":
|
123 |
"weight_decay": 0.01
|
124 |
}
|
125 |
```
|
@@ -129,10 +129,20 @@ Parameters of the fit()-Method:
|
|
129 |
|
130 |
LinkTransformer(
|
131 |
(0): Transformer({'max_seq_length': 514, 'do_lower_case': False}) with Transformer model: CamembertModel
|
132 |
-
(1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False})
|
133 |
)
|
134 |
```
|
135 |
|
136 |
## Citing & Authors
|
137 |
|
138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
# dell-research-harvard/lt-un-data-fine-fine-fr
|
14 |
|
15 |
+
This is a [LinkTransformer](https://linktransformer.github.io/) model. At its core this model this is a sentence transformer model [sentence-transformers](https://www.SBERT.net) model- it just wraps around the class.
|
16 |
It is designed for quick and easy record linkage (entity-matching) through the LinkTransformer package. The tasks include clustering, deduplication, linking, aggregation and more.
|
17 |
Notwithstanding that, it can be used for any sentence similarity task within the sentence-transformers framework as well.
|
18 |
It maps sentences & paragraphs to a 1024 dimensional dense vector space and can be used for tasks like clustering or semantic search.
|
|
|
23 |
|
24 |
|
25 |
This model was trained on a dataset prepared by linking product classifications from [UN stats](https://unstats.un.org/unsd/classifications/Econ).
|
26 |
+
This model is designed to link different products together - trained on variation brought on by product level correspondance. It was trained for 50 epochs using other defaults that can be found in the repo's LinkTransformer config file - LT_training_config.json
|
27 |
|
28 |
|
29 |
## Usage (LinkTransformer)
|
|
|
109 |
Parameters of the fit()-Method:
|
110 |
```
|
111 |
{
|
112 |
+
"epochs": 50,
|
113 |
+
"evaluation_steps": 33,
|
114 |
"evaluator": "sentence_transformers.evaluation.SequentialEvaluator.SequentialEvaluator",
|
115 |
"max_grad_norm": 1,
|
116 |
"optimizer_class": "<class 'torch.optim.adamw.AdamW'>",
|
117 |
"optimizer_params": {
|
118 |
+
"lr": 2e-05
|
119 |
},
|
120 |
"scheduler": "WarmupLinear",
|
121 |
"steps_per_epoch": null,
|
122 |
+
"warmup_steps": 3300,
|
123 |
"weight_decay": 0.01
|
124 |
}
|
125 |
```
|
|
|
129 |
|
130 |
LinkTransformer(
|
131 |
(0): Transformer({'max_seq_length': 514, 'do_lower_case': False}) with Transformer model: CamembertModel
|
132 |
+
(1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False})
|
133 |
)
|
134 |
```
|
135 |
|
136 |
## Citing & Authors
|
137 |
|
138 |
+
```
|
139 |
+
@misc{arora2023linktransformer,
|
140 |
+
title={LinkTransformer: A Unified Package for Record Linkage with Transformer Language Models},
|
141 |
+
author={Abhishek Arora and Melissa Dell},
|
142 |
+
year={2023},
|
143 |
+
eprint={2309.00789},
|
144 |
+
archivePrefix={arXiv},
|
145 |
+
primaryClass={cs.CL}
|
146 |
+
}
|
147 |
+
|
148 |
+
```
|
config.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"_name_or_path": "models/linkage_un_data_fr_fine_fine
|
3 |
"architectures": [
|
4 |
"CamembertModel"
|
5 |
],
|
@@ -22,7 +22,7 @@
|
|
22 |
"pad_token_id": 1,
|
23 |
"position_embedding_type": "absolute",
|
24 |
"torch_dtype": "float32",
|
25 |
-
"transformers_version": "4.
|
26 |
"type_vocab_size": 1,
|
27 |
"use_cache": true,
|
28 |
"vocab_size": 32005
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "models/linkage_un_data_fr_fine_fine",
|
3 |
"architectures": [
|
4 |
"CamembertModel"
|
5 |
],
|
|
|
22 |
"pad_token_id": 1,
|
23 |
"position_embedding_type": "absolute",
|
24 |
"torch_dtype": "float32",
|
25 |
+
"transformers_version": "4.35.1",
|
26 |
"type_vocab_size": 1,
|
27 |
"use_cache": true,
|
28 |
"vocab_size": 32005
|
config_sentence_transformers.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
{
|
2 |
"__version__": {
|
3 |
-
"sentence_transformers": "2.
|
4 |
-
"transformers": "4.
|
5 |
-
"pytorch": "2.0
|
6 |
}
|
7 |
}
|
|
|
1 |
{
|
2 |
"__version__": {
|
3 |
+
"sentence_transformers": "2.3.1",
|
4 |
+
"transformers": "4.35.1",
|
5 |
+
"pytorch": "2.1.0+cu121"
|
6 |
}
|
7 |
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ff8d55a91d5d4a5a9a3e348c41fa77dd1cf5bd8d2d34bf5ee6da44357edb18bd
|
3 |
+
size 1346690896
|
special_tokens_map.json
CHANGED
@@ -3,9 +3,27 @@
|
|
3 |
"<s>NOTUSED",
|
4 |
"</s>NOTUSED"
|
5 |
],
|
6 |
-
"bos_token":
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
"mask_token": {
|
10 |
"content": "<mask>",
|
11 |
"lstrip": true,
|
@@ -13,7 +31,25 @@
|
|
13 |
"rstrip": false,
|
14 |
"single_word": false
|
15 |
},
|
16 |
-
"pad_token":
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
}
|
|
|
3 |
"<s>NOTUSED",
|
4 |
"</s>NOTUSED"
|
5 |
],
|
6 |
+
"bos_token": {
|
7 |
+
"content": "<s>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": false,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false
|
12 |
+
},
|
13 |
+
"cls_token": {
|
14 |
+
"content": "<s>",
|
15 |
+
"lstrip": false,
|
16 |
+
"normalized": false,
|
17 |
+
"rstrip": false,
|
18 |
+
"single_word": false
|
19 |
+
},
|
20 |
+
"eos_token": {
|
21 |
+
"content": "</s>",
|
22 |
+
"lstrip": false,
|
23 |
+
"normalized": false,
|
24 |
+
"rstrip": false,
|
25 |
+
"single_word": false
|
26 |
+
},
|
27 |
"mask_token": {
|
28 |
"content": "<mask>",
|
29 |
"lstrip": true,
|
|
|
31 |
"rstrip": false,
|
32 |
"single_word": false
|
33 |
},
|
34 |
+
"pad_token": {
|
35 |
+
"content": "<pad>",
|
36 |
+
"lstrip": false,
|
37 |
+
"normalized": false,
|
38 |
+
"rstrip": false,
|
39 |
+
"single_word": false
|
40 |
+
},
|
41 |
+
"sep_token": {
|
42 |
+
"content": "</s>",
|
43 |
+
"lstrip": false,
|
44 |
+
"normalized": false,
|
45 |
+
"rstrip": false,
|
46 |
+
"single_word": false
|
47 |
+
},
|
48 |
+
"unk_token": {
|
49 |
+
"content": "<unk>",
|
50 |
+
"lstrip": false,
|
51 |
+
"normalized": false,
|
52 |
+
"rstrip": false,
|
53 |
+
"single_word": false
|
54 |
+
}
|
55 |
}
|
tokenizer.json
CHANGED
@@ -128210,6 +128210,7 @@
|
|
128210 |
"<mask>",
|
128211 |
0.0
|
128212 |
]
|
128213 |
-
]
|
|
|
128214 |
}
|
128215 |
}
|
|
|
128210 |
"<mask>",
|
128211 |
0.0
|
128212 |
]
|
128213 |
+
],
|
128214 |
+
"byte_fallback": false
|
128215 |
}
|
128216 |
}
|
tokenizer_config.json
CHANGED
@@ -1,4 +1,62 @@
|
|
1 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
"additional_special_tokens": [
|
3 |
"<s>NOTUSED",
|
4 |
"</s>NOTUSED"
|
@@ -7,18 +65,18 @@
|
|
7 |
"clean_up_tokenization_spaces": true,
|
8 |
"cls_token": "<s>",
|
9 |
"eos_token": "</s>",
|
10 |
-
"mask_token":
|
11 |
-
|
12 |
-
"content": "<mask>",
|
13 |
-
"lstrip": true,
|
14 |
-
"normalized": true,
|
15 |
-
"rstrip": false,
|
16 |
-
"single_word": false
|
17 |
-
},
|
18 |
"model_max_length": 1000000000000000019884624838656,
|
|
|
19 |
"pad_token": "<pad>",
|
|
|
|
|
20 |
"sep_token": "</s>",
|
21 |
"sp_model_kwargs": {},
|
|
|
22 |
"tokenizer_class": "CamembertTokenizer",
|
|
|
|
|
23 |
"unk_token": "<unk>"
|
24 |
}
|
|
|
1 |
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "<s>NOTUSED",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"1": {
|
12 |
+
"content": "<pad>",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"2": {
|
20 |
+
"content": "</s>NOTUSED",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"3": {
|
28 |
+
"content": "<unk>",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"5": {
|
36 |
+
"content": "<s>",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
},
|
43 |
+
"6": {
|
44 |
+
"content": "</s>",
|
45 |
+
"lstrip": false,
|
46 |
+
"normalized": false,
|
47 |
+
"rstrip": false,
|
48 |
+
"single_word": false,
|
49 |
+
"special": true
|
50 |
+
},
|
51 |
+
"32004": {
|
52 |
+
"content": "<mask>",
|
53 |
+
"lstrip": true,
|
54 |
+
"normalized": true,
|
55 |
+
"rstrip": false,
|
56 |
+
"single_word": false,
|
57 |
+
"special": true
|
58 |
+
}
|
59 |
+
},
|
60 |
"additional_special_tokens": [
|
61 |
"<s>NOTUSED",
|
62 |
"</s>NOTUSED"
|
|
|
65 |
"clean_up_tokenization_spaces": true,
|
66 |
"cls_token": "<s>",
|
67 |
"eos_token": "</s>",
|
68 |
+
"mask_token": "<mask>",
|
69 |
+
"max_length": 514,
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
"model_max_length": 1000000000000000019884624838656,
|
71 |
+
"pad_to_multiple_of": null,
|
72 |
"pad_token": "<pad>",
|
73 |
+
"pad_token_type_id": 0,
|
74 |
+
"padding_side": "right",
|
75 |
"sep_token": "</s>",
|
76 |
"sp_model_kwargs": {},
|
77 |
+
"stride": 0,
|
78 |
"tokenizer_class": "CamembertTokenizer",
|
79 |
+
"truncation_side": "right",
|
80 |
+
"truncation_strategy": "longest_first",
|
81 |
"unk_token": "<unk>"
|
82 |
}
|