Intel / bert-base-uncased-mrpc

huggingface.co
Total runs: 5.9K
24-hour runs: 0
7-day runs: 264
30-day runs: -319
Model's Last Updated: June 22 2024
text-classification

Introduction of bert-base-uncased-mrpc

Model Details of bert-base-uncased-mrpc

bert-base-uncased-mrpc

This model is a fine-tuned version of bert-base-uncased on the GLUE MRPC dataset . The GLUE MRPC dataset, from The Microsoft Research Paraphrase Corpus (Dolan & Brockett, 2005) is a corpus of sentence pairs automatically extracted from online news sources, with human annotations for whether the sentences in the pair are semantically equivalent.

It is a pretrained model on English language using a masked language modeling (MLM) objective. It was introduced in this paper BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding . This model, bert-base-uncased-mrpc, is uncased: it does not make a difference between "english" and "English" . Masked language modeling predicts a masked token in a sequence, and the model can attend to tokens bidirectionally. This means the model has full access to the tokens on the left and right. Masked language modeling is great for tasks that require a good contextual understanding of an entire sequence. BERT is an example of a masked language model. For this model, you don’t need labels (also known as an unsupervised task) because the next word (MLM) is the label BERT base model (uncased)

It provides:

  • Masked language modeling (MLM): taking a sentence, the model randomly masks 15% of the words in the input then run the entire masked sentence through the model and has to predict the masked words. This is different from traditional recurrent neural networks (RNNs) that usually see the words one after the other, or from autoregressive models like GPT which internally masks the future tokens. It allows the model to learn a bidirectional representation of the sentence.
  • Next sentence prediction (NSP): the models concatenates two masked sentences as inputs during pretraining. Sometimes they correspond to sentences that were next to each other in the original text, sometimes not. The model then has to predict if the two sentences were following each other or not.

Results

It achieves the following results on the evaluation set:

  • Loss: 0.6978
  • Accuracy: 0.8603
  • F1: 0.9042
  • Combined Score: 0.8822
Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 2e-05
  • train_batch_size: 16
  • eval_batch_size: 8
  • seed: 42
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • num_epochs: 5.0
Framework versions
  • Transformers 4.17.0
  • Pytorch 1.10.0+cu102
  • Datasets 1.14.0
  • Tokenizers 0.11.6

To use:

from transformers import BertTokenizer, BertModel
tokenizer = BertTokenizer.from_pretrained('Intel/bert-base-uncased-mrpc')
model = BertModel.from_pretrained("Intel/bert-base-uncased-mrpc")
text = "The inspector analyzed the soundness in the building."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
# print BaseModelOutputWithPoolingAndCrossAttentions and  pooler_output

# Print tokens * ids in of inmput string below
print('Tokenized Text: ', tokenizer.tokenize(text), '\n')
print('Token IDs: ', tokenizer.convert_tokens_to_ids(tokenizer.tokenize(text)))

#Print tokens in text
encoded_input['input_ids'][0]
tokenizer.convert_ids_to_tokens(encoded_input['input_ids'][0])

Output similar to:

BaseModelOutputWithPoolingAndCrossAttentions(last_hidden_state=tensor([[[ 0.0219,  0.1258, -0.8529,  ...,  0.6416,  0.6275,  0.5583],
         [ 0.3125, -0.1921, -0.9895,  ...,  0.6069,  1.8431, -0.5939],
         [ 0.6147, -0.6098, -0.3517,  ..., -0.1145,  1.1748, -0.7104],
         ...,
         [ 0.8959, -0.2324, -0.6311,  ...,  0.2424,  0.1025,  0.2101],
         [ 0.2484, -0.3004, -0.9474,  ...,  1.0401,  0.5493, -0.4170],
         [ 0.8206,  0.2023, -0.7929,  ...,  0.7073,  0.0779, -0.2781]]],
       grad_fn=<NativeLayerNormBackward0>), pooler_output=tensor([[-0.7867,  0.1878, -0.8186,  0.8494,  0.4263,  0.5157,  0.9564,  0.1514,
         -0.9176, -0.9994,  0.2962,  0.2891, -0.3301,  0.8786,  0.9234, -0.7643,
          0.2487, -0.5245, -0.0649, -0.6722,  0.8550,  1.0000, -0.7785,  0.5322,
          0.6056,  0.4622,  0.2838,  0.5501,  0.6981,  0.2597, -0.7896, -0.1189,

Related work on QuantizationAwareTraining

An Int8 Quantized version of this model can be found link

This is an INT8 PyTorch model quantized with huggingface/optimum-intel through the usage of Intel® Neural Compressor.

Ethical Considerations and Limitations

bert-base-uncased-mrpc can produce factually incorrect output, and should not be relied on to produce factually accurate information. Because of the limitations of the pretrained model and the finetuning datasets, it is possible that this model could generate lewd, biased or otherwise offensive outputs.

Therefore, before deploying any applications of bert-base-uncased-mrpc, developers should perform safety testing.

Caveats and Recommendations

Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.

Here are a couple of useful links to learn more about Intel's AI software:

  • Intel Neural Compressor link
  • Intel Extension for Transformers link

Disclaimer

The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please cosult an attorney before using this model for commercial purposes.

BibTeX entry and citation info

@article{DBLP:journals/corr/abs-1810-04805,
  author    = {Jacob Devlin and
               Ming{-}Wei Chang and
               Kenton Lee and
               Kristina Toutanova},
  title     = {{BERT:} Pre-training of Deep Bidirectional Transformers for Language
               Understanding},
  journal   = {CoRR},
  volume    = {abs/1810.04805},
  year      = {2018},
  url       = {http://arxiv.org/abs/1810.04805},
  archivePrefix = {arXiv},
  eprint    = {1810.04805},
  timestamp = {Tue, 30 Oct 2018 20:39:56 +0100},
  biburl    = {https://dblp.org/rec/journals/corr/abs-1810-04805.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

Runs of Intel bert-base-uncased-mrpc on huggingface.co

5.9K
Total runs
0
24-hour runs
205
3-day runs
264
7-day runs
-319
30-day runs

More Information About bert-base-uncased-mrpc huggingface.co Model

More bert-base-uncased-mrpc license Visit here:

https://choosealicense.com/licenses/apache-2.0

bert-base-uncased-mrpc huggingface.co

bert-base-uncased-mrpc huggingface.co is an AI model on huggingface.co that provides bert-base-uncased-mrpc's model effect (), which can be used instantly with this Intel bert-base-uncased-mrpc model. huggingface.co supports a free trial of the bert-base-uncased-mrpc model, and also provides paid use of the bert-base-uncased-mrpc. Support call bert-base-uncased-mrpc model through api, including Node.js, Python, http.

bert-base-uncased-mrpc huggingface.co Url

https://huggingface.co/Intel/bert-base-uncased-mrpc

Intel bert-base-uncased-mrpc online free

bert-base-uncased-mrpc huggingface.co is an online trial and call api platform, which integrates bert-base-uncased-mrpc's modeling effects, including api services, and provides a free online trial of bert-base-uncased-mrpc, you can try bert-base-uncased-mrpc online for free by clicking the link below.

Intel bert-base-uncased-mrpc online free url in huggingface.co:

https://huggingface.co/Intel/bert-base-uncased-mrpc

bert-base-uncased-mrpc install

bert-base-uncased-mrpc is an open source model from GitHub that offers a free installation service, and any user can find bert-base-uncased-mrpc on GitHub to install. At the same time, huggingface.co provides the effect of bert-base-uncased-mrpc install, users can directly use bert-base-uncased-mrpc installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

bert-base-uncased-mrpc install url in huggingface.co:

https://huggingface.co/Intel/bert-base-uncased-mrpc

Url of bert-base-uncased-mrpc

bert-base-uncased-mrpc huggingface.co Url

Provider of bert-base-uncased-mrpc huggingface.co

Intel
ORGANIZATIONS

Other API from Intel

huggingface.co

Total runs: 475.4K
Run Growth: -44.0K
Growth Rate: -9.37%
Updated:February 09 2024
huggingface.co

Total runs: 60.8K
Run Growth: -29.7K
Growth Rate: -48.54%
Updated:February 24 2024
huggingface.co

Total runs: 4.4K
Run Growth: -1.9K
Growth Rate: -42.43%
Updated:June 12 2024
huggingface.co

Total runs: 3.5K
Run Growth: -48
Growth Rate: -1.43%
Updated:March 26 2024
huggingface.co

Total runs: 1.5K
Run Growth: 284
Growth Rate: 18.92%
Updated:May 20 2024
huggingface.co

Total runs: 1.0K
Run Growth: 628
Growth Rate: 61.75%
Updated:March 29 2024
huggingface.co

Total runs: 685
Run Growth: 129
Growth Rate: 18.83%
Updated:February 24 2025
huggingface.co

Total runs: 530
Run Growth: 68
Growth Rate: 28.45%
Updated:March 01 2024
huggingface.co

Total runs: 303
Run Growth: -59
Growth Rate: -21.07%
Updated:May 20 2024
huggingface.co

Total runs: 248
Run Growth: 200
Growth Rate: 91.74%
Updated:September 07 2023