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

Summarizer() class object #3

Merged
merged 26 commits into from
Jan 18, 2023
Merged

Summarizer() class object #3

merged 26 commits into from
Jan 18, 2023

Conversation

pszemraj
Copy link
Owner

@pszemraj pszemraj commented Jan 16, 2023

  • introduces a Summarizer class object defined in summarize.py
  • this helps organize/wrangle the many functions required for processing & enables easier usage in python API

fairly straightforward

from textsum.summarize import Summarizer

summ = Summarizer()
output_path = summ.summarize_file('test.txt', batch_length=1024)
print(f"summary saved to {output_path.resolve()}")

Summarizer of course, accepts several different kwargs for defining model and so on

Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
@pszemraj pszemraj added the enhancement New feature or request label Jan 16, 2023
@pszemraj pszemraj self-assigned this Jan 16, 2023
@pszemraj
Copy link
Owner Author

colab notebook showing that the class works in MWE fashion.

still need to update CLI script with new class API

Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Copy link
Owner Author

@pszemraj pszemraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 tested and gpu works on colab for all 3 main fns with the class, see gist with notebook

@pszemraj
Copy link
Owner Author

status: everything should work except the UI in app.py which needs to be updated with the Summarizer class api

pszemraj and others added 8 commits January 18, 2023 19:45
Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Signed-off-by: Peter <74869040+pszemraj@users.noreply.github.com>
Signed-off-by: peter szemraj <peterszemraj@gmail.com>
Signed-off-by: peter szemraj <peterszemraj@gmail.com>
Signed-off-by: peter szemraj <peterszemraj@gmail.com>
Signed-off-by: peter szemraj <peterszemraj@gmail.com>
Signed-off-by: peter szemraj <peterszemraj@gmail.com>
Signed-off-by: peter szemraj <peterszemraj@gmail.com>
@pszemraj
Copy link
Owner Author

the UI works

screencapture-823239a7-d0d4-4416-gradio-live-2023-01-18-20_40_52

@pszemraj pszemraj merged commit f096278 into main Jan 18, 2023
@pszemraj pszemraj deleted the summarizer-class branch January 18, 2023 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant