This repository contains a comprehensive pipeline for authorship attribution implemented in a Jupyter Notebook format. The pipeline involves the following steps:
Authors' texts are collected from two datasets: "taamolat" and "alaraby."
The collected texts undergo several preprocessing steps, including normalization, tokenization, stop word removal, and stemming.
Two types of features are extracted from the preprocessed texts:
- TF-IDF features: Representing the importance of words in each document using the Term Frequency-Inverse Document Frequency (TF-IDF) method.
- Word Embedding features: Using FastText to generate word embeddings, representing words as dense vectors.
Several classification models are trained and evaluated using the extracted features:
- Support Vector Machine (SVM)
- Logistic Regression
- Random Forest
- K-Nearest Neighbors (KNN)
- Multilayer Perceptron (MLP)
The trained models are evaluated based on precision, recall, F1 score, and accuracy.
A graphical user interface (GUI) is created to input two texts and predict whether they are written by the same author or not using the trained models.
Users can input text samples into the GUI and select a model to predict the authorship of the texts.
To use the authorship attribution pipeline in Google Colab:
- Open the provided Jupyter Notebook (
authorship_attribution.ipynb
) in Google Colab. - Execute each cell in the notebook sequentially.
- Follow the instructions in the notebook to interact with the pipeline.
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Make your changes in the notebook.
- Test your changes.
- Commit your changes (
git commit -am 'Add new feature'
). - Push to your forked repository.
- Create a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.