This project aims to correct common typing errors using a deep learning model.
This guide will walk you through setting up the project environment and running the scripts. We will use conda for managing our project's dependencies, which helps avoid conflicts with other Python projects on your system.
If you don't have conda installed, you'll need to install either Miniconda (recommended for a minimal installation) or Anaconda. Follow the instructions on their respective websites for your operating system.
This project requires a specific Python version (3.8) and TensorFlow 2.10.0, which is compatible with CUDA 11.2 and cuDNN 8.1.1 for GPU acceleration.
- Open your terminal or Anaconda Prompt.
- Create the
tf210_py38conda environment:When prompted to proceed, typeconda create -n tf210_py38 python=3.8
yand press Enter. - Activate the newly created environment:
You should see
conda activate tf210_py38
(tf210_py38)at the beginning of your terminal prompt, indicating that the environment is active.
With your tf210_py38 environment activated, you can now install the necessary libraries for the project.
- Navigate to the project directory (where this
README.mdfile is located) in your terminal. - Install the dependencies using pip:
This will install all the required Python packages.
pip install -r requirements.txt
This project uses the GitHub Typo Corpus v1.0.0 for training.
To prepare the data, run the following scripts in order within your activated tf210_py38 environment:
- Extract data:
python extract.py
- Generate dataset:
python generate_dataset.py
To run any of the project's scripts, ensure your tf210_py38 Conda environment is active.
-
To start the main AI training script:
start.bat
This script is configured to use the Python executable from your
tf210_py38environment. -
To run other Python scripts (e.g., tests):
python test_ai.py
Make sure you are in the project's root directory and the
tf210_py38environment is active.
For optimal performance with TensorFlow, especially for training, ensure you have the following installed on your system:
- CUDA Toolkit: Version 11.2
- cuDNN: Version 8.1.1
TensorFlow 2.10.0 is compatible with these versions. If you have a compatible NVIDIA GPU, installing these will allow TensorFlow to utilize it for faster computations. Refer to the official TensorFlow documentation for detailed installation instructions for GPU support.
To ensure you are using the correct Python environment:
- After activating your
tf210_py38environment, run:It should outputpython --version
Python 3.8.x. - To see which Python executable is being used, run:
(on Windows) or
where python
(on Linux/macOS). The output should point to thewhich python
python.exewithin yourtf210_py38conda environment (e.g.,C:\Users\Admin\miniconda3\envs\tf210_py38\python.exe).