Rule-based Idea Unit segmentation algorithm for the English language.
Project description
IUExtract
Rule-based Idea Unit segmentation algorithm for the English language.
Installation
First of all, you need to install the dependencies:
pip install spacy
python -m spacy download en_core_web_lg
To install the package with the command line tool install pipx and run the following command:
pipx install iuextract
If the install fails you might want to try to pin a specific python version with the following command:
pipx install iuextract --python 3.9
Note: on first run, the program will download the Spacy model en_core_web_lg. This could take some time. A custom Spacy model can be selected when importing the module into your python projects.
If you only wish to use the package in your python projects you can install without executable via
pip install iuextract
Command Line Interface (CLI) Usage
Once installed via pipx, you can run iuextract via
iuextract -i input_file.txt
to segment file.txt into Idea Units.
If installed iuextract via pip you can still run the program via CLI with the following command:
python -m iuextract -i input_file.txt
Input text as argument
If you run iuextract without the -i argument, the program will look for positional arguments to segment.
For example
iuextract My dog, Chippy, just won its first grooming competition.
will output
D1|My dog,
2|Chippy,
D1|just won its first grooming competition.
Note: all positional arguments are joined into a single string. There is no need to put the text between quotation marks.
Output file
If you don't specify an outp file in the arguments, the segmented file will be printed on the console as standard output.
You can specify an output file with the -o parameter.
iuextract -i input_file.txt -o output_file.txt
Additional arguments
For additional arguments, such as specifying the separator between the IUs and the index, you can call iuextract with the help argument and get a list of possible arguments.
iuextract -h
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iuextract-1.0.6.tar.gz.
File metadata
- Download URL: iuextract-1.0.6.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4728711bf95cf5e8ec50ac4395d6906471669a1a69a55bc691e6e4d2ce5ed54
|
|
| MD5 |
85a78fa81b0497a84c835397ac27de3f
|
|
| BLAKE2b-256 |
54793b8293a64649a6624facf9258c380a304b1a65a605932ae76262e1638e79
|
File details
Details for the file IUExtract-1.0.6-py3-none-any.whl.
File metadata
- Download URL: IUExtract-1.0.6-py3-none-any.whl
- Upload date:
- Size: 19.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07be7096e9085fe52bce18e61759b2cc87bb80ee71aa4b298a1481fe1fd3d715
|
|
| MD5 |
21437aa69d01141efaf518ba60ce88cb
|
|
| BLAKE2b-256 |
7fbf7e2307b7723f35346e946a14415d029a861d504ed106442cb4c34fcc2f73
|