File size: 2,410 Bytes
1024bd2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
license: cc0-1.0
language:
- de
tags:
  - natural-language-processing
  - poetry-generation
  - text-generation
  - torch
  - lstm
---

This generative text model was trained using [Andrej Karpathy's code](https://github.com/karpathy/char-rnn) on texts of German [Hexameter](https://en.wikipedia.org/w/index.php?title=Hexameter&oldid=1198526559). Models of this type well represent individual style.

Model was trained with size 512 and 3 layers, dropout 0.5.

## 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 hexameter_lm_lstm_epoch80.00_1.3702.t7
```

## Train data

Hexameter lines extracted from [large collection of German verses](https://github.com/tnhaider/DLK) running by Thomas Haider.

## 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 poetic style.

## Dataset

There is a [repository](https://github.com/nevmenandr/german-generated-poetic-texts) that publishes German poetic texts generated by RNN LSTM models (inclding this one) with different temperature.

## Publication

There are some texts explaining the goal o these poetic experiments and their place in the history of human culture.

* "[Der digitale Superdichter](http://nevmenandr.net/personalia/holderlin.pdf). Vor 250 Jahren wurde Friedrich Hölderlin geboren. Heute kann Computertechnik neue Gedichte im Hölderlin-Sound generieren. Ein Werkstattbericht" *Die Literarische Welt*, 14 March 2020, p. 29. (included in this repository as pdf)

* Orekhov, Boris, and Frank Fischer. "Neural reading: Insights from the analysis of poetry generated by artificial neural networks." *Orbis Litterarum* 75.5 (2020): 230-246. [DOI: 10.1111/oli.12274](https://onlinelibrary.wiley.com/doi/abs/10.1111/oli.12274)

## BibTeX entry and citation info

```
@article{orekhov2020neural,
  title={Neural reading: Insights from the analysis of poetry generated by artificial neural networks},
  author={Orekhov, Boris and Fischer, Frank},
  journal={Orbis Litterarum},
  volume={75},
  number={5},
  pages={230--246},
  year={2020},
  publisher={Wiley Online Library}
}
```