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

BERT transformers - trial on google colab #3

Open
yomnamahmoud opened this issue Jul 25, 2021 · 1 comment
Open

BERT transformers - trial on google colab #3

yomnamahmoud opened this issue Jul 25, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@yomnamahmoud
Copy link

yomnamahmoud commented Jul 25, 2021

I was running the following example as part of multiple trials on google collab:

import spacy_sentence_bert

nlp = spacy_sentence_bert.load_model('en_roberta_large_nli_stsb_mean_tokens')
doc_1 = nlp('Hi there, how are you?')
doc_2 = nlp('Hello there, how are you doing today?')
print(doc_1.similarity(doc_2[0:7]))

I got the following message :

 24 
 25 # the pipeline stage factory

---> 26 @Language.factory('sentence_bert', default_config={
27 'model_name': None,
28 'debug': True

AttributeError: type object 'Language' has no attribute 'factory'

I am currently trying to trace it in the library itself but any suggestion would be appreciated,

@MartinoMensio
Copy link
Owner

hi @yomnamahmoud ,
Can you please check the version of SpaCy? You may be running a version not up to date. I think Language.factory was introduced with SpaCy v2 or higher. Now I would recommend at least spaCy v3.

Best,
Martino

@MartinoMensio MartinoMensio added the bug Something isn't working label Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants