My project is called Spelling Correction. This is a solution which helps a person correct a sentence with spelling mistakes. This repository contains 2 versions of my soluion. The first one is successfully built (from scratch) with Transformer architecture. Besides, the second one is fine-tuned with GPT-2. However, unluckily, the second one is completely coded but it has not been trained because my computational resources were limited.
To get started, you should have prior knowledge on Python and Pytorch at first. A few resources to get you started if this is your first Python or Tensorflow project:
-
Clone the repo
git clone https://github.com/phkhanhtrinh23/spelling_correction_project.git
-
Use any code editor to open the folder spelling_correction_project. With
python=3.8
, runpip install -r requirements.txt
in your corresponding conda venv.
-
Download the weights into
spelling_correction_v1
. -
Download the data
english.txt
into thedata/
folder inspelling_correction_v1
. The correct path isdata/english.txt
. -
Run
python train.py
to train the model using Transformer architecture. -
Run
python api.py
to run the Front-end + Back-end Web Demo for this application. Share your results with me!
-
Download the data
english.txt
into thedata/
folder inspelling_correction_v1
. The correct path isdata/english.txt
. -
Run
python train.py
to train the model using GPT-2. -
The log is saved in
logs/
folder. -
If the training is finised, you can run
python evaluate.py
to evaluate the results. Again, share your results with me if possible!
-
Input:
english.txt
a English Dictionary. -
Output:
spelling_correction_v1
is based on Transformer Encoder-Decoder model. It is fast in training and inference.spelling_correction_v2
is based on GPT-2 from huggingface.co.
- This is the result from the successfully built
spelling_correction_v1
.
- Link to the YouTube demonstration.
Contributions are what make GitHub such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the project
- Create your Contribute branch:
git checkout -b contribute/Contribute
- Commit your changes:
git commit -m 'add your messages'
- Push to the branch:
git push origin contribute/Contribute
- Open a pull request
Email: phkhanhtrinh23@gmail.com