Skip to main content

Natural Language Understanding (text processing) for math symbols, digits, and words with a Gradio user interface and REST API.

Project description


title: MathText app_file: app.py sdk: gradio sdk_version: 3.15.0 license: agpl-3.0

MathText NLU

Natural Language Understanding for math symbols, digits, and words with a Gradio user interface and REST API.

Setup your Python environment

Launch a terminal on linux (or the git-bash application on Windows). Then create a virtualenv with whatever python version you have available on your system.

Any python version greater than 3.7 should work. Most of us on Linux systems use Python 3.9:

git clone git@gitlab.com:tangibleai/community/mathtext
cd mathtext
pip install --upgrade virtualenv poetry
python -m virtualenv .venv
ls -hal

You should see a new .venv/ directory. It will contain your python interpreter and a few site-packages like pip and distutils.

Now activate your new virtual environment by sourcing .venv/bin/activate (on Linux) or .venv/scripts/activate (on Windows).

source .venv/bin/activate || source .venv/scripts/activate

Developer installation

Once you have a shiny new virtual environment activated you can install the mathtext in --editable mode. This way, when you edit the files and have the package change immediately.

Make sure you are already within your cloned mathtext project directory. And makes sure your virtual environment is activated. You should see the name of your virtual environment in parentheses within your command line prompt, like (.venv) $. Then when you install MathText it will be available to any other application within that environment.

pip install --editable .

User installation

If you don't want to contribute to the MathText source code and you just want to import and run the MathText modules, you can install it from a binary wheel on PyPi.

pip install mathtext

Usage

Sentiment classification

Directory structure with notes

mathtext
    mathtext: mathtext code
        data: training and test sets for various tasks
        models: scripts to create models and store in/retrieve from object storage
        utils: utility functions
            checkers.py: T/F evaluations
            converters.py: Change the data type from one to another
            extractors.py: Looks for specific values or value types in a message
            formatters.py: Attempts to format text in a standardized way
        api_gradio.py: gradio api
        predict_intent.py: functions to run multilabel recognizer on message
        text_processing.py: evaluations that use sequences of utils
    scripts: setup scripts
        api_scaling.sh: makes calls to local api
        api_scaling.py: makes async http requests to the local api
        build.sh
        plot_calls.py: Functions for plotting data
        pyproject.template
    tests: various tests
        __init.py
        test_cases_all.py
    .git*: various git files
    app.py: ties all of the api components together for huggingface
    LICENSE.md: license
    pyproject.toml: pyproject file
    README.md: this
    requirements.txt: project dependencies

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

mathtext-2.0.4.tar.gz (12.1 MB view details)

Uploaded Source

Built Distribution

mathtext-2.0.4-py3-none-any.whl (12.5 MB view details)

Uploaded Python 3

File details

Details for the file mathtext-2.0.4.tar.gz.

File metadata

  • Download URL: mathtext-2.0.4.tar.gz
  • Upload date:
  • Size: 12.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for mathtext-2.0.4.tar.gz
Algorithm Hash digest
SHA256 718699f7b112abfe05616cff8899d6b0957fae2a244a5425fff686fe35ca27e9
MD5 2da9dff12e32d5f71efd1abb7faaedd7
BLAKE2b-256 a649defc54fe351959c6d2a08f26260602e63108877adb618f7af8dd587ca87d

See more details on using hashes here.

Provenance

File details

Details for the file mathtext-2.0.4-py3-none-any.whl.

File metadata

  • Download URL: mathtext-2.0.4-py3-none-any.whl
  • Upload date:
  • Size: 12.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for mathtext-2.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d5fb917ac64eeb614b74d0b971e1e3f28ec1fa5e94c6b55c7113f1e7a301fda9
MD5 e6e694309c2d75255d083eb52842a446
BLAKE2b-256 59d0a79f869e9ea0c0c0f7d8e9ee5db535aa69c5da34465e37124b912f08aa6b

See more details on using hashes here.

Provenance

Supported by

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