Skip to main content

Pypi Installs Latest Version Supported Python Versions

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.

Release files for pymathics-natlang 8.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymathics-natlang 8.0.0
File Size Uploaded Provenance Actions
pymathics_natlang-8.0.0.tar.gz 32.2 kB Without provenance Details for pymathics_natlang-8.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pymathics-natlang 8.0.0
File Interpreter ABI Platform Actions
pymathics_natlang-8.0.0-py3-none-any.whl Python 3 none any Details for pymathics_natlang-8.0.0-py3-none-any.whl

Total release size: 65.8 kB

Release files / pymathics_natlang-8.0.0.tar.gz

Download URL pymathics_natlang-8.0.0.tar.gz
Size 32.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9eaf49e98fea377eacc7fc4baf954696576cc94d958a45abc53f0d30f6996d16
BLAKE2b-256 checksum
How to use checksums
975ea94b05baebd3e00b46b0fc94216434202cfd637f418879af7409dc5c02a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release files / pymathics_natlang-8.0.0-py3-none-any.whl

Download URL pymathics_natlang-8.0.0-py3-none-any.whl
Size 33.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7572dfac980551dc9528e8414a8185fe316fc9bce76cf6e6465c5ca64b00f699
BLAKE2b-256 checksum
How to use checksums
2eb3b9ebeb8b3bdf43313148e9329193b14048d577a5cbc33c8e4dead1c68b47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Security for pymathics-natlang 8.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page