{"id":41161802,"url":"https://github.com/wencan/distilnlp","last_synced_at":"2026-01-22T19:24:12.290Z","repository":{"id":218489904,"uuid":"745948926","full_name":"wencan/distilNLP","owner":"wencan","description":"distilNLP is a natural language processing toolkits that are out-of-the-box, low-dependency, high-performance, and can achieve good results in solving real-world problems.","archived":false,"fork":false,"pushed_at":"2024-03-24T07:55:50.000Z","size":13786,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-25T11:32:27.212Z","etag":null,"topics":["data-science","language-model","machine-learning","natural-language-processing","nlp"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wencan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-01-20T16:29:20.000Z","updated_at":"2024-02-06T17:05:09.000Z","dependencies_parsed_at":"2024-02-18T05:27:29.619Z","dependency_job_id":"6268553e-ab5c-4bb2-af5a-c52a5e08d8e8","html_url":"https://github.com/wencan/distilNLP","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"799cdecb6a2e51b70c378089b3365faee3b14970"},"previous_names":["wencan/snlp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wencan/distilNLP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wencan%2FdistilNLP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wencan%2FdistilNLP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wencan%2FdistilNLP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wencan%2FdistilNLP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wencan","download_url":"https://codeload.github.com/wencan/distilNLP/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wencan%2FdistilNLP/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28669092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T17:07:18.858Z","status":"ssl_error","status_checked_at":"2026-01-22T17:05:02.040Z","response_time":144,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["data-science","language-model","machine-learning","natural-language-processing","nlp"],"created_at":"2026-01-22T19:24:12.231Z","updated_at":"2026-01-22T19:24:12.282Z","avatar_url":"https://github.com/wencan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# distilNLP\n本项目的目的是提供一套开箱即用、低依赖、高性能、解决实际问题能取得良好效果的自然语言处理工具箱。  \n不同于其它NLP项目采用经典机器学习技术，或者基于大规模预训练模型去微调，本项目采用深度学习技术，从头设计小型语言模型，或基于高度压缩的预训练语言模型，以期取得较高推理准确率和较低资源消耗。  \n现阶段，本项目仅限学习和研究使用。\n\nThe purpose of this project is to provide a set of out of the box, low-dependency, high-performance natural language processing toolkits that can achieve good results in solving real-world problems.  \nUnlike other NLP projects that use classical machine learning techniques or fine-tune based on large-scale pre-trained models, this project uses deep learning techniques to design a series of small language models from scratch, or based on highly compressed pre-trained language models, in order to achieve higher inference accuracy and lower resource consumption.\nAt this stage, this project is only for learning and research.\n\n# Usage\n程序自动下载所需的模型文件。国内用户需要翻墙才能正常下载。  \nThe program automatically downloads the required model files.\n\n## Text Normalize\n文本正规化。  \n移除多余的字符，矫正错误的标点符号。  \n文本正规化包含标点符号正规化模型。但是没有足够的高质量的正规化文本语料用于训练。请考虑将enable_punctuation_normalize参数置为False，以禁用标点符号正规化。\n\nText normalization processing removes redundant characters and corrects incorrect punctuation.  \nText normalization includes a punctuation normalization model. But there is not enough high-quality normalized text corpus available for training. Please consider setting the enable_punctuation_normalize parameter to False to disable punctuation normalization.\n```python\nfrom distilnlp import text_normalize\n\ntext_normalize('The project was started in 2007 by David Cournapeau as a Google Summer of Code project， \\nand since then many volunteers have contributed.\\nSee the About us page for a list of core contributors. ')\n# got: 'The project was started in 2007 by David Cournapeau as a Google Summer of Code project, and since then many volunteers have contributed. See the About us page for a list of core contributors.'\n\ntext_normalize('😇54。 妇女署推出了增强妇女经济权能知识网关(参阅www.empowerwomen。org)，帮助各利益攸关方建立联系并分享经验和专长。')\n# got: '54. 妇女署推出了增强妇女经济权能知识网关（参阅www.empowerwomen.org），帮助各利益攸关方建立联系并分享经验和专长。'\n\ntext_normalize([\n    'This is an English sentence。',\n    '百度的网址是 http：//www.baidu。com'\n])\n# got: [\n#   'This is an English sentence.',\n#   '百度的网址是 http://www.baidu.com'\n# ]\n```\n\n## Chinese Tokenize\n中文分词\n```python\nfrom distilnlp import distilnlp\nchinese_tokenize([\n    '6. 讲习班的参加者是在国家和区域应急机构和服务部门的管理岗位上工作了若干年的专业人员。', \n    '人权是所有人与生俱来的权利，不分国籍、性别、宗教或任何其他身份。'\n])\n# got: [\n#   ['6', '.', ' ', '讲习班', '的', '参加者', '是', '在', '国家', '和', '区域', '应急', '机构', '和', '服务', '部门', '的', '管理', '岗位', '上', '工作', '了', '若干年', '的', '专业', '人员', '。'], \n#   ['人权', '是', '所有', '人', '与生', '俱来', '的', '权利', '，', '不', '分', '国籍', '、', '性别', '、', '宗教', '或', '任何', '其他', '身份', '。'],\n# ]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwencan%2Fdistilnlp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwencan%2Fdistilnlp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwencan%2Fdistilnlp/lists"}