Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are there instructions on how to generate summaries from provided models? #7

Closed
RevanthRameshkumar opened this issue Nov 17, 2020 · 3 comments

Comments

@RevanthRameshkumar
Copy link

Hello,
Are there any instructions on how to use the provided bins/joblibs to generate summaries from a file or string?

Thanks!

@tingofurro
Copy link
Collaborator

tingofurro commented Feb 2, 2021

Hello Revanth,

Sorry for the late reply.
Here's how one could use the pre-trained model to generate a summary:

from model_generator import GeneTransformer

generator = GeneTransformer(device="cuda") # Initialize the generator
generator.reload("/path/to/summary_loop_length_61.bin")
document = "This is a long document I want to summarize"

# Have to put in list because the decode function is meant to be used in batches for efficiency.
# You can use a beam size or not (beam_size), and you can use sampling or not (sample), without sampling it does argmax/top_k

summary = generator.decode([document], max_output_length=61, beam_size=1, return_scores=False, sample=False)

I hope this helps and sorry for the very late answer...
I love the CRD3 dataset by the way!

Philippe

@badrinath-reddy
Copy link

Hi,

I could not find "summary_loop_length_61.bin" model in releases,

Thanks

@NightMachinery
Copy link

@Badrinath Reddy commented on Jun 1, 2021, 11:17 AM GMT+4:30:

Hi,

I could not find "summary_loop_length_61.bin" model in releases,

Thanks

https://github.com/CannyLab/summary_loop/releases/download/v0.1/summary_loop_length46.bin is there though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants