HHousen / TransformerSum

Models to perform neural summarization (extractive and abstractive) using machine learning transformers and a tool to convert abstractive summarization datasets to the extractive task.
https://transformersum.rtfd.io
GNU General Public License v3.0
429 stars 58 forks source link

Abstractive summarization model example not working #44

Closed Pekkoo closed 3 years ago

Pekkoo commented 3 years ago

Hello,

https://transformersum.readthedocs.io/en/latest/abstractive/training.html#example does not seem to work.

We get the following error after installing the environment with conda env create --file environment.yml:

Traceback (most recent call last):
  File "/home/ec2-user/transformersum/src/main.py", line 434, in <module>
    main(main_args)
  File "/home/ec2-user/transformersum/src/main.py", line 74, in main
    model = summarizer(hparams=args)
  File "/home/ec2-user/transformersum/src/abstractive.py", line 123, in __init__
    self.tokenizer.add_tokens(self.rouge_sentence_split_token)
  File "/home/ec2-user/anaconda3/envs/transformersum/lib/python3.9/site-packages/torch/nn/modules/module.py", line 778, in __getattr__
    raise ModuleAttributeError("'{}' object has no attribute '{}'".format(
torch.nn.modules.module.ModuleAttributeError: 'AbstractiveSummarizer' object has no attribute 'tokenizer'

Wondering if this is related to package version inconsistencies or something else? Cheers.

HHousen commented 3 years ago

@Pekkoo This is a bug caused by the changes made to abstractive.py in 58c4786. I just fixed this in 9294897.