dmmiller612 / bert-extractive-summarizer

Easy to use extractive text summarization with BERT
MIT License
1.4k stars 308 forks source link

NameError: name 'AlbertModel' not defined #113

Closed 3th4n1sn3rd closed 2 years ago

3th4n1sn3rd commented 3 years ago

I am facing this issue in python 3.8.11 where the library is getting an error while running a simple program.

first sample code

` from summarizer import Summarizer

body = 'Text body that you want to summarize with BERT' body2 = 'Something else you want to summarize with BERT' model = Summarizer() print(model(body)) print(model(body2)) `

Error Occured

Traceback (most recent call last): File "bert_summary.py", line 9, in <module> from summarizer import Summarizer File "/home/devpc/anaconda3/lib/python3.8/site-packages/summarizer/__init__.py", line 1, in <module> from summarizer.model_processors import Summarizer, TransformerSummarizer File "/home/devpc/anaconda3/lib/python3.8/site-packages/summarizer/model_processors.py", line 6, in <module> from summarizer.bert_parent import BertParent File "/home/devpc/anaconda3/lib/python3.8/site-packages/summarizer/bert_parent.py", line 9, in <module> class BertParent(object): File "/home/devpc/anaconda3/lib/python3.8/site-packages/summarizer/bert_parent.py", line 21, in BertParent 'albert-base-v1': (AlbertModel, AlbertTokenizer), NameError: name 'AlbertModel' is not defined

albertError

dmmiller612 commented 2 years ago

what version on transformers do you have? if you pip install requirements.txt it should be there.