ScalaConsultants / Aspect-Based-Sentiment-Analysis

💭 Aspect-Based-Sentiment-Analysis: Transformer & Explainable ML (TensorFlow)
Apache License 2.0
543 stars 90 forks source link

module 'aspect_based_sentiment_analysis' has no attribute 'BertTokenizer' #47

Closed MustafaCelen closed 3 years ago

MustafaCelen commented 3 years ago

name = 'absa/classifier-rest-0.2' model = absa.BertABSClassifier.from_pretrained(name) tokenizer = absa.BertTokenizer.from_pretrained(name) professor = absa.Professor(...) # Explained in detail later on. text_splitter = absa.sentencizer() # The English CNN model from SpaCy. nlp = absa.Pipeline(model, tokenizer, professor, text_splitter)

I got this error module 'aspect_based_sentiment_analysis' has no attribute 'BertTokenizer' while runnnig the above code , any ideas ?

MustafaCelen commented 3 years ago

find the solution from another issue my bad...

from transformers import BertTokenizer tokenizer = BertTokenizer.from_pretrained(model_name)