Ndamulelo Nemakhavhani commited on
Commit
c624f82
1 Parent(s): 02a7e31

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +32 -0
README.md CHANGED
@@ -28,6 +28,38 @@ tags:
28
  - **Model Size:** 80 - 250 million parameters
29
  - **Language Support:** Tshivenda, Nguni languages (Zulu, Xhosa, Swati), Sotho languages (Northern Sotho, Southern Sotho, Setswana), and Xitsonga.
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
  ## Model Variants
33
 
 
28
  - **Model Size:** 80 - 250 million parameters
29
  - **Language Support:** Tshivenda, Nguni languages (Zulu, Xhosa, Swati), Sotho languages (Northern Sotho, Southern Sotho, Setswana), and Xitsonga.
30
 
31
+ ## Usage example(s)
32
+
33
+ ```python
34
+ from transformers import pipeline
35
+
36
+ # Initialize the pipeline for masked language model
37
+ # Note: You might need to login, and request permissions to access dsfsi while the model is in private-beta
38
+ unmasker = pipeline('fill-mask', model='dsfsi/zabantu-bantu-250m')
39
+
40
+
41
+ sample_sentences = {
42
+ 'zulu': "Le ndoda ithi izo____ ukudla.", # Masked word for Zulu
43
+ 'tshivenda': "Mufana uyo____ vhukuma.", # Masked word for Tshivenda
44
+ 'sepedi': "Mosadi o ____ pheka.", # Masked word for Sepedi
45
+ 'tswana': "Monna o ____ tsamaya.", # Masked word for Tswana
46
+ 'tsonga': "N'wana wa xisati u ____ ku tsaka." # Masked word for Tsonga
47
+ }
48
+
49
+
50
+ for language, sentence in sample_sentences.items():
51
+ masked_sentence = sentence.replace('____', unmasker.tokenizer.mask_token)
52
+ # Get the model predictions
53
+ results = unmasker(masked_sentence)
54
+ print(f"Original sentence ({language}): {sentence}")
55
+ print(f"Top prediction for the masked token: {results[0]['sequence']}\n")
56
+ ```
57
+
58
+ * For fine-tuning tasks, checkout these examples:
59
+ * [Text Classification]()
60
+ * [NER]()
61
+ * [POS]()
62
+
63
 
64
  ## Model Variants
65