# The New Paradigm of Deepfake Detection at the Text Level
## 3 Materials and Methods
### CDFTM Dataset  
To achieve these objectives, the authors constructed a dataset. The dataset included two categories of texts: human-generated and AI-generated. Human-generated texts were taken from the authors' articles published before 2022, corresponding to the launch of NLP models for the general public. This ensures the authenticity of the texts, as these texts cannot contain AI patterns. Synthetic data were generated to complete the dataset with AI texts. AI-generated texts were obtained using the ChatGPT, Copilot, and Gemini models. Texts from the source [49] were added to this collection to create an even larger dataset. This resulted in a dataset containing 1300 records. Of these, 650 are deepfakes, while the remaining 650 are human-generated. The initial dataset contains texts of different sizes and addresses various topics. These texts are processed according to the algorithm illustrated in the logical schema in Figure 2. The conversion algorithm of the initial dataset into the final dataset was implemented in C#. Figure 1: Conceptual diagram of the CDFTM and ADFTM as a unitary process. The average number of words per record is obtained using Equation (1):  
\[AW=\frac{\sum_{i=1}^{n}n_{words\_sentence_{i}}}{n} \tag{1}\]  
where:  
\(AW\) is the average number of words;  
\(n_{words\_sentence_{i}}\)--the total number of words in each sentence;  
\(n\)--the total number of sentences in record \(i\). The average number of characters of the words for each record is obtained according to Equation (2):  
\[AC=\frac{\sum_{i=1}^{n}\sum_{j=1}^{m}length\_word_{ij}}{\sum_{i=1}^{n}m_{i}} \tag{2}\]  
where:  
\(AC\) is the average number of characters;  
\(length\_word_{ij}\)--the length of each word in every sentence;  
\(m_{i}\)--the number of words in the record \(i\). Figure 2: Logical schema of transforming the initial dataset into the final dataset. The ratio between the number of unique words and the total number of words in each record highlights the variety of words used and the frequency of word repetition (Equation (3)):  
\[UR=\frac{\sum_{i=1}^{n}unique_{wordsi}}{\sum_{i=1}^{n}total_{wordsi}} \tag{3}\]  
where:  
_UR_ is the ratio of unique words to the total number of words in each record;  
\(unique_{wordsi}\)--the count of unique words;  
\(total_{wordsi}\)--the total number of words. The confidence level (\(CL\)) of the content expressed in the text is indicated by using the value 0 if the sentiment identified is positive or negative. Otherwise, if the sentiment is neutral or mixed, it is coded by the value 1. Based on this metric, the authors suspect that the text is generated with an NLP model if the value is 1. The extraction of the positive, negative, neutral, or mixed labels is determined using the Azure Sentiment Analysis service. The mathematical form is expressed by Equation (4):  
\[CL=\left\{ \begin{array}{ll}0,\ if\ sentiment\ is\ Positive\ or\ Negative\\ 1,\ if\ sentiment\ is\ Neutral\ or\ Mixed\end{array} \right. \tag{4}\]  
Figure 3 shows an example of converting an original text into a record to be associated with the final dataset used to train the model, as analyzed in the following sections. Thus, 13.00 is \(AW\), 5.44 is \(AC\), 0.79 is \(UR\), and 1 is the \(CL\). Figures 4-7 present a statistical summary of the dataset. Figure 4 depicts the comparative trends of the \(AW\) frequency distribution at the sentence level between AI and humans. AI shows a broader distribution, with a significantly higher number of words in its sentences. The frequency of a larger number of words at the sentence level highlights AI's use of a diversified vocabulary. Humans are more associated with sentences of 7-11 words, representing expressions of natural language. Figure 5 compares the \(AC\) frequency distribution between AI and humans. AI shows a higher frequency for long words (6 characters) and a tendency to use more complex words. This approach suggests a diversified vocabulary. In contrast, humans have a higher frequency of short words (4 characters).