dmmiller612 / bert-extractive-summarizer

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

Trying to mimic the API's result #149

Open thijssdaniels opened 1 year ago

thijssdaniels commented 1 year ago

First of all, amazing work on the library!

I'm trying to mimic the result I get when I use the API for my text, however, in my Jupyter Notebook I'm getting a different result. I'm using the following code to get the summary:

` LANG_MODEL='distilbert-base-uncased'

custom_config = AutoConfig.from_pretrained(LANG_MODEL) custom_config.output_hidden_states=True custom_tokenizer = AutoTokenizer.from_pretrained(LANG_MODEL) custom_model = AutoModel.from_pretrained(LANG_MODEL, config=custom_config)

model = Summarizer(custom_model=custom_model, custom_tokenizer=custom_tokenizer) resp = model(text, num_sentences=6) `

Could you please tell me what I'm doing wrong?

Thanks in advance!