File size: 3,376 Bytes
86be9b0
32d0e7d
 
86be9b0
 
 
 
 
b002907
 
 
32d0e7d
 
86be9b0
 
 
 
 
 
 
 
 
 
 
601e6cc
 
 
 
 
 
 
 
 
 
 
 
86be9b0
 
 
b002907
 
 
86be9b0
 
 
b002907
86be9b0
 
 
b002907
86be9b0
4d42d04
 
 
 
 
 
 
 
 
 
 
 
86be9b0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
601e6cc
86be9b0
 
 
 
 
 
 
 
 
 
 
b002907
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
language:
- en
license: apache-2.0
tags:
- generated_from_trainer
metrics:
- accuracy
- f1
- recall
- precision
pipeline_tag: text-classification
base_model: distilbert-base-multilingual-cased
model-index:
- name: distilbert-base-multilingual-cased-language_detection
  results: []
---

# distilbert-base-multilingual-cased-language_detection

This model is a fine-tuned version of [distilbert-base-multilingual-cased](https://huggingface.co/distilbert-base-multilingual-cased) on the None dataset.
It achieves the following results on the evaluation set:
- Loss: 0.0595
- Accuracy: 0.9971
- F1
  - Weighted: 0.9971
  - Micro: 0.9971
  - Macro: 0.9977
- Recall
  - Weighted: 0.9971
  - Micro: 0.9971
  - Macro: 0.9974
- Precision
  - Weighted: 0.9971
  - Micro: 0.9971
  - Macro: 0.9981

## Model description

This is a classification model of 16 different languages.

For more information on how it was created, check out the following link: https://github.com/DunnBC22/NLP_Projects/blob/main/Language%20Detection/Language%20Detection-%2010k%20Samples/language_detection-10k.ipynb

## Intended uses & limitations

This model is intended to demonstrate my ability to solve a complex problem using technology.

## Training and evaluation data

Dataset Source: https://www.kaggle.com/datasets/basilb2s/language-detection

_Input Word Length:_

![Length of Input Text (in Words)](https://github.com/DunnBC22/NLP_Projects/raw/main/Language%20Detection/Language%20Detection-%2010k%20Samples/Images/Input%20Word%20Length.png)

_Input Word Length By Class:_

![Length of Input Text (in Words) By Class](https://github.com/DunnBC22/NLP_Projects/raw/main/Language%20Detection/Language%20Detection-%2010k%20Samples/Images/Input%20Word%20Length%20by%20Class.png)

_Class Distribution:_

![Class Distribution](https://github.com/DunnBC22/NLP_Projects/raw/main/Language%20Detection/Language%20Detection-%2010k%20Samples/Images/Class%20Distribution.png)

## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 64
- eval_batch_size: 64
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 3

### Training results

| Training Loss | Epoch | Step | Validation Loss | Accuracy | Weighted F1 | Micro F1 | Macro F1 | Weighted Recall | Micro Recall | Macro Recall | Weighted Precision | Micro Precision | Macro Precision |
|:-------------:|:-----:|:----:|:---------------:|:--------:|:-----------:|:--------:|:--------:|:---------------:|:------------:|:------------:|:------------------:|:---------------:|:---------------:|
| 1.0783        | 1.0   | 128  | 0.1544          | 0.9823   | 0.9819      | 0.9823   | 0.9806   | 0.9823          | 0.9823       | 0.9798       | 0.9847             | 0.9823          | 0.9852          |
| 0.1189        | 2.0   | 256  | 0.0595          | 0.9971   | 0.9971      | 0.9971   | 0.9977   | 0.9971          | 0.9971       | 0.9974       | 0.9971             | 0.9971          | 0.9981          |
| 0.0651        | 3.0   | 384  | 0.0473          | 0.9971   | 0.9971      | 0.9971   | 0.9977   | 0.9971          | 0.9971       | 0.9974       | 0.9971             | 0.9971          | 0.9981          |


### Framework versions

- Transformers 4.26.1
- Pytorch 1.12.1
- Datasets 2.9.0
- Tokenizers 0.12.1