LiYuan commited on
Commit
27eebda
1 Parent(s): f1e153c
Files changed (1) hide show
  1. README.md +33 -8
README.md CHANGED
@@ -5,31 +5,57 @@ tags:
5
  metrics:
6
  - accuracy
7
  model-index:
8
- - name: distilbert-base-uncased-finetuned-mnli
9
  results: []
10
  ---
11
 
12
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
13
  should probably proofread and complete it, then remove this comment. -->
14
 
15
- # distilbert-base-uncased-finetuned-mnli
16
 
17
- This model is a fine-tuned version of [distilbert-base-uncased](https://huggingface.co/distilbert-base-uncased) on an unknown dataset.
 
 
18
  It achieves the following results on the evaluation set:
19
  - Loss: 0.8244
20
  - Accuracy: 0.6617
21
 
22
  ## Model description
23
 
24
- More information needed
 
 
 
25
 
26
  ## Intended uses & limitations
27
 
28
- More information needed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  ## Training and evaluation data
31
 
32
- More information needed
 
 
 
 
 
 
33
 
34
  ## Training procedure
35
 
@@ -57,5 +83,4 @@ The following hyperparameters were used during training:
57
  - Transformers 4.18.0
58
  - Pytorch 1.11.0+cu113
59
  - Datasets 2.1.0
60
- - Tokenizers 0.12.1
61
-
 
5
  metrics:
6
  - accuracy
7
  model-index:
8
+ - name: distilbert-base-uncased-finetuned-mnli-amazon-query-shopping
9
  results: []
10
  ---
11
 
12
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
13
  should probably proofread and complete it, then remove this comment. -->
14
 
15
+ # distilbert-base-uncased-finetuned-mnli-amazon-query-shopping
16
 
17
+ This model is a fine-tuned version of [distilbert-base-uncased](https://huggingface.co/distilbert-base-uncased) on an [Amazon shopping query dataset](https://www.aicrowd.com/challenges/esci-challenge-for-improving-product-search). The code for the fine-tuning process can be found
18
+ [here](https://github.com/vanderbilt-data-science/sna). This model is uncased: it does
19
+ not make a difference between english and English.
20
  It achieves the following results on the evaluation set:
21
  - Loss: 0.8244
22
  - Accuracy: 0.6617
23
 
24
  ## Model description
25
 
26
+ DistilBERT is a transformers model, smaller and faster than BERT, which was pretrained on the same corpus in a
27
+ self-supervised fashion, using the BERT base model as a teacher. This means it was pretrained on the raw texts only,
28
+ with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic
29
+ process to generate inputs and labels from those texts using the BERT base model. We replaced its head with our shopping relevance category to fine-tune it on 571,223 rows of training set while validate it on 142,806 rows of dev set. Finally, we evaluated our model performance on a held-out test set: 79,337 rows.
30
 
31
  ## Intended uses & limitations
32
 
33
+ DistilBERT is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked)
34
+ to make decisions, such as sequence classification, token classification, or question answering. This fine-tuned version of DistilBERT is used to predict the relevance between one query and one product description. It also can be used to rerank the relevance order of products given one query for the amazon platform or other e-commerce platforms.
35
+
36
+ The limitations are this trained model is focusing on queries and products on Amazon. If you apply this model to other domains, it may perform poorly.
37
+
38
+ ## How to use
39
+
40
+ You can use this model directly by downloading the trained weights and configurations like the below code snippet:
41
+
42
+ ```python
43
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
44
+
45
+ tokenizer = AutoTokenizer.from_pretrained("LiYuan/amazon-query-product-ranking")
46
+
47
+ model = AutoModelForSequenceClassification.from_pretrained("LiYuan/amazon-query-product-ranking")
48
+ ```
49
 
50
  ## Training and evaluation data
51
 
52
+ Download all the raw [dataset](https://www.aicrowd.com/challenges/esci-challenge-for-improving-product-search/dataset_files) from the Amazon KDD Cup website.
53
+
54
+ 1. Concatenate the all product attributes from the product dataset
55
+ 2. Join it with a training query dataset
56
+ 3. Stratified Split the merged data into 571,223-row training, 142,806-row validation, 79,337-row test set
57
+ 4. Train on the full training set
58
+
59
 
60
  ## Training procedure
61
 
 
83
  - Transformers 4.18.0
84
  - Pytorch 1.11.0+cu113
85
  - Datasets 2.1.0
86
+ - Tokenizers 0.12.1