Update README.md
Browse files
README.md
CHANGED
@@ -31,12 +31,25 @@ inference:
|
|
31 |
num_beams: 3
|
32 |
do_sample: True
|
33 |
---
|
|
|
34 |
# 💡GENIUS – generating text using sketches!
|
35 |
|
|
|
|
|
36 |
- **Paper: [GENIUS: Sketch-based Language Model Pre-training via Extreme and Selective Masking for Text Generation and Augmentation](https://github.com/beyondguo/genius/blob/master/GENIUS_gby_arxiv.pdf)**
|
37 |
-
- **GitHub: [GENIUS project, GENIUS pre-training, GeniusAug for data augmentation](https://github.com/beyondguo/genius)**
|
38 |
|
39 |
-
💡**GENIUS** is a powerful conditional text generation model using sketches as input, which can fill in the missing contexts for a given **sketch** (key information consisting of textual spans, phrases, or words, concatenated by mask tokens). GENIUS is pre-trained on a large-scale textual corpus with a novel *reconstruction from sketch* objective using an *extreme and selective masking* strategy, enabling it to generate diverse and high-quality texts given sketches.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
|
42 |
**GENIUS** can also be used as a general textual **data augmentation tool** for **various NLP tasks** (including sentiment analysis, topic classification, NER, and QA).
|
@@ -45,6 +58,7 @@ inference:
|
|
45 |
![image-20221119164544165](https://cdn.jsdelivr.net/gh/beyondguo/mdnice_pictures/typora/hi-genius.png)
|
46 |
|
47 |
|
|
|
48 |
- Models hosted in 🤗 Huggingface:
|
49 |
|
50 |
**Model variations:**
|
@@ -57,7 +71,14 @@ inference:
|
|
57 |
| [`genius-base-ps`](https://huggingface.co/beyond/genius-base) | 139M | English | pre-trained both in paragraphs and short sentences |
|
58 |
| [`genius-base-chinese`](https://huggingface.co/beyond/genius-base-chinese) | 116M | 中文 | 在一千万纯净中文段落上预训练|
|
59 |
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
## Usage
|
63 |
|
@@ -67,13 +88,12 @@ First, what is a **sketch**? As defined in our paper, a sketch is "key informati
|
|
67 |
|
68 |
The sketch which can be composed of:
|
69 |
|
70 |
-
- keywords /key-phrases, like
|
71 |
- spans, like `Conference on Empirical Methods__submission of research papers__`
|
72 |
- sentences, like `I really like machine learning__I work at Google since last year__`
|
73 |
- or a mixup!
|
74 |
|
75 |
|
76 |
-
|
77 |
### How to use the model
|
78 |
#### 1. If you already have a sketch in mind, and want to get a paragraph based on it...
|
79 |
```python
|
|
|
31 |
num_beams: 3
|
32 |
do_sample: True
|
33 |
---
|
34 |
+
|
35 |
# 💡GENIUS – generating text using sketches!
|
36 |
|
37 |
+
**基于草稿的文本生成模型**
|
38 |
+
|
39 |
- **Paper: [GENIUS: Sketch-based Language Model Pre-training via Extreme and Selective Masking for Text Generation and Augmentation](https://github.com/beyondguo/genius/blob/master/GENIUS_gby_arxiv.pdf)**
|
|
|
40 |
|
41 |
+
💡**GENIUS** is a powerful conditional text generation model using sketches as input, which can fill in the missing contexts for a given **sketch** (key information consisting of textual spans, phrases, or words, concatenated by mask tokens). GENIUS is pre-trained on a large- scale textual corpus with a novel *reconstruction from sketch* objective using an *extreme and selective masking* strategy, enabling it to generate diverse and high-quality texts given sketches.
|
42 |
+
|
43 |
+
**Example 1:**
|
44 |
+
|
45 |
+
- sketch: `__ machine learning __ my research interest __ data science __`
|
46 |
+
- **GENIUS**: `I am a Ph.D. student in machine learning, and my research interest is in data science. I am interested in understanding how humans and machines interact and how we can improve the quality of life for people around the world.`
|
47 |
+
|
48 |
+
**Example 2:**
|
49 |
+
|
50 |
+
- sketch: `自然语言处理__谷歌__通用人工智能__`
|
51 |
+
- **GENIUS**: `自然语言处理是谷歌在通用人工智能领域的一个重要研究方向,其目的是为了促进人类智能的发展。 `
|
52 |
+
|
53 |
|
54 |
|
55 |
**GENIUS** can also be used as a general textual **data augmentation tool** for **various NLP tasks** (including sentiment analysis, topic classification, NER, and QA).
|
|
|
58 |
![image-20221119164544165](https://cdn.jsdelivr.net/gh/beyondguo/mdnice_pictures/typora/hi-genius.png)
|
59 |
|
60 |
|
61 |
+
|
62 |
- Models hosted in 🤗 Huggingface:
|
63 |
|
64 |
**Model variations:**
|
|
|
71 |
| [`genius-base-ps`](https://huggingface.co/beyond/genius-base) | 139M | English | pre-trained both in paragraphs and short sentences |
|
72 |
| [`genius-base-chinese`](https://huggingface.co/beyond/genius-base-chinese) | 116M | 中文 | 在一千万纯净中文段落上预训练|
|
73 |
|
74 |
+
![image-20221119191940969](https://cdn.jsdelivr.net/gh/beyondguo/mdnice_pictures/typora/202211191919005.png)
|
75 |
+
|
76 |
+
|
77 |
+
|
78 |
+
|
79 |
+
More Examples:
|
80 |
+
|
81 |
+
![image-20221119184950762](https://cdn.jsdelivr.net/gh/beyondguo/mdnice_pictures/typora/202211191849815.png)
|
82 |
|
83 |
## Usage
|
84 |
|
|
|
88 |
|
89 |
The sketch which can be composed of:
|
90 |
|
91 |
+
- keywords /key-phrases, like `__NLP__AI__computer__science__`
|
92 |
- spans, like `Conference on Empirical Methods__submission of research papers__`
|
93 |
- sentences, like `I really like machine learning__I work at Google since last year__`
|
94 |
- or a mixup!
|
95 |
|
96 |
|
|
|
97 |
### How to use the model
|
98 |
#### 1. If you already have a sketch in mind, and want to get a paragraph based on it...
|
99 |
```python
|