No project description provided
Project description
Mathics3 Natural Language Toolkit module.
Example Session
$ mathicsscript In[1]:= LoadModule["pymathics.natlang"] Out[1]= pymathics.natlang In[2]= Pluralize["try"] Out[2]= tries In[3]= WordFrequency["Apple Tree and apple", "apple", IgnoreCase -> True] Out[3]= 0.5 In[4] = TextCases["I was in London last year.", "Pronoun"] Out[4]= {I}
More examples can be found in the test file.
Installing and Running
To use build module, you will need to install Python module nltk and spacy, and then install some data from Language-specific words:
$ make develop # or make install
The above make command uses defaults the language to English. If you would like to install for another language set the variable LANG. For example:
$ make develop LANG=fr
In order to use the Extended Open Multilingual Wordnet with NLTK and use even more languages, you need to install them manually. Go to http://compling.hss.ntu.edu.sg/omw/summx.html, download the data, and then create a new folder under $HOME/nltk_data/corpora/omw/your_language where you put the file from wiki/wn-wikt-your_language.tab, and rename it to wn-data-your_language.tab.
If you get the message
OSError: [E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.
There is a problem with the spacy the library for advanced Natural Language Processing in Python.
You might be able to fix this running:
python -m spacy download en
Adjust “python” and “en” (the language you want) above as needed.
User customization
In order to use the Extended Open Multilingual Wordnet (OMW) with ‘NLTK’ and use even more languages, you need to install them manually.
Go to http://compling.hss.ntu.edu.sg/omw/summx.html, download the data, and then create a new folder under $HOME/nltk_data/corpora/omw/your_language where you put the file from wiki/wn-wikt-your_language.tab, and rename it to wn-data-your_language.tab.
Adding more languages to Open Multilingual Wordnet:
In order to use the Extended Open Multilingual Wordnet with NLTK and use even more languages, you need to install them manually. Go to http://compling.hss.ntu.edu.sg/omw/summx.html, download the data, and then create a new folder under $HOME/nltk_data/corpora/omw/your_language where you put the file from wiki/wn-wikt-your_language.tab, and rename it to wn-data-your_language.tab.
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
Built Distribution
File details
Details for the file pymathics-natlang-7.0.0.tar.gz
.
File metadata
- Download URL: pymathics-natlang-7.0.0.tar.gz
- Upload date:
- Size: 32.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d41184779e73d8867c5969bde2e84d24eee19e96ab19cfa7c024e27fb56a7c9 |
|
MD5 | 4a15ab79335a3ab72c4b040e0ac4a4e0 |
|
BLAKE2b-256 | b01242d869fc02feb2fd9c943e09fde47f8e04a757c36eb8d2ae700af881f401 |
File details
Details for the file pymathics_natlang-7.0.0-py3-none-any.whl
.
File metadata
- Download URL: pymathics_natlang-7.0.0-py3-none-any.whl
- Upload date:
- Size: 33.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ff89c138c22dec0b4d3724d9a340cb439eb663eabcf753e0d084f6a8b88061f |
|
MD5 | a90f97e12e5e808f2396c5a3c1535299 |
|
BLAKE2b-256 | d8ba45c5db2bfb02d1d7a82a01c8150eff0bfbdb37a55be33a6ad005d0173d97 |