{"id":13418368,"url":"https://github.com/facebookresearch/pytext","last_synced_at":"2025-09-27T06:32:40.592Z","repository":{"id":37735746,"uuid":"143080897","full_name":"facebookresearch/pytext","owner":"facebookresearch","description":"A natural language modeling framework based on PyTorch","archived":true,"fork":false,"pushed_at":"2022-10-17T19:55:31.000Z","size":8448,"stargazers_count":6334,"open_issues_count":145,"forks_count":799,"subscribers_count":169,"default_branch":"main","last_synced_at":"2025-01-13T23:00:04.465Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pytext.readthedocs.io/en/master/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/facebookresearch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-31T23:40:46.000Z","updated_at":"2025-01-09T11:19:52.000Z","dependencies_parsed_at":"2022-07-12T15:18:23.401Z","dependency_job_id":null,"html_url":"https://github.com/facebookresearch/pytext","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookresearch%2Fpytext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookresearch%2Fpytext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookresearch%2Fpytext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookresearch%2Fpytext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/facebookresearch","download_url":"https://codeload.github.com/facebookresearch/pytext/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234402284,"owners_count":18826726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T22:01:01.500Z","updated_at":"2025-09-27T06:32:32.999Z","avatar_url":"https://github.com/facebookresearch.png","language":"Python","readme":"\u003ctable align=\"center\"\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\u003ch1 align=\"center\"\u003e\n⚠️ Please migrate to \u003ca href=\"https://github.com/pytorch/text\"\u003e\u003cb\u003etorchtext\u003c/b\u003e\u003c/a\u003e ⚠️\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\nPyText is deprecated and will no longer be actively maintained. Please check out \u003ca href=\"https://github.com/pytorch/text\"\u003etorchtext\u003c/a\u003e and contribute there!\n\u003c/p\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n\n# Overview\n\n[![Support Ukraine](https://img.shields.io/badge/Support-Ukraine-FFD500?style=flat\u0026labelColor=005BBB)](https://opensource.fb.com/support-ukraine)\n[![CircleCI](https://circleci.com/gh/facebookresearch/pytext.svg?style=svg\u0026circle-token=2e0e0cb6dc686b646df887c2e0f07a8429712243)](https://circleci.com/gh/facebookresearch/pytext)\n\nPyText is a deep-learning based NLP modeling framework built on PyTorch. PyText addresses the often-conflicting requirements of enabling rapid experimentation and of serving models at scale. It achieves this by providing simple and extensible interfaces and abstractions for model components, and by using PyTorch’s capabilities of exporting models for inference via the optimized Caffe2 execution engine. We are using PyText in Facebook to iterate quickly on new modeling ideas and then seamlessly ship them at scale.\n\n**Core PyText features:**\n- Production ready models for various NLP/NLU tasks:\n  - Text classifiers\n    - [Yoon Kim (2014): Convolutional Neural Networks for Sentence Classification](https://arxiv.org/abs/1408.5882)\n    - [Lin et al. (2017): A Structured Self-attentive Sentence Embedding](https://arxiv.org/abs/1703.03130)\n  - Sequence taggers\n    - [Lample et al. (2016): Neural Architectures for Named Entity Recognition](https://www.aclweb.org/anthology/N16-1030)\n  - Joint intent-slot model\n    - [Zhang et al. (2016): A Joint Model of Intent Determination and Slot Filling for Spoken Language Understanding](https://www.ijcai.org/Proceedings/16/Papers/425.pdf)\n  - Contextual intent-slot models\n- Distributed-training support built on the new C10d backend in PyTorch 1.0\n- Mixed precision training support through [APEX](https://github.com/NVIDIA/apex) (trains faster with less GPU memory on [NVIDIA Tensor Cores](https://developer.nvidia.com/tensor-cores))\n- Extensible components that allows easy creation of new models and tasks\n- Reference implementation and a pretrained model for the paper: [Gupta et al. (2018): Semantic Parsing for Task Oriented Dialog using Hierarchical Representations](http://aclweb.org/anthology/D18-1300)\n- Ensemble training support\n- Reference implementation for the paper: [Babu et al. 2021: Non-autoregressive Semantic Parsing for Compositional Task Oriented Dialog](https://github.com/facebookresearch/pytext/tree/master/pytext/models/seq_models/benchmarks/nar_top.json)\n\n# Installing PyText\n\n### PyText requires Python 3.6.1 or above.\n\n*To get started on a Cloud VM, check out [our guide](https://pytext.readthedocs.io/en/master/installation.html#cloud-vm-setup)*.\n\nGet the source code:\n```\n  $ git clone https://github.com/facebookresearch/pytext\n  $ cd pytext\n```\nCreate a virtualenv and install PyText:\n\n```\n  $ python3 -m venv pytext_venv\n  $ source pytext_venv/bin/activate\n  (pytext_venv) $ pip install pytext-nlp\n```\n\nDetailed instructions and more installation options can be found in our [Documentation](https://pytext.readthedocs.io/en/master/installation.html). If you encounter issues with missing dependencies during installation, please refer to [OS Dependencies](https://pytext.readthedocs.io/en/master/installation.html#os-dependencies).\n\n# Train your first text classifier\n\nFor this first example, we'll train a CNN-based text-classifier that classifies text utterances, using the examples in `tests/data/train_data_tiny.tsv`. The data and configs files can be obtained either by cloning the repository or by downloading the files manually from GitHub.\n\n```\n  (pytext_venv) $ pytext train \u003c demo/configs/docnn.json\n```\n\nBy default, the model is created in `/tmp/model.pt`\n\nNow you can export your model as a caffe2 net:\n\n```\n  (pytext_venv) $ pytext export \u003c demo/configs/docnn.json\n```\n\nYou can use the exported caffe2 model to predict the class of raw utterances like this:\n\n```\n  (pytext_venv) $ pytext --config-file demo/configs/docnn.json predict \u003c\u003c\u003c '{\"text\": \"create an alarm for 1:30 pm\"}'\n```\n\nMore examples and tutorials can be found in [Full Documentation](https://pytext.readthedocs.io/en/master/).\n\n# Join the community\n\n* Facebook group: https://www.facebook.com/groups/pytext/\n\n# License\nPyText is BSD-licensed, as found in the LICENSE file.\n","funding_links":[],"categories":["Natural Language Processing","资源列表","Python","文本数据和NLP","NLP","Pytorch \u0026 related libraries｜Pytorch \u0026 相关库","自然语言处理","Pytorch \u0026 related libraries","自然语言处理 (NLP)","Feature Extraction","**Programming (learning)**"],"sub_categories":["自然语言处理","工具","NLP \u0026 Speech Processing｜自然语言处理 \u0026 语音处理:","NLP \u0026 Speech Processing:","Text/NLP","**Developer\\'s Tools**"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebookresearch%2Fpytext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffacebookresearch%2Fpytext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebookresearch%2Fpytext/lists"}