Skip to main content

Mathics3 Natural Language Toolkit module

Reason this release was yanked:

Wheel and tarball does not match code organization

Project description

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.

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

mathics3_module_nltk-9.0.0.tar.gz (33.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mathics3_module_nltk-9.0.0-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file mathics3_module_nltk-9.0.0.tar.gz.

File metadata

  • Download URL: mathics3_module_nltk-9.0.0.tar.gz
  • Upload date:
  • Size: 33.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mathics3_module_nltk-9.0.0.tar.gz
Algorithm Hash digest
SHA256 480096285bad28c179948904bce67c1fa8a0409ba8cae4c834a933ea83718bc7
MD5 665796f496bf9838d616a4a327dfbc2c
BLAKE2b-256 2be0697b65a1b1f25be5cea160f6578fb5e41a31ef8676f6287755051904ff0f

See more details on using hashes here.

File details

Details for the file mathics3_module_nltk-9.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mathics3_module_nltk-9.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc313c6e0adaaaad1181f1fded5f4c1dc4f6bf7653c0f7af0937786787148fda
MD5 48cae51841707ae575483592885ee207
BLAKE2b-256 ab996d7240c3f0e2856f4f50a2e0e9e3c690ccd54b8a530562b515ac3b797e9f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page