--- language: - en - zh - multilingual license: apache-2.0 tags: - GENIUS - conditional text generation - sketch-based text generation - data augmentation datasets: - c4 - beyond/chinese_clean_passages_80m widget: - text: Conference on Empirical Methods submission of research papers Deep Learning example_title: Example 1 - text: machine learning my research interest data science example_title: Example 2 - text: play basketball a strong team Shanghai University of Finance and Economics last Sunday example_title: Example 3 - text: 'Good news: the European Union month by EU Farm Commissioner Franz ' example_title: Example with a prompt 1 - text: 'Bad news: the European Union month by EU Farm Commissioner Franz ' example_title: Example with a prompt 2 inference: parameters: max_length: 200 num_beams: 3 do_sample: true --- # GENIUS: generating text using sketches! - **Paper: [GENIUS: Sketch-based Language Model Pre-training via Extreme and Selective Masking for Text Generation and Augmentation](https://arxiv.org/abs/2211.10330)** - **GitHub: [GENIUS, Pre-training/Data Augmentation Tutorial](https://github.com/beyondguo/genius)** You can use this model directly with a pipeline for masked language modeling: ```python from transformers import pipeline # 1. load the model with the huggingface `pipeline` genius = pipeline("text2text-generation", model='beyond/genius-large', device=0) # 2. provide a sketch (joint by tokens) sketch = " Conference on Empirical Methods submission of research papers Deep Learning " # 3. here we go! generated_text = genius(sketch, num_beams=3, do_sample=True, max_length=200)[0]['generated_text'] print(generated_text) ``` If you find our paper/code/demo useful, please cite our paper: ``` @article{guo2022genius, title={GENIUS: Sketch-based Language Model Pre-training via Extreme and Selective Masking for Text Generation and Augmentation}, author={Guo, Biyang and Gong, Yeyun and Shen, Yelong and Han, Songqiao and Huang, Hailiang and Duan, Nan and Chen, Weizhu}, journal={arXiv preprint arXiv:2211.10330}, year={2022} } ```