Update README.md
Browse files
README.md
CHANGED
@@ -1,199 +1,109 @@
|
|
1 |
-
|
2 |
-
library_name: transformers
|
3 |
-
tags: []
|
4 |
-
---
|
5 |
-
|
6 |
-
# Model Card for Model ID
|
7 |
-
|
8 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
9 |
|
|
|
10 |
|
|
|
11 |
|
12 |
## Model Details
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
-
|
21 |
-
-
|
22 |
-
-
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
-
|
28 |
-
### Model Sources [optional]
|
29 |
-
|
30 |
-
<!-- Provide the basic links for the model. -->
|
31 |
-
|
32 |
-
- **Repository:** [More Information Needed]
|
33 |
-
- **Paper [optional]:** [More Information Needed]
|
34 |
-
- **Demo [optional]:** [More Information Needed]
|
35 |
-
|
36 |
-
## Uses
|
37 |
-
|
38 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
39 |
-
|
40 |
-
### Direct Use
|
41 |
-
|
42 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
43 |
-
|
44 |
-
[More Information Needed]
|
45 |
-
|
46 |
-
### Downstream Use [optional]
|
47 |
-
|
48 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
49 |
-
|
50 |
-
[More Information Needed]
|
51 |
-
|
52 |
-
### Out-of-Scope Use
|
53 |
-
|
54 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
55 |
-
|
56 |
-
[More Information Needed]
|
57 |
-
|
58 |
-
## Bias, Risks, and Limitations
|
59 |
-
|
60 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
61 |
-
|
62 |
-
[More Information Needed]
|
63 |
-
|
64 |
-
### Recommendations
|
65 |
-
|
66 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
67 |
-
|
68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
69 |
-
|
70 |
-
## How to Get Started with the Model
|
71 |
-
|
72 |
-
Use the code below to get started with the model.
|
73 |
-
|
74 |
-
[More Information Needed]
|
75 |
-
|
76 |
-
## Training Details
|
77 |
-
|
78 |
-
### Training Data
|
79 |
-
|
80 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
81 |
-
|
82 |
-
[More Information Needed]
|
83 |
-
|
84 |
-
### Training Procedure
|
85 |
-
|
86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
87 |
-
|
88 |
-
#### Preprocessing [optional]
|
89 |
-
|
90 |
-
[More Information Needed]
|
91 |
-
|
92 |
-
|
93 |
-
#### Training Hyperparameters
|
94 |
-
|
95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
-
|
97 |
-
#### Speeds, Sizes, Times [optional]
|
98 |
-
|
99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
100 |
-
|
101 |
-
[More Information Needed]
|
102 |
-
|
103 |
-
## Evaluation
|
104 |
-
|
105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
-
|
107 |
-
### Testing Data, Factors & Metrics
|
108 |
-
|
109 |
-
#### Testing Data
|
110 |
-
|
111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
112 |
-
|
113 |
-
[More Information Needed]
|
114 |
-
|
115 |
-
#### Factors
|
116 |
-
|
117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
-
|
119 |
-
[More Information Needed]
|
120 |
-
|
121 |
-
#### Metrics
|
122 |
-
|
123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
-
|
125 |
-
[More Information Needed]
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Summary
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
## Model Examination [optional]
|
136 |
-
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
|
139 |
-
|
140 |
|
141 |
-
|
142 |
|
143 |
-
|
|
|
144 |
|
145 |
-
|
146 |
|
147 |
-
- **
|
148 |
-
- **
|
149 |
-
- **
|
150 |
-
- **
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
|
153 |
-
##
|
154 |
|
155 |
-
|
156 |
|
157 |
-
|
|
|
|
|
|
|
|
|
|
|
158 |
|
159 |
-
|
160 |
|
161 |
-
|
162 |
|
163 |
-
|
|
|
164 |
|
165 |
-
|
166 |
|
167 |
-
|
|
|
|
|
|
|
|
|
168 |
|
169 |
-
|
|
|
|
|
|
|
170 |
|
171 |
-
|
172 |
|
173 |
-
|
|
|
|
|
|
|
|
|
174 |
|
175 |
-
|
176 |
|
177 |
-
|
|
|
|
|
178 |
|
179 |
-
|
180 |
|
181 |
-
|
|
|
182 |
|
183 |
-
##
|
184 |
|
185 |
-
|
186 |
|
187 |
-
|
188 |
|
189 |
-
|
|
|
|
|
|
|
190 |
|
191 |
-
|
192 |
|
193 |
-
|
194 |
|
195 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
|
197 |
-
##
|
198 |
|
199 |
-
|
|
|
1 |
+
# Kannada Tokenizer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
+
[![Hugging Face](https://img.shields.io/badge/HuggingFace-Model%20Card-orange)](https://huggingface.co/charanhu/kannada-tokenizer)
|
4 |
|
5 |
+
This is a Byte-Pair Encoding (BPE) tokenizer trained specifically for the Kannada language using the `translated_output` column from the [Cognitive-Lab/Kannada-Instruct-dataset](https://huggingface.co/datasets/Cognitive-Lab/Kannada-Instruct-dataset). It is suitable for various Natural Language Processing (NLP) tasks involving Kannada text.
|
6 |
|
7 |
## Model Details
|
8 |
|
9 |
+
- **Model Type:** Byte-Pair Encoding (BPE) Tokenizer
|
10 |
+
- **Language:** Kannada (`kn`)
|
11 |
+
- **Vocabulary Size:** 32,000
|
12 |
+
- **Special Tokens:**
|
13 |
+
- `[UNK]` (Unknown token)
|
14 |
+
- `[PAD]` (Padding token)
|
15 |
+
- `[CLS]` (Classifier token)
|
16 |
+
- `[SEP]` (Separator token)
|
17 |
+
- `[MASK]` (Masking token)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
+
## Training Data
|
20 |
|
21 |
+
The tokenizer was trained on the `translated_output` column from the [Cognitive-Lab/Kannada-Instruct-dataset](https://huggingface.co/datasets/Cognitive-Lab/Kannada-Instruct-dataset). This dataset contains translated instructions and responses in Kannada, providing a rich corpus for effective tokenization.
|
22 |
|
23 |
+
- **Dataset Size:** The dataset includes a significant number of entries covering a wide range of topics and linguistic structures in Kannada.
|
24 |
+
- **Data Preprocessing:** Text normalization was applied using NFKC normalization to standardize characters.
|
25 |
|
26 |
+
## Training Procedure
|
27 |
|
28 |
+
- **Normalization:** NFKC normalization was used to handle canonical decomposition and compatibility decomposition, ensuring that characters are represented consistently.
|
29 |
+
- **Pre-tokenization:** The text was pre-tokenized using whitespace splitting.
|
30 |
+
- **Tokenizer Algorithm:** Byte-Pair Encoding (BPE) was chosen for its effectiveness in handling subword units, which is beneficial for languages with rich morphology like Kannada.
|
31 |
+
- **Training Library:** The tokenizer was built using the [Hugging Face Tokenizers](https://github.com/huggingface/tokenizers) library.
|
|
|
32 |
|
33 |
+
## Intended Use
|
34 |
|
35 |
+
This tokenizer is intended for NLP applications involving the Kannada language, such as:
|
36 |
|
37 |
+
- Language Modeling
|
38 |
+
- Text Classification
|
39 |
+
- Machine Translation
|
40 |
+
- Named Entity Recognition
|
41 |
+
- Question Answering
|
42 |
+
- Summarization
|
43 |
|
44 |
+
## Usage
|
45 |
|
46 |
+
You can load the tokenizer directly from the Hugging Face Hub:
|
47 |
|
48 |
+
```python
|
49 |
+
from transformers import PreTrainedTokenizerFast
|
50 |
|
51 |
+
tokenizer = PreTrainedTokenizerFast.from_pretrained("charanhu/kannada-tokenizer")
|
52 |
|
53 |
+
# Example usage
|
54 |
+
text = "ನೀವು ಹೇಗಿದ್ದೀರಿ?"
|
55 |
+
encoding = tokenizer.encode(text)
|
56 |
+
tokens = tokenizer.convert_ids_to_tokens(encoding)
|
57 |
+
decoded_text = tokenizer.decode(encoding)
|
58 |
|
59 |
+
print("Original Text:", text)
|
60 |
+
print("Tokens:", tokens)
|
61 |
+
print("Decoded Text:", decoded_text)
|
62 |
+
```
|
63 |
|
64 |
+
**Output:**
|
65 |
|
66 |
+
```
|
67 |
+
Original Text: ನೀವು ಹೇಗಿದ್ದೀರಿ?
|
68 |
+
Tokens: ['ನೀವು', 'ಹೇಗಿದ್ದೀರಿ', '?']
|
69 |
+
Decoded Text: ನೀವು ಹೇಗಿದ್ದೀರಿ?
|
70 |
+
```
|
71 |
|
72 |
+
## Limitations
|
73 |
|
74 |
+
- **Vocabulary Coverage:** While the tokenizer is trained on a diverse dataset, it may not include all possible words or phrases in Kannada.
|
75 |
+
- **Biases:** The tokenizer inherits any biases present in the training data. Users should be cautious when applying it to sensitive or critical applications.
|
76 |
+
- **OOV Words:** Out-of-vocabulary words may be broken into subword tokens or mapped to the `[UNK]` token.
|
77 |
|
78 |
+
## Recommendations
|
79 |
|
80 |
+
- **Fine-tuning:** For best results in specific applications, consider fine-tuning language models with this tokenizer on domain-specific data.
|
81 |
+
- **Evaluation:** Users should evaluate the tokenizer in their specific context to ensure it meets their requirements.
|
82 |
|
83 |
+
## License
|
84 |
|
85 |
+
[MIT License](LICENSE)
|
86 |
|
87 |
+
## Acknowledgments
|
88 |
|
89 |
+
- **Dataset:** Thanks to [Cognitive-Lab](https://huggingface.co/Cognitive-Lab) for providing the [Kannada-Instruct-dataset](https://huggingface.co/datasets/Cognitive-Lab/Kannada-Instruct-dataset).
|
90 |
+
- **Libraries:**
|
91 |
+
- [Hugging Face Tokenizers](https://github.com/huggingface/tokenizers)
|
92 |
+
- [Hugging Face Transformers](https://github.com/huggingface/transformers)
|
93 |
|
94 |
+
## Citation
|
95 |
|
96 |
+
If you use this tokenizer in your research or applications, please consider citing it:
|
97 |
|
98 |
+
```bibtex
|
99 |
+
@misc{kannada_tokenizer_2023,
|
100 |
+
title={Kannada Tokenizer},
|
101 |
+
author={charanhu},
|
102 |
+
year={2023},
|
103 |
+
howpublished={\url{https://huggingface.co/charanhu/kannada-tokenizer}},
|
104 |
+
}
|
105 |
+
```
|
106 |
|
107 |
+
## Contact Information
|
108 |
|
109 |
+
For questions or comments about the tokenizer, please contact [charanhu](https://huggingface.co/charanhu).
|