Traditional stylometry has long relied on word frequencies and n-grams to identify authors or categorize genres. However, these methods often struggle with language dependency and fail to capture the deeper structural nuances of literary prose. This paper introduces a novel approach: representing documents as semantic graphs using Word2vec embeddings. By analyzing the topological properties of these graphs, researchers can create a "fingerprint" of an author's style that is both language-agnostic and robust across different literary domains.
Methodology
The proposed system transforms a document into a network where nodes represent words and edges represent semantic relationships. The process follows a structured pipeline involving Word2vec training, node selection, and structural categorization.
- Word2vec Training: A Word2vec model is trained on the document to generate vector representations for each word.
- Node Selection: The top $N$ most frequent words are designated as "core nodes."
- Edge Weighting: Connections are established between words based on the cosine similarity of their embeddings.
- Structural Categorization: Nodes are classified into three tiers: Core nodes (high-frequency vocabulary), Multi nodes (words connected to multiple core nodes, representing central themes), and Boundary nodes (words connected to only one core node, capturing unique stylistic flourishes).
To quantify the "shape" of these graphs, the authors extract a comprehensive set of 85 to 95 features. These metrics include node degrees, edge weights, and frequency indices, which are then used to train a Support Vector Machine (SVM) for classification.
Datasets and Evaluation
The model was evaluated on three diverse corpora to test its versatility:
- Bengali Literature Corpus: A new dataset of 8 authors across genres like sci-fi and short stories.
- English Literature Fiction Corpus: A subset of Project Gutenberg covering 54 authors and 6 genres (e.g., Detective, Westerns).
- Bengali Newspaper Editorials: A contemporary dataset used to test the model outside of classical literature.
Key Results
The Word2vec graph model demonstrated significant success, particularly in genre detection. On the Bengali literature dataset, the $w2v+$ model achieved an F1-score of 92.30%, outperforming both TF-IDF (85.43%) and the transformer-based m-BERT (62.22%).
In author attribution, the model reached an F1-score of 81.40%. While m-BERT scored slightly higher at 85.98%, the graph-based approach proved more robust in specific genres and maintained its effectiveness across both Bengali and English datasets, confirming its language-independent nature.
Discussion and Future Work
The study reveals that the "shape" of a semantic graph—its density and connectivity—is a powerful stylistic indicator. For example, the model identified that some authors use a more focused vocabulary (fewer boundary nodes) compared to others who employ more divergent stylistic flourishes. By using Word2vec, the graph captures both context (meaning) and style (relational choices).
While the current classification methods are traditional, future work aims to incorporate advanced graph embedding techniques like Graph Convolutional Networks (GCNs) and scale the model to larger, more diverse datasets. This approach holds promise for broader applications, such as tracking stylistic evolution over an author's career (stylochronometry).
Summary updated