Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples in our documentation #41

Open
R1j1t opened this issue Dec 17, 2020 · 2 comments
Open

Add examples in our documentation #41

R1j1t opened this issue Dec 17, 2020 · 2 comments
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@R1j1t
Copy link
Owner

R1j1t commented Dec 17, 2020

We have examples of how to use this package in English and Japanese. It would help if we can improve our documentation so that it becomes easy to understand contextualSpellCheck for others maybe add documentation in other languages.

@R1j1t R1j1t added documentation Improvements or additions to documentation help wanted Extra attention is needed labels Dec 17, 2020
@R1j1t
Copy link
Owner Author

R1j1t commented Dec 23, 2020

This looks like a good first start
https://packaging.python.org/tutorials/creating-documentation/

@jenriqps
Copy link

jenriqps commented Dec 5, 2024

This is an example for Spanish

import contextualSpellCheck
import os
os.environ['HF_HUB_DISABLE_SYMLINKS_WARNING'] = 'True'
nlp_es = spacy.load("es_core_news_sm")
print(nlp_es.pipe_names)

There are more trained models here https://huggingface.co/models?pipeline_tag=fill-mask&sort=trending&search=spanish

nlp_es.add_pipe("contextual spellchecker",
config={
"model_name": "dccuchile/bert-base-spanish-wwm-uncased",
"max_edit_dist": 2,
},)
print(nlp_es.pipe_names)

In the following, assume that doc_es is a series where each entry is a doc object

start_time=time.time()
doc_es2=doc_es.apply(lambda x: nlp_es(x.text))
end_time=time.time()
elapsed_time = end_time - start_time
print(f"Elapsed time: {elapsed_time} seconds")

Suggestions

doc_es2_err=doc_es2[doc_es2.apply(lambda x: len(x..suggestions_spellCheck)>0)]
doc_es2_err.apply(lambda x: print(x.text,"\n",x.
.suggestions_spellCheck))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants