Update README.md
Browse files
README.md
CHANGED
@@ -15,7 +15,7 @@ This model is fine-tuned model of "Helsinki-NLP/opus-mt-ko-en" <br/>
|
|
15 |
The model has been trained with 1,198,943 Korean, Enlgish sentence pairs which mainly contains science, technology terms.
|
16 |
|
17 |
# Load Model
|
18 |
-
```
|
19 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
20 |
|
21 |
tokenizer = AutoTokenizer.from_pretrained("mjk0618/mt-ko-en-scitech")
|
@@ -23,18 +23,12 @@ model = AutoModelForSeq2SeqLM.from_pretrained("mjk0618/mt-ko-en-scitech")
|
|
23 |
```
|
24 |
|
25 |
# How to use
|
26 |
-
```
|
27 |
# After loading model
|
28 |
-
# Define the text you want to translate
|
29 |
sentence = "์ธ๊ณต์ง๋ฅ์ ์ธ๊ฐ์ ํ์ต๋ฅ๋ ฅ, ์ถ๋ก ๋ฅ๋ ฅ, ์ง๊ฐ๋ฅ๋ ฅ์ ์ธ๊ณต์ ์ผ๋ก ๊ตฌํํ๋ ค๋ ์ปดํจํฐ ๊ณผํ์ ์ธ๋ถ๋ถ์ผ ์ค ํ๋์ด๋ค"
|
30 |
|
31 |
-
# Tokenize the text
|
32 |
inputs = tokenizer(sentence, return_tensors="pt").input_ids
|
33 |
-
|
34 |
-
# Generate the translated text
|
35 |
outputs = model.generate(inputs)[0]
|
36 |
-
|
37 |
-
# Decode the translated text
|
38 |
translated_sentence = tokenizer.decode(outputs, skip_special_tokens=True)
|
39 |
|
40 |
print(translated_sentence)
|
|
|
15 |
The model has been trained with 1,198,943 Korean, Enlgish sentence pairs which mainly contains science, technology terms.
|
16 |
|
17 |
# Load Model
|
18 |
+
```python
|
19 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
20 |
|
21 |
tokenizer = AutoTokenizer.from_pretrained("mjk0618/mt-ko-en-scitech")
|
|
|
23 |
```
|
24 |
|
25 |
# How to use
|
26 |
+
```python
|
27 |
# After loading model
|
|
|
28 |
sentence = "์ธ๊ณต์ง๋ฅ์ ์ธ๊ฐ์ ํ์ต๋ฅ๋ ฅ, ์ถ๋ก ๋ฅ๋ ฅ, ์ง๊ฐ๋ฅ๋ ฅ์ ์ธ๊ณต์ ์ผ๋ก ๊ตฌํํ๋ ค๋ ์ปดํจํฐ ๊ณผํ์ ์ธ๋ถ๋ถ์ผ ์ค ํ๋์ด๋ค"
|
29 |
|
|
|
30 |
inputs = tokenizer(sentence, return_tensors="pt").input_ids
|
|
|
|
|
31 |
outputs = model.generate(inputs)[0]
|
|
|
|
|
32 |
translated_sentence = tokenizer.decode(outputs, skip_special_tokens=True)
|
33 |
|
34 |
print(translated_sentence)
|