mangaphd commited on
Commit
45ac6d8
·
1 Parent(s): 3513a9c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +45 -15
README.md CHANGED
@@ -4,34 +4,64 @@ base_model: bert-base-cased
4
  tags:
5
  - generated_from_keras_callback
6
  model-index:
7
- - name: hausaBERTaa
8
  results: []
 
 
 
 
 
9
  ---
10
 
11
  <!-- This model card has been generated automatically according to the information Keras had access to. You should
12
  probably proofread and complete it, then remove this comment. -->
13
 
14
- # hausaBERTaa
15
 
16
- This model is a fine-tuned version of [bert-base-cased](https://huggingface.co/bert-base-cased) on an unknown dataset.
17
  It achieves the following results on the evaluation set:
18
- - Train Loss: 0.2333
19
- - Train Accuracy: 0.9063
20
  - Epoch: 2
21
 
22
  ## Model description
23
 
24
- More information needed
 
25
 
26
  ## Intended uses & limitations
27
 
28
- More information needed
29
 
30
- ## Training and evaluation data
 
31
 
32
- More information needed
33
 
34
- ## Training procedure
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  ### Training hyperparameters
37
 
@@ -43,14 +73,14 @@ The following hyperparameters were used during training:
43
 
44
  | Train Loss | Train Accuracy | Epoch |
45
  |:----------:|:--------------:|:-----:|
46
- | 0.4838 | 0.7577 | 0 |
47
- | 0.3030 | 0.8682 | 1 |
48
- | 0.2333 | 0.9063 | 2 |
49
 
50
 
51
  ### Framework versions
52
 
53
- - Transformers 4.34.0
54
  - TensorFlow 2.13.0
55
  - Datasets 2.14.5
56
- - Tokenizers 0.14.0
 
4
  tags:
5
  - generated_from_keras_callback
6
  model-index:
7
+ - name: hausaBERTa
8
  results: []
9
+ datasets:
10
+ - mangaphd/hausaBERTdatatrain
11
+ language:
12
+ - ha
13
+ - af
14
  ---
15
 
16
  <!-- This model card has been generated automatically according to the information Keras had access to. You should
17
  probably proofread and complete it, then remove this comment. -->
18
 
19
+ # hausaBERTa
20
 
21
+ This model is a fine-tuned version of [bert-base-cased](https://huggingface.co/bert-base-cased) trained on mangaphd/hausaBERTdatatrain dataset.
22
  It achieves the following results on the evaluation set:
23
+ - Train Loss: 0.1186
24
+ - Train Accuracy: 0.9549
25
  - Epoch: 2
26
 
27
  ## Model description
28
 
29
+ HausaBERTa is a pretrained lexicon low resources language model. The model was trained on Hausa Language (Hausa is a Chadic language spoken by the Hausa people in the northern half of Nigeria, Niger, Ghana, Cameroon, Benin and Togo, and the southern half of Niger, Chad and Sudan, with significant minorities in Ivory Coast. It is the most widely spoken language in West Africa, and one of the most widely spoken languages in Africa as a whole).
30
+ The model has been shown to obtain competitive downstream performances on text classification on trained language
31
 
32
  ## Intended uses & limitations
33
 
34
+ You can use this model with Transformers for sentiment analysis task in Hausa Language.
35
 
36
+ # Use a pipeline as a high-level helper
37
+ from transformers import pipeline
38
 
39
+ pipe = pipeline("text-classification", model="mangaphd/hausaBERTmodel")
40
 
41
+ # Load model directly
42
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
43
+
44
+ tokenizer = AutoTokenizer.from_pretrained("mangaphd/HausaBERTa")
45
+ model = AutoModelForSequenceClassification.from_pretrained("mangaphd/HausaBERTa")
46
+
47
+ # Supplementary function
48
+ Add the following codes for ease of interpretation
49
+
50
+ import pandas as pd
51
+ def sentiment_analysis(text):
52
+ rs = pipe(text)
53
+ df = pd.DataFrame(rs)
54
+ senti=df['label'][0]
55
+ score=df['score'][0]
56
+ if senti == 'LABEL_0' and score > 0.5:
57
+ lb='NEGATIVE'
58
+ elif senti == 'LABEL_1' and score > 0.5:
59
+ lb='POSITIVE'
60
+ else:
61
+ lb='NEUTRAL'
62
+ return lb
63
+
64
+ call sentiment_analysis('Your text here') while using the model
65
 
66
  ### Training hyperparameters
67
 
 
73
 
74
  | Train Loss | Train Accuracy | Epoch |
75
  |:----------:|:--------------:|:-----:|
76
+ | 0.2108 | 0.9168 | 0 |
77
+ | 0.1593 | 0.9385 | 1 |
78
+ | 0.1186 | 0.9549 | 2 |
79
 
80
 
81
  ### Framework versions
82
 
83
+ - Transformers 4.33.2
84
  - TensorFlow 2.13.0
85
  - Datasets 2.14.5
86
+ - Tokenizers 0.13.3