satpalsr commited on
Commit
2a7832d
1 Parent(s): 17a7009

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -7
README.md CHANGED
@@ -6,18 +6,29 @@ The original Google's [**T5-base**] model was pre-trained on [**C4 dataset**](ht
6
 
7
  The T5 model was presented in [**Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer**](https://arxiv.org/pdf/1910.10683.pdf) by Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu.
8
 
 
 
 
9
  ## Usage :
10
  ```
11
- from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
12
-
13
- tokenizer = AutoTokenizer.from_pretrained("team-writing-assistant/t5-base-c4jfleg")
 
 
 
 
14
 
15
- model = AutoModelForSeq2SeqLM.from_pretrained("team-writing-assistant/t5-base-c4jfleg")
 
 
 
 
16
  ```
17
 
18
- ## Examples :
19
  Input: My grammar are bad.
20
  Output: My grammar is bad.
21
 
22
- Input: Speed of light is fastest than speed of sound
23
- Output: Speed of light is faster than speed of sound.
 
6
 
7
  The T5 model was presented in [**Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer**](https://arxiv.org/pdf/1910.10683.pdf) by Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu.
8
 
9
+ # Prefix:
10
+ The T-5 model use "grammar: " as the input text prefix for grammatical corrections.
11
+
12
  ## Usage :
13
  ```
14
+ from transformers import pipeline
15
+
16
+ checkpoint = "team-writing-assistant/t5-base-c4jfleg"
17
+ model = pipeline("text2text-generation", model=checkpoint)
18
+
19
+ text = "Speed of light is fastest then speed of sound"
20
+ text = "grammar: " + text
21
 
22
+ output = model(text)
23
+ print("Result: ", output[0]['generated_text'])
24
+ ```
25
+ ```
26
+ Result: Speed of light is faster than speed of sound.
27
  ```
28
 
29
+ ## Other Examples :
30
  Input: My grammar are bad.
31
  Output: My grammar is bad.
32
 
33
+ Input: Who are the president?
34
+ Output: Who is the president?