contextualSpellCheck icon indicating copy to clipboard operation
contextualSpellCheck copied to clipboard

Change pre-trained model?

Open ggnicolau opened this issue 2 years ago • 5 comments

I'm trying to create a spell checker proof-of-concept (POC) for an e-commerce search engine. We're already using Transformers architecture of other tasks and I thought about trying it also with spell checker.

I've came across this beatiful API and I want to give it a try. I've seen it uses BERT classical pre-trained model. But I need to use a pre-trained model in portuguese (such as 'BERTimbau') or multi-cross lingual (such as miniLM).

It would be good if we could pass the desired pre-trained model as a parameter for the function.

I may be wrong and it's already implemented. Correct me if I'm wrong. Is there an easy solution or where I can choose my pre-trained model without going low-level?

ggnicolau avatar Mar 25 '22 14:03 ggnicolau

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Apr 24 '22 15:04 stale[bot]

Hey @ggnicolau, apologies for the delayed response. The package supports the passing of custom models to spacy pipeline and/or contextual spellchecker. Can you please refer to the below snippet:

https://github.com/R1j1t/contextualSpellCheck/blob/88bbbb46252c534679b185955fd88c239ed548a7/examples/ja_example.py#L1-L12

If this does not solve the issue, please let me know, and we can work from there! Furthermore, from this issue, it seems that documentation (README) can be updated with this use case. I will update the label accordingly!

R1j1t avatar Apr 24 '22 18:04 R1j1t

I think the codes do not work for all pre-trained models. I tried changing bert-base-cased to roberta-large and it did not work for the example in the documentation

hardianlawi avatar Nov 27 '22 05:11 hardianlawi

Thank you very much. Due to area internet access limitations, the Bert_base_cased model can‘t be loaded from the internet automatically, this code solves my problem that loading the Bert model from the compute disk.

linhuixiao avatar Aug 01 '23 05:08 linhuixiao

Hi, I am also trying this model bert-base-multilingual-uncased and it seem not to work. I am aiming at a multi-language spell-checker. Any tips on that? thank you!

shoegazerstella avatar Oct 31 '23 11:10 shoegazerstella