tarekziade commited on
Commit
9dd7584
1 Parent(s): 57bd9f7

added onnx

Browse files
README.md CHANGED
@@ -2,44 +2,48 @@
2
  license: apache-2.0
3
  base_model: distilbert-base-cased
4
  tags:
5
- - generated_from_trainer
6
- - news_classification
7
- - multi_label
8
  datasets:
9
- - reuters21578
10
  metrics:
11
- - f1
12
- - accuracy
13
  model-index:
14
- - name: distilbert-finetuned-reuters21578-multilabel
15
- results:
16
- - task:
17
- name: Text Classification
18
- type: text-classification
19
- dataset:
20
- name: reuters21578
21
- type: reuters21578
22
- config: ModApte
23
- split: test
24
- args: ModApte
25
- metrics:
26
- - name: F1
27
- type: f1
28
- value: 0.8628858578607322
29
- - name: Accuracy
30
- type: accuracy
31
- value: 0.8195625759416768
32
  language:
33
- - en
34
  pipeline_tag: text-classification
35
  widget:
36
- - text: "JAPAN TO REVISE LONG-TERM ENERGY DEMAND DOWNWARDS The Ministry of International Trade and Industry (MITI) will revise its long-term energy supply/demand outlook by August to meet a forecast downtrend in Japanese energy demand, ministry officials said. MITI is expected to lower the projection for primary energy supplies in the year 2000 to 550 mln kilolitres (kl) from 600 mln, they said. The decision follows the emergence of structural changes in Japanese industry following the rise in the value of the yen and a decline in domestic electric power demand. MITI is planning to work out a revised energy supply/demand outlook through deliberations of committee meetings of the Agency of Natural Resources and Energy, the officials said. They said MITI will also review the breakdown of energy supply sources, including oil, nuclear, coal and natural gas. Nuclear energy provided the bulk of Japan's electric power in the fiscal year ended March 31, supplying an estimated 27 pct on a kilowatt/hour basis, followed by oil (23 pct) and liquefied natural gas (21 pct), they noted. REUTER"
37
- example_title: "Example-1"
38
  ---
39
 
40
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
41
  should probably proofread and complete it, then remove this comment. -->
42
 
 
 
 
 
43
  ## Motivation
44
 
45
  Fine-tuning on the Reuters-21578 multilabel dataset is a valuable exercise, especially as it's frequently used in take-home tests during interviews. The dataset's complexity is just right for testing multilabel classification skills within a limited timeframe, while its real-world relevance helps simulate practical challenges. Experimenting with this dataset not only helps candidates prepare for interviews but also hones various skills including preprocessing, feature extraction, and model evaluation.
@@ -92,15 +96,14 @@ nat-gas 0.8600426316261292
92
 
93
  ```
94
 
95
-
96
  ## Overall Summary and Comparison Table
97
 
98
- | Metric | Baseline (Scikit-learn) | Transformer Model |
99
- |-----------------------|--------------------------|-------------------|
100
- | Micro-Averaged F1 | 0.77 | 0.86 |
101
- | Macro-Averaged F1 | 0.29 | 0.33 |
102
- | Weighted Average F1 | 0.70 | 0.84 |
103
- | Samples Average F1 | 0.75 | 0.80 |
104
 
105
  **Precision vs Recall**: Both models prioritize high precision over recall. In our client-facing news classification model, precision takes precedence over recall. This is because the repercussions of false positives are more severe and harder to justify to clients compared to false negatives. When the model incorrectly tags a news item with a topic, it's challenging to explain this error. On the other hand, if the model misses a topic, it's easier to defend by stating that the topic wasn't sufficiently emphasized in the news article.
106
 
@@ -112,7 +115,6 @@ nat-gas 0.8600426316261292
112
 
113
  **Conclusion**: While both models exhibit high precision, which is a business requirement, the transformer model slightly outperforms the scikit-learn baseline model in all metrics considered. It provides a better trade-off between precision and recall, as well as some improvement, albeit small, in handling minority classes. Thus, despite sharing similar weaknesses with the baseline, the transformer model demonstrates incremental improvements that could be significant in a production setting.
114
 
115
-
116
  ## Training and evaluation data
117
 
118
  We remove single appearance label from both training and test sets using the following code:
@@ -150,7 +152,6 @@ print(f"We have {len(unique_labels)} unique labels:\n{unique_labels}")
150
  {'veg-oil', 'gold', 'platinum', 'ipi', 'acq', 'carcass', 'wool', 'coconut-oil', 'linseed', 'copper', 'soy-meal', 'jet', 'dlr', 'copra-cake', 'hog', 'rand', 'strategic-metal', 'can', 'tea', 'sorghum', 'livestock', 'barley', 'lumber', 'earn', 'wheat', 'trade', 'soy-oil', 'cocoa', 'inventories', 'income', 'rubber', 'tin', 'iron-steel', 'ship', 'rapeseed', 'wpi', 'sun-oil', 'pet-chem', 'palmkernel', 'nat-gas', 'gnp', 'l-cattle', 'propane', 'rice', 'lead', 'alum', 'instal-debt', 'saudriyal', 'cpu', 'jobs', 'meal-feed', 'oilseed', 'dmk', 'plywood', 'zinc', 'retail', 'dfl', 'cpi', 'crude', 'pork-belly', 'gas', 'money-fx', 'corn', 'tapioca', 'palladium', 'lei', 'cornglutenfeed', 'sunseed', 'potato', 'silver', 'sugar', 'grain', 'groundnut', 'naphtha', 'orange', 'soybean', 'coconut', 'stg', 'cotton', 'yen', 'rape-oil', 'palm-oil', 'oat', 'reserves', 'housing', 'interest', 'coffee', 'fuel', 'austdlr', 'money-supply', 'heat', 'fishmeal', 'bop', 'nickel', 'nzdlr'}
151
  ```
152
 
153
-
154
  ## Training procedure
155
 
156
  [EDA on Reuters-21578 dataset](https://github.com/LxYuan0420/nlp/blob/main/notebooks/eda_reuters.ipynb):
@@ -164,12 +165,14 @@ This notebook delves into advanced text classification using a Transformer model
164
 
165
  [Multilabel Stratified Sampling & Hypyerparameter Search on Reuters Dataset](https://github.com/LxYuan0420/nlp/blob/main/notebooks/transformer_reuters_hyperparameter_tuning.ipynb):
166
  In this notebook, we explore advanced machine learning techniques through the lens of the Hugging Face Trainer API, specifically targeting Multilabel Iterative Stratified Splitting and Hyperparameter Search. The former aims to fairly distribute imbalanced datasets across multiple labels in k-fold cross-validation, maintaining a distribution closely resembling that of the complete dataset. The latter walks users through a structured hyperparameter search to fine-tune model performance for optimal results.
 
167
  ## Evaluation results
 
168
  <details>
169
  <summary>Transformer Model Evaluation Result</summary>
170
 
171
  Classification Report:
172
- precision recall f1-score support
173
 
174
  acq 0.97 0.93 0.95 719
175
  alum 1.00 0.70 0.82 23
@@ -269,11 +272,11 @@ Classification Report:
269
 
270
  micro avg 0.92 0.81 0.86 3694
271
  macro avg 0.41 0.30 0.33 3694
272
- weighted avg 0.87 0.81 0.84 3694
273
- samples avg 0.81 0.80 0.80 3694
274
 
275
- </details>
 
276
 
 
277
 
278
  <details>
279
  <summary>Scikit-learn Baseline Model Evaluation Result</summary>
@@ -378,14 +381,16 @@ Classification Report:
378
 
379
  micro avg 0.97 0.64 0.77 3694
380
  macro avg 0.98 0.25 0.29 3694
381
- weighted avg 0.96 0.64 0.70 3694
382
- samples avg 0.98 0.74 0.75 3694
 
 
383
  </details>
384
 
385
-
386
  ### Training hyperparameters
387
 
388
  The following hyperparameters were used during training:
 
389
  - learning_rate: 2e-05
390
  - train_batch_size: 32
391
  - eval_batch_size: 32
@@ -396,33 +401,32 @@ The following hyperparameters were used during training:
396
 
397
  ### Training results
398
 
399
- | Training Loss | Epoch | Step | Validation Loss | F1 | Roc Auc | Accuracy |
400
- |:-------------:|:-----:|:----:|:---------------:|:------:|:-------:|:--------:|
401
- | 0.1801 | 1.0 | 300 | 0.0439 | 0.3896 | 0.6210 | 0.3566 |
402
- | 0.0345 | 2.0 | 600 | 0.0287 | 0.6289 | 0.7318 | 0.5954 |
403
- | 0.0243 | 3.0 | 900 | 0.0219 | 0.6721 | 0.7579 | 0.6084 |
404
- | 0.0178 | 4.0 | 1200 | 0.0177 | 0.7505 | 0.8128 | 0.6908 |
405
- | 0.014 | 5.0 | 1500 | 0.0151 | 0.7905 | 0.8376 | 0.7278 |
406
- | 0.0115 | 6.0 | 1800 | 0.0135 | 0.8132 | 0.8589 | 0.7555 |
407
- | 0.0096 | 7.0 | 2100 | 0.0124 | 0.8291 | 0.8727 | 0.7725 |
408
- | 0.0082 | 8.0 | 2400 | 0.0124 | 0.8335 | 0.8757 | 0.7822 |
409
- | 0.0071 | 9.0 | 2700 | 0.0119 | 0.8392 | 0.8847 | 0.7883 |
410
- | 0.0064 | 10.0 | 3000 | 0.0123 | 0.8339 | 0.8810 | 0.7828 |
411
- | 0.0058 | 11.0 | 3300 | 0.0114 | 0.8538 | 0.8999 | 0.8047 |
412
- | 0.0053 | 12.0 | 3600 | 0.0113 | 0.8525 | 0.8967 | 0.8044 |
413
- | 0.0048 | 13.0 | 3900 | 0.0115 | 0.8520 | 0.8982 | 0.8029 |
414
- | 0.0045 | 14.0 | 4200 | 0.0111 | 0.8566 | 0.8962 | 0.8104 |
415
- | 0.0042 | 15.0 | 4500 | 0.0110 | 0.8610 | 0.9060 | 0.8165 |
416
- | 0.0039 | 16.0 | 4800 | 0.0112 | 0.8583 | 0.9021 | 0.8138 |
417
- | 0.0037 | 17.0 | 5100 | 0.0110 | 0.8620 | 0.9055 | 0.8196 |
418
- | 0.0035 | 18.0 | 5400 | 0.0110 | 0.8629 | 0.9063 | 0.8196 |
419
- | 0.0035 | 19.0 | 5700 | 0.0111 | 0.8624 | 0.9062 | 0.8180 |
420
- | 0.0034 | 20.0 | 6000 | 0.0111 | 0.8626 | 0.9055 | 0.8177 |
421
-
422
 
423
  ### Framework versions
424
 
425
  - Transformers 4.33.0.dev0
426
  - Pytorch 2.0.1+cu117
427
  - Datasets 2.14.3
428
- - Tokenizers 0.13.3
 
2
  license: apache-2.0
3
  base_model: distilbert-base-cased
4
  tags:
5
+ - generated_from_trainer
6
+ - news_classification
7
+ - multi_label
8
  datasets:
9
+ - reuters21578
10
  metrics:
11
+ - f1
12
+ - accuracy
13
  model-index:
14
+ - name: distilbert-finetuned-reuters21578-multilabel
15
+ results:
16
+ - task:
17
+ name: Text Classification
18
+ type: text-classification
19
+ dataset:
20
+ name: reuters21578
21
+ type: reuters21578
22
+ config: ModApte
23
+ split: test
24
+ args: ModApte
25
+ metrics:
26
+ - name: F1
27
+ type: f1
28
+ value: 0.8628858578607322
29
+ - name: Accuracy
30
+ type: accuracy
31
+ value: 0.8195625759416768
32
  language:
33
+ - en
34
  pipeline_tag: text-classification
35
  widget:
36
+ - text: "JAPAN TO REVISE LONG-TERM ENERGY DEMAND DOWNWARDS The Ministry of International Trade and Industry (MITI) will revise its long-term energy supply/demand outlook by August to meet a forecast downtrend in Japanese energy demand, ministry officials said. MITI is expected to lower the projection for primary energy supplies in the year 2000 to 550 mln kilolitres (kl) from 600 mln, they said. The decision follows the emergence of structural changes in Japanese industry following the rise in the value of the yen and a decline in domestic electric power demand. MITI is planning to work out a revised energy supply/demand outlook through deliberations of committee meetings of the Agency of Natural Resources and Energy, the officials said. They said MITI will also review the breakdown of energy supply sources, including oil, nuclear, coal and natural gas. Nuclear energy provided the bulk of Japan's electric power in the fiscal year ended March 31, supplying an estimated 27 pct on a kilowatt/hour basis, followed by oil (23 pct) and liquefied natural gas (21 pct), they noted. REUTER"
37
+ example_title: "Example-1"
38
  ---
39
 
40
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
41
  should probably proofread and complete it, then remove this comment. -->
42
 
43
+ ## Origin of this model
44
+
45
+ This model was forked from https://huggingface.co/lxyuan/distilbert-finetuned-reuters21578-multilabel -- I just generated the onnx versions in /onnx
46
+
47
  ## Motivation
48
 
49
  Fine-tuning on the Reuters-21578 multilabel dataset is a valuable exercise, especially as it's frequently used in take-home tests during interviews. The dataset's complexity is just right for testing multilabel classification skills within a limited timeframe, while its real-world relevance helps simulate practical challenges. Experimenting with this dataset not only helps candidates prepare for interviews but also hones various skills including preprocessing, feature extraction, and model evaluation.
 
96
 
97
  ```
98
 
 
99
  ## Overall Summary and Comparison Table
100
 
101
+ | Metric | Baseline (Scikit-learn) | Transformer Model |
102
+ | ------------------- | ----------------------- | ----------------- |
103
+ | Micro-Averaged F1 | 0.77 | 0.86 |
104
+ | Macro-Averaged F1 | 0.29 | 0.33 |
105
+ | Weighted Average F1 | 0.70 | 0.84 |
106
+ | Samples Average F1 | 0.75 | 0.80 |
107
 
108
  **Precision vs Recall**: Both models prioritize high precision over recall. In our client-facing news classification model, precision takes precedence over recall. This is because the repercussions of false positives are more severe and harder to justify to clients compared to false negatives. When the model incorrectly tags a news item with a topic, it's challenging to explain this error. On the other hand, if the model misses a topic, it's easier to defend by stating that the topic wasn't sufficiently emphasized in the news article.
109
 
 
115
 
116
  **Conclusion**: While both models exhibit high precision, which is a business requirement, the transformer model slightly outperforms the scikit-learn baseline model in all metrics considered. It provides a better trade-off between precision and recall, as well as some improvement, albeit small, in handling minority classes. Thus, despite sharing similar weaknesses with the baseline, the transformer model demonstrates incremental improvements that could be significant in a production setting.
117
 
 
118
  ## Training and evaluation data
119
 
120
  We remove single appearance label from both training and test sets using the following code:
 
152
  {'veg-oil', 'gold', 'platinum', 'ipi', 'acq', 'carcass', 'wool', 'coconut-oil', 'linseed', 'copper', 'soy-meal', 'jet', 'dlr', 'copra-cake', 'hog', 'rand', 'strategic-metal', 'can', 'tea', 'sorghum', 'livestock', 'barley', 'lumber', 'earn', 'wheat', 'trade', 'soy-oil', 'cocoa', 'inventories', 'income', 'rubber', 'tin', 'iron-steel', 'ship', 'rapeseed', 'wpi', 'sun-oil', 'pet-chem', 'palmkernel', 'nat-gas', 'gnp', 'l-cattle', 'propane', 'rice', 'lead', 'alum', 'instal-debt', 'saudriyal', 'cpu', 'jobs', 'meal-feed', 'oilseed', 'dmk', 'plywood', 'zinc', 'retail', 'dfl', 'cpi', 'crude', 'pork-belly', 'gas', 'money-fx', 'corn', 'tapioca', 'palladium', 'lei', 'cornglutenfeed', 'sunseed', 'potato', 'silver', 'sugar', 'grain', 'groundnut', 'naphtha', 'orange', 'soybean', 'coconut', 'stg', 'cotton', 'yen', 'rape-oil', 'palm-oil', 'oat', 'reserves', 'housing', 'interest', 'coffee', 'fuel', 'austdlr', 'money-supply', 'heat', 'fishmeal', 'bop', 'nickel', 'nzdlr'}
153
  ```
154
 
 
155
  ## Training procedure
156
 
157
  [EDA on Reuters-21578 dataset](https://github.com/LxYuan0420/nlp/blob/main/notebooks/eda_reuters.ipynb):
 
165
 
166
  [Multilabel Stratified Sampling & Hypyerparameter Search on Reuters Dataset](https://github.com/LxYuan0420/nlp/blob/main/notebooks/transformer_reuters_hyperparameter_tuning.ipynb):
167
  In this notebook, we explore advanced machine learning techniques through the lens of the Hugging Face Trainer API, specifically targeting Multilabel Iterative Stratified Splitting and Hyperparameter Search. The former aims to fairly distribute imbalanced datasets across multiple labels in k-fold cross-validation, maintaining a distribution closely resembling that of the complete dataset. The latter walks users through a structured hyperparameter search to fine-tune model performance for optimal results.
168
+
169
  ## Evaluation results
170
+
171
  <details>
172
  <summary>Transformer Model Evaluation Result</summary>
173
 
174
  Classification Report:
175
+ precision recall f1-score support
176
 
177
  acq 0.97 0.93 0.95 719
178
  alum 1.00 0.70 0.82 23
 
272
 
273
  micro avg 0.92 0.81 0.86 3694
274
  macro avg 0.41 0.30 0.33 3694
 
 
275
 
276
+ weighted avg 0.87 0.81 0.84 3694
277
+ samples avg 0.81 0.80 0.80 3694
278
 
279
+ </details>
280
 
281
  <details>
282
  <summary>Scikit-learn Baseline Model Evaluation Result</summary>
 
381
 
382
  micro avg 0.97 0.64 0.77 3694
383
  macro avg 0.98 0.25 0.29 3694
384
+
385
+ weighted avg 0.96 0.64 0.70 3694
386
+ samples avg 0.98 0.74 0.75 3694
387
+
388
  </details>
389
 
 
390
  ### Training hyperparameters
391
 
392
  The following hyperparameters were used during training:
393
+
394
  - learning_rate: 2e-05
395
  - train_batch_size: 32
396
  - eval_batch_size: 32
 
401
 
402
  ### Training results
403
 
404
+ | Training Loss | Epoch | Step | Validation Loss | F1 | Roc Auc | Accuracy |
405
+ | :-----------: | :---: | :--: | :-------------: | :----: | :-----: | :------: |
406
+ | 0.1801 | 1.0 | 300 | 0.0439 | 0.3896 | 0.6210 | 0.3566 |
407
+ | 0.0345 | 2.0 | 600 | 0.0287 | 0.6289 | 0.7318 | 0.5954 |
408
+ | 0.0243 | 3.0 | 900 | 0.0219 | 0.6721 | 0.7579 | 0.6084 |
409
+ | 0.0178 | 4.0 | 1200 | 0.0177 | 0.7505 | 0.8128 | 0.6908 |
410
+ | 0.014 | 5.0 | 1500 | 0.0151 | 0.7905 | 0.8376 | 0.7278 |
411
+ | 0.0115 | 6.0 | 1800 | 0.0135 | 0.8132 | 0.8589 | 0.7555 |
412
+ | 0.0096 | 7.0 | 2100 | 0.0124 | 0.8291 | 0.8727 | 0.7725 |
413
+ | 0.0082 | 8.0 | 2400 | 0.0124 | 0.8335 | 0.8757 | 0.7822 |
414
+ | 0.0071 | 9.0 | 2700 | 0.0119 | 0.8392 | 0.8847 | 0.7883 |
415
+ | 0.0064 | 10.0 | 3000 | 0.0123 | 0.8339 | 0.8810 | 0.7828 |
416
+ | 0.0058 | 11.0 | 3300 | 0.0114 | 0.8538 | 0.8999 | 0.8047 |
417
+ | 0.0053 | 12.0 | 3600 | 0.0113 | 0.8525 | 0.8967 | 0.8044 |
418
+ | 0.0048 | 13.0 | 3900 | 0.0115 | 0.8520 | 0.8982 | 0.8029 |
419
+ | 0.0045 | 14.0 | 4200 | 0.0111 | 0.8566 | 0.8962 | 0.8104 |
420
+ | 0.0042 | 15.0 | 4500 | 0.0110 | 0.8610 | 0.9060 | 0.8165 |
421
+ | 0.0039 | 16.0 | 4800 | 0.0112 | 0.8583 | 0.9021 | 0.8138 |
422
+ | 0.0037 | 17.0 | 5100 | 0.0110 | 0.8620 | 0.9055 | 0.8196 |
423
+ | 0.0035 | 18.0 | 5400 | 0.0110 | 0.8629 | 0.9063 | 0.8196 |
424
+ | 0.0035 | 19.0 | 5700 | 0.0111 | 0.8624 | 0.9062 | 0.8180 |
425
+ | 0.0034 | 20.0 | 6000 | 0.0111 | 0.8626 | 0.9055 | 0.8177 |
 
426
 
427
  ### Framework versions
428
 
429
  - Transformers 4.33.0.dev0
430
  - Pytorch 2.0.1+cu117
431
  - Datasets 2.14.3
432
+ - Tokenizers 0.13.3
onnx/config.json ADDED
@@ -0,0 +1,220 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "lxyuan/distilbert-finetuned-reuters21578-multilabel",
3
+ "activation": "gelu",
4
+ "architectures": [
5
+ "DistilBertForSequenceClassification"
6
+ ],
7
+ "attention_dropout": 0.1,
8
+ "dim": 768,
9
+ "dropout": 0.1,
10
+ "hidden_dim": 3072,
11
+ "id2label": {
12
+ "0": "acq",
13
+ "1": "alum",
14
+ "2": "austdlr",
15
+ "3": "barley",
16
+ "4": "bop",
17
+ "5": "can",
18
+ "6": "carcass",
19
+ "7": "cocoa",
20
+ "8": "coconut",
21
+ "9": "coconut-oil",
22
+ "10": "coffee",
23
+ "11": "copper",
24
+ "12": "copra-cake",
25
+ "13": "corn",
26
+ "14": "cornglutenfeed",
27
+ "15": "cotton",
28
+ "16": "cpi",
29
+ "17": "cpu",
30
+ "18": "crude",
31
+ "19": "dfl",
32
+ "20": "dlr",
33
+ "21": "dmk",
34
+ "22": "earn",
35
+ "23": "fishmeal",
36
+ "24": "fuel",
37
+ "25": "gas",
38
+ "26": "gnp",
39
+ "27": "gold",
40
+ "28": "grain",
41
+ "29": "groundnut",
42
+ "30": "heat",
43
+ "31": "hog",
44
+ "32": "housing",
45
+ "33": "income",
46
+ "34": "instal-debt",
47
+ "35": "interest",
48
+ "36": "inventories",
49
+ "37": "ipi",
50
+ "38": "iron-steel",
51
+ "39": "jet",
52
+ "40": "jobs",
53
+ "41": "l-cattle",
54
+ "42": "lead",
55
+ "43": "lei",
56
+ "44": "linseed",
57
+ "45": "livestock",
58
+ "46": "lumber",
59
+ "47": "meal-feed",
60
+ "48": "money-fx",
61
+ "49": "money-supply",
62
+ "50": "naphtha",
63
+ "51": "nat-gas",
64
+ "52": "nickel",
65
+ "53": "nzdlr",
66
+ "54": "oat",
67
+ "55": "oilseed",
68
+ "56": "orange",
69
+ "57": "palladium",
70
+ "58": "palm-oil",
71
+ "59": "palmkernel",
72
+ "60": "pet-chem",
73
+ "61": "platinum",
74
+ "62": "plywood",
75
+ "63": "pork-belly",
76
+ "64": "potato",
77
+ "65": "propane",
78
+ "66": "rand",
79
+ "67": "rape-oil",
80
+ "68": "rapeseed",
81
+ "69": "reserves",
82
+ "70": "retail",
83
+ "71": "rice",
84
+ "72": "rubber",
85
+ "73": "saudriyal",
86
+ "74": "ship",
87
+ "75": "silver",
88
+ "76": "sorghum",
89
+ "77": "soy-meal",
90
+ "78": "soy-oil",
91
+ "79": "soybean",
92
+ "80": "stg",
93
+ "81": "strategic-metal",
94
+ "82": "sugar",
95
+ "83": "sun-oil",
96
+ "84": "sunseed",
97
+ "85": "tapioca",
98
+ "86": "tea",
99
+ "87": "tin",
100
+ "88": "trade",
101
+ "89": "veg-oil",
102
+ "90": "wheat",
103
+ "91": "wool",
104
+ "92": "wpi",
105
+ "93": "yen",
106
+ "94": "zinc"
107
+ },
108
+ "initializer_range": 0.02,
109
+ "label2id": {
110
+ "acq": 0,
111
+ "alum": 1,
112
+ "austdlr": 2,
113
+ "barley": 3,
114
+ "bop": 4,
115
+ "can": 5,
116
+ "carcass": 6,
117
+ "cocoa": 7,
118
+ "coconut": 8,
119
+ "coconut-oil": 9,
120
+ "coffee": 10,
121
+ "copper": 11,
122
+ "copra-cake": 12,
123
+ "corn": 13,
124
+ "cornglutenfeed": 14,
125
+ "cotton": 15,
126
+ "cpi": 16,
127
+ "cpu": 17,
128
+ "crude": 18,
129
+ "dfl": 19,
130
+ "dlr": 20,
131
+ "dmk": 21,
132
+ "earn": 22,
133
+ "fishmeal": 23,
134
+ "fuel": 24,
135
+ "gas": 25,
136
+ "gnp": 26,
137
+ "gold": 27,
138
+ "grain": 28,
139
+ "groundnut": 29,
140
+ "heat": 30,
141
+ "hog": 31,
142
+ "housing": 32,
143
+ "income": 33,
144
+ "instal-debt": 34,
145
+ "interest": 35,
146
+ "inventories": 36,
147
+ "ipi": 37,
148
+ "iron-steel": 38,
149
+ "jet": 39,
150
+ "jobs": 40,
151
+ "l-cattle": 41,
152
+ "lead": 42,
153
+ "lei": 43,
154
+ "linseed": 44,
155
+ "livestock": 45,
156
+ "lumber": 46,
157
+ "meal-feed": 47,
158
+ "money-fx": 48,
159
+ "money-supply": 49,
160
+ "naphtha": 50,
161
+ "nat-gas": 51,
162
+ "nickel": 52,
163
+ "nzdlr": 53,
164
+ "oat": 54,
165
+ "oilseed": 55,
166
+ "orange": 56,
167
+ "palladium": 57,
168
+ "palm-oil": 58,
169
+ "palmkernel": 59,
170
+ "pet-chem": 60,
171
+ "platinum": 61,
172
+ "plywood": 62,
173
+ "pork-belly": 63,
174
+ "potato": 64,
175
+ "propane": 65,
176
+ "rand": 66,
177
+ "rape-oil": 67,
178
+ "rapeseed": 68,
179
+ "reserves": 69,
180
+ "retail": 70,
181
+ "rice": 71,
182
+ "rubber": 72,
183
+ "saudriyal": 73,
184
+ "ship": 74,
185
+ "silver": 75,
186
+ "sorghum": 76,
187
+ "soy-meal": 77,
188
+ "soy-oil": 78,
189
+ "soybean": 79,
190
+ "stg": 80,
191
+ "strategic-metal": 81,
192
+ "sugar": 82,
193
+ "sun-oil": 83,
194
+ "sunseed": 84,
195
+ "tapioca": 85,
196
+ "tea": 86,
197
+ "tin": 87,
198
+ "trade": 88,
199
+ "veg-oil": 89,
200
+ "wheat": 90,
201
+ "wool": 91,
202
+ "wpi": 92,
203
+ "yen": 93,
204
+ "zinc": 94
205
+ },
206
+ "max_position_embeddings": 512,
207
+ "model_type": "distilbert",
208
+ "n_heads": 12,
209
+ "n_layers": 6,
210
+ "output_past": true,
211
+ "pad_token_id": 0,
212
+ "problem_type": "multi_label_classification",
213
+ "qa_dropout": 0.1,
214
+ "seq_classif_dropout": 0.2,
215
+ "sinusoidal_pos_embds": false,
216
+ "tie_weights_": true,
217
+ "torch_dtype": "float32",
218
+ "transformers_version": "4.36.1",
219
+ "vocab_size": 28996
220
+ }
onnx/model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6900e4173b045a757302d2d29ceb8351904e144a925076c3568ae0656a529f4c
3
+ size 263553912
onnx/model_quantized.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa39c07bf7646fb7f4faff0269a051b00f34812ad1374ae2acca338f7e06569d
3
+ size 66291698
onnx/ort_config.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "one_external_file": true,
3
+ "opset": null,
4
+ "optimization": {},
5
+ "optimum_version": "1.16.1",
6
+ "quantization": {
7
+ "activations_dtype": "QUInt8",
8
+ "activations_symmetric": false,
9
+ "format": "QOperator",
10
+ "is_static": false,
11
+ "mode": "IntegerOps",
12
+ "nodes_to_exclude": [],
13
+ "nodes_to_quantize": [],
14
+ "operators_to_quantize": [
15
+ "Conv",
16
+ "MatMul",
17
+ "Attention",
18
+ "LSTM",
19
+ "Gather",
20
+ "Transpose",
21
+ "EmbedLayerNormalization"
22
+ ],
23
+ "per_channel": false,
24
+ "qdq_add_pair_to_weight": false,
25
+ "qdq_dedicated_pair": false,
26
+ "qdq_op_type_per_channel_support_to_axis": {
27
+ "MatMul": 1
28
+ },
29
+ "reduce_range": false,
30
+ "weights_dtype": "QInt8",
31
+ "weights_symmetric": true
32
+ },
33
+ "transformers_version": "4.36.1",
34
+ "use_external_data_format": false
35
+ }
onnx/special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
onnx/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
onnx/tokenizer_config.json ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": true,
45
+ "cls_token": "[CLS]",
46
+ "do_lower_case": false,
47
+ "mask_token": "[MASK]",
48
+ "max_length": 512,
49
+ "model_max_length": 512,
50
+ "pad_to_multiple_of": null,
51
+ "pad_token": "[PAD]",
52
+ "pad_token_type_id": 0,
53
+ "padding_side": "right",
54
+ "sep_token": "[SEP]",
55
+ "stride": 0,
56
+ "strip_accents": null,
57
+ "tokenize_chinese_chars": true,
58
+ "tokenizer_class": "DistilBertTokenizer",
59
+ "truncation_side": "right",
60
+ "truncation_strategy": "longest_first",
61
+ "unk_token": "[UNK]"
62
+ }
onnx/vocab.txt ADDED
The diff for this file is too large to render. See raw diff