Your Name commited on
Commit
3e4d895
·
2 Parent(s): b2428ce e9b9dd5

Resolved merge conflicts by keeping upstream version

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ *.json filter=lfs diff=lfs merge=lfs -text
1_Pooling/config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4be450dde3b0273bb9787637cfbd28fe04a7ba6ab9d36ac48e92b11e350ffc23
3
+ size 190
README.md CHANGED
@@ -1,3 +1,150 @@
1
  ---
2
- license: mit
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ pipeline_tag: sentence-similarity
3
+ tags:
4
+ - sentence-transformers
5
+ - feature-extraction
6
+ - sentence-similarity
7
+ - transformers
8
+
9
  ---
10
+
11
+ <div align="center">
12
+ <h1 style="margin-bottom: 0.5em;">WebLINX: Real-World Website Navigation with Multi-Turn Dialogue</h1>
13
+ <em>Xing Han Lù*, Zdeněk Kasner*, Siva Reddy</em>
14
+ </div>
15
+
16
+ <div style="margin-bottom: 2em"></div>
17
+
18
+ <div style="display: flex; justify-content: space-around; align-items: center; font-size: 120%;">
19
+ <div><a href="https://arxiv.org/abs/2402.05930">📄Paper</a></div>
20
+ <div><a href="https://mcgill-nlp.github.io/weblinx">🌐Website</a></div>
21
+ <div><a href="https://huggingface.co/spaces/McGill-NLP/weblinx-explorer">💻Explorer</a></div>
22
+ <div><a href="https://huggingface.co/datasets/McGill-NLP/WebLINX">🤗Dataset</a></div>
23
+ <div><a href="https://github.com/McGill-NLP/weblinx">💾Code</a></div>
24
+ </div>
25
+
26
+ <div style="margin-bottom: 2em"></div>
27
+
28
+
29
+
30
+ ## Original Model
31
+
32
+ This model is finetuned on WebLINX using checkpoints previously published on Huggingface Hub.\
33
+ [Click here to access the original model.](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2)
34
+
35
+ # Sentence Transformers Details
36
+
37
+ This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search.
38
+
39
+ <!--- Describe your model here -->
40
+
41
+ ## Usage (Sentence-Transformers)
42
+
43
+ Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
44
+
45
+ ```
46
+ pip install -U sentence-transformers
47
+ ```
48
+
49
+ Then you can use the model like this:
50
+
51
+ ```python
52
+ from sentence_transformers import SentenceTransformer
53
+ sentences = ["This is an example sentence", "Each sentence is converted"]
54
+
55
+ model = SentenceTransformer('McGill-NLP/MiniLM-L6-dmr')
56
+ embeddings = model.encode(sentences)
57
+ print(embeddings)
58
+ ```
59
+
60
+
61
+
62
+ ## Usage (HuggingFace Transformers)
63
+ Without [sentence-transformers](https://www.SBERT.net), you can use the model like this: First, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings.
64
+
65
+ ```python
66
+ from transformers import AutoTokenizer, AutoModel
67
+ import torch
68
+
69
+
70
+ #Mean Pooling - Take attention mask into account for correct averaging
71
+ def mean_pooling(model_output, attention_mask):
72
+ token_embeddings = model_output[0] #First element of model_output contains all token embeddings
73
+ input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
74
+ return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
75
+
76
+
77
+ # Sentences we want sentence embeddings for
78
+ sentences = ['This is an example sentence', 'Each sentence is converted']
79
+
80
+ # Load model from HuggingFace Hub
81
+ tokenizer = AutoTokenizer.from_pretrained('McGill-NLP/MiniLM-L6-dmr')
82
+ model = AutoModel.from_pretrained('McGill-NLP/MiniLM-L6-dmr')
83
+
84
+ # Tokenize sentences
85
+ encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
86
+
87
+ # Compute token embeddings
88
+ with torch.no_grad():
89
+ model_output = model(**encoded_input)
90
+
91
+ # Perform pooling. In this case, mean pooling.
92
+ sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
93
+
94
+ print("Sentence embeddings:")
95
+ print(sentence_embeddings)
96
+ ```
97
+
98
+
99
+
100
+ ## Evaluation Results
101
+
102
+ <!--- Describe how your model was evaluated -->
103
+
104
+ For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name=McGill-NLP/MiniLM-L6-dmr)
105
+
106
+
107
+ ## Training
108
+ The model was trained with the parameters:
109
+
110
+ **DataLoader**:
111
+
112
+ `torch.utils.data.dataloader.DataLoader` of length 2560 with parameters:
113
+ ```
114
+ {'batch_size': 64, 'sampler': 'torch.utils.data.sampler.RandomSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}
115
+ ```
116
+
117
+ **Loss**:
118
+
119
+ `sentence_transformers.losses.CosineSimilarityLoss.CosineSimilarityLoss`
120
+
121
+ Parameters of the fit()-Method:
122
+ ```
123
+ {
124
+ "epochs": 10,
125
+ "evaluation_steps": 0,
126
+ "evaluator": "NoneType",
127
+ "max_grad_norm": 1,
128
+ "optimizer_class": "<class 'torch.optim.adamw.AdamW'>",
129
+ "optimizer_params": {
130
+ "lr": 3e-05
131
+ },
132
+ "scheduler": "warmuplinear",
133
+ "steps_per_epoch": null,
134
+ "warmup_steps": 500,
135
+ "weight_decay": 0.0
136
+ }
137
+ ```
138
+
139
+
140
+ ## Full Model Architecture
141
+ ```
142
+ SentenceTransformer(
143
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
144
+ (1): Pooling({'word_embedding_dimension': 384, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False})
145
+ )
146
+ ```
147
+
148
+ ## Citing & Authors
149
+
150
+ <!--- Describe where people can find more information -->
config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6aafb69a540b010d432088e3da1107e9032eed1ab21fede681bb37658b43fed2
3
+ size 683
config_sentence_transformers.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:74a549d340534515b83e1d83fe9bb9c1bbf690eae7aff33516e825e4b6f5de4a
3
+ size 128
modules.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f4b264b80206c830bebbdcae377e137925650a433b689343a63bdc9b3145460
3
+ size 229
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:49230f8ec5764fcd0d1c3d83ea87387d602e3c0343efbbb2d96452702ed651dd
3
+ size 90887145
sentence_bert_config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec8e29d6dcb61b611b7d3fdd2982c4524e6ad985959fa7194eacfb655a8d0d51
3
+ size 53
special_tokens_map.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b6d346be366a7d1d48332dbc9fdf3bf8960b5d879522b7799ddba59e76237ee3
3
+ size 125
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91f1def9b9391fdabe028cd3f3fcc4efd34e5d1f08c3bf2de513ebb5911a1854
3
+ size 711649
tokenizer_config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3b0a0734314b40eb8116f8b194e713ed7bc6582f88ca52ea280ab573b791e5c
3
+ size 1468
vocab.txt ADDED
The diff for this file is too large to render. See raw diff