Code to run the Extra algorithm for unsupervised topic extraction.
Table of Contents
Code to run the Extra algorithm for the unsupervised topic/aspect extraction on English texts.
- When running Extra inside docker-container, make sure that Docker process has enough resources. For example, on Mac/Windows it should have at least 8 Gb of RAM available to it. Read More about RAM Requirements
- GitHub repo does not come with Glove Embeddings. See section
Downloading Embeddingsfor how to download the required embeddings.
This is a preferred way to run
You can find instructions on how to run
extra-model using CLI or as a Python package here
First, build the image:
Then, run following command to make sure that
extra-model was installed correctly:
docker-compose run test
Next step is to download the embeddings (we use Glove from Stanford in this project).
To download the required embeddings, run the following command:
docker-compose run --rm setup
The embeddings will be downloaded, unzipped and formatted into a space-efficient format. Files will be saved in the
embeddings/ directory in the root of the project directory. If the process fails, it can be safely restarted. If you want to restart the process with new files, delete all files except
README.md in the
docker-compose build again
After you've downloaded the embeddings, you may want to run
docker-compose build again.
This will build an image with embeddings already present inside the image.
The tradeoff here is that the image will be much bigger, but you won't spend ~2 minutes each time you run
extra-model waiting for embeddings to be mounted into the container.
On the other hand, building an image with embeddings in the context will increase build time from ~3 minutes to ~10 minutes.
extra-model is as simple as:
docker-compose run extra-model /package/tests/resources/100_comments.csv
NOTE: when using this approach, input file should be mounted inside the container.
By default, everything from
extra-model folder will be mounted to
This can be changed in
This will produce a
result.csv file in
/io/ (default setting) folder.
There are multiple flags you can set to change input/outputs of extra. You can find them by running:
docker-compose run extra-model --help
Our official documentation is the best place to continue learning about
- Explanation of inputs/outputs
- Step-by-step workflow of what happens inside of
- Examples of how
extra-modelcan be used in downstream applications
- Detailed explanation of how to run
extra-modelusing different interfaces (via
docker-compose, via CLI, as a Python package).
extra-model was written by
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for extra_model-0.4.0-py3-none-any.whl