A generic language 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.
Setup
- Create a
python3
virtual environment. - 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
.
- Under
./data
folder, create a directory for your corpus (for example,wiki-he
). - Download Hebrew (or any other language) dataset from Wikipedia:
- Go to wikimedia dumps.
- Download
hewiki-latest-pages-articles.xml.bz2
, and save it under./data/wiki-he
.
- Create your initial text corpus: TODO: create a notebook for that.
- Train the model: TODO: create a notebook for that.
- Play with your trained model using
playground.ipynb
.
Generic iterative stemming
TODO: Explain the algorithm.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file generic_iterative_stemmer-1.1.4.tar.gz
.
File metadata
- Download URL: generic_iterative_stemmer-1.1.4.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9f1a4a08b104b7d091182594e5b5e5a07c59fbe902f2ffc9b4697be7a0b25c0 |
|
MD5 | 279d9b1ce5bb705633759e6a9701e57a |
|
BLAKE2b-256 | a28f779aa94b23411c9d515dcfa3bc3bf61a7b6e8f7a73700c04c233c6cc4047 |
File details
Details for the file generic_iterative_stemmer-1.1.4-py3-none-any.whl
.
File metadata
- Download URL: generic_iterative_stemmer-1.1.4-py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9936e266b3226e3af1617d6bb4a181a432e390d163a43ae09bd9c0a80cf918c |
|
MD5 | 04a448987880affcf3c429c1656b71f6 |
|
BLAKE2b-256 | 23a41a26e7d1721079606d9912fa8c7e1dfbc72efb09c85ab7929f50d4948280 |