--- license: mit language: - ru tags: - natural-language-processing - poetry-generation - text-generation - torch - lstm --- This model was trained using [Andrej Karpathy's code](https://github.com/karpathy/char-rnn) on texts of Russian songs. Models of this type well represent poetic style. Model was trained with size 512 and 7 layers, dropout 0.5. There are 2 checkpoints of this model presented in the repository. One after 35 epochs with loss 0.9145, the other after 49 epochs with loss 0.9113. These metrics are in the file name. ## Usage The procedure for installing the required software is described [by Karpathy](https://github.com/karpathy/char-rnn), torch is required, the code is written in lua. Be careful, versions of libraries written many years ago are used! ```bash th sample.lua lm_lstm_epoch50.00_1.1207.t7 -length 10000 -temperature 0.5 -primetext 'some text' ``` ## Train data and goal Train corpus provided by Artjoms Šela the athor of *[“Russian song” in literature of the 1800–1840s](https://scholar.google.com/citations?view_op=view_citation&hl=ru&user=4eYapmIAAAAJ&citation_for_view=4eYapmIAAAAJ:LkGwnXOMwfcC)* (2018). The corpus is close to the dataset published here: [Шеля, Артем, 2020, "Корпус «русской песни» 1800—1840-х гг."](https://dataverse.pushdom.ru/dataset.xhtml?persistentId=doi:10.31860/openlit-2019.11-C003), https://doi.org/10.31860/openlit-2019.11-C003, Репозиторий открытых данных по русской литературе и фольклору, V1, UNF:6:jhDsLpjMCNmSDeqoCckL9g== [fileUNF] Samples generated by the model are used in *“Russian song” in literature of the 1800–1840s*, see p. 193 ## What for? In an era of winning Transformers, ancient RNN models seem archaic. But I see that they still work better than modern architectures with such important categories from the humanities point of view as individual style. ## Samples ### epoch 35, temperature 0.4 ``` Не как не мог за поле, Ветер был конца моя, Под косящатом волной, Нет на век подруженька! Ах! как же в сердце не покой! Что ж не забыл мне весной Слезы льешь все не ведает, И сердце приветная, Не последний волны вострою, Как по поле в своей забилися, И слезами не веселилися. ``` ### epoch 35, temperature 0.6 ``` Как бы на кручине мой! Собержитесь в москву на свете любить, С красной сторону моей тоскою, Осветил тебе любовь молодца, Что забыл, как молодец, В православный твой изведет. Все полно, без ответ так скажите, Положены меня, Слезы молодая погода. ``` ### epoch 49, temperature 0.5 ``` Нет, как далеко мне, Под кольцо легла, Не веселишь мне милой, Не пойдешь же ты Без милой долго Не полевает она В лесочке в разлуке, Не поет солнышко Себя молодца, Скажи красна девица, Разлюбила мне Скучно казатки Подружки подобно, Обольюсь в ту мою, Как стало и в поле, Как в поле сыпал, Девка моя! Ах! зачем ты нам тогда, На чужих людей, Как слезами Сердце бедное Не пристало тебя! Не помнит на меня, За тобой свой грозенький Он в вечной веточке С ним весной помираюсь, Стало белого душе Сердце больше да ворона. ```