Instructions to use textattack/bert-base-uncased-yelp-polarity with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use textattack/bert-base-uncased-yelp-polarity with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="textattack/bert-base-uncased-yelp-polarity")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("textattack/bert-base-uncased-yelp-polarity") model = AutoModelForSequenceClassification.from_pretrained("textattack/bert-base-uncased-yelp-polarity") - Inference
- Notebooks
- Google Colab
- Kaggle
File size: 776 Bytes
954843a 7012c18 954843a 7012c18 954843a 7012c18 954843a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | {
"model": "bert-base-uncased",
"dataset": "yelp_polarity",
"dataset_train_split": "train",
"dataset_dev_split": "test",
"tb_writer_step": 1000,
"checkpoint_steps": -1,
"checkpoint_every_epoch": false,
"num_train_epochs": 5,
"early_stopping_epochs": -1,
"batch_size": 16,
"max_length": 256,
"learning_rate": 5e-05,
"grad_accum_steps": 1,
"warmup_proportion": 0.1,
"config_name": "config.json",
"weights_name": "pytorch_model.bin",
"enable_wandb": false,
"output_dir": "/p/qdata/jm8wx/research/text_attacks/textattack/outputs/training/bert-base-uncased-yelp_polarity-2020-07-08-10:42/",
"num_labels": 2,
"do_regression": false,
"best_eval_score": 0.9699473684210527,
"best_eval_score_epoch": 4,
"epochs_since_best_eval_score": 0
}
|