dmmiller612 / bert-extractive-summarizer

Easy to use extractive text summarization with BERT
MIT License
1.39k stars 307 forks source link

'Summarizer' object is not callable #48

Open avinash-550 opened 4 years ago

avinash-550 commented 4 years ago

from summarizer import Summarizer model = Summarizer() No problem in running above two lines result = model(a, min_length=60) When I run this it says:

'Summarizer' object is not callable

Ad1tyaV commented 4 years ago

@Viwarrior Try these in sequence pip install torch==1.6.0+cpu torchvision==0.7.0+cpu -f https://download.pytorch.org/whl/torch_stable.html

Then

pip install bert-extractive-summarizer==0.4.2 ( or ) pip install bert-extractive-summarizer==0.5.0

Then in import try these two lines

import torch
from summarizer import Summarizer

Everything should work fine :)

YatinKapoor commented 3 years ago

@Ad1tyaV It is still giving the same error for me. Kindly help.

Taneesha-creates commented 2 years ago

@Ad1tyaV Do you know another solution for the same? I'm facing the same difficulty

Ad1tyaV commented 2 years ago

@Taneesha-creates Yes that solution seems to be incompatible now, it worked back then, but based on python version, the package versions need to be tweaked a little bit, try this, I used this for reference

dmmiller612 commented 2 years ago

Do you get the same error if you run TransformerSummarizer?

As in:

from summarizer import TransformerSummarizer

If this throws an import error, then it is likely that another package is installed with the summarizer package.

deanlongio commented 2 years ago

Hi guys. Any update on this?

I have tried pip3 install bert-extractive-summarizer

then

pip3 install summarize

but none of these work

I also triedfrom summarizer import TransformerSummarizer

but it didn't work with TransformerSummarizer (not recognized)

Any suggestion?

dmmiller612 commented 2 years ago

You definitely don't want to pip install summarize. That is a different library, and it is overriding the bert-extractive-summarizer library. If from summarizer import TransformerSummarizer that means that you have another summarizer library installed.

apragm commented 2 years ago

I have the same issue TypeError: 'Summarizer' object is not callable, did someone found a solution? I am not able to use Summarizer because of that, even when installing bert-extractive-summarizer as suggested here...

dmmiller612 commented 2 years ago

what happens when you try: from summarizer import TransformerSummarizer

apragm commented 2 years ago

I get a ImportError: cannot import name 'TransformerSummarizer' from 'summarizer' (C:\Users\glom\AppData\Local\Programs\Python\Python310\lib\site-packages\summarizer__init__.py)

Also, for some reason I am not able to install bert-extractive-summarizer anymore (I get a Failed to build tokenizers error) but it might not be related.

dmmiller612 commented 2 years ago

the error most likely means you already have a package called summarizer installed. For the latter error, I am not sure. Would have to see full error message.

claudiaor commented 2 years ago

Hi here,

I am sure I do not have summarizer but bert-extractive-summarizer installed.

Still, haven't been successful, I get the error: ModuleNotFoundError: No module named 'summarizer'

I ran from summarizer import TransformerSummarizer

and get the same error

Any help is appreciated.

PriyeshDave commented 2 years ago

Hi @claudiaor I am facing the same issue. Were you able to resolve this? Would really appreciate your help.

ThePipsPlug commented 2 years ago

Hey, I have been facing the same issue. Has there been a found solution or way in which I can bypass using this package to still get an extractive summary?

soja735 commented 1 year ago

Do all package installations on the desired project path in terminal and try these , also check venv is activated

import torch from summarizer.bert import Summarizer

worked for me :)

rdius commented 1 year ago

@soja735 thank you, works for me too and you do not need to import torch.

from summarizer.bert import Summarizer only works perfectly.