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

Change pre-trained model? #70

Open
ggnicolau opened this issue Mar 25, 2022 · 5 comments
Open

Change pre-trained model? #70

ggnicolau opened this issue Mar 25, 2022 · 5 comments
Labels
documentation Improvements or additions to documentation

Comments

@ggnicolau
Copy link

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 ggnicolau added the enhancement New feature or request label Mar 25, 2022
@stale
Copy link

stale bot commented Apr 24, 2022

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 stale bot added the wontfix This will not be worked on label Apr 24, 2022
@R1j1t
Copy link
Owner

R1j1t commented Apr 24, 2022

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:

import spacy
import contextualSpellCheck
nlp = spacy.load("ja_core_news_sm")
nlp.add_pipe(
"contextual spellchecker",
config={
"model_name": "cl-tohoku/bert-base-japanese-whole-word-masking",
"max_edit_dist": 2,
},
)

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!

@stale stale bot removed the wontfix This will not be worked on label Apr 24, 2022
@R1j1t R1j1t added documentation Improvements or additions to documentation and removed enhancement New feature or request labels Apr 26, 2022
@hardianlawi
Copy link

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

@linhuixiao
Copy link

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.

@shoegazerstella
Copy link

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!

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
Projects
None yet
Development

No branches or pull requests

5 participants