PyIMS
A simple python wrapper around the IMS (It Makes Sense) word-sense disambiguation toolkit, that integrates it with NLTK's WordNet interface. Requires IMS to be downloaded separately, which requires a working Java installation. Also requires NLTK with WordNet downloaded. Only tested in Linux, might not work in other OSes. Built for python 3.6+
Installation
First, follow the instructions in Section 3 of the IMS Readme to install the components of IMS into some directory; extract the models from here (step 3.e) into the same directory as in steps 3.b and 3.c. Then, run:
pip install pyims
Usage
from pyims import PyIMS
wsd = PyIMS("path/to/ims", "modelsDirName")
print(wsd.disambiguate("I am interested in the interest rates at the bank.", probs=True, synsets=False))
# If probs=True, returns a list of (token, probability_distribution) tuples where probability_distribution is a map of lemma to its probability
# If probs=False (default False), returns a list of (token, lemma) where lemma is the most probable word-sense in WordNet for the given token
# If synsets=True, lemmas are replaced with the Synsets to which they belong
# If synsets=False (default False), to access a lemma's synset, call lemma.synset()
References
- Zhong, Zhi and Ng, Hwee Tou. 2010. It Makes Sense: A Wide-Coverage Word Sense Disambiguation System for Free Text. In Proceedings of the ACL 2010 System Demonstrations, pages 78--83, Uppsala, Sweden
Release files for pyims 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyims-0.1.2.tar.gz | 3.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyims-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.3 kB
Release files / pyims-0.1.2.tar.gz
| Download URL | pyims-0.1.2.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d7487d6f86f8d1be55488a7eddb794a6d62bed13c5c3d4bc5c8241cbdc5677ef
|
|
BLAKE2b-256 checksum How to use checksums |
7f799e9b11d2513ec52edf43c0c9d6c72cc8e981c71aaea30a27ec9af230b6aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyims-0.1.2-py3-none-any.whl
| Download URL | pyims-0.1.2-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
744a99c641c2bcf32400cba199cfadb270fe74b91d1cefe2a8348671443f122e
|
|
BLAKE2b-256 checksum How to use checksums |
e93229387c5383e8aabc755e72cfc00e317ad563e22bf8baba7eb20dfbc5375f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |