Skip to main content

A generic language stemming utility, dedicated for gensim word-embedding.

Project description

Word embedding: generic iterative stemmer

PyPI version Pipeline codecov Ruff Code style: black Imports: isort Type checked: mypy Linting: pylint

A generic helper for training gensim and fasttext word embedding models.
Specifically, this repository was created in order to implement stemming on a Wikipedia-based corpus in Hebrew, but it will probably also work for other corpus sources and languages as well.

Important to note that while there are sophisticated and efficient approaches to the stemming task, this repository implements a naive approach with no strict time or memory considerations (more about that in the explanation section).

Based on https://github.com/liorshk/wordembedding-hebrew.

Setup

  1. Create a python3 virtual environment.
  2. Install dependencies using make install (this will run tests too).

Usage

This section shows the basic flow this repository was designed to perform. It supports more complicated flows as well.

The output of the training process is a StemmedKeyedVectors object (in the form of a .kv file), which inherits the standard gensim.models.KeyedVectors.

  1. Under ./data folder, create a directory for your corpus (for example, wiki-he).
  2. Download Hebrew (or any other language) dataset from Wikipedia:
    1. Go to wikimedia dumps.
    2. Download hewiki-latest-pages-articles.xml.bz2, and save it under ./data/wiki-he.
  3. Create your initial text corpus: TODO: create a notebook for that.
  4. Train the model: TODO: create a notebook for that.
  5. Play with your trained model using playground.ipynb.

Generic iterative stemming

TODO: Explain the algorithm.

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

generic_iterative_stemmer-1.1.6.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

generic_iterative_stemmer-1.1.6-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file generic_iterative_stemmer-1.1.6.tar.gz.

File metadata

File hashes

Hashes for generic_iterative_stemmer-1.1.6.tar.gz
Algorithm Hash digest
SHA256 126de712f315f00a1da8a2fa45f3e5b26e88fd0e5a44440a7d05e676dca3bb87
MD5 495b0876fa0de2f77c5215b16560c653
BLAKE2b-256 4d39b6604ce827ea688a7e4fabd4676cb5f4b5792846bbe92926c4a639e4b060

See more details on using hashes here.

File details

Details for the file generic_iterative_stemmer-1.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for generic_iterative_stemmer-1.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 12c80020b191090d60315ad83278e097fc595af0bcce7e303806b3e023e099cb
MD5 1f0bb1d014809b057034179498f35175
BLAKE2b-256 450622191f1b2ede2d9f46a60e96274b28ca45ffa841fbdd8cbaae252690250e

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