ydshieh HF staff commited on
Commit
c821edd
1 Parent(s): 220cbeb

commit files to HF hub

Browse files
Files changed (8) hide show
  1. README.md +10 -0
  2. config.json +21 -0
  3. log.txt +34 -0
  4. special_tokens_map.json +1 -0
  5. tf_model.h5 +3 -0
  6. tokenizer_config.json +1 -0
  7. train_args.json +25 -0
  8. vocab.txt +0 -0
README.md ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ ## TextAttack Model Card
2
+ This `bert-base-uncased` model was fine-tuned for sequence classification using TextAttack
3
+ and the yelp_polarity dataset loaded using the `nlp` library. The model was fine-tuned
4
+ for 5 epochs with a batch size of 16, a learning
5
+ rate of 5e-05, and a maximum sequence length of 256.
6
+ Since this was a classification task, the model was trained with a cross-entropy loss function.
7
+ The best score the model achieved on this task was 0.9699473684210527, as measured by the
8
+ eval set accuracy, found after 4 epochs.
9
+
10
+ For more information, check out [TextAttack on Github](https://github.com/QData/TextAttack).
config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertForSequenceClassification"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "finetuning_task": "yelp_polarity",
7
+ "gradient_checkpointing": false,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 768,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 3072,
13
+ "layer_norm_eps": 1e-12,
14
+ "max_position_embeddings": 512,
15
+ "model_type": "bert",
16
+ "num_attention_heads": 12,
17
+ "num_hidden_layers": 12,
18
+ "pad_token_id": 0,
19
+ "type_vocab_size": 2,
20
+ "vocab_size": 30522
21
+ }
log.txt ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Writing logs to /p/qdata/jm8wx/research/text_attacks/textattack/outputs/training/bert-base-uncased-yelp_polarity-2020-07-08-10:42/log.txt.
2
+ Loading nlp dataset yelp_polarity, split train.
3
+ Loading nlp dataset yelp_polarity, split test.
4
+ Loaded dataset. Found: 2 labels: ([0, 1])
5
+ Loading transformers AutoModelForSequenceClassification: bert-base-uncased
6
+ Tokenizing training data. (len: 560000)
7
+ Tokenizing eval data (len: 38000)
8
+ Loaded data and tokenized in 720.6436557769775s
9
+ Using torch.nn.DataParallel.
10
+ Training model across 4 GPUs
11
+ Wrote original training args to /p/qdata/jm8wx/research/text_attacks/textattack/outputs/training/bert-base-uncased-yelp_polarity-2020-07-08-10:42/train_args.json.
12
+ ***** Running training *****
13
+ Num examples = 560000
14
+ Batch size = 16
15
+ Max sequence length = 256
16
+ Num steps = 175000
17
+ Num epochs = 5
18
+ Learning rate = 5e-05
19
+ Eval accuracy: 95.95263157894736%
20
+ Best acc found. Saved model to /p/qdata/jm8wx/research/text_attacks/textattack/outputs/training/bert-base-uncased-yelp_polarity-2020-07-08-10:42/.
21
+ Eval accuracy: 96.59473684210526%
22
+ Best acc found. Saved model to /p/qdata/jm8wx/research/text_attacks/textattack/outputs/training/bert-base-uncased-yelp_polarity-2020-07-08-10:42/.
23
+ Eval accuracy: 96.69473684210527%
24
+ Best acc found. Saved model to /p/qdata/jm8wx/research/text_attacks/textattack/outputs/training/bert-base-uncased-yelp_polarity-2020-07-08-10:42/.
25
+ Eval accuracy: 96.91052631578947%
26
+ Best acc found. Saved model to /p/qdata/jm8wx/research/text_attacks/textattack/outputs/training/bert-base-uncased-yelp_polarity-2020-07-08-10:42/.
27
+ Eval accuracy: 96.99473684210527%
28
+ Best acc found. Saved model to /p/qdata/jm8wx/research/text_attacks/textattack/outputs/training/bert-base-uncased-yelp_polarity-2020-07-08-10:42/.
29
+ Finished training. Re-loading and evaluating model from disk.
30
+ Loading transformers AutoModelForSequenceClassification: bert-base-uncased
31
+ Eval of saved model accuracy: 96.99473684210527%
32
+ Saved tokenizer <textattack.models.tokenizers.auto_tokenizer.AutoTokenizer object at 0x7fcc548eb730> to /p/qdata/jm8wx/research/text_attacks/textattack/outputs/training/bert-base-uncased-yelp_polarity-2020-07-08-10:42/.
33
+ Wrote README to /p/qdata/jm8wx/research/text_attacks/textattack/outputs/training/bert-base-uncased-yelp_polarity-2020-07-08-10:42/README.md.
34
+ Wrote final training args to /p/qdata/jm8wx/research/text_attacks/textattack/outputs/training/bert-base-uncased-yelp_polarity-2020-07-08-10:42/train_args.json.
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]"}
tf_model.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e5e279bf9ed05eb5c2d9fe1810b893a7fb75a93b31a907931ae3e09b58ab52a
3
+ size 438223192
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"do_lower_case": true, "model_max_length": 512}
train_args.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": "bert-base-uncased",
3
+ "dataset": "yelp_polarity",
4
+ "dataset_train_split": "train",
5
+ "dataset_dev_split": "test",
6
+ "tb_writer_step": 1000,
7
+ "checkpoint_steps": -1,
8
+ "checkpoint_every_epoch": false,
9
+ "num_train_epochs": 5,
10
+ "early_stopping_epochs": -1,
11
+ "batch_size": 16,
12
+ "max_length": 256,
13
+ "learning_rate": 5e-05,
14
+ "grad_accum_steps": 1,
15
+ "warmup_proportion": 0.1,
16
+ "config_name": "config.json",
17
+ "weights_name": "pytorch_model.bin",
18
+ "enable_wandb": false,
19
+ "output_dir": "/p/qdata/jm8wx/research/text_attacks/textattack/outputs/training/bert-base-uncased-yelp_polarity-2020-07-08-10:42/",
20
+ "num_labels": 2,
21
+ "do_regression": false,
22
+ "best_eval_score": 0.9699473684210527,
23
+ "best_eval_score_epoch": 4,
24
+ "epochs_since_best_eval_score": 0
25
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff