bert-quote-attribution and Grimbert
bert-quote-attribution
During my master's thesis, I wanted to extract conversational character networks from novels. To do so, I had to automatically detect quote speakers in novels: that is, perform quote attribution. Since addressee attribution was a much harder task, I did not tackle it at the time.
That was the start of the bert-quote-attribution project. at the
time, BERT (1) was very new, and I used it to
generate representations from quotes and potential candidate
speakers. I then trained a ranker based on those features, that would
output a score between 0 and 1 to decide whether or not a candidate
was a quote speaker. The ranker was trained on a dataset of 3
classical novels introduced by Muzny et al., 2017
(2). See my
master's thesis for more
details. Documentation is available at
https://aethor.gitlab.io/bert-quote-attribution.
At the time, visualizing attention was all the rage, so the project even includes an attention visualizer:
Figure 1: The attention visualizer of the bert-quote-attribution project, written using the Python bindings to Gtk3
Grimbert
Grimbert is a new and improve version of my previous
bert-quote-attribution project, and is used in
Renard. Compared to its previous iteration, Grimbert
is installable using pip, the training loop uses huggingface instead
of being manually implemented which allows more parameters, the
training can be monitored by sacred, and it supports the PDNC
(3) dataset as well as the original one
from Muzny et al., 2017 (2).