GithubHelp home page GithubHelp logo

liuzc188 / spellcorrect Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jbhoosreddy/spellcorrect

0.0 0.0 0.0 8.81 MB

A program to correct non-word spelling error in sentences using ngram MAP Language Models, Noisy Channel Model, Error Confusion Matrix and Damerau-Levenshtein Edit Distance.

License: MIT License

Python 100.00%

spellcorrect's Introduction

spellcorrect

A package to correct non-word spelling error in sentences using ngram MAP Language Models, Noisy Channel Model, Error Confusion Matrix and Damerau-Levenshtein Edit Distance.

I have encoded the datasets in a computer readable-form. Feel free to utilize the dataset and the ngram helper library (included) to improve this library or make your own. Or you can play with the hyper-parameters to improve your results. You can ping me on #IRC and Twitter at @jbhoosreddy if you have any questions.

class SpellCorrect
 |  A program to correct non-word spelling error in sentences using ngram MAP Language Models, Noisy Channel Model, Error Confusion Matrix and Damerau-Levenshtein Edit Distance.
 |  Usage:
 |  Input: 'she is a briliant acress'
 |  Response: she is a brilliant actress
 |  
 |  Methods defined here:
 |  
 |  __init__(self)
 |      Constructor method to load external nGram class, load words, confusion matrix and dictionary.
 |  
 |  channelModel(self, x, y, edit)
 |      Method to calculate channel model probability for errors.
 |  
 |  dlEditDistance(self, s1, s2)
 |      Method to calculate Damerau-Levenshtein Edit Distance for two strings.
 |  
 |  editType(self, candidate, word)
 |      Method to calculate edit type for single edit errors.
 |  
 |  genCandidates(self, word)
 |      Method to generate set of candidates for a given word using Damerau-Levenshtein Edit Distance.
 |  
 |  loadConfusionMatrix(self)
 |      Method to load Confusion Matrix from external data file.
 |  
 |  loadDict(self)
 |      Method to load dictionary from external data file.

spellcorrect's People

Contributors

jbhoosreddy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.