# Digital Authorship Attribution in Russian-Language Fanfiction and Classical Literature
## 3 Problem Statement  
When setting the mathematical formulation of the closed attribution problem, the process of establishing text authorship is given by three finite sets: \(\mathbf{A}=\{a_{1},\ldots,a_{n}\}\), \(\mathbf{T}=\{t_{1},\ldots,t_{m}\}\), \(\mathbf{T}^{\prime}=\{t^{\prime}_{1},\ldots,t^{\prime}_{s}\}\) representing the authors, texts with known authorship, and anonymous texts, respectively. Each text, including anonymous ones, corresponds to a feature vector. The solution of the problem is reduced to the calculation of the objective function \(f\big{(}t_{i}^{\prime}\big{)}=[p(a_{1}),p(a_{2}),\ldots,p(a_{n})]\), which takes an anonymous text as input and represents the probability distribution of belonging to each of the authors based on the featured text.  
The final step in authorship identification for an anonymous text is to select the author with the maximum probability based on the objective function. Texts with certain authorship are used as a training sample. An equal number of non-anonymous texts are provided for each candidate author, while anonymous texts, in contrast, are unevenly distributed across all authors. All texts used for these experiments were written in Russian.  
For closed set attribution, the previously considered classical literary texts are used to solve the authorship attribution task in a man-machine case, where machine texts were generated using RuGPT-2 [6] and RuGPT-3 [7] based on texts written by ten authors with the highest separating ability, as identified in the results of past work [5].  
When solving open set attribution, it is proposed that some anonymous texts were written by none of the candidate authors. Thus, the size of the authors' training set is over that authors' training set \((|A_{test}|>|A_{train}|)\cup(A_{test}\cap A_{train}=A_{train})\). In this case, any new authors are defined as \(-1\) class, and in the absence of sufficient similarity of the feature vector with the known samples of the authors, the new anonymous text is assigned to the negative class. Sufficient similarity in this context is determined depending on the method of open attribution: it can be a threshold value of probability, a measure of similarity between vectors calculated based on the Euclidean distance, or others.  
In addition, special attention is paid to the data specifics. There are thematic texts with special keywords, such as names of characters, locations, special phrases, etc., that are repeated in all texts. In the case of open attribution, the experiments were devoted to the thematic of fanfics, that is, we divided the task into two cases, simple and complex, including:  
* Cross-topic, in which we use authors who write fanfiction for various thematic groups;
* In-group classification, including classifications within each thematic group.  
Simplicity and complexity depend on the vocabulary of the thematic group. Let there be a set of thematic groups \(G=\{g_{1},\ldots,g_{l}\}\). That is, for the simple case: if author \(a_{1}\) writes all his texts based on the thematic group \(g_{1}\), and author \(a_{2}\) based on the group \(g_{2}\), then we assume that it will be easy to distinguish such authors because each author repeats in his texts words of his thematic category which do not occur in the other one. In the complex case, both \(a_{1}\) and \(a_{2}\) write based on only one thematic group \(g_{1}\).