Skip to main content

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

Project description

Word embedding: generic iterative stemmer

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.

Lint Tests

Setup

  1. Create a python3 virtual environment.
  2. Install dependencies using make install.

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-0.1.8.tar.gz (12.9 kB view details)

Uploaded Source

File details

Details for the file generic-iterative-stemmer-0.1.8.tar.gz.

File metadata

  • Download URL: generic-iterative-stemmer-0.1.8.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for generic-iterative-stemmer-0.1.8.tar.gz
Algorithm Hash digest
SHA256 10172eee6bf360cbfbdbf76985a3d4131af82934eee9d0429c5e3e2e5014bd88
MD5 035a6af20f223f2b7418b5706ad966b0
BLAKE2b-256 2de576461e2efb06943f79184094e35cb45bba76404bfdd03c79149c8a8dada8

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