Skip to content

Commit

Permalink
Update docs (#4)
Browse files Browse the repository at this point in the history
this PR updates the docs on the README to reflect the package is now on
pypi.

Also added the ability to install `unidecode` optionally if desired.

Signed-off-by: peter szemraj <[email protected]>
  • Loading branch information
pszemraj authored Jan 18, 2023
1 parent 83a11f5 commit 7405685
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Install using pip:

```bash
# create a virtual environment (optional)
pip install git+https://github.com/pszemraj/textsum.git
pip install textsum
```

The `textsum` package is now installed in your virtual environment. You can now use the CLI or python API to summarize text docs see the [Usage](#usage) section for more details.
Expand All @@ -40,6 +40,16 @@ cd textsum
pip install -e .[all]
```

### Additional Details

This package uses the [clean-text](https://github.com/jfilter/clean-text) python package, and like the "base" version of the package **does not** include the GPL-licensed `unidecode` dependency. If you want to use the `unidecode` package, install the package as an extra with `pip`:

```bash
pip install textsum[unidecode]
```

In practice, text cleaning pre-summarization with/without `unidecode` should not make a significant difference.

## Usage

There are three ways to use this package:
Expand All @@ -50,6 +60,10 @@ There are three ways to use this package:

### Python API

To use the python API, import the `Summarizer` class and instantiate it. This will load the default model and parameters.

You can then use the `summarize_string` method to summarize a long string of text.

```python
from textsum.summarize import Summarizer

Expand Down Expand Up @@ -96,7 +110,7 @@ textsum-dir --help
For convenience, a UI demo[^1] is provided using [gradio](https://gradio.app/). To ensure you have the dependencies installed, clone the repo and run the following command:

```bash
pip install -e .[app]
pip install textsum[app]
```

To run the demo, run the following command:
Expand All @@ -116,7 +130,7 @@ This will start a local server that you can access in your browser & a shareable
- [x] add CLI for summarization of all text files in a directory
- [x] python API for summarization of text docs
- [ ] add argparse CLI for UI demo
- [ ] put on pypi
- [x] put on pypi
- [ ] optimum inference integration, LLM.int8 inference
- [ ] better documentation [in the wiki](https://github.com/pszemraj/textsum/wiki), details on improving performance (speed, quality, memory usage, etc.)

Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ all =
%(app)s
%(optimum)s
%(8bit)s
unidecode = unidecode
# Add here test requirements (semicolon/line-separated)
testing =
setuptools
Expand Down

0 comments on commit 7405685

Please sign in to comment.