Update README.md
Browse files
README.md
CHANGED
@@ -25,8 +25,6 @@ Eval loss:
|
|
25 |
```python
|
26 |
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
27 |
|
28 |
-
model = T5ForConditionalGeneration.from_pretrained(model_path)
|
29 |
-
tokenizer = T5Tokenizer.from_pretrained(model_path)
|
30 |
|
31 |
def do_inference(text, model, tokenizer):
|
32 |
input_text = f"denoise: {text}"
|
@@ -47,5 +45,13 @@ def do_inference(text, model, tokenizer):
|
|
47 |
|
48 |
corrected_sentence = tokenizer.decode(corrected_ids[0], skip_special_tokens=True)
|
49 |
return corrected_sentence
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
```
|
51 |
|
|
|
25 |
```python
|
26 |
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
27 |
|
|
|
|
|
28 |
|
29 |
def do_inference(text, model, tokenizer):
|
30 |
input_text = f"denoise: {text}"
|
|
|
45 |
|
46 |
corrected_sentence = tokenizer.decode(corrected_ids[0], skip_special_tokens=True)
|
47 |
return corrected_sentence
|
48 |
+
|
49 |
+
|
50 |
+
model = T5ForConditionalGeneration.from_pretrained("radlab/polish-denoiser-t5-base")
|
51 |
+
tokenizer = T5Tokenizer.from_pretrained("radlab/polish-denoiser-t5-base")
|
52 |
+
|
53 |
+
text_str = "As | -T ron^# om ia je@st je!d &*ną z na -J s | AA ta rsZy ch n a u k."
|
54 |
+
print(do_inference(text_str, model, tokenizer))
|
55 |
+
|
56 |
```
|
57 |
|