The Deep Comedy
This research project is focused on applications of Deep Learning to the work of
Dante Alighieri.
As a preliminary step in this direction, I have been working, in collaboration with the metricist Stefano Dal Bianco, to the complete
syllabification
of the Divine Comedy, published in the ACM Journal on Computing and Cultural Heritage.
This particular application does not exploit deep learning, but
simple probabilistic and constraint programming techniques. We particularly focus on the synalephe, addressed in terms of the "propensity" of a word to take part in a synalephe with adjacent words.
We jointly provide an online vocabulary containing, for each word, information about its syllabification, the location of the tonic accent, and the aforementioned synalephe propensity, on the left and right sides.
The syllabification algorithm is intrinsically nondeterministic, producing different possible syllabifications for each verse, with different likelihoods; metric constraints relative to accents on the 10th, 4th and 6th syllables are used to further reduce the solution space. The most likely syllabification is hence returned as output.
Code and digital sources
The syllabification code, written in python, and the digital sources (with and withour syllabification), are freely
available from the
Dante github repository.
Syllabification of the first canto of the inferno
As an example, here is the syllabification of the first canto.
Let me recall a couple of our conventions:
- group of vowels in the final word of the verse are treated as diphthongs (tro|vai, in|trai, ab|ban|do|nai, ...)
- apostrophes are assimilated to vowels: (on|d'io, do|v'or, \dots)
1 |Nel |mez|zo |del |cam|min |di |no|stra |vi|ta
2 |mi |ri|tro|vai |per |u|na |sel|va o|scu|ra,
3 |ché |la |di|rit|ta |via |e|ra |smar|ri|ta.
4 |Ahi |quan|to a |dir |qual |e|ra è |co|sa |du|ra
5 |e|sta |sel|va |sel|vag|gia e |a|spra e |for|te
6 |che |nel |pen|sier |ri|no|va |la |pa|u|ra!
7 |Tan|t’ è |a|ma|ra |che |po|co è |più |mor|te;
8 |ma |per |trat|tar |del |ben |ch’ i’ |vi |tro|vai,
9 |di|rò |de |l’ al|tre |co|se |ch’ i’ |v’ ho |scor|te.
10 |Io |non |so |ben |ri|dir |com’ |i’ |v’ in|trai,
11 |tan|t’ e|ra |pien |di |son|no |a |quel |pun|to
12 |che |la |ve|ra|ce |via |ab|ban|do|nai.
13 |Ma |poi |ch’ i’ |fui |al |piè |d’ un |col|le |giun|to,
14 |là |do|ve |ter|mi|na|va |quel|la |val|le
15 |che |m’ a|vea |di |pa|u|ra il |cor |com|pun|to,
16 |guar|dai |in |al|to e |vi|di |le |sue |spal|le
17 |ve|sti|te |già |de’ |rag|gi |del |pia|ne|ta
18 |che |me|na |drit|to al|trui |per |o|gne |cal|le.
19 |Al|lor |fu |la |pa|u|ra un |po|co |que|ta,
20 |che |nel |la|go |del |cor |m’ e|ra |du|ra|ta
21 |la |not|te |ch’ i’ |pas|sai |con |tan|ta |pie|ta.
22 |E |co|me |quei |che |con |le|na af|fan|na|ta,
23 |u|sci|to |fuor |del |pe|la|go a |la |ri|va,
24 |si |vol|ge a |l’ ac|qua |pe|ri|glio|sa e |gua|ta,
25 |co|sì |l’ a|ni|mo |mio, |ch’ an|cor |fug|gi|va,
26 |si |vol|se a |re|tro a |ri|mi|rar |lo |pas|so
27 |che |non |la|sciò |già |mai |per|so|na |vi|va.
28 |Poi |ch’ èi |po|sa|to un |po|co il |cor|po |las|so,
29 |ri|pre|si |via |per |la |piag|gia |di|ser|ta,
30 |sì |che ’l |piè |fer|mo |sem|pre e|ra ’l |più |bas|so.
31 |Ed |ec|co, |qua|si al |co|min|ciar |de |l’ er|ta,
32 |u|na |lon|za |leg|ge|ra e |pre|sta |mol|to,
33 |che |di |pel |ma|co|la|to e|ra |co|ver|ta;
34 |e |non |mi |si |par|tia |di|nan|zi al |vol|to,
35 |an|zi ’m|pe|di|va |tan|to il |mio |cam|mi|no,
36 |ch’ i’ |fui |per |ri|tor|nar |più |vol|te |vòl|to.
37 |Tem|p’ e|ra |dal |prin|ci|pio |del |mat|ti|no,
38 |e ’l |sol |mon|ta|va ’n |sù |con |quel|le |stel|le
39 |ch’ e|ran |con |lui |quan|do |l’ a|mor |di|vi|no
40 |mos|se |di |pri|ma |quel|le |co|se |bel|le;
41 |sì |ch’ a |be|ne |spe|rar |m’ e|ra |ca|gio|ne
42 |di |quel|la |fie|ra a |la |ga|et|ta |pel|le
43 |l’ o|ra |del |tem|po e |la |dol|ce |sta|gio|ne;
44 |ma |non |sì |che |pa|u|ra |non |mi |des|se
45 |la |vi|sta |che |m’ ap|par|ve |d’ un |le|o|ne.
46 |Que|sti |pa|rea |che |con|tra |me |ve|nis|se
47 |con |la |te|st’ al|ta e |con |rab|bio|sa |fa|me,
48 |sì |che |pa|rea |che |l’ ae|re |ne |tre|mes|se.
49 |Ed |u|na |lu|pa, |che |di |tut|te |bra|me
50 |sem|bia|va |car|ca |ne |la |sua |ma|grez|za,
51 |e |mol|te |gen|ti |fé |già |vi|ver |gra|me,
52 |que|sta |mi |por|se |tan|to |di |gra|vez|za
53 |con |la |pa|u|ra |ch’ u|scia |di |sua |vi|sta,
54 |ch’ io |per|dei |la |spe|ran|za |de |l’ al|tez|za.
55 |E |qual |è |quei |che |vo|lon|tie|ri ac|qui|sta,
56 |e |giu|gne ’l |tem|po |che |per|der |lo |fa|ce,
57 |che ’n |tut|ti |suoi |pen|sier |pian|ge e |s’ at|tri|sta;
58 |tal |mi |fe|ce |la |be|stia |san|za |pa|ce,
59 |che, |ve|nen|do|mi ’n|con|tro, a |po|co a |po|co
60 |mi |ri|pi|gne|va |là |do|ve ’l |sol |ta|ce.
61 |Men|tre |ch’ i’ |ro|vi|na|va in |bas|so |lo|co,
62 |di|nan|zi a |li oc|chi |mi |si |fu |of|fer|to
63 |chi |per |lun|go |si|len|zio |pa|rea |fio|co.
64 |Quan|do |vi|di |co|stui |nel |gran |di|ser|to,
65 « |Mi|se|re|re |di |me», |gri|dai |a |lui,
66 « |qual |che |tu |sii, |od |om|bra od |o|mo |cer|to!».
67 |Ri|spuo|se|mi:« |Non |o|mo, o|mo |già |fui,
68 |e |li |pa|ren|ti |miei |fu|ron |lom|bar|di,
69 |man|to|a|ni |per |pa|trï|a am|be|dui.
70 |Nac|qui |sub |Iu|lio, an|cor |che |fos|se |tar|di,
71 |e |vis|si a |Ro|ma |sot|to ’l |buo|no Au|gu|sto
72 |nel |tem|po |de |li |dèi |fal|si e |bu|giar|di.
73 |Po|e|ta |fui, |e |can|tai |di |quel |giu|sto
74 |fi|gliuol |d’ An|chi|se |che |ven|ne |di |Tro|ia,
75 |poi |che ’l |su|per|bo I|lï|ón |fu |com|bu|sto.
76 |Ma |tu |per|ché |ri|tor|ni a |tan|ta |no|ia?
77 |per|ché |non |sa|li il |di|let|to|so |mon|te
78 |ch’ è |prin|ci|pio e |ca|gion |di |tut|ta |gio|ia?».
79 « |Or |se’ |tu |quel |Vir|gi|lio e |quel|la |fon|te
80 |che |span|di |di |par|lar |sì |lar|go |fiu|me?»,
81 |ri|spuo|s’ io |lui |con |ver|go|gno|sa |fron|te.
82 « |O |de |li al|tri |po|e|ti o|no|re e |lu|me,
83 |va|glia|mi ’l |lun|go |stu|dio e ’l |gran|de a|mo|re
84 |che |m’ ha |fat|to |cer|car |lo |tuo |vo|lu|me.
85 |Tu |se’ |lo |mio |ma|e|stro e ’l |mio |au|to|re,
86 |tu |se’ |so|lo |co|lui |da |cu’ |io |tol|si
87 |lo |bel|lo |sti|lo |che |m’ ha |fat|to o|no|re.
88 |Ve|di |la |be|stia |per |cu’ |io |mi |vol|si;
89 |a|iu|ta|mi |da |lei, |fa|mo|so |sag|gio,
90 |ch’ el|la |mi |fa |tre|mar |le |ve|ne e i |pol|si».
91 « |A |te |con|vien |te|ne|re al|tro |vï|ag|gio»,
92 |ri|spuo|se, |poi |che |la|gri|mar |mi |vi|de,
93 « |se |vuo’ |cam|par |d’ e|sto |lo|co |sel|vag|gio;
94 |ché |que|sta |be|stia, |per |la |qual |tu |gri|de,
95 |non |la|scia al|trui |pas|sar |per |la |sua |via,
96 |ma |tan|to |lo ’m|pe|di|sce |che |l’ uc|ci|de;
97 |e |ha |na|tu|ra |sì |mal|va|gia e |ria,
98 |che |mai |non |em|pie |la |bra|mo|sa |vo|glia,
99 |e |do|po ’l |pa|sto ha |più |fa|me |che |pria.
100 |Mol|ti |son |li a|ni|ma|li a |cui |s’ am|mo|glia,
101 |e |più |sa|ran|no an|co|ra, in|fin |che ’l |vel|tro
102 |ver|rà, |che |la |fa|rà |mo|rir |con |do|glia.
103 |Que|sti |non |ci|be|rà |ter|ra |né |pel|tro,
104 |ma |sa|pï|en|za, a|mo|re |e |vir|tu|te,
105 |e |sua |na|zion |sa|rà |tra |fel|tro e |fel|tro.
106 |Di |quel|la u|mi|le I|ta|lia |fia |sa|lu|te
107 |per |cui |mo|rì |la |ver|gi|ne |Cam|mil|la,
108 |Eu|ria|lo e |Tur|no e |Ni|so |di |fe|ru|te.
109 |Que|sti |la |cac|ce|rà |per |o|gne |vil|la,
110 |fin |che |l’ av|rà |ri|mes|sa |ne |lo ’n|fer|no,
111 |là |on|de ’n|vi|dia |pri|ma |di|par|til|la.
112 |On|d’ io |per |lo |tuo |me’ |pen|so e |di|scer|no
113 |che |tu |mi |se|gui, e |io |sa|rò |tua |gui|da,
114 |e |trar|rot|ti |di |qui |per |lo|co et|ter|no;
115 |o|ve u|di|rai |le |di|spe|ra|te |stri|da,
116 |ve|drai |li an|ti|chi |spi|ri|ti |do|len|ti,
117 |ch’ a |la |se|con|da |mor|te |cia|scun |gri|da;
118 |e |ve|de|rai |co|lor |che |son |con|ten|ti
119 |nel |fo|co, |per|ché |spe|ran |di |ve|ni|re
120 |quan|do |che |sia |a |le |be|a|te |gen|ti.
121 |A |le |quai |poi |se |tu |vor|rai |sa|li|re,
122 |a|ni|ma |fia |a |ciò |più |di |me |de|gna:
123 |con |lei |ti |la|sce|rò |nel |mio |par|ti|re;
124 |ché |quel|lo im|pe|ra|dor |che |là |sù |re|gna,
125 |per|ch’ i’ |fu’ |ri|bel|lan|te a |la |sua |leg|ge,
126 |non |vuol |che ’n |sua |cit|tà |per |me |si |ve|gna.
127 |In |tut|te |par|ti im|pe|ra e |qui|vi |reg|ge;
128 |qui|vi è |la |sua |cit|tà |e |l’ al|to |seg|gio:
129 |oh |fe|li|ce |co|lui |cu’ |i|vi e|leg|ge!».