96abhishekarora
commited on
Commit
•
4e7e74b
1
Parent(s):
3745df9
Modified validation and training for linktransformer model
Browse files- .gitattributes +2 -0
- 1_Pooling/config.json +3 -1
- LT_training_config.json +5 -2
- README.md +17 -7
- config.json +2 -2
- model.safetensors +3 -0
- special_tokens_map.json +42 -6
- tokenizer_config.json +57 -0
.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/21/f6/21f62a2f5d51a4a54c4b42e01fb10b45fc505cae8c7ad33ea62a89790a951532 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/21/f6/21f62a2f5d51a4a54c4b42e01fb10b45fc505cae8c7ad33ea62a89790a951532 filter=lfs diff=lfs merge=lfs -text
|
38 |
+
model.safetensors filter=lfs diff=lfs merge=lfs -text
|
39 |
+
.git/lfs/objects/3a/24/3a24ab799bbbdf5df9869468abcb2eb4c97436c5eb810627cdd569b2e926572b filter=lfs diff=lfs merge=lfs -text
|
1_Pooling/config.json
CHANGED
@@ -3,5 +3,7 @@
|
|
3 |
"pooling_mode_cls_token": true,
|
4 |
"pooling_mode_mean_tokens": false,
|
5 |
"pooling_mode_max_tokens": false,
|
6 |
-
"pooling_mode_mean_sqrt_len_tokens": false
|
|
|
|
|
7 |
}
|
|
|
3 |
"pooling_mode_cls_token": true,
|
4 |
"pooling_mode_mean_tokens": false,
|
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
@@ -6,7 +6,8 @@
|
|
6 |
"train_batch_size": 64,
|
7 |
"num_epochs": 100,
|
8 |
"warm_up_perc": 1,
|
9 |
-
"learning_rate": 2e-
|
|
|
10 |
"val_perc": 0.2,
|
11 |
"wandb_names": {
|
12 |
"project": "linkage",
|
@@ -16,9 +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 |
"eval_type": "retrieval",
|
23 |
"training_dataset": "dataframe",
|
24 |
"base_model_path": "multi-qa-mpnet-base-dot-v1",
|
|
|
6 |
"train_batch_size": 64,
|
7 |
"num_epochs": 100,
|
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": "multi-qa-mpnet-base-dot-v1",
|
README.md
CHANGED
@@ -12,7 +12,7 @@ tags:
|
|
12 |
|
13 |
# dell-research-harvard/lt-wikidata-comp-en
|
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 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.
|
@@ -97,7 +97,7 @@ The model was trained with the parameters:
|
|
97 |
|
98 |
**DataLoader**:
|
99 |
|
100 |
-
`torch.utils.data.dataloader.DataLoader` of length
|
101 |
```
|
102 |
{'batch_size': 64, 'sampler': 'torch.utils.data.dataloader._InfiniteConstantSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}
|
103 |
```
|
@@ -110,16 +110,16 @@ Parameters of the fit()-Method:
|
|
110 |
```
|
111 |
{
|
112 |
"epochs": 100,
|
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': 512, 'do_lower_case': False}) with Transformer model: MPNetModel
|
132 |
-
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, '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-wikidata-comp-en
|
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 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.
|
|
|
97 |
|
98 |
**DataLoader**:
|
99 |
|
100 |
+
`torch.utils.data.dataloader.DataLoader` of length 2087 with parameters:
|
101 |
```
|
102 |
{'batch_size': 64, 'sampler': 'torch.utils.data.dataloader._InfiniteConstantSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}
|
103 |
```
|
|
|
110 |
```
|
111 |
{
|
112 |
"epochs": 100,
|
113 |
+
"evaluation_steps": 1044,
|
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": 208700,
|
123 |
"weight_decay": 0.01
|
124 |
}
|
125 |
```
|
|
|
129 |
|
130 |
LinkTransformer(
|
131 |
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: MPNetModel
|
132 |
+
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, '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_en_aliases
|
3 |
"architectures": [
|
4 |
"MPNetModel"
|
5 |
],
|
@@ -19,6 +19,6 @@
|
|
19 |
"pad_token_id": 1,
|
20 |
"relative_attention_num_buckets": 32,
|
21 |
"torch_dtype": "float32",
|
22 |
-
"transformers_version": "4.
|
23 |
"vocab_size": 30527
|
24 |
}
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "models/linkage_en_aliases",
|
3 |
"architectures": [
|
4 |
"MPNetModel"
|
5 |
],
|
|
|
19 |
"pad_token_id": 1,
|
20 |
"relative_attention_num_buckets": 32,
|
21 |
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.35.1",
|
23 |
"vocab_size": 30527
|
24 |
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4d88dbbf624b0416b72827f3c8d16f8e21f1a59f8047e737eece87fb5a10b424
|
3 |
+
size 437967672
|
special_tokens_map.json
CHANGED
@@ -1,7 +1,25 @@
|
|
1 |
{
|
2 |
-
"bos_token":
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
"mask_token": {
|
6 |
"content": "<mask>",
|
7 |
"lstrip": true,
|
@@ -9,7 +27,25 @@
|
|
9 |
"rstrip": false,
|
10 |
"single_word": false
|
11 |
},
|
12 |
-
"pad_token":
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
}
|
|
|
1 |
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"cls_token": {
|
10 |
+
"content": "<s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"eos_token": {
|
17 |
+
"content": "</s>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
"mask_token": {
|
24 |
"content": "<mask>",
|
25 |
"lstrip": true,
|
|
|
27 |
"rstrip": false,
|
28 |
"single_word": false
|
29 |
},
|
30 |
+
"pad_token": {
|
31 |
+
"content": "<pad>",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false
|
36 |
+
},
|
37 |
+
"sep_token": {
|
38 |
+
"content": "</s>",
|
39 |
+
"lstrip": false,
|
40 |
+
"normalized": false,
|
41 |
+
"rstrip": false,
|
42 |
+
"single_word": false
|
43 |
+
},
|
44 |
+
"unk_token": {
|
45 |
+
"content": "[UNK]",
|
46 |
+
"lstrip": false,
|
47 |
+
"normalized": false,
|
48 |
+
"rstrip": false,
|
49 |
+
"single_word": false
|
50 |
+
}
|
51 |
}
|
tokenizer_config.json
CHANGED
@@ -1,15 +1,72 @@
|
|
1 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
"bos_token": "<s>",
|
3 |
"clean_up_tokenization_spaces": true,
|
4 |
"cls_token": "<s>",
|
5 |
"do_lower_case": true,
|
6 |
"eos_token": "</s>",
|
7 |
"mask_token": "<mask>",
|
|
|
8 |
"model_max_length": 512,
|
|
|
9 |
"pad_token": "<pad>",
|
|
|
|
|
10 |
"sep_token": "</s>",
|
|
|
11 |
"strip_accents": null,
|
12 |
"tokenize_chinese_chars": true,
|
13 |
"tokenizer_class": "MPNetTokenizer",
|
|
|
|
|
14 |
"unk_token": "[UNK]"
|
15 |
}
|
|
|
1 |
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "<s>",
|
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>",
|
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": true,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"104": {
|
36 |
+
"content": "[UNK]",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
},
|
43 |
+
"30526": {
|
44 |
+
"content": "<mask>",
|
45 |
+
"lstrip": true,
|
46 |
+
"normalized": false,
|
47 |
+
"rstrip": false,
|
48 |
+
"single_word": false,
|
49 |
+
"special": true
|
50 |
+
}
|
51 |
+
},
|
52 |
"bos_token": "<s>",
|
53 |
"clean_up_tokenization_spaces": true,
|
54 |
"cls_token": "<s>",
|
55 |
"do_lower_case": true,
|
56 |
"eos_token": "</s>",
|
57 |
"mask_token": "<mask>",
|
58 |
+
"max_length": 250,
|
59 |
"model_max_length": 512,
|
60 |
+
"pad_to_multiple_of": null,
|
61 |
"pad_token": "<pad>",
|
62 |
+
"pad_token_type_id": 0,
|
63 |
+
"padding_side": "right",
|
64 |
"sep_token": "</s>",
|
65 |
+
"stride": 0,
|
66 |
"strip_accents": null,
|
67 |
"tokenize_chinese_chars": true,
|
68 |
"tokenizer_class": "MPNetTokenizer",
|
69 |
+
"truncation_side": "right",
|
70 |
+
"truncation_strategy": "longest_first",
|
71 |
"unk_token": "[UNK]"
|
72 |
}
|