Commit
•
b0b6483
1
Parent(s):
2bc3472
Update README.md (#4)
Browse files- Update README.md (89ac5f28798ef9bb059a9b4a498364416801c829)
Co-authored-by: Muhammed Ashiq Abdul Khader <[email protected]>
README.md
CHANGED
@@ -1,3 +1,42 @@
|
|
1 |
---
|
2 |
-
license: bigscience-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
license: bigscience-bloom-rail-1.0
|
3 |
+
|
4 |
+
widget :
|
5 |
+
- text: "ആധുനിക ഭാരതം കണ്ട "
|
6 |
+
example_title: "ആധുനിക ഭാരതം"
|
7 |
+
- text : "മലയാളഭാഷ എഴുതുന്നതിനായി"
|
8 |
+
example_title: "മലയാളഭാഷ എഴുതുന്നതിനായി"
|
9 |
+
- text : "ഇന്ത്യയിൽ കേരള സംസ്ഥാനത്തിലും"
|
10 |
+
example_title : "ഇന്ത്യയിൽ കേരള"
|
11 |
---
|
12 |
+
# GPT2-Tamil
|
13 |
+
|
14 |
+
## Model description
|
15 |
+
GPT2-Malayalam is a GPT-2 transformer model fine Tuned on a large corpus of Malayalam data in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way with an automatic process to generate inputs and labels from those texts. More precisely, it was trained to guess the next word in sentences.
|
16 |
+
|
17 |
+
More precisely, inputs are sequences of continuous text of a certain length and the targets are the same sequence, shifted one token (word or piece of word) to the right. The model uses internally a mask-mechanism to make sure the predictions for the token i only uses the inputs from 1 to i but not the future tokens.
|
18 |
+
|
19 |
+
This way, the model learns an inner representation of the Malayalam language that can then be used to extract features useful for downstream tasks.
|
20 |
+
## Intended uses & limitations
|
21 |
+
|
22 |
+
You can use the raw model for text generation or fine-tune it to a downstream task. See the
|
23 |
+
[model hub](https://huggingface.co/models?filter=gpt2) to look for fine-tuned versions on a task that interests you.
|
24 |
+
|
25 |
+
## Usage
|
26 |
+
You can use this model for Malayalam text generation:
|
27 |
+
```python
|
28 |
+
>>> from transformers import TFGPT2LMHeadModel, GPT2Tokenizer
|
29 |
+
>>> tokenizer = GPT2Tokenizer.from_pretrained("Lagstill/GPT-2-Tamil")
|
30 |
+
>>> model = TFGPT2LMHeadModel.from_pretrained("Lagstill/GPT-2-Tamil")
|
31 |
+
>>> text = "விக்கிப்பீடியா"
|
32 |
+
>>> encoded_text = tokenizer.encode(text, return_tensors='tf')
|
33 |
+
>>> beam_output = model.generate(
|
34 |
+
encoded_text,
|
35 |
+
max_length=100,
|
36 |
+
num_beams=5,
|
37 |
+
temperature=0.7,
|
38 |
+
no_repeat_ngram_size=2,
|
39 |
+
num_return_sequences=5
|
40 |
+
)
|
41 |
+
>>> print(tokenizer.decode(beam_output[0], skip_special_tokens=True))
|
42 |
+
```
|