Kelvinmbewe commited on
Commit
91653ce
·
verified ·
1 Parent(s): b0a438b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +11 -8
README.md CHANGED
@@ -69,7 +69,7 @@ The model captures **code-switching**, **local idioms**, **indirect expressions*
69
 
70
 
71
  ## Task
72
- ```
73
  def classify_text(text):
74
  """
75
  Run inference on a single text input using the fine‑tuned LusakaLang model.
@@ -79,18 +79,25 @@ def classify_text(text):
79
  label = result["label"]
80
  score = round(result["score"], 4)
81
  return label, score
82
-
83
-
84
  samples = [
85
  "Muli shani bane, nalishiba bwino.",
86
  "How are you doing today?",
87
  "Tili bwino, zikomo kwambiri."
88
  ]
89
-
90
  for s in samples:
91
  label, score = classify_text(s)
92
  print(f"Text: {s}\nPrediction: {label} (confidence={score})\n")
 
 
 
 
 
93
 
 
 
 
 
 
94
  ```
95
  ---
96
 
@@ -102,15 +109,11 @@ for s in samples:
102
  ![image](https://cdn-uploads.huggingface.co/production/uploads/674ed988f86d2ca07fa23abe/aJVi9d-xRUuu-8IEwybLW.png)
103
 
104
 
105
-
106
-
107
  ![image](https://cdn-uploads.huggingface.co/production/uploads/674ed988f86d2ca07fa23abe/v5eLxfxuKDJ7Sd8uX2P9s.png)
108
 
109
 
110
-
111
  ![image](https://cdn-uploads.huggingface.co/production/uploads/674ed988f86d2ca07fa23abe/mxnDjRmAX-XLHzMfcWnfr.png)
112
 
113
 
114
-
115
  ![image](https://cdn-uploads.huggingface.co/production/uploads/674ed988f86d2ca07fa23abe/J-atqadjfCh7xUKRSRSnL.png)
116
 
 
69
 
70
 
71
  ## Task
72
+ ```python
73
  def classify_text(text):
74
  """
75
  Run inference on a single text input using the fine‑tuned LusakaLang model.
 
79
  label = result["label"]
80
  score = round(result["score"], 4)
81
  return label, score
 
 
82
  samples = [
83
  "Muli shani bane, nalishiba bwino.",
84
  "How are you doing today?",
85
  "Tili bwino, zikomo kwambiri."
86
  ]
 
87
  for s in samples:
88
  label, score = classify_text(s)
89
  print(f"Text: {s}\nPrediction: {label} (confidence={score})\n")
90
+ ```
91
+ Sample Output
92
+ ```python
93
+ Text: Muli shani bane, nalishiba bwino.
94
+ Prediction: Bemba (confidence=0.9821)
95
 
96
+ Text: How are you doing today?
97
+ Prediction: English (confidence=0.9954)
98
+
99
+ Text: Tili bwino, zikomo kwambiri.
100
+ Prediction: Nyanja (confidence=0.9736)
101
  ```
102
  ---
103
 
 
109
  ![image](https://cdn-uploads.huggingface.co/production/uploads/674ed988f86d2ca07fa23abe/aJVi9d-xRUuu-8IEwybLW.png)
110
 
111
 
 
 
112
  ![image](https://cdn-uploads.huggingface.co/production/uploads/674ed988f86d2ca07fa23abe/v5eLxfxuKDJ7Sd8uX2P9s.png)
113
 
114
 
 
115
  ![image](https://cdn-uploads.huggingface.co/production/uploads/674ed988f86d2ca07fa23abe/mxnDjRmAX-XLHzMfcWnfr.png)
116
 
117
 
 
118
  ![image](https://cdn-uploads.huggingface.co/production/uploads/674ed988f86d2ca07fa23abe/J-atqadjfCh7xUKRSRSnL.png)
119