readme: ---
  language:
  
  - es
  
  license: apache-2.0
  
  tags:
  
  - "national library of spain"
  - "spanish"
  - "bne"
  - "PlanTL-GOB-ES/MLDoc"
  - "text-classification"
  
  datasets:
  
  - "PlanTL-GOB-ES/MLDoc"
  
  metrics:
  - "f1"
  
  model-index:
  - name: roberta-base-bne-mldoc
    results:
    - task: 
        type: text-classification
      dataset:
        type: mldoc
        name: PlanTL-GOB-ES/MLDoc
      metrics:
        - name: F1 
          type: f1
          value: 0.9664
          
  
  widget:
  
  - ' FRANCFORT, 17 feb (Reuter) - La Bolsa de Francfort abrió la sesión de corros con baja por la caída del viernes en Wall Street y una toma de beneficios.   El dólar ayudaba a apuntalar al mercado, que pronto podría reanudar su tendencia alcista.   Volkswagen bajaba por los daños ocasionados por la huelga de camioneros en España.   Preussag participaba en un joint venture de exploración petrolífera en Filipinas con Atlantic Richfield Co.   A las 0951 GMT, el Dax 30 bajaba 10,49 puntos, un 0,32 pct, a 3.237,69 tras abrir a un máximo de 3.237,69.   (c) Reuters Limited 1997. '
  
  ---
  
  # Spanish RoBERTa-base trained on BNE finetuned for the Spanish portion of the MLDoc dataset.
  
  ## Table of contents
  <details>
  <summary>Click to expand</summary>
  
  - [Model description](#model-description)
  - [Intended uses and limitations](#intended-use)
  - [How to use](#how-to-use)
  - [Limitations and bias](#limitations-and-bias)
  - [Training](#training)
  - [Training](#training)
    - [Training data](#training-data)
    - [Training procedure](#training-procedure)
  - [Evaluation](#evaluation)
  - [Evaluation](#evaluation)
     - [Variable and metrics](#variable-and-metrics)
     - [Evaluation results](#evaluation-results)
  - [Additional information](#additional-information)
    - [Author](#author)
    - [Contact information](#contact-information)
    - [Copyright](#copyright)
    - [Licensing information](#licensing-information)
    - [Funding](#funding)
    - [Citing information](#citing-information)
    - [Disclaimer](#disclaimer)
    
  </details>
  
  ## Model description
  The **roberta-base-bne-mldoc** is a text classification model for the Spanish language fine-tuned from the [roberta-base-bne](https://huggingface.co/PlanTL-GOB-ES/roberta-base-bne) model, a [RoBERTa](https://arxiv.org/abs/1907.11692) base model pre-trained using the largest Spanish corpus known to date, with a total of 570GB of clean and deduplicated text, processed for this work, compiled from the web crawlings performed by the [National Library of Spain (Biblioteca Nacional de España)](http://www.bne.es/en/Inicio/index.html) from 2009 to 2019.
  The finetuning corpus consists of 14,458 news articles from Reuters classified in four categories: CCAT (Corporate/Industrial), ECAT (Economics), GCAT (Government/Social) and MCAT (Markets).
  
  
  
  ## Intended uses and limitations
  
  **roberta-base-bne-mldoc** model can be used to classify texts into four hierarchical groups: CCAT (Corporate/Industrial), ECAT (Economics), GCAT (Government/Social) and MCAT (Markets). The model is limited by its training dataset (news stories) and may not generalize well for all use cases.
  
  
  ## How to use
  
  Here is how to use this model:
  
  ```python
  from transformers import pipeline
  from pprint import pprint
  
  nlp = pipeline("text-classification", model="PlanTL-GOB-ES/roberta-base-bne-mldoc")
  example = ' FRANCFORT, 17 feb (Reuter) - La Bolsa de Francfort abrió la sesión de corros con baja por la caída del viernes en Wall Street y una toma de beneficios.   El dólar ayudaba a apuntalar al mercado, que pronto podría reanudar su tendencia alcista.   Volkswagen bajaba por los daños ocasionados por la huelga de camioneros en España.   Preussag participaba en un joint venture de exploración petrolífera en Filipinas con Atlantic Richfield Co.   A las 0951 GMT, el Dax 30 bajaba 10,49 puntos, un 0,32 pct, a 3.237,69 tras abrir a un máximo de 3.237,69.   (c) Reuters Limited 1997. '
  
  results = nlp(example)
  pprint(results)
  ```
  
  ## Limitations and bias
  At the time of submission, no measures have been taken to estimate the bias embedded in the model. However, we are well aware that our models may be biased since the corpora have been collected using crawling techniques on multiple web sources. We intend to conduct research in these areas in the future, and if completed, this model card will be updated.
  
  ## Training
  
  For training and evaluation we used the Spanish portion of the Multilingual Document Classification Corpus (MLDoc) [(Schwenk and Li, 2018)](http://www.lrec-conf.org/proceedings/lrec2018/pdf/658.pdf), a cross-lingual document classification dataset covering 8 languages. 
  
  ### Training procedure
  The model was trained with a batch size of 32 and a learning rate of 1e-5 for 5 epochs. We then selected the best checkpoint using the downstream task metric in the corresponding development set and then evaluated it on the test set.
  
  
  ## Evaluation 
  
  ### Variable and metrics
  
  This model was finetuned maximizing F1.
  
  ## Evaluation results
  We evaluated the *roberta-base-bne-mldoc* on the XNLI test set again