Update README.md
Browse files
README.md
CHANGED
|
@@ -3,4 +3,36 @@ license: cc-by-sa-4.0
|
|
| 3 |
language:
|
| 4 |
- eo
|
| 5 |
pipeline_tag: text-generation
|
| 6 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
language:
|
| 4 |
- eo
|
| 5 |
pipeline_tag: text-generation
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
## Description (Priskribo)
|
| 9 |
+
|
| 10 |
+
This is a simple generative LSTM model for Esperanto, trained on public data from Esperanto Telegram groups, using internet slang and informal language style.
|
| 11 |
+
|
| 12 |
+
Tio ĉi estas simpla generativa LSTM-modelo por Esperanto, trejnita per publikaj datumoj de esperantaj Telegram-grupoj, uzante interretan slangon kaj neformalan stilon.
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
The model can be used in two modes - generative (in this case a simple query is enough), and dialog (in this case the query must end with the ">" symbol). Note - due to the peculiarities of the training data in the dialog mode the model barely preserves the semantics of the question, and using this mode is not recommended.
|
| 16 |
+
|
| 17 |
+
La modelo uzeblas en du reĝimoj: generativa (ĉi-okaze sufiĉas simpla demando ) kaj dialoga (ĉi-okaze la demando devas finiĝi je la simbolo ">"). Bonvolu noti, ke pro la naturo de la trejnaj datumoj en dialoga reĝimo la modelo apenaŭ konservas la semantikon de la demando, kaj uzi ĉi tiun reĝimon estas malrekomendinde.
|
| 18 |
+
|
| 19 |
+
## Using (Uzado)
|
| 20 |
+
|
| 21 |
+
```python
|
| 22 |
+
from epo_lstm import LSTMGeneratorPipeline, EOLSTMGenerator
|
| 23 |
+
|
| 24 |
+
from transformers import PreTrainedTokenizerFast
|
| 25 |
+
|
| 26 |
+
generator = LSTMGeneratorPipeline(
|
| 27 |
+
model=EOLSTMGenerator.from_pretrained("./version_1"),
|
| 28 |
+
tokenizer=PreTrainedTokenizerFast(
|
| 29 |
+
tokenizer_file="./version_1/tokenizer.json",
|
| 30 |
+
bos_token="[BOS]",
|
| 31 |
+
eos_token="\n",
|
| 32 |
+
unk_token="[UNK]",
|
| 33 |
+
pad_token="[PAD]",
|
| 34 |
+
),
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
print(generator('saluton, mi estas'))
|
| 38 |
+
```
|