readme: ---
  language: en
  license: apache-2.0
  datasets:
  - bookcorpus
  - wikipedia
  ---
  
  # ALBERT XXLarge v1
  
  Pretrained model on English language using a masked language modeling (MLM) objective. It was introduced in
  [this paper](https://arxiv.org/abs/1909.11942) and first released in
  [this repository](https://github.com/google-research/albert). This model, as all ALBERT models, is uncased: it does not make a difference
  between english and English.
  
  Disclaimer: The team releasing ALBERT did not write a model card for this model so this model card has been written by
  the Hugging Face team.
  
  ## Model description
  
  ALBERT is a transformers model pretrained on a large corpus of English data in a self-supervised fashion. This means it
  was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of
  publicly available data) with an automatic process to generate inputs and labels from those texts. More precisely, it
  was pretrained with two objectives:
  
  - 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 mask the future tokens. It allows the model to learn a bidirectional representation of the
    sentence.
  - Sentence Ordering Prediction (SOP): ALBERT uses a pretraining loss based on predicting the ordering of two consecutive segments of text.
  
  This way, the model learns an inner representation of the English language that can then be used to extract features
  useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standard
  classifier using the features produced by the ALBERT model as inputs.
  
  ALBERT is particular in that it shares its layers across its Transformer. Therefore, all layers have the same weights. Using repeating layers results in a small memory footprint, however, the computational cost remains similar to a BERT-like architecture with the same number of hidden layers as it has to iterate through the same number of (repeating) layers.
  
  This is the first version of the xxlarge model. Version 2 is different from version 1 due to different dropout rates, additional training data, and longer training. It has better results in nearly all downstream tasks.
  
  This model has the following configuration:
  
  - 12 repeating layers
  - 128 embedding dimension
  - 4096 hidden dimension
  - 64 attention heads
  - 223M parameters
  
  ## Intended uses & limitations
  
  You can use the raw model for either masked language modeling or next sentence prediction, but it's mostly intended to
  be fine-tuned on a downstream task. See the [model hub](https://huggingface.co/models?filter=albert) to look for
  fine-tuned versions on a task that interests you.
  
  Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked)
  to make decisions, such as sequence classification, token classification or question answering. For tasks such as text
  generation you should look at model like GPT2.
  
  ### How to use
  
  You can use this model directly with a pipeline for masked language modeling:
  
  ```python
  >>> from transformers import pipeline
  >>> unmasker = pipeline('fill-mask', model='albert-xxlarge-v1')
  >>> unmasker("Hello I'm a [MASK] model.")
  [
     {
        "sequence":"[CLS] hello i'm a modeling model.[SEP]",
        "score":0.05816134437918663,
        "token":12807,
        "token_str":"â–modeling"
     },
     {
        "sequence":"[CLS] hello i'm a modelling model.[SEP]",
        "score":0.03748830780386925,
        "token":23089,
        "token_str":"â–modelling"
     },
     {
        "sequence":"[CLS] hello i'm a model model.[SEP]",
        "score":0.033725276589393616,
        "token":1061,
        "token_str":"â–model"
     },
     {
        "sequence":"[CLS] hello i'm a runway model.[SEP]",
        "score":0.017313428223133087,
        "token":8014,
        "token_str":"â–runway"
     },
     {
        "sequence":"[CLS] hello i'm a lingerie model.[SEP]",
        "score":0.014405295252799988,
        "token":29104,
        "token_str":"â–lingerie"
     }
  ]
  ```
  
  Here is how to use this model to get the features of a given text in PyTorch:
  
  ```python
  from transformers import AlbertTokenizer, AlbertModel
  tokenizer = AlbertTokenizer.from_pretrained('albert-xxlarge-v1')
  model = AlbertModel.from_pretrained("albert-xxlarge-v1")
  text = "Replace me by any text you'd like."
  encoded_input = tokenizer(text, return_tensors='pt')
  output = model(**encoded_input)
  ```
  
  and in TensorFlow:
  
  ```python
  from transformers import AlbertTokenizer, TFAlbertModel
  tokenizer = AlbertTokenizer.from_pretrained('albert-xxlarge-v1')
  model = TFAlbertModel.from_pretrained("albert-xxlarge-v1")
  text = "Replace me by any text you'd like."
  encoded_input = tokenizer(text, return_tensors='tf')
  o