Skip to main content

TakeSpellChecker

TakeSpellChecker is a package that checks the spelling of words in any language using machine learning. It corrects the misspelled word by combining the context of the surrounding words to predict a list of the probable words and finds the one with the highest character similarity. The solution uses word embedding to learn the context. So, it's required to pass the path of the word embedding file. Also supports optionally to pass a configuration file (if the file is in an Azure fileshare, in other words, if the parameter from_azure is true).

TakeSpellChecker.SpellCheck: create constructor

  • path: str
  • path is the full embedding path to your word embedding model. Optionally, you can also set from_azure as True and pass a configuration file path to path.
  • from_azure: boolean
  • from_azure is an optional parameter. If you need to automatically download an embedding model from azure file share, you need to set this parameter as True and pass a configuration file to path instead of an embedding file.

TakeSpellChecker.set_data: sets the data

  • data: list, series, dataframe or a string that represents the file path
  • data is the content that needs to be processed. It can be a list, series, string or dataframe.
  • content_column_name: str
  • content_column_name is an optional parameter. It's only required when the data's type is a Dataframe or a path to the text file. If the column name is not set, the set_data method uses the first column as content
  • file_sep: str
  • file_sep is an optional parameter. It's only required when the data's is a path to the text file. If the file separator is not set, the set_data uses ';'.
  • encoding: str
  • encoding is an optional parameter. It's only required when the data's is a path to the text file. If the file encoding is not set, the set_data uses 'utf-8'.

TakeSpellChecker.spell_check: checks the spelling of the data

  • window_limit: int
  • window_limit is an optional parameter. Used to determine how many words of the sentence will be used as context.
  • threshold: float
  • threshold is an optional parameter. Used to determine how permissive your spell checker will be.
  • save_result: boolean
  • save_result is an optional parameter. If save_result is True, a file (output_spell_check.csv) with the columns: Original, SpellChecked and Corrected will be created in the same directory. The last column is an boolean column indicating if any word in the sentence was corrected.
  • output_file_name: str
  • output_file_name is an optional parameter. If save_result is True and output_file_name is set, the file will output_spell_check.csv) with the columns: Original, SpellChecked and Corrected will be created in the same directory

config.yml

account_name: my_account_name
account_key: my_key
directory: my_directory_name
embedding_file: my_embedding_file_name
embedding_share: my_file_share_name

Installation

Use the package manager pip to install TakeSpellChecker

pip install TakeSpellChecker

Usage

import TakeSpellChecker as sc

spell_checker = sc.SpellCheck(path, from_azure = True)
spell_checker.set_data(data)
corrected_df = spell_checker.spell_check(window_limit = 5, threshold = 0.94, save_result = True)
print(corrected_df)

Author

Karina Tiemi Kato

License

MIT

Release files for TakeSparkSpellChecker 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for TakeSparkSpellChecker 0.0.6
File Size Uploaded
TakeSparkSpellChecker-0.0.6.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for TakeSparkSpellChecker 0.0.6
File Interpreter ABI Platform
TakeSparkSpellChecker-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 9.8 kB

Release files / TakeSparkSpellChecker-0.0.6.tar.gz

Download URL TakeSparkSpellChecker-0.0.6.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9e88eae6fa7f808e717feb6d21a0d12f7f97b6fd94f3851b8ffb04b3dabb369f
BLAKE2b-256 checksum
How to use checksums
5c422b543bcba6c930475bb12d07697117598959dbbc2b83cd9c74a23d765053
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release files / TakeSparkSpellChecker-0.0.6-py3-none-any.whl

Download URL TakeSparkSpellChecker-0.0.6-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b0863c538b98bafa3c34f0f14e0272282972a34168a261dfb99f0daf6b8f874
BLAKE2b-256 checksum
How to use checksums
d5ddc735c55aee34676fe45203184d71f4c1551715af8278df50741268570858
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page