All Projects → MighTguY → customized-symspell

MighTguY / customized-symspell

Licence: MIT License
Java port of SymSpell: 1 million times faster through Symmetric Delete spelling correction algorithm

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to customized-symspell

Symspell
SymSpell: 1 million times faster spelling correction & fuzzy search through Symmetric Delete spelling correction algorithm
Stars: ✭ 1,976 (+3774.51%)
Mutual labels:  levenshtein-distance, word-segmentation, spelling-correction, damerau-levenshtein, symspell
spellchecker-wasm
SpellcheckerWasm is an extrememly fast spellchecker for WebAssembly based on SymSpell
Stars: ✭ 46 (-9.8%)
Mutual labels:  levenshtein-distance, spelling-correction, spellchecker, symspell
WordSegmentationDP
Word Segmentation with Dynamic Programming
Stars: ✭ 18 (-64.71%)
Mutual labels:  word-segmentation, spelling-correction, spellchecker, symspell
LinSpell
Fast approximate strings search & spelling correction
Stars: ✭ 52 (+1.96%)
Mutual labels:  levenshtein-distance, spelling-correction, damerau-levenshtein
SymSpellCppPy
Fast SymSpell written in c++ and exposes to python via pybind11
Stars: ✭ 28 (-45.1%)
Mutual labels:  word-segmentation, spelling-correction, symspell
spell
Spelling correction and string segmentation written in Go
Stars: ✭ 24 (-52.94%)
Mutual labels:  word-segmentation, spelling-correction, symspell
spacy hunspell
✏️ Hunspell extension for spaCy 2.0.
Stars: ✭ 94 (+84.31%)
Mutual labels:  spelling-correction, spellchecker
Nkocr
🔎📝 This is a module to make specifics OCRs at food products and nutritional tables.
Stars: ✭ 15 (-70.59%)
Mutual labels:  spelling-correction, symspell
Textdistance
Compute distance between sequences. 30+ algorithms, pure python implementation, common interface, optional external libs usage.
Stars: ✭ 2,575 (+4949.02%)
Mutual labels:  levenshtein-distance, damerau-levenshtein
Semantic-Textual-Similarity
Natural Language Processing using NLTK and Spacy
Stars: ✭ 30 (-41.18%)
Mutual labels:  spelling-correction, spellchecker
Java String Similarity
Implementation of various string similarity and distance algorithms: Levenshtein, Jaro-winkler, n-Gram, Q-Gram, Jaccard index, Longest Common Subsequence edit distance, cosine similarity ...
Stars: ✭ 2,403 (+4611.76%)
Mutual labels:  levenshtein-distance, damerau-levenshtein
contextualSpellCheck
✔️Contextual word checker for better suggestions
Stars: ✭ 274 (+437.25%)
Mutual labels:  spelling-correction, spellchecker
Levenshtein
The Levenshtein Python C extension module contains functions for fast computation of Levenshtein distance and string similarity
Stars: ✭ 38 (-25.49%)
Mutual labels:  levenshtein-distance
hanzi-tools
Converts from Chinese characters to pinyin, between simplified and traditional, and does word segmentation.
Stars: ✭ 69 (+35.29%)
Mutual labels:  word-segmentation
sylbreak
Syllable segmentation tool for Myanmar language (Burmese) by Ye.
Stars: ✭ 44 (-13.73%)
Mutual labels:  word-segmentation
viconf
My (n)Vim config files
Stars: ✭ 18 (-64.71%)
Mutual labels:  spellchecker
pytorch Joint-Word-Segmentation-and-POS-Tagging
Paper: A Simple and Effective Neural Model for Joint Word Segmentation and POS Tagging
Stars: ✭ 37 (-27.45%)
Mutual labels:  word-segmentation
edits.cr
Edit distance algorithms inc. Jaro, Damerau-Levenshtein, and Optimal Alignment
Stars: ✭ 16 (-68.63%)
Mutual labels:  damerau-levenshtein
sentencepiece-jni
Java JNI wrapper for SentencePiece: unsupervised text tokenizer for Neural Network-based text generation.
Stars: ✭ 26 (-49.02%)
Mutual labels:  word-segmentation
kotlin-java-spellchecker
A simple spellcheckers on Java and Kotlin
Stars: ✭ 13 (-74.51%)
Mutual labels:  spellchecker

Travis Build Status Coverage Status License: MIT Maven Central javadoc.io

Customized SymSpell SpellCheck Java

This customized spell check is is based on the spell correction fuzzy search library SymSpell with a few customizations and optimizations

Java Ported v6.6 (Bigrams)

  • the optional bigram dictionary in order to use sentence level context information for selecting best spelling correction.

SymSpell

  • The Symmetric Delete spelling correction algorithm reduces the complexity of edit candidate generation and dictionary lookup for a given Damerau-Levenshtein distance.
  • It is six orders of magnitude faster (than the standard approach with deletes + transposes + replaces + inserts) and language independent.
  • Opposite to other algorithms only deletes are required, no transposes + replaces + inserts. Transposes + replaces + inserts of the input term are transformed into deletes of the dictionary term.
  • The speed comes from the inexpensive delete-only edit candidate generation and the pre-calculation.

Customizations

  • We replaced the Damerau-Levenshtein implementation with a weighted Damerau-Levenshtein implementation: where each operation (delete, insert, swap, replace) can have different edit weights.
  • We added some customizing "hooks" that are used to rerank the top-k results (candidate list). The results are then reordered based on a combined proximity
    • added keyboard-distance to get a dynamic replacement weight (since letters close to each other are more likely to be replaced)
    • do some query normalization before search

Keyboard based Qwerty/Qwertz Distance

There are 2 implementations of the keyboards one is English Qwerty based and other is German Qwertz based implementation we used the adjancey graph of the keyboard for the weights to the connected nodes.

Example

For 2 terms: 
        slices  
        olives

If the misspelled word is, slives 
both slices and olives is 1 edit distnace, 
  so in default case the one with higher frequency will end up in the result.
While with the qwerty based char distance,
 slives is more closer to slices.

The reason for this is in Qwerty Based Keyboard, 
 S and O are too far while V and C are adjacent.

Generation of Deletes

Word deletes are generated with taking edit distance which is minimum of max edit distance and 0.3 * word.length

Usage

Solr Usage

Accuracy Summary

Indexed Docs: 3695

Searches: 8060

Spellcorrection Strategy Accuracy Failures TP TN FP FN
LUCENE 78.96% 21.04% 5883 481 146 1550
Vanilla SymSpell 88.80% 11.20% 6888 269 358 545
Weighted SymSpell 75.74% 24.26% 5781 324 303 1652
Qwerty Vanilla SymSpell 88.57% 11.43% 6860 279 348 573
Qwerty Weighted SymSpell 75.36% 24.64% 5744 330 297 1689

Benchmark Summary

We have done 3 runs each for 30k and 80k data set, which also includes results for each verbosity level. After the runs the final benchmarking looks like:

Average Precalculation time instance 30843.33 ms
Average Lookup time instance 138141.09296296295 ns ~ 0.03814 ms
Total Lookup results instance 648092

More Detailed summary

Built With

Versioning

We use SemVer for versioning.

Nexus

Licenese

The MIT License (MIT)
Copyright © 2019 Lucky Sharma ( https://github.com/MighTguY/customized-symspell )
Copyright © 2018 Wolf Garbe (Original C# implementation https://github.com/wolfgarbe/SymSpell )

Permission is hereby granted, free of charge, to any person 
obtaining a copy of this software and associated documentation files
(the “Software”), to deal in the Software without restriction, 
including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is 
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall 
be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, 
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR 
THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Special Mentions

Sachin Lala

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].