j5ng commited on
Commit
1eb3893
โ€ข
1 Parent(s): 51e4c3c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -3
README.md CHANGED
@@ -58,7 +58,30 @@ output_text = tokenizer.decode(output_encoding[0], skip_special_tokens=True)
58
  # ๊ฒฐ๊ณผ ์ถœ๋ ฅ
59
  print(output_text)
60
  ```
 
61
 
62
- ```bash
63
- ์•„๋‹ˆ ์ง„์งœ ๋ญ ํ•˜๋ƒ๊ณ .
64
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  # ๊ฒฐ๊ณผ ์ถœ๋ ฅ
59
  print(output_text)
60
  ```
61
+ ### ๊ฒฐ๊ณผ : ์•„๋‹ˆ ์ง„์งœ ๋ญ ํ•˜๋ƒ๊ณ .
62
 
63
+ ## With Transformer Pipeline
64
+ ```python
65
+ from transformers import T5ForConditionalGeneration, T5Tokenizer, pipeline
66
+
67
+ model = T5ForConditionalGeneration.from_pretrained('j5ng/et5-typos-corrector')
68
+ tokenizer = T5Tokenizer.from_pretrained('j5ng/et5-typos-corrector')
69
+
70
+ typos_corrector = pipeline(
71
+ "text2text-generation",
72
+ model=model,
73
+ tokenizer=tokenizer,
74
+ device=0 if torch.cuda.is_available() else -1,
75
+ framework="pt",
76
+ )
77
+
78
+ input_text = "์™„์ฃค ์–ด์ด์—…ใ……๋„ค์ง„์จฌใ…‹ใ…‹ใ…‹"
79
+ output_text = typos_corrector("๋งž์ถค๋ฒ•์„ ๊ณ ์ณ์ฃผ์„ธ์š”: " + input_text,
80
+ max_length=128,
81
+ num_beams=5,
82
+ early_stopping=True)[0]['generated_text']
83
+
84
+ print(output_text)
85
+ ```
86
+
87
+ ### ์™„์ „ ์–ด์ด์—†๋„ค ์ง„์งœ แ„แ„แ„แ„.