File size: 851 Bytes
2922c06
 
 
 
 
 
 
 
9d516ae
2922c06
 
 
 
9d516ae
2922c06
 
 
 
 
 
 
9d516ae
 
2922c06
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
language:
- yue
tags:
- bart
- cantonese
- fill-mask
license: other

---

# bart-base-cantonese

This is the Cantonese model of BART base. It is based on another model created by: https://huggingface.co/Ayaka/bart-base-cantonese



## Usage

```python
from transformers import BertTokenizer, BartForConditionalGeneration, Text2TextGenerationPipeline
tokenizer = BertTokenizer.from_pretrained('jed351/bart-zh-hk-wiki')
model = BartForConditionalGeneration.from_pretrained('jed351/bart-zh-hk-wiki')
text2text_generator = Text2TextGenerationPipeline(model, tokenizer)  
output = text2text_generator('聽日就要返香港,我激動到[MASK]唔着', max_length=50, do_sample=False)
print(output[0]['generated_text'].replace(' ', ''))
```

**Note**: Please use the `BertTokenizer` for the model vocabulary. DO NOT use the original `BartTokenizer`.