跳转到主要内容

自然语言理解(文本处理)用于数学符号、数字和单词,具有Gradio用户界面和REST API。

项目描述


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

MathText NLU

使用Gradio用户界面和REST API进行数学符号、数字和单词的自然语言理解。

设置Python环境

在Linux上打开一个终端(或在Windows上的git-bash应用程序)。然后使用系统上可用的任何Python版本创建一个virtualenv。

任何大于3.7的Python版本都应该可以工作。大多数Linux用户使用Python 3.9

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

您应该看到一个新目录.venv/。它将包含您的Python解释器和一些site-packages,如pipdistutils

现在通过在Linux上运行.venv/bin/activate或Windows上运行.venv/scripts/activate来激活您的虚拟环境。

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

开发者安装

一旦激活了新的虚拟环境,您就可以以--editable模式安装mathtext。这样,当您编辑文件时,包会立即更改。

确保您已经在复制的mathtext项目目录中。并且确保您的虚拟环境已激活。您应该在命令行提示符中看到虚拟环境的名称在括号内,例如(.venv) $。然后当您安装MathText时,它将可用于该环境中的任何其他应用程序。

pip install --editable .

用户安装

如果您不想为MathText源代码做出贡献,只想导入和运行MathText模块,您可以从PyPi上的二进制轮安装它。

pip install mathtext

用法

情感分类

目录结构说明

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

项目详情


下载文件

下载适用于您平台的项目。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分布

mathtext-2.0.6.tar.gz (12.0 MB 查看散列)

上传时间

构建分布

mathtext-2.0.6-py3-none-any.whl (12.0 MB 查看散列)

上传时间 Python 3

支持者:

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面