Skip to content

This is a spelling correction project I have carried out to help people correct their spelling mistakes in English.

Notifications You must be signed in to change notification settings

phkhanhtrinh23/spelling_correction_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spelling Correction

About The Project

Introduction

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.

Getting Started

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:

Installation and Run

  1. Clone the repo

    git clone https://github.com/phkhanhtrinh23/spelling_correction_project.git
  2. Use any code editor to open the folder spelling_correction_project. With python=3.8, run pip install -r requirements.txt in your corresponding conda venv.

Version 1

  1. Download the weights into spelling_correction_v1.

  2. Download the data english.txt into the data/ folder in spelling_correction_v1. The correct path is data/english.txt.

  3. Run python train.py to train the model using Transformer architecture.

  4. Run python api.py to run the Front-end + Back-end Web Demo for this application. Share your results with me!

Version 2

  1. Download the data english.txt into the data/ folder in spelling_correction_v1. The correct path is data/english.txt.

  2. Run python train.py to train the model using GPT-2.

  3. The log is saved in logs/ folder.

  4. If the training is finised, you can run python evaluate.py to evaluate the results. Again, share your results with me if possible!

Outline

  • 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.

Results

  • This is the result from the successfully built spelling_correction_v1.

Contribution

Contributions are what make GitHub such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the project
  2. Create your Contribute branch: git checkout -b contribute/Contribute
  3. Commit your changes: git commit -m 'add your messages'
  4. Push to the branch: git push origin contribute/Contribute
  5. Open a pull request

Contact

Email: phkhanhtrinh23@gmail.com

About

This is a spelling correction project I have carried out to help people correct their spelling mistakes in English.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published