Mathics3-Module-nltk


NameMathics3-Module-nltk JSON
Version 9.0.2 PyPI version JSON
download
home_pageNone
SummaryMathics3 Natural Language Toolkit module
upload_time2025-09-04 20:44:35
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords mathematica wolfram interpreter shell math cas
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            |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}
   In[5] = Synonyms["forget"]
   Out[5]= {blank out, block, bury, draw a blank, leave}
   In[6] = Antonyms["big"]
   Out[6]= {little, small}
   In[7] = LanguageIdentify["eins zwei drei"]
   Out[7]= "German"

Other examples can be found in the `test file <https://github.com/Mathics3/Mathics3-Module-nltk/blob/master/test/test_ntlk.py>`_.

Installing and Running
----------------------

To build this Mathics3 module, you will need to install the Python module `nltk
<https://pypi.org/project/nltk/>`_ and `spacy
<https://pypi.org/project/spacy/>`_, and then install some data from
Language-specific words:

::

   $ make develop  # or make install

The above ``make`` command defaults to the English. If
you would like to install for another language, set the variable
``LANG``. For example:

::

   $ make develop LANG=fr

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`` library for advanced Natural Language Processing in Python.

You might be able to fix this by running:

::

   python -m spacy download en

Adjust "python" and "en" (the language you want) above as needed.


User customization
------------------

.. reinstate after this is fixed in the code
.. For nltk, use the environment variable ``NLTK_DATA`` to specify a custom data path (instead of $HOME/.nltk).  For spacy, set 'MATHICS3_SPACY_DATA', a Mathics3-specific variable.

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:

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.



.. |Latest Version| image:: https://badge.fury.io/py/Mathics3-Module-nltk.svg
		 :target: https://badge.fury.io/py/Mathics3-Module-nltk
.. |Pypi Installs| image:: https://pepy.tech/badge/Mathics3-Module-nltk
.. |Supported Python Versions| image:: https://img.shields.io/pypi/pyversions/Mathics3-Module-nltk.svg
.. |Packaging status| image:: https://repology.org/badge/vertical-allrepos/Mathics3-Module-nltk.svg
			    :target: https://repology.org/project/Mathics3-Module-nltk/versions

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "Mathics3-Module-nltk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "Mathics Group <mathics-devel@googlegroups.com>",
    "keywords": "Mathematica, Wolfram, Interpreter, Shell, Math, CAS",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/a4/05/4dd147f5ddcc19d7b7ac7e80a2a774519a9880c0d25ff0bd64cf9debf614/mathics3_module_nltk-9.0.2.tar.gz",
    "platform": null,
    "description": "|Pypi Installs| |Latest Version| |Supported Python Versions|\n\nMathics3 Natural Language Toolkit module.\n\n\nExample Session\n---------------\n\n::\n\n   $ mathicsscript\n   In[1]:= LoadModule[\"pymathics.natlang\"]\n   Out[1]= pymathics.natlang\n   In[2]= Pluralize[\"try\"]\n   Out[2]= tries\n   In[3]= WordFrequency[\"Apple Tree and apple\", \"apple\", IgnoreCase -> True]\n   Out[3]= 0.5\n   In[4] = TextCases[\"I was in London last year.\", \"Pronoun\"]\n   Out[4]= {I}\n   In[5] = Synonyms[\"forget\"]\n   Out[5]= {blank out, block, bury, draw a blank, leave}\n   In[6] = Antonyms[\"big\"]\n   Out[6]= {little, small}\n   In[7] = LanguageIdentify[\"eins zwei drei\"]\n   Out[7]= \"German\"\n\nOther examples can be found in the `test file <https://github.com/Mathics3/Mathics3-Module-nltk/blob/master/test/test_ntlk.py>`_.\n\nInstalling and Running\n----------------------\n\nTo build this Mathics3 module, you will need to install the Python module `nltk\n<https://pypi.org/project/nltk/>`_ and `spacy\n<https://pypi.org/project/spacy/>`_, and then install some data from\nLanguage-specific words:\n\n::\n\n   $ make develop  # or make install\n\nThe above ``make`` command defaults to the English. If\nyou would like to install for another language, set the variable\n``LANG``. For example:\n\n::\n\n   $ make develop LANG=fr\n\nTo use the Extended Open Multilingual Wordnet with NLTK and use even more languages, you need to install them manually. Go to\n`<http://compling.hss.ntu.edu.sg/omw/summx.html>`_, download the data,\nand then create a new folder under\n``$HOME/nltk_data/corpora/omw/your_language`` where you put the file\nfrom wiki/wn-wikt-your_language.tab, and rename it to\nwn-data-your_language.tab.\n\nIf you get the message:\n\n::\n\n   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.\n\nThere is a problem with the ``spacy`` library for advanced Natural Language Processing in Python.\n\nYou might be able to fix this by running:\n\n::\n\n   python -m spacy download en\n\nAdjust \"python\" and \"en\" (the language you want) above as needed.\n\n\nUser customization\n------------------\n\n.. reinstate after this is fixed in the code\n.. For nltk, use the environment variable ``NLTK_DATA`` to specify a custom data path (instead of $HOME/.nltk).  For spacy, set 'MATHICS3_SPACY_DATA', a Mathics3-specific variable.\n\nTo use the Extended Open Multilingual Wordnet (OMW) with 'NLTK' and use even more languages, you need to install them manually.\n\nGo to http://compling.hss.ntu.edu.sg/omw/summx.html, download the data, and then create a new folder under\n``$HOME/nltk_data/corpora/omw/your_language`` where you put the file from\nwiki/wn-wikt-your_language.tab, and rename it to\nwn-data-your_language.tab.\n\nAdding more languages to Open Multilingual Wordnet:\n\nTo use the Extended Open Multilingual Wordnet with NLTK and use even more languages, you need to install them manually. Go to\nhttp://compling.hss.ntu.edu.sg/omw/summx.html, download the data, and then create a new folder under\n$HOME/nltk_data/corpora/omw/your_language where you put the file from\nwiki/wn-wikt-your_language.tab, and rename it to\nwn-data-your_language.tab.\n\n\n\n.. |Latest Version| image:: https://badge.fury.io/py/Mathics3-Module-nltk.svg\n\t\t :target: https://badge.fury.io/py/Mathics3-Module-nltk\n.. |Pypi Installs| image:: https://pepy.tech/badge/Mathics3-Module-nltk\n.. |Supported Python Versions| image:: https://img.shields.io/pypi/pyversions/Mathics3-Module-nltk.svg\n.. |Packaging status| image:: https://repology.org/badge/vertical-allrepos/Mathics3-Module-nltk.svg\n\t\t\t    :target: https://repology.org/project/Mathics3-Module-nltk/versions\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Mathics3 Natural Language Toolkit module",
    "version": "9.0.2",
    "project_urls": {
        "Downloads": "https://github.com/Mathics3/Mathics3-Module-nltk/releases",
        "Homepage": "https://github.com/Mathics3/Mathics3-Module-nltk"
    },
    "split_keywords": [
        "mathematica",
        " wolfram",
        " interpreter",
        " shell",
        " math",
        " cas"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9f9e70a1ca0cea57152ffd7513b1686ca772c53d1786eb307a9ef76077584be1",
                "md5": "474461fdf50f9c8d315eec20ce279271",
                "sha256": "eefa1d5f1651beec279b17fc36602988ef018d003bfd3eae47c4927d768a7983"
            },
            "downloads": -1,
            "filename": "mathics3_module_nltk-9.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "474461fdf50f9c8d315eec20ce279271",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 34647,
            "upload_time": "2025-09-04T20:44:33",
            "upload_time_iso_8601": "2025-09-04T20:44:33.726468Z",
            "url": "https://files.pythonhosted.org/packages/9f/9e/70a1ca0cea57152ffd7513b1686ca772c53d1786eb307a9ef76077584be1/mathics3_module_nltk-9.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a4054dd147f5ddcc19d7b7ac7e80a2a774519a9880c0d25ff0bd64cf9debf614",
                "md5": "a634d114977d6dff949bf5e2a47ebc86",
                "sha256": "8406c9a9fc9de519ebb348533df8af91ffe8b9ebe8b24bb5ef9f4f4cec8731a2"
            },
            "downloads": -1,
            "filename": "mathics3_module_nltk-9.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "a634d114977d6dff949bf5e2a47ebc86",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 41359,
            "upload_time": "2025-09-04T20:44:35",
            "upload_time_iso_8601": "2025-09-04T20:44:35.052504Z",
            "url": "https://files.pythonhosted.org/packages/a4/05/4dd147f5ddcc19d7b7ac7e80a2a774519a9880c0d25ff0bd64cf9debf614/mathics3_module_nltk-9.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-04 20:44:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Mathics3",
    "github_project": "Mathics3-Module-nltk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "mathics3-module-nltk"
}
        
Elapsed time: 0.60832s