This project focuses on restoring ancient epigraphs using genetic algorithms. The core idea is to predict missing words in partially destroyed epigraphs based on the content of epigraphs from the same geographic region.
-
Clone the repository:
git clone https://github.com/johnvelgakis/EpigraphRestoration.git cd EpigraphRestoration -
Install the required packages:
pip install -r requirements.txt
To run the Genetic Algorithm, use the following command:
python epigraphRestoration.py --population_size 100 --generations 1000 --crossover_rate 0.6 --mutation_rate 0.01 --elite_size 1 --num_runs 10 --improveThresh 0.01 --stagThresh 25
For interactive mode:
python epigraphRestoration.py --interactive
To run <number> experiments using random parameters from Table 1:
python testing.py --num_trials <number>
| Parameters | Values |
|---|---|
| population size | [20, 50, 100, 200, 250, 500, 1000] |
| number of generations | [250, 500, 1000] |
| crossover probability | [0.1, 0.3, 0.6, 0.9] |
| mutation probability | [0, 0.01, 0.05, 0.1] |
| number of elits | [0, 1, 2, 5, 10] |
| number of runs | [10, 15, 25] |
| improve threshold | [0.001, 0.01, 0.1] |
| stagnation threshold | [20, 50, 100] |
To run the predefined experiments:
python testing.py --exercise
To view stored results:
python testing.py --results
- epigraphRestoration.py: Main script for running the genetic algorithm for epigraph restoration.
- testing.py: Script for running multiple experiments and viewing results.
- experimentResults.csv: CSV file where experiment results are stored.
- experimentResults.txt: Text file where experiment results are logged.
- data.csv: Contains the epigraph data used for training and testing.
- media/: Directory where generated plots are saved.
EpigraphRestoration/
│
├── epigraphRestoration.py
├── testing.py
├── experimentResults.csv
├── experimentResults.txt
├── data.csv
├── requirements.txt
├── LICENSE
├── README.md
├── media/
│ └── (All the plots being saved)
Here is an example of a restored epigraph:
- Original: [...] αλεξανδρε ουδις [...]
Restored: αγενειων αλεξανδρε ουδις αρτεμισιου
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature-branch. - Make your changes and commit them:
git commit -m 'Add new feature'. - Push to the branch:
git push origin feature-branch. - Submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions or issues, please contact:
- Ioannis Velgakis - (johnvelgakis@gmail.com)