
## Model description
This model is a fine-tuned version of the [bert-base-uncased](https://huggingface.co/transformers/model_doc/bert.html) model to classify the sentiment of yelp reviews. \
The BERT model is finetuned using adversarial training to boost robustness against textual adversarial attacks. 

## How to use

You can use the model with the following code.

```python
from transformers import BertForSequenceClassification, BertTokenizer, TextClassificationPipeline
model_path = "JiaqiLee/robust-bert-yelp"
tokenizer = BertTokenizer.from_pretrained(model_path)
model = BertForSequenceClassification.from_pretrained(model_path, num_labels=2)
pipeline = TextClassificationPipeline(model=model, tokenizer=tokenizer)
print(pipeline("Definitely a greasy spoon! Always packed here and always a wait but worth it."))
```

## Training data
The training data comes from Huggingface [yelp polarity dataset](https://huggingface.co/datasets/yelp_polarity). We use 90% of the `train.csv` data to train the model. \
We augment original training data with adversarial examples generated by PWWS, TextBugger and TextFooler.

## Evaluation results

The model achieves 0.9532 accuracy in yelp polarity test dataset.
{"language": ["en"], "license": "apache-2.0", "library_name": "transformers", "datasets": ["yelp_polarity"], "metrics": ["accuracy"], "pipeline_tag": "text-classification"}
transformers pytorch bert text-classification en dataset:yelp_polarity license:apache-2.0 autotrain_compatible endpoints_compatible region:us
TAGS
#transformers #pytorch #bert #text-classification #en #dataset-yelp_polarity #license-apache-2.0 #autotrain_compatible #endpoints_compatible #region-us 


## Model description
This model is a fine-tuned version of the bert-base-uncased model to classify the sentiment of yelp reviews. \
The BERT model is finetuned using adversarial training to boost robustness against textual adversarial attacks. 

## How to use

You can use the model with the following code.



## Training data
The training data comes from Huggingface yelp polarity dataset. We use 90% of the 'URL' data to train the model. \
We augment original training data with adversarial examples generated by PWWS, TextBugger and TextFooler.

## Evaluation results

The model achieves 0.9532 accuracy in yelp polarity test dataset.
## Model description
This model is a fine-tuned version of the bert-base-uncased model to classify the sentiment of yelp reviews. \
The BERT model is finetuned using adversarial training to boost robustness against textual adversarial attacks. ## How to use

You can use the model with the following code. ## Training data
The training data comes from Huggingface yelp polarity dataset. We use 90% of the 'URL' data to train the model. \
We augment original training data with adversarial examples generated by PWWS, TextBugger and TextFooler. ## Evaluation results

The model achieves 0.9532 accuracy in yelp polarity test dataset.
TAGS
#transformers #pytorch #bert #text-classification #en #dataset-yelp_polarity #license-apache-2.0 #autotrain_compatible #endpoints_compatible #region-us 
 ## Model description
This model is a fine-tuned version of the bert-base-uncased model to classify the sentiment of yelp reviews. \
The BERT model is finetuned using adversarial training to boost robustness against textual adversarial attacks. ## How to use

You can use the model with the following code. ## Training data
The training data comes from Huggingface yelp polarity dataset. We use 90% of the 'URL' data to train the model. \
We augment original training data with adversarial examples generated by PWWS, TextBugger and TextFooler. ## Evaluation results

The model achieves 0.9532 accuracy in yelp polarity test dataset.
TAGS
#transformers #pytorch #bert #text-classification #en #dataset-yelp_polarity #license-apache-2.0 #autotrain_compatible #endpoints_compatible #region-us 
## Model description
This model is a fine-tuned version of the bert-base-uncased model to classify the sentiment of yelp reviews. \
The BERT model is finetuned using adversarial training to boost robustness against textual adversarial attacks.## How to use

You can use the model with the following code.## Training data
The training data comes from Huggingface yelp polarity dataset. We use 90% of the 'URL' data to train the model. \
We augment original training data with adversarial examples generated by PWWS, TextBugger and TextFooler.## Evaluation results

The model achieves 0.9532 accuracy in yelp polarity test dataset.