# Multilingual_Language_Detection

This model is a fine-tuned version of [XLM-Roberta-base](https://huggingface.co/xlm-roberta-base) on the multilingual dataset.

It achieves the following results on the evaluation set:
- Training Loss :  0.087900
- Validation Loss : 0.067496
- Accuracy : 0.988409
- F1 : 0.988507  

## Languages

It's trained in more than 22 different languages, they are listed below.

Arabic, Urdu, Tamil, Hindi, English, French, Spanish, Japanese, Chinese, Thai, Indonesian, Dutch, Korean, Latin, Persian, Portugese, 
Pushto, Romanian, Russian, Swedish, Turkish, Estonian

## Model Description

XLM-RoBERTa is a multilingual version of RoBERTa. It is pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages.

RoBERTa is a transformers model pretrained on a large corpus 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 the Masked language modeling (MLM) objective. 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.

This way, the model learns an inner representation of 100 languages 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 XLM-RoBERTa model as inputs.

## Training procedure

Fine-tuning was done via the `Trainer` API. Here is the [Colab notebook](https://colab.research.google.com/drive/19T7RdCjXAmu_TXx0iPGP2CuxVoBHDhim?usp=sharing) with the training code.


### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 2e-5
- train_batch_size: 8
- eval_batch_size: 16
- optimizer: Adam 
- evaluation strategy: epoch
- num_epochs: 3
- warmup_steps: 100

## Training result

| Training Loss | Epoch | Validation Loss | Accuracy | F1     |
|:-------------:|:-----:|:---------------:|:--------:|:------:|
| 0.003000      | 1     |  0.083116       | 0.9861   | 0.9863 |
| 0.000900      | 2     |  0.069443       | 0.9872   | 0.9874 |
| 0.087900      | 3     |  0.067496       | 0.9884   | 0.9885 |
{}
transformers pytorch xlm-roberta text-classification autotrain_compatible endpoints_compatible region:us
TAGS
#transformers #pytorch #xlm-roberta #text-classification #autotrain_compatible #endpoints_compatible #region-us 

Multilingual\_Language\_Detection
=================================


This model is a fine-tuned version of XLM-Roberta-base on the multilingual dataset.


It achieves the following results on the evaluation set:


* Training Loss : 0.087900
* Validation Loss : 0.067496
* Accuracy : 0.988409
* F1 : 0.988507


Languages
---------


It's trained in more than 22 different languages, they are listed below.


Arabic, Urdu, Tamil, Hindi, English, French, Spanish, Japanese, Chinese, Thai, Indonesian, Dutch, Korean, Latin, Persian, Portugese,
Pushto, Romanian, Russian, Swedish, Turkish, Estonian


Model Description
-----------------


XLM-RoBERTa is a multilingual version of RoBERTa. It is pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages.


RoBERTa is a transformers model pretrained on a large corpus 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 the Masked language modeling (MLM) objective. 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.


This way, the model learns an inner representation of 100 languages 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 XLM-RoBERTa model as inputs.


Training procedure
------------------


Fine-tuning was done via the 'Trainer' API. Here is the Colab notebook with the training code.


### Training hyperparameters


The following hyperparameters were used during training:


* learning\_rate: 2e-5
* train\_batch\_size: 8
* eval\_batch\_size: 16
* optimizer: Adam
* evaluation strategy: epoch
* num\_epochs: 3
* warmup\_steps: 100


Training result
---------------




### Training hyperparameters


The following hyperparameters were used during training:


* learning\_rate: 2e-5
* train\_batch\_size: 8
* eval\_batch\_size: 16
* optimizer: Adam
* evaluation strategy: epoch
* num\_epochs: 3
* warmup\_steps: 100


Training result
---------------
TAGS
#transformers #pytorch #xlm-roberta #text-classification #autotrain_compatible #endpoints_compatible #region-us 
 ### Training hyperparameters


The following hyperparameters were used during training:


* learning\_rate: 2e-5
* train\_batch\_size: 8
* eval\_batch\_size: 16
* optimizer: Adam
* evaluation strategy: epoch
* num\_epochs: 3
* warmup\_steps: 100


Training result
---------------