Detecting Spells in Fantasy Literature with a Transformer Based
  Artificial Intelligence
Marcel Moravek Alexander Zender Andreas Müller
Transformer architectures and models have made significant progress in
language-based tasks. In this area, is BERT one of the most widely used and
freely available transformer architecture. In our work, we use BERT for
context-based phrase recognition of magic spells in the Harry Potter novel
series. Spells are a common part of active magic in fantasy novels. Typically,
spells are used in a specific context to achieve a supernatural effect. A
series of investigations were conducted to see if a Transformer architecture
could recognize such phrases based on their context in the Harry Potter saga.
For our studies a pre-trained BERT model was used and fine-tuned utilising
different datasets and training methods to identify the searched context. By
considering different approaches for sequence classification as well as token
classification, it is shown that the context of spells can be recognised.
According to our investigations, the examined sequence length for fine-tuning
and validation of the model plays a significant role in context recognition.
Based on this, we have investigated whether spells have overarching properties
that allow a transfer of the neural network models to other fantasy universes
as well. The application of our model showed promising results and is worth to
be deepened in subsequent studies.