Update README.md
Browse files
README.md
CHANGED
@@ -36,8 +36,22 @@ SEGA is a general text augmentation model that can be used for data augmentation
|
|
36 |
- Github: [this repository](to_be_added).
|
37 |
|
38 |
|
39 |
-
## Model description
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
## Model variations
|
43 |
|
@@ -56,7 +70,7 @@ SEGA is a general text augmentation model that can be used for data augmentation
|
|
56 |
|
57 |
|
58 |
|
59 |
-
|
60 |
|
61 |
|
62 |
### Limitations and bias
|
|
|
36 |
- Github: [this repository](to_be_added).
|
37 |
|
38 |
|
|
|
39 |
|
40 |
+
### How to use
|
41 |
+
```python
|
42 |
+
from transformers import pipeline
|
43 |
+
# 1. load the model with the huggingface `pipeline`
|
44 |
+
sega = pipeline("text2text-generation", model='beyond/sega-large', device=0)
|
45 |
+
# 2. provide a sketch (joint by <mask> tokens)
|
46 |
+
sketch = "<mask> Conference on Empirical Methods <mask> submission of research papers <mask> Deep Learning <mask>"
|
47 |
+
# 3. just do it!
|
48 |
+
generated_text = sega(sketch, num_beams=3, do_sample=True, max_length=200)[0]['generated_text']
|
49 |
+
print(generated_text)
|
50 |
+
```
|
51 |
+
|
52 |
+
```shell
|
53 |
+
'The Conference on Empirical Methods welcomes the submission of research papers. Abstracts should be in the form of a paper or presentation. Please submit abstracts to the following email address: eemml.stanford.edu. The conference will be held at Stanford University on April 1618, 2019. The theme of the conference is Deep Learning.'
|
54 |
+
```
|
55 |
|
56 |
## Model variations
|
57 |
|
|
|
70 |
|
71 |
|
72 |
|
73 |
+
|
74 |
|
75 |
|
76 |
### Limitations and bias
|