The Sparv pipeline is a corpus annotation tool run from the command line. The documentation can be found here: https://spraakbanken.gu.se/sparv/docs.
Check the changelog to see what's new!
Sparv is developed by Språkbanken. The source code is available under the MIT license.
If you have any questions, problems or suggestions please contact sb-sparv@svenska.gu.se.
- A Unix-like environment (e.g. Linux, OS X or Windows Subsystem for Linux) Note: Most things within Sparv should work in a Windows environment as well but we cannot guarantee anything since we do not test our software on Windows.
- Python 3.6.1 or newer
- Java (if you want to run Swedish dependency parsing, Swedish word sense disambiguation or the Stanford Parser)
The Sparv pipeline can be installed using pip. We even recommend using
pipx so that you can install the sparv
command globally:
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install sparv-pipeline
Alternatively you can install Sparv from the latest release from GitHub:
pipx install https://github.com/spraakbanken/sparv-pipeline/archive/latest.tar.gz
Now you should be ready to run the Sparv command! Try it by typing sparv --help
.
The Sparv Pipeline can be used together with several plugins and third-party software. Please check the Sparv user manual for more details!
- Export of corpus metadata to META-SHARE format
- Support for Swedish historic texts
- Support for parallel corpora
- Preprocessing of indata with automatic chunking
If you want to run the tests you will need to clone this project from GitHub since the test data is not distributed with pip.
Before cloning the repository with git make sure you have Git Large File
Storage installed (apt install git-lfs
). Some files will not be downloaded correctly
otherwise.
We recommend that you set up a virtual environment and install the dependencies (including the dev dependencies) listed
in setup.py
:
python3 -m venv venv
source venv/bin/activate
pip install -e .[dev]
Now with the virtual environment activated you can run pytest
from the sparv-pipeline directory. You can run
particular tests using the provided markers (e.g. pytest -m swe
to run the Swedish tests only) or via substring
matching (e.g. pytest -k "not slow"
to skip the slow tests).