microsoft / AzureML-BERT

End-to-End recipes for pre-training and fine-tuning BERT using Azure Machine Learning Service
https://azure.microsoft.com/en-us/blog/microsoft-makes-it-easier-to-build-popular-language-representation-model-bert-at-large-scale/
MIT License
393 stars 127 forks source link

BERTopic not working on AzureML #68

Open jnicholls82 opened 2 years ago

jnicholls82 commented 2 years ago

Hello, has anyone successfully got BERTopic running on AzureML?

Environment: Azure ML 3.8

Having installed the BERTopic (pip install BERTopic), I then use the following starter code (from the BERTopic GitHub):

from bertopic import BERTopic
from sklearn.datasets import fetch_20newsgroups

docs = fetch_20newsgroups(subset='all',  remove=('headers', 'footers', 'quotes'))['data']

topic_model = BERTopic()
topics, probs = topic_model.fit_transform(docs)

After running for around 4 minutes, this gives the following error: UFuncTypeError: ufunc 'correct_alternative_cosine' did not contain a loop with signature matching types <class 'numpy.dtype[float32]'> -> None

Any support would be gratefully received!

Regards, James