An implementation of the Porter2 English stemming algorithm.
Project description
An implementation of the Porter2 English stemming algorithm.
Free software: BSD license
Documentation: http://porter2-stemmer.readthedocs.org/
What is stemming?
Stemming is a technique used in Natural Language Processing to reduce different inflected forms of words to a single invariant root form. The root form is called the stem and may or may not be identical to the morphological root of the word.
What is it good for?
Lots of things, but query expansion in information retrieval is the canonical example. Let’s say you are building a search engine. If someone searches for “cat” it would be nice if they were shown documents that contained the word “cats” too. Unless the query and document index are stemmed, that won’t happen. Stemming can be thought of as a method to reduce the specificity of queries in order to pull back more relevant results. As such, it involves a trade-off.
What type of stemmer is this?
Porter2 is a suffix-stripping stemmer. It transforms words into stems by applying a deterministic sequence of changes to the final portion of the word. Other stemmers work differently. They may, for instance, simply look up the inflected form in a table and map it to a morphological root, or they may use a clustering approach to map diverse forms to a centre form. Different approaches have different advantages and disadvantages.
How do I use it?
Very simply. Import it, instantiate a stemmer, and away you go:
from porter2stemmer import Porter2Stemmer stemmer = Porter2Stemmer() print(stemmer.stem('conspicuous'))
History
1.0 (2016-03-31)
First release on PyPI.
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 porter2stemmer-1.0.tar.gz
.
File metadata
- Download URL: porter2stemmer-1.0.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba478ad6550258a1fd8e102e554387dd9ac73f73059483eefee98211f0ad5244 |
|
MD5 | 7ad7bf4262158f879e5e62112d5ade28 |
|
BLAKE2b-256 | d7e8ce7cc2c30bee2cdb68686340480e1183b3af3be530c54ef06ffa1658c836 |
File details
Details for the file porter2stemmer-1.0-py2.7.egg
.
File metadata
- Download URL: porter2stemmer-1.0-py2.7.egg
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 561b2537767a086e3bd33558e8f3cd4cb60ee2b0240c4c06eb98754601db34dd |
|
MD5 | de8c54975b95084445d6b690e4325321 |
|
BLAKE2b-256 | 29566268d7bd5974bc947b87718b25d85dd21c154e5054debb19d6d0cf7fc5d3 |