Update README.md
Browse files
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 |
-
|
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 |
+
### ์์ ์ด์ด์๋ค ์ง์ง แแแแ.
|