Skip to main content

Opinionated Czech Language Processing

Project description

Vltava

PyPI Test Publish

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

vltava-0.1.3.tar.gz (5.1 MB view details)

Uploaded Source

Built Distribution

vltava-0.1.3-py3-none-any.whl (5.1 MB view details)

Uploaded Python 3

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

Hashes for vltava-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d4e336e9e7f6089579b36d681a657651a92f425a102c9b063854dd0fcfa89a5a
MD5 2e471c30996b4c0b5141cf42375a979f
BLAKE2b-256 b8bc2e3097574e51fc46956a66fbe88fdd0fadee2ec827524b3c36803db81fff

See more details on using hashes here.

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

Hashes for vltava-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 71eaafb516b57b2b964b9bdd93ed30904b9ccc2262de0c8ee12da715fc3d898f
MD5 82e7627b07336bdbb44cba4c8519b342
BLAKE2b-256 73fcd73b02d307a6096976017e61fd2e33bfda967317befef464e1543e994ca7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page