huseinzol05 commited on
Commit
cc932d0
1 Parent(s): 6566654

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -0
README.md ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ms
4
+ ---
5
+ # Noisy Translation Tiny T5
6
+
7
+ Trained on 1536 context length, able to translate malay, pasar malay (social media texts or local context), english, manglish, javanese, banjarese and indonesian to target language. It also able to maintain the text structure as it is and only translate necessary texts, eg, programming code.
8
+
9
+ Try it at https://huggingface.co/spaces/mesolitica/malaysian-translation
10
+
11
+ ## how-to
12
+
13
+ ```python
14
+ from transformers import T5ForConditionalGeneration, AutoTokenizer
15
+ tokenizer = AutoTokenizer.from_pretrained(
16
+ 'mesolitica/t5-tiny-standard-bahasa-cased',
17
+ use_fast=False
18
+ )
19
+ model = T5ForConditionalGeneration.from_pretrained(
20
+ 'mesolitica/t5-tiny-standard-bahasa-cased'
21
+ )
22
+ s = 'Hai, ada yang bisa saya bantu?'
23
+ input_ids = tokenizer.encode(f'terjemah ke Melayu: {s}', return_tensors = 'pt')
24
+ outputs = model.generate(input_ids, max_length = 100)
25
+ print(tokenizer.decode(outputs[0], spaces_between_special_tokens = False, skip_special_tokens = True))
26
+ ```