Opinionated Czech Language Processing
Project description
Vltava
Opinionated Czech language processing.
The processor takes in raw documents and applies basic preprocessing (such as tags and accent striping) and lemmatization using either Majka or MorphoDiTa.
from vltava import DocumentProcessor
doc = "v televizi říkali, že zítra pršet nebude"
document_processor = DocumentProcessor()
result = document_processor.process(doc)
# result is ['televize', 'rikat', 'zitra', 'prset', 'byt']
DocumentProcessor supports multiprocessing when dealing with
large collections of documents.
from vltava import DocumentProcessor
docs = ["Ahoj, jak se máš?"] * 100
result = DocumentProcessor().process_from_iterable(docs, n_jobs=2)
Installation
pip install vltava
Backend
The package is using two different backends for finding Czech lemmas: Majka, MorphoDiTa. Check out the links for more information. The required binary files are contained directly in the package.
Public API
vltava.DocumentProcessor
vltava.DocumentProcessor(backend: str = "majka")
Initializes DocumentProcessor with the selected backend.
Methods:
DocumentProcessor.process(
self, doc: str, tokenize: bool = True
) -> Union[str, List[str]]
Processes the input doc and returns it as a processed
string or a list of processed tokens, if tokenize is True.
DocumentProcessor.process_from_iterable(
self, docs: Iterable[str], tokenize: bool = True, n_jobs: int = 1
) -> Union[Iterable[str], Iterable[List[str]]]:
Processes the input docs collection of documents. Result is either
an iterable of processed strings or an iterable of lists of processed
tokens (if tokenize is True).
If n_jobs is greater than one, multiple worker are launched to
process the documents.
Project details
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 vltava-0.1.3.tar.gz.
File metadata
- Download URL: vltava-0.1.3.tar.gz
- Upload date:
- Size: 5.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4e336e9e7f6089579b36d681a657651a92f425a102c9b063854dd0fcfa89a5a
|
|
| MD5 |
2e471c30996b4c0b5141cf42375a979f
|
|
| BLAKE2b-256 |
b8bc2e3097574e51fc46956a66fbe88fdd0fadee2ec827524b3c36803db81fff
|
File details
Details for the file vltava-0.1.3-py3-none-any.whl.
File metadata
- Download URL: vltava-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71eaafb516b57b2b964b9bdd93ed30904b9ccc2262de0c8ee12da715fc3d898f
|
|
| MD5 |
82e7627b07336bdbb44cba4c8519b342
|
|
| BLAKE2b-256 |
73fcd73b02d307a6096976017e61fd2e33bfda967317befef464e1543e994ca7
|