96abhishekarora
commited on
Commit
•
594f96a
1
Parent(s):
bee4cb6
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 +52 -8
- tokenizer_config.json +49 -51
.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/45/1d/451d07b21cc069b7c2c7e8f6624f52da26f0e246f90abaedc8749782b54b0adf 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/45/1d/451d07b21cc069b7c2c7e8f6624f52da26f0e246f90abaedc8749782b54b0adf filter=lfs diff=lfs merge=lfs -text
|
38 |
+
model.safetensors filter=lfs diff=lfs merge=lfs -text
|
39 |
+
.git/lfs/objects/1c/44/1c44e50620136eaacd05a96a354f8255cf1be856117f155c8786525b6b9f11a1 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
@@ -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": "oshizo/sbert-jsnli-luke-japanese-base-lite",
|
|
|
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": "oshizo/sbert-jsnli-luke-japanese-base-lite",
|
README.md
CHANGED
@@ -12,7 +12,7 @@ tags:
|
|
12 |
|
13 |
# dell-research-harvard/lt-wikidata-comp-ja
|
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': 128, 'do_lower_case': False}) with Transformer model: LukeModel
|
132 |
-
(1): Pooling({'word_embedding_dimension': 768, '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-wikidata-comp-ja
|
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 562 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": 281,
|
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": 56200,
|
123 |
"weight_decay": 0.01
|
124 |
}
|
125 |
```
|
|
|
129 |
|
130 |
LinkTransformer(
|
131 |
(0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: LukeModel
|
132 |
+
(1): Pooling({'word_embedding_dimension': 768, '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_ja_aliases
|
3 |
"architectures": [
|
4 |
"LukeModel"
|
5 |
],
|
@@ -24,7 +24,7 @@
|
|
24 |
"pad_token_id": 1,
|
25 |
"position_embedding_type": "absolute",
|
26 |
"torch_dtype": "float32",
|
27 |
-
"transformers_version": "4.
|
28 |
"type_vocab_size": 1,
|
29 |
"use_cache": true,
|
30 |
"use_entity_aware_attention": true,
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "models/linkage_ja_aliases",
|
3 |
"architectures": [
|
4 |
"LukeModel"
|
5 |
],
|
|
|
24 |
"pad_token_id": 1,
|
25 |
"position_embedding_type": "absolute",
|
26 |
"torch_dtype": "float32",
|
27 |
+
"transformers_version": "4.35.1",
|
28 |
"type_vocab_size": 1,
|
29 |
"use_cache": true,
|
30 |
"use_entity_aware_attention": true,
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a8f7cb65577aa50b1c49fd5e0cb7beef2d858cdd37baa16adc932ac5370c60b0
|
3 |
+
size 532299592
|
special_tokens_map.json
CHANGED
@@ -1,23 +1,49 @@
|
|
1 |
{
|
2 |
"additional_special_tokens": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
{
|
4 |
"content": "<ent>",
|
5 |
"lstrip": false,
|
6 |
-
"normalized":
|
7 |
"rstrip": false,
|
8 |
"single_word": false
|
9 |
},
|
10 |
{
|
11 |
"content": "<ent2>",
|
12 |
"lstrip": false,
|
13 |
-
"normalized":
|
14 |
"rstrip": false,
|
15 |
"single_word": false
|
16 |
}
|
17 |
],
|
18 |
-
"bos_token":
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
"mask_token": {
|
22 |
"content": "<mask>",
|
23 |
"lstrip": true,
|
@@ -25,7 +51,25 @@
|
|
25 |
"rstrip": false,
|
26 |
"single_word": false
|
27 |
},
|
28 |
-
"pad_token":
|
29 |
-
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
}
|
|
|
1 |
{
|
2 |
"additional_special_tokens": [
|
3 |
+
"<ent>",
|
4 |
+
"<ent2>",
|
5 |
+
"<ent>",
|
6 |
+
"<ent2>",
|
7 |
+
"<ent>",
|
8 |
+
"<ent2>",
|
9 |
+
"<ent>",
|
10 |
+
"<ent2>",
|
11 |
{
|
12 |
"content": "<ent>",
|
13 |
"lstrip": false,
|
14 |
+
"normalized": true,
|
15 |
"rstrip": false,
|
16 |
"single_word": false
|
17 |
},
|
18 |
{
|
19 |
"content": "<ent2>",
|
20 |
"lstrip": false,
|
21 |
+
"normalized": true,
|
22 |
"rstrip": false,
|
23 |
"single_word": false
|
24 |
}
|
25 |
],
|
26 |
+
"bos_token": {
|
27 |
+
"content": "<s>",
|
28 |
+
"lstrip": false,
|
29 |
+
"normalized": false,
|
30 |
+
"rstrip": false,
|
31 |
+
"single_word": false
|
32 |
+
},
|
33 |
+
"cls_token": {
|
34 |
+
"content": "<s>",
|
35 |
+
"lstrip": false,
|
36 |
+
"normalized": false,
|
37 |
+
"rstrip": false,
|
38 |
+
"single_word": false
|
39 |
+
},
|
40 |
+
"eos_token": {
|
41 |
+
"content": "</s>",
|
42 |
+
"lstrip": false,
|
43 |
+
"normalized": false,
|
44 |
+
"rstrip": false,
|
45 |
+
"single_word": false
|
46 |
+
},
|
47 |
"mask_token": {
|
48 |
"content": "<mask>",
|
49 |
"lstrip": true,
|
|
|
51 |
"rstrip": false,
|
52 |
"single_word": false
|
53 |
},
|
54 |
+
"pad_token": {
|
55 |
+
"content": "<pad>",
|
56 |
+
"lstrip": false,
|
57 |
+
"normalized": false,
|
58 |
+
"rstrip": false,
|
59 |
+
"single_word": false
|
60 |
+
},
|
61 |
+
"sep_token": {
|
62 |
+
"content": "</s>",
|
63 |
+
"lstrip": false,
|
64 |
+
"normalized": false,
|
65 |
+
"rstrip": false,
|
66 |
+
"single_word": false
|
67 |
+
},
|
68 |
+
"unk_token": {
|
69 |
+
"content": "<unk>",
|
70 |
+
"lstrip": false,
|
71 |
+
"normalized": false,
|
72 |
+
"rstrip": false,
|
73 |
+
"single_word": false
|
74 |
+
}
|
75 |
}
|
tokenizer_config.json
CHANGED
@@ -1,69 +1,73 @@
|
|
1 |
{
|
2 |
-
"
|
3 |
-
{
|
4 |
-
"
|
5 |
-
"content": "<ent>",
|
6 |
"lstrip": false,
|
7 |
-
"normalized":
|
8 |
"rstrip": false,
|
9 |
-
"single_word": false
|
|
|
10 |
},
|
11 |
-
{
|
12 |
-
"
|
13 |
-
"content": "<ent2>",
|
14 |
"lstrip": false,
|
15 |
-
"normalized":
|
16 |
"rstrip": false,
|
17 |
-
"single_word": false
|
|
|
18 |
},
|
19 |
-
{
|
20 |
-
"
|
21 |
-
"content": "<ent>",
|
22 |
-
"lstrip": false,
|
23 |
-
"normalized": true,
|
24 |
-
"rstrip": false,
|
25 |
-
"single_word": false
|
26 |
-
},
|
27 |
-
{
|
28 |
-
"__type": "AddedToken",
|
29 |
-
"content": "<ent2>",
|
30 |
"lstrip": false,
|
31 |
-
"normalized":
|
32 |
"rstrip": false,
|
33 |
-
"single_word": false
|
|
|
34 |
},
|
35 |
-
{
|
36 |
-
"
|
37 |
-
"content": "<ent>",
|
38 |
"lstrip": false,
|
39 |
-
"normalized":
|
40 |
"rstrip": false,
|
41 |
-
"single_word": false
|
|
|
42 |
},
|
43 |
-
{
|
44 |
-
"
|
45 |
-
"
|
46 |
-
"lstrip": false,
|
47 |
"normalized": true,
|
48 |
"rstrip": false,
|
49 |
-
"single_word": false
|
|
|
50 |
},
|
51 |
-
{
|
52 |
-
"__type": "AddedToken",
|
53 |
"content": "<ent>",
|
54 |
"lstrip": false,
|
55 |
"normalized": true,
|
56 |
"rstrip": false,
|
57 |
-
"single_word": false
|
|
|
58 |
},
|
59 |
-
{
|
60 |
-
"__type": "AddedToken",
|
61 |
"content": "<ent2>",
|
62 |
"lstrip": false,
|
63 |
"normalized": true,
|
64 |
"rstrip": false,
|
65 |
-
"single_word": false
|
|
|
66 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
],
|
68 |
"bos_token": "<s>",
|
69 |
"clean_up_tokenization_spaces": true,
|
@@ -77,7 +81,8 @@
|
|
77 |
"lstrip": false,
|
78 |
"normalized": true,
|
79 |
"rstrip": false,
|
80 |
-
"single_word": false
|
|
|
81 |
},
|
82 |
"entity_token_2": {
|
83 |
"__type": "AddedToken",
|
@@ -85,18 +90,12 @@
|
|
85 |
"lstrip": false,
|
86 |
"normalized": true,
|
87 |
"rstrip": false,
|
88 |
-
"single_word": false
|
|
|
89 |
},
|
90 |
"entity_unk_token": "[UNK]",
|
91 |
"eos_token": "</s>",
|
92 |
-
"mask_token":
|
93 |
-
"__type": "AddedToken",
|
94 |
-
"content": "<mask>",
|
95 |
-
"lstrip": true,
|
96 |
-
"normalized": true,
|
97 |
-
"rstrip": false,
|
98 |
-
"single_word": false
|
99 |
-
},
|
100 |
"max_entity_length": 32,
|
101 |
"max_mention_length": 30,
|
102 |
"model_max_length": 512,
|
@@ -105,6 +104,5 @@
|
|
105 |
"sp_model_kwargs": {},
|
106 |
"task": null,
|
107 |
"tokenizer_class": "MLukeTokenizer",
|
108 |
-
"tokenizer_file": "models/luke-japanese/hf_luke_japanese_lite_epoch20/tokenizer.json",
|
109 |
"unk_token": "<unk>"
|
110 |
}
|
|
|
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": false,
|
31 |
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
},
|
35 |
+
"32769": {
|
36 |
+
"content": "<mask>",
|
37 |
+
"lstrip": true,
|
|
|
38 |
"normalized": true,
|
39 |
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
},
|
43 |
+
"32770": {
|
|
|
44 |
"content": "<ent>",
|
45 |
"lstrip": false,
|
46 |
"normalized": true,
|
47 |
"rstrip": false,
|
48 |
+
"single_word": false,
|
49 |
+
"special": true
|
50 |
},
|
51 |
+
"32771": {
|
|
|
52 |
"content": "<ent2>",
|
53 |
"lstrip": false,
|
54 |
"normalized": true,
|
55 |
"rstrip": false,
|
56 |
+
"single_word": false,
|
57 |
+
"special": true
|
58 |
}
|
59 |
+
},
|
60 |
+
"additional_special_tokens": [
|
61 |
+
"<ent>",
|
62 |
+
"<ent2>",
|
63 |
+
"<ent>",
|
64 |
+
"<ent2>",
|
65 |
+
"<ent>",
|
66 |
+
"<ent2>",
|
67 |
+
"<ent>",
|
68 |
+
"<ent2>",
|
69 |
+
"<ent>",
|
70 |
+
"<ent2>"
|
71 |
],
|
72 |
"bos_token": "<s>",
|
73 |
"clean_up_tokenization_spaces": true,
|
|
|
81 |
"lstrip": false,
|
82 |
"normalized": true,
|
83 |
"rstrip": false,
|
84 |
+
"single_word": false,
|
85 |
+
"special": false
|
86 |
},
|
87 |
"entity_token_2": {
|
88 |
"__type": "AddedToken",
|
|
|
90 |
"lstrip": false,
|
91 |
"normalized": true,
|
92 |
"rstrip": false,
|
93 |
+
"single_word": false,
|
94 |
+
"special": false
|
95 |
},
|
96 |
"entity_unk_token": "[UNK]",
|
97 |
"eos_token": "</s>",
|
98 |
+
"mask_token": "<mask>",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
"max_entity_length": 32,
|
100 |
"max_mention_length": 30,
|
101 |
"model_max_length": 512,
|
|
|
104 |
"sp_model_kwargs": {},
|
105 |
"task": null,
|
106 |
"tokenizer_class": "MLukeTokenizer",
|
|
|
107 |
"unk_token": "<unk>"
|
108 |
}
|