Open Seyedhosseinzadeh opened 2 years ago
This is an old issue, so I'm not sure how helpful my comment is, but the elipsis, although a valid token in python, were merely meant as placeholders for actual code. Try something like this:
import transformers
name = 'absa/classifier-rest-0.2'
reference_recognizer = absa.aux_models.BasicReferenceRecognizer.from_pretrained('absa/basic_reference_recognizer-rest-0.1')
professor = absa.Professor(reference_recognizer=reference_recognizer)
model = absa.BertABSClassifier.from_pretrained(name)
tokenizer = transformers.BertTokenizer.from_pretrained(name)
text_splitter = absa.sentencizer() # The English CNN model from SpaCy.
nlp = absa.Pipeline(model, tokenizer, professor, text_splitter)
I run this sample:
import aspect_based_sentiment_analysis as absa name = 'absa/classifier-rest-0.2' model = absa.BertABSClassifier.from_pretrained(name) tokenizer = 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)
task = nlp.preprocess(text="We are great fans of Slack", aspects=['slack']) tokenized_examples = nlp.tokenize(task.examples) input_batch = nlp.encode(tokenized_examples) output_batch = nlp.predict(input_batch) predictions = nlp.review(tokenized_examples, output_batch) completed_task = nlp.postprocess(task, predictions)
but actually I got error in this line : completed_task = nlp.postprocess(task, predictions)
details: 41 42 is_reference = self.reference_recognizer(example, output) \ ---> 43 if self.reference_recognizer else None 44 patterns = self.pattern_recognizer(example, output) \ 45 if self.pattern_recognizer and is_reference is not False else None
TypeError: 'ellipsis' object is not callable
could you help to solve the issue?