[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-scofield7419--sequence-labeling-BiLSTM-CRF":3,"tool-scofield7419--sequence-labeling-BiLSTM-CRF":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":80,"owner_email":81,"owner_twitter":82,"owner_website":83,"owner_url":84,"languages":85,"stars":113,"forks":114,"last_commit_at":115,"license":116,"difficulty_score":23,"env_os":117,"env_gpu":118,"env_ram":118,"env_deps":119,"category_tags":128,"github_topics":129,"view_count":23,"oss_zip_url":81,"oss_zip_packed_at":81,"status":16,"created_at":136,"updated_at":137,"faqs":138,"releases":179},2745,"scofield7419\u002Fsequence-labeling-BiLSTM-CRF","sequence-labeling-BiLSTM-CRF","The BiLSTM-CRF model implementation in Tensorflow, for sequence labeling tasks.","sequence-labeling-BiLSTM-CRF 是一个基于 TensorFlow 打造的开源项目，专为自然语言处理中的序列标注任务而设计。它核心解决了如何从文本中精准识别并标记特定信息的问题，例如在命名实体识别中提取人名地名、在词性标注中判断单词属性，或进行中文分句与标点恢复等。\n\n该工具实现了经典的 BiLSTM+CRF 神经网络模型，被业界公认为此类任务中稳定且高效的基准方案。其独特亮点在于极高的可配置性与模块化架构：用户不仅能灵活调整编码器（如双向 LSTM）、解码器（CRF 或 Softmax）及嵌入层等模型结构，还能通过配置文件轻松切换训练、测试、交互式预测或 API 服务等多种运行模式。此外，项目内置了完善的日志记录功能，并提供了一个基于 Django 的 Web 演示应用，让效果验证更加直观。\n\nsequence-labeling-BiLSTM-CRF 特别适合 NLP 领域的研究人员、算法工程师以及希望深入理解序列标注模型的初学者使用。清晰的代码结构和友好的文档支持，使其成为学习经典模型实现或快速构建自定义标注系统的理想起点。","\r\n# BiLSTM+CRF for sequential labeling tasks\r\n\r\n![Authour](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAuthor-Scofield%20Phil-blue.svg) \r\n![Python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.6-brightgreen.svg) \r\n![Configurable](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVex-Configurable-red.svg) \r\n![Tensorflow](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTensorFlow-1.10.0-yellowgreen.svg)\r\n![BiLSTM+CRF](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FNLP-BiLSTM+CRF-redgreen.svg)\r\n![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-GPL3.0-green.svg)\r\n\r\n---\r\n\r\n🚀🚀🚀 A TensorFlow implementation of BiLSTM+CRF model, for sequence labeling tasks.\r\n\r\n##### Project Features\r\n\r\n* based on Tensorflow api. \r\n* highly _scalable_; everything is *configurable*. \r\n* modularized with clear structure.\r\n* very friendly for beginners.\r\n* easy to DIY.\r\n \r\n---\r\n\r\n## Task and Model\r\n\r\n`Sequential labeling` is one typical methodology modeling the sequence prediction tasks in NLP.\r\n Common sequential labeling tasks include, e.g., \r\n \r\n 1. _Part-of-Speech (POS) Tagging_, \r\n 2. _Chunking_, \r\n 3. _Named Entity Recognition (NER)_, \r\n 4. _Punctuation Restoration_, \r\n 5. _Sentence Boundary Detection_, \r\n 6. _Scope Detection_,\r\n 7. _Chinese Word Segmentation (CWG)_,\r\n 8. _Semantic Role Labeling (SRL)_,\r\n 9. _Spoken Language Understanding_, \r\n 10. _Event Extraction_,\r\n 11. and so forth...\r\n\r\nTaking *Named Entity Recognition* (NER) task as example:\r\n \r\n```bash\r\nStanford University located at California .\r\nB-ORG    I-ORG      O       O  B-LOC      O\r\n```\r\nhere, two entities, `Stanford University` and `California` are to be extracted.\r\nAnd specifically, each `token` in the text is tagged with a corresponding `label`.\r\nE.g., {`token`:_Stanford_, `label`:_B-ORG_}.\r\nThe sequence labeling model aims to predict the label sequence, given a token sequence.\r\n  \r\n\r\n`BiLSTM+CRF` proposed by [Lample et al., 2016](https:\u002F\u002Fwww.aclweb.org\u002Fanthology\u002FN16-1030), is so far the most classical and stable neural model for sequential labeling tasks.\r\n![BiLSTM+CRF](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fscofield7419_sequence-labeling-BiLSTM-CRF_readme_9631b03bcfd3.png)\r\n\r\n\r\n\r\n---\r\n\r\n# Project\r\n\r\n\r\n## Function Support\r\n\r\n- configuring all settings\r\n    - Running Mode: [`train`\u002F`test`\u002F`interactive_predict`\u002F`api_service`]\r\n    - Datasets(Input\u002FOutput): \r\n    - Labeling Scheme: \r\n        - [`BIO`\u002F`BIESO`]\r\n        - [`PER`|`LOC`|`ORG`]\r\n        - ...\r\n    - Model Configuration: \r\n        - encoder: BGU\u002FBi-LSTM, layer, Bi\u002FUni-directional\r\n        - decoder: crf\u002Fsoftmax,\r\n        - embedding level: char\u002Fword,\r\n        - with\u002Fwithout self attention\r\n        - hyperparameters,\r\n        - ...\r\n    - Training Settings: \r\n        - subscribe measuring metrics: [precision,recall,f1,accuracy]\r\n        - optimazers: GD\u002FAdagrad\u002FAdaDelta\u002FRMSprop\u002FAdam\r\n    - Testing Settings,\r\n    - Api service Settings,\r\n    \r\n- logging everything\r\n- web app demo for easy demonstration\r\n- object oriented: BILSTM_CRF, Datasets, Configer, utils\r\n- modularized with clear structure, easy for DIY.\r\n\r\nsee more in [HandBook](HandBook.md).\r\n\r\n## Requirements\r\n\r\n- python >=3.5 \r\n- tensorflow >=1.8\r\n- numpy\r\n- pandas\r\n- Django==1.11.8\r\n- jieba\r\n- ...\r\n\r\n## Setup\r\n\r\n#### Option A:\r\ndownload the repo for directly use.\r\n\r\n```\r\ngit clone https:\u002F\u002Fgithub.com\u002Fscofield7419\u002Fsequence-labeling-BiLSTM-CRF.git\r\npip install -r requirements.txt\r\n```\r\n\r\n#### Option B: _TODO_\r\ninstall the BiLSTM-CRF package as a module.\r\n\r\n```\r\npip install BiLSTM-CRF\r\n```\r\n\r\nusage:\r\n```\r\nfrom BiLSTM-CRF.engines.BiLSTM_CRFs import BiLSTM_CRFs as BC\r\nfrom BiLSTM-CRF.engines.DataManager import DataManager\r\nfrom BiLSTM-CRF.engines.Configer import Configer\r\nfrom BiLSTM-CRF.engines.utils import get_logger\r\n\r\n...\r\n\r\nconfig_file = r'\u002Fhome\u002Fprojects\u002Fsystem.config'\r\nconfigs = Configer(config_file)\r\n\r\nlogger = get_logger(configs.log_dir)\r\nconfigs.show_data_summary(logger) # optional\r\n\r\ndataManager = DataManager(configs, logger)\r\nmodel = BC(configs, logger, dataManager)\r\n        \r\n###### mode == 'train':\r\nmodel.train()\r\n\r\n###### mode == 'test':\r\nmodel.test()\r\n\r\n###### mode == 'single predicting':\r\nsentence_tokens, entities, entities_type, entities_index = model.predict_single(sentence)\r\nif configs.label_level == 1:\r\n    print(\"\\nExtracted entities:\\n %s\\n\\n\" % (\"\\n\".join(entities)))\r\nelif configs.label_level == 2:\r\n    print(\"\\nExtracted entities:\\n %s\\n\\n\" % (\"\\n\".join([a + \"\\t(%s)\" % b for a, b in zip(entities, entities_type)])))\r\n\r\n\r\n###### mode == 'api service webapp':\r\ncmd_new = r'cd demo_webapp; python manage.py runserver %s:%s' % (configs.ip, configs.port)\r\nres = os.system(cmd_new)\r\n\r\nopen `ip:port` in your browser.\r\n\r\n```\r\n\r\n## Module Structure\r\n\r\n\r\n```\r\n\r\n├── main.py\r\n├── system.config\r\n├── HandBook.md\r\n├── README.md\r\n│\r\n├── checkpoints\r\n│   ├── BILSTM-CRFs-datasets1\r\n│   │   ├── checkpoint\r\n│   │   └── ...\r\n│   └── ...\r\n├── data\r\n│   ├── example_datasets1\r\n│   │   ├── logs\r\n│   │   ├── vocabs\r\n│   │   ├── test.csv\r\n│   │   ├── train.csv\r\n│   │   └── dev.csv\r\n│   └── ...\r\n├── demo_webapp\r\n│   ├── demo_webapp\r\n│   ├── interface\r\n│   └── manage.py\r\n├── engines\r\n│   ├── BiLSTM_CRFs.py\r\n│   ├── Configer.py\r\n│   ├── DataManager.py\r\n│   └── utils.py\r\n└── tools\r\n    ├── calcu_measure_testout.py\r\n    └── statis.py\r\n```\r\n\r\n- Folds\r\n    - in `engines` fold, providing the core functioning py.\r\n    - in `data-subfold` fold, the datasets are placed.\r\n    - in `checkpoints-subfold` fold, model checkpoints are stored.\r\n    - in `demo_webapp` fold, we can demonstrate the system in web, and provides api.\r\n    - in `tools` fold, providing some offline utils.\r\n    \r\n- Files\r\n    - `main.py` is the entry python file for the system.\r\n    - `system.config` is the configure file for all the system settings.\r\n    - `HandBook.md` provides some usage instructions.\r\n    - `BiLSTM_CRFs.py` is the main model.\r\n    - `Configer.py` parses the `system.config`.\r\n    - `DataManager.py` manages the datasets and scheduling.\r\n    - `utils.py` provides on the fly tools.\r\n\r\n    \r\n\r\n## Quick Start\r\n\r\nUnder following steps:\r\n\r\n#### step 1. composing your configure file in `system.config`.\r\n\r\n- configure the Datasets(Input\u002FOutput).\r\n- configure the Labeling Scheme.\r\n- configure the Model architecture.\r\n- configure the webapp setting when demonstrating demo.\r\n\r\n![system.config](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fscofield7419_sequence-labeling-BiLSTM-CRF_readme_41bb556b2d54.png)\r\n\r\n\r\n#### step 2. starting training (necessary and compulsory)\r\n\r\n- configure the running mode.\r\n- configure the training setting.\r\n- run `main.py`.\r\n\r\n![training](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fscofield7419_sequence-labeling-BiLSTM-CRF_readme_5cbe561db2f4.png)\r\n\r\n\r\n#### step 3. starting testing (optional)\r\n\r\n- configure the running mode.\r\n- configure the testing setting.\r\n- run `main.py`.\r\n\r\n    \r\n#### step 4. starting interactively predicting (optional)\r\n\r\n- configure the running mode.\r\n- run `main.py`.\r\n- interactively input sentences.\r\n    \r\n![interactively predicting](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fscofield7419_sequence-labeling-BiLSTM-CRF_readme_2b9b83dca9c8.png)\r\n\r\n    \r\n#### step 5. starting api service and web app (optional)\r\n\r\n- configure the running mode.\r\n- configure the api_service setting.\r\n- run `main.py`.\r\n- make interactively prediction in browser.\r\n    \r\n![web app1](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fscofield7419_sequence-labeling-BiLSTM-CRF_readme_113fdc27c63d.png)\r\n\r\n![web app2](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fscofield7419_sequence-labeling-BiLSTM-CRF_readme_edefc65e084d.png)\r\n\r\n\r\n## Datasets\r\n\r\n#### Input\r\n\r\nDatasets including trainset, testset, devset are necessary for the overall usage.\r\nHowever, is you only wanna train the model the use it offline, only the trainset\r\nis needed. \r\nAfter training, you can make inference with the saved model checkpoint files.\r\nIf you wanna make test, you should \r\n\r\n\r\nFor `trainset`, `testset`, `devset`, the common format is as follows:\r\n\r\n- word level:\r\n\r\n```\r\n(Token)         (Label)\r\n\r\nfor             O\r\nthe             O\r\nlattice         B_TAS\r\nQCD             I_TAS\r\ncomputation     I_TAS\r\nof              I_TAS\r\nnucleon–nucleon I_TAS\r\nlow-energy      I_TAS\r\ninteractions    E_TAS\r\n.               O\r\n\r\nIt              O\r\nconsists        O\r\nin              O\r\nsimulating      B_PRO\r\n...\r\n```\r\n\r\n- char level:\r\n\r\n```\r\n(Token) (Label)\r\n\r\n马 B-LOC\r\n来 I-LOC\r\n西 I-LOC\r\n亚 I-LOC\r\n副 O\r\n总 O\r\n理 O\r\n。 O\r\n\r\n他 O\r\n兼 O\r\n任 O\r\n财 B-ORG\r\n政 I-ORG\r\n部 I-ORG\r\n长 O\r\n...\r\n```\r\n\r\nNote that:\r\n\r\n1. the `testset` can only exists with the the `Token` row. \r\n2. each sentence of tokens is segmented with a blank line.\r\n3. go to the example dataset for detailed formation.\r\n\r\n\r\n#### Output (during testing phase)\r\n\r\nDuring testing, model will output the predicted entities based on the `test.csv`.\r\nThe output files include two: `test.out`, `test.entity.out`(optional).\r\n\r\n- `test.out`\r\n\r\n    with the same formation as input `test.csv`.\r\n\r\n- `test.entity.out`\r\n\r\n```\r\nSentence\r\nentity1 (Type)\r\nentity2 (Type)\r\nentity3 (Type)\r\n...\r\n\r\n```\r\n![test.entity.out](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fscofield7419_sequence-labeling-BiLSTM-CRF_readme_47260ec9e169.png)\r\n\r\n\r\n\r\n## DIY\r\n\r\nIf you wanna adapt this project to your own specific sequence labeling task, you may need the following tips. \r\n\r\n- Download the repo sources.\r\n- Labeling Scheme (most important)\r\n    - label_scheme: BIO\u002FBIESO\r\n    - label_level: with\u002Fwithout suffix\r\n    - hyphen, for connecting the prefix and suffix: `B_PER', `I_LOC'\r\n    - suffix=[NR,NS,NT]\r\n    - labeling_level: word\u002Fchar\r\n\r\n- Model: modify the model architecture into the one you wanted, in `BiLSTM_CRFs.py`.\r\n     \r\n- Dataset: adapt to your dataset, in the correct formation.\r\n\r\n- Training\r\n    - specify all directories.\r\n    - training hyperparameters.\r\n    \r\n\r\n## Others\r\n\r\n---\r\n\r\nFor more useage details, please refers to the [HandBook](HandBook.md)\r\n\r\nYou're welcomed to issue anything wrong.\r\n\r\n---\r\n\r\n\r\nUpdating...\r\n====\r\n* 2019-Jun-04, Vex version, v1.0, supporting configuration, scalable.\r\n* 2018-Nov-05, support char and word level embedding.\r\n* 2017-Dec-06, init version, v0.1.\r\n\r\n\r\n## License\r\n\r\n[![CC0](http:\u002F\u002Fmirrors.creativecommons.org\u002Fpresskit\u002Fbuttons\u002F88x31\u002Fsvg\u002Fcc-zero.svg)](https:\u002F\u002Fcreativecommons.org\u002Fpublicdomain\u002Fzero\u002F1.0\u002F)\r\n\r\n","# BiLSTM+CRF 用于序列标注任务\n\n![作者](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAuthor-Scofield%20Phil-blue.svg) \n![Python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.6-brightgreen.svg) \n![可配置](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVex-Configurable-red.svg) \n![TensorFlow](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTensorFlow-1.10.0-yellowgreen.svg)\n![BiLSTM+CRF](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FNLP-BiLSTM+CRF-redgreen.svg)\n![许可证](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-GPL3.0-green.svg)\n\n---\n\n🚀🚀🚀 一个基于 TensorFlow 的 BiLSTM+CRF 模型实现，用于序列标注任务。\n\n##### 项目特点\n\n* 基于 TensorFlow API。\n* 高度 _可扩展_；所有内容均可 _配置_。\n* 模块化设计，结构清晰。\n* 对初学者非常友好。\n* 易于自定义和二次开发。\n\n---\n\n## 任务与模型\n\n`序列标注` 是自然语言处理中对序列预测任务建模的一种典型方法。常见的序列标注任务包括：\n\n1. _词性标注 (POS Tagging)_，\n2. _短语切分 (Chunking)_，\n3. _命名实体识别 (NER)_，\n4. _标点符号恢复_，\n5. _句子边界检测_，\n6. _作用域检测_，\n7. _中文分词 (CWG)_，\n8. _语义角色标注 (SRL)_，\n9. _口语理解_，\n10. _事件抽取_，\n11. 等等……\n\n以 *命名实体识别*（NER）任务为例：\n\n```bash\n斯坦福大学位于加利福尼亚州。\nB-ORG    I-ORG      O       O  B-LOC      O\n```\n\n这里需要提取两个实体：`斯坦福大学` 和 `加利福尼亚州`。具体来说，文本中的每个 `token` 都会打上相应的 `label`。例如：{`token`:_斯坦福_, `label`:_B-ORG_}。序列标注模型的目标是根据给定的 token 序列，预测出对应的 label 序列。\n\n由 [Lample 等人, 2016](https:\u002F\u002Fwww.aclweb.org\u002Fanthology\u002FN16-1030) 提出的 `BiLSTM+CRF`，迄今为止是序列标注任务中最经典、最稳定的神经网络模型。\n![BiLSTM+CRF](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fscofield7419_sequence-labeling-BiLSTM-CRF_readme_9631b03bcfd3.png)\n\n---\n\n# 项目\n\n## 功能支持\n\n- 配置所有设置：\n  - 运行模式：[`train`\u002F`test`\u002F`interactive_predict`\u002F`api_service`]  \n  - 数据集（输入\u002F输出）：\n  - 标注方案：\n    - [`BIO`\u002F`BIESO`]\n    - [`PER`|`LOC`|`ORG`]\n    - ...\n  - 模型配置：\n    - 编码器：BGU\u002FBi-LSTM，层数，双向\u002F单向\n    - 解码器：crf\u002Fsoftmax，\n    - 嵌入层次：字符\u002F单词，\n    - 是否使用自注意力机制\n    - 超参数，\n    - ...\n  - 训练设置：\n    - 监控指标：[精确率、召回率、F1 分数、准确率]\n    - 优化器：GD\u002FAdagrad\u002FAdaDelta\u002FRMSprop\u002FAdam\n  - 测试设置，\n  - API 服务设置，\n\n- 记录所有日志\n- 提供 Web 应用演示，便于展示\n- 面向对象设计：BILSTM_CRF、Datasets、Configer、utils\n- 模块化设计，结构清晰，易于二次开发。\n\n更多内容请参阅 [HandBook](HandBook.md)。\n\n## 需求\n\n- python >=3.5 \n- tensorflow >=1.8\n- numpy\n- pandas\n- Django==1.11.8\n- jieba\n- ... \n\n## 安装\n\n#### 选项 A:\n直接下载仓库使用。\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fscofield7419\u002Fsequence-labeling-BiLSTM-CRF.git\npip install -r requirements.txt\n```\n\n#### 选项 B: _待开发_\n将 BiLSTM-CRF 包作为模块安装。\n\n```bash\npip install BiLSTM-CRF\n```\n\n使用方法：\n\n```python\nfrom BiLSTM-CRF.engines.BiLSTM_CRFs import BiLSTM_CRFs as BC\nfrom BiLSTM-CRF.engines.DataManager import DataManager\nfrom BiLSTM-CRF.engines.Configer import Configer\nfrom BiLSTM-CRF.engines.utils import get_logger\n\n...\n\nconfig_file = r'\u002Fhome\u002Fprojects\u002Fsystem.config'\nconfigs = Configer(config_file)\n\nlogger = get_logger(configs.log_dir)\nconfigs.show_data_summary(logger) # 可选\n\ndataManager = DataManager(configs, logger)\nmodel = BC(configs, logger, dataManager)\n        \n###### 模式 == 'train':\nmodel.train()\n\n###### 模式 == 'test':\nmodel.test()\n\n###### 模式 == '单句预测':\nsentence_tokens, entities, entities_type, entities_index = model.predict_single(sentence)\nif configs.label_level == 1:\n    print(\"\\n提取的实体:\\n %s\\n\\n\" % (\"\\n\".join(entities)))\nelif configs.label_level == 2:\n    print(\"\\n提取的实体:\\n %s\\n\\n\" % (\"\\n\".join([a + \"\\t(%s)\" % b for a, b in zip(entities, entities_type)])))\n\n\n###### 模式 == 'API 服务 Web 应用':\ncmd_new = r'cd demo_webapp; python manage.py runserver %s:%s' % (configs.ip, configs.port)\nres = os.system(cmd_new)\n\n在浏览器中打开 `ip:port`。\n\n```\n\n## 模块结构\n\n\n```\n\n├── main.py\n├── system.config\n├── HandBook.md\n├── README.md\n│\n├── checkpoints\n│   ├── BILSTM-CRFs-datasets1\n│   │   ├── checkpoint\n│   │   └── ...\n│   └── ...\n├── data\n│   ├── example_datasets1\n│   │   ├── logs\n│   │   ├── vocabs\n│   │   ├── test.csv\n│   │   ├── train.csv\n│   │   └── dev.csv\n│   └── ...\n├── demo_webapp\n│   ├── demo_webapp\n│   ├── interface\n│   └── manage.py\n├── engines\n│   ├── BiLSTM_CRFs.py\n│   ├── Configer.py\n│   ├── DataManager.py\n│   └── utils.py\n└── tools\n    ├── calcu_measure_testout.py\n    └── statis.py\n``` \n\n- 文件夹\n  - 在 `engines` 文件夹中，提供核心功能代码。\n  - 在 `data-subfold` 文件夹中存放数据集。\n  - 在 `checkpoints-subfold` 文件夹中存储模型检查点。\n  - 在 `demo_webapp` 文件夹中，可以进行系统 Web 展示，并提供 API 接口。\n  - 在 `tools` 文件夹中，提供一些离线工具。\n\n- 文件\n  - `main.py` 是系统的入口文件。\n  - `system.config` 是用于配置所有系统设置的文件。\n  - `HandBook.md` 提供使用说明。\n  - `BiLSTM_CRFs.py` 是主模型。\n  - `Configer.py` 用于解析 `system.config`。\n  - `DataManager.py` 负责管理数据集和调度。\n  - `utils.py` 提供即时工具。\n\n## 快速入门\n\n请按照以下步骤操作：\n\n#### 第一步：在 `system.config` 中编写配置文件。\n\n- 配置数据集（输入\u002F输出）。\n- 配置标注方案。\n- 配置模型架构。\n- 在演示示例时，配置 Web 应用设置。\n\n![system.config](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fscofield7419_sequence-labeling-BiLSTM-CRF_readme_41bb556b2d54.png)\n\n\n#### 第二步：开始训练（必要且必须）\n\n- 配置运行模式。\n- 配置训练设置。\n- 运行 `main.py`。\n\n![training](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fscofield7419_sequence-labeling-BiLSTM-CRF_readme_5cbe561db2f4.png)\n\n\n#### 第三步：开始测试（可选）\n\n- 配置运行模式。\n- 配置测试设置。\n- 运行 `main.py`。\n\n    \n#### 第四步：开始交互式预测（可选）\n\n- 配置运行模式。\n- 运行 `main.py`。\n- 交互式输入句子。\n    \n![interactively predicting](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fscofield7419_sequence-labeling-BiLSTM-CRF_readme_2b9b83dca9c8.png)\n\n    \n#### 第五步：启动 API 服务和 Web 应用（可选）\n\n- 配置运行模式。\n- 配置 api_service 设置。\n- 运行 `main.py`。\n- 在浏览器中进行交互式预测。\n    \n![web app1](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fscofield7419_sequence-labeling-BiLSTM-CRF_readme_113fdc27c63d.png)\n\n![web app2](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fscofield7419_sequence-labeling-BiLSTM-CRF_readme_edefc65e084d.png)\n\n\n## 数据集\n\n#### 输入\n\n训练集、测试集和验证集是整体使用所必需的。然而，如果您只想训练模型并在离线环境中使用，则仅需训练集即可。训练完成后，您可以使用保存的模型检查点文件进行推理。如果需要进行测试，则应...\n\n\n对于 `trainset`、`testset` 和 `devset`，常见格式如下：\n\n- 词级别：\n\n``` \n(Token)         (Label)\n\nfor             O\nthe             O\nlattice         B_TAS\nQCD             I_TAS\ncomputation     I_TAS\nof              I_TAS\nnucleon–nucleon I_TAS\nlow-energy      I_TAS\ninteractions    E_TAS\n.               O\n\nIt              O\nconsists        O\nin              O\nsimulating      B_PRO\n...\n```\n\n- 字符级别：\n\n``` \n(Token) (Label)\n\n马 B-LOC\n来 I-LOC\n西 I-LOC\n亚 I-LOC\n副 O\n总 O\n理 O\n。 O\n\n他 O\n兼 O\n任 O\n财 B-ORG\n政 I-ORG\n部 I-ORG\n长 O\n...\n```\n\n请注意：\n\n1. `testset` 只能包含 `Token` 行。\n2. 每个句子的标记之间用空行分隔。\n3. 请参阅示例数据集以获取详细的格式说明。\n\n\n#### 输出（测试阶段）\n\n在测试过程中，模型会根据 `test.csv` 输出预测的实体。输出文件包括两个：`test.out` 和 `test.entity.out`（可选）。\n\n- `test.out`\n\n与输入的 `test.csv` 格式相同。\n\n- `test.entity.out`\n\n``` \nSentence\nentity1 (Type)\nentity2 (Type)\nentity3 (Type)\n...\n\n```\n![test.entity.out](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fscofield7419_sequence-labeling-BiLSTM-CRF_readme_47260ec9e169.png)\n\n\n\n## 自定义\n\n如果您想将该项目适配到自己的特定序列标注任务，可能需要以下提示。\n\n- 下载仓库源代码。\n- 标注方案（最重要）\n    - label_scheme：BIO\u002FBIESO\n    - label_level：带后缀\u002F不带后缀\n    - 连字符用于连接前缀和后缀：如 `B_PER'`、`I_LOC'\n    - 后缀=[NR,NS,NT]\n    - 标注级别：词\u002F字\n\n- 模型：在 `BiLSTM_CRFs.py` 中将模型架构修改为您所需的结构。\n     \n- 数据集：按照正确的格式适配您的数据集。\n\n- 训练\n    - 指定所有目录。\n    - 设置训练超参数。\n    \n\n## 其他\n\n---\n\n有关更多使用细节，请参阅 [HandBook](HandBook.md)。\n\n欢迎提出任何问题或错误。\n\n---\n\n\n正在更新...\n====\n* 2019年6月4日，Vex 版本，v1.0，支持配置，可扩展。\n* 2018年11月5日，支持字符和词级别的嵌入。\n* 2017年12月6日，初始版本，v0.1。\n\n\n## 许可证\n\n[![CC0](http:\u002F\u002Fmirrors.creativecommons.org\u002Fpresskit\u002Fbuttons\u002F88x31\u002Fsvg\u002Fcc-zero.svg)](https:\u002F\u002Fcreativecommons.org\u002Fpublicdomain\u002Fzero\u002F1.0\u002F)","# sequence-labeling-BiLSTM-CRF 快速上手指南\n\n本指南旨在帮助开发者快速部署并使用基于 TensorFlow 的 BiLSTM+CRF 序列标注工具，适用于命名实体识别（NER）、词性标注（POS）、中文分词等任务。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**: Linux \u002F macOS \u002F Windows\n*   **Python 版本**: >= 3.5 (推荐 3.6)\n*   **核心框架**: TensorFlow >= 1.8 (原文示例基于 1.10.0)\n*   **其他依赖**:\n    *   numpy\n    *   pandas\n    *   Django == 1.11.8 (用于 Web 演示)\n    *   jieba (中文分词支持)\n\n> **注意**：由于该项目基于 TensorFlow 1.x 版本，建议创建独立的虚拟环境以避免版本冲突。\n\n## 安装步骤\n\n### 1. 克隆项目代码\n使用 git 将仓库下载到本地：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fscofield7419\u002Fsequence-labeling-BiLSTM-CRF.git\ncd sequence-labeling-BiLSTM-CRF\n```\n\n### 2. 安装依赖库\n推荐使用国内镜像源（如清华源）加速安装过程：\n\n```bash\npip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n如果 `requirements.txt` 未包含所有依赖，可手动安装核心包：\n\n```bash\npip install tensorflow==1.10.0 numpy pandas Django==1.11.8 jieba -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n## 基本使用\n\n本项目采用配置文件驱动模式，核心流程分为：**配置参数** -> **训练模型** -> **预测\u002F测试**。\n\n### 第一步：修改配置文件\n编辑根目录下的 `system.config` 文件，根据您的需求调整以下关键参数：\n\n*   **运行模式 (`Running Mode`)**: 设置为 `train` (训练), `test` (测试), 或 `interactive_predict` (交互式预测)。\n*   **数据集路径**: 指定 `train.csv`, `dev.csv`, `test.csv` 的位置。\n*   **标注体系**: 选择 `BIO` 或 `BIESO` 格式。\n*   **模型架构**: 配置编码器 (Bi-LSTM)、解码器 (CRF)、嵌入层 (char\u002Fword) 及超参数。\n\n### 第二步：准备数据\n确保数据文件夹 (`data\u002F`) 中包含符合格式的训练集。文件格式为两列（Token 和 Label），句子之间用空行分隔。\n\n**示例格式 (`train.csv`):**\n```text\nStanford B-ORG\nUniversity I-ORG\nlocated O\nat O\nCalifornia B-LOC\n. O\n\n马 B-LOC\n来 I-LOC\n西 I-LOC\n亚 I-LOC\n```\n\n### 第三步：运行模型\n\n#### 场景 A：训练模型\n将 `system.config` 中的运行模式设为 `train`，然后执行：\n\n```bash\npython main.py\n```\n训练完成后，模型检查点将保存在 `checkpoints\u002F` 目录下。\n\n#### 场景 B：交互式预测\n将 `system.config` 中的运行模式设为 `interactive_predict`，确保已加载训练好的模型检查点，然后执行：\n\n```bash\npython main.py\n```\n程序启动后，您可以在终端直接输入句子，系统将实时输出识别出的实体。\n\n#### 场景 C：启动 Web 演示服务\n将 `system.config` 中的运行模式设为 `api_service`，配置好 IP 和端口后执行：\n\n```bash\npython main.py\n```\n随后在浏览器访问配置的地址（例如 `http:\u002F\u002F127.0.0.1:8000`）即可使用图形化界面进行预测。\n\n### 代码调用示例 (Python API)\n如果您希望在其他 Python 项目中直接调用该模型，可参考以下代码：\n\n```python\nfrom engines.BiLSTM_CRFs import BiLSTM_CRFs as BC\nfrom engines.DataManager import DataManager\nfrom engines.Configer import Configer\nfrom engines.utils import get_logger\n\n# 初始化配置\nconfig_file = r'\u002Fpath\u002Fto\u002Fsystem.config'\nconfigs = Configer(config_file)\n\nlogger = get_logger(configs.log_dir)\ndataManager = DataManager(configs, logger)\nmodel = BC(configs, logger, dataManager)\n\n# 单句预测\nsentence = \"斯坦福大学位于加州。\"\n# 注意：实际输入可能需要根据配置进行分词处理\nsentence_tokens = sentence.split() \nsentence_tokens, entities, entities_type, entities_index = model.predict_single(sentence_tokens)\n\nprint(\"\\nExtracted entities:\\n %s\\n\" % (\"\\n\".join(entities)))\n```","某电商公司的数据团队需要从海量用户评论中自动提取品牌名、产品型号及故障部位，以构建智能客服知识库。\n\n### 没有 sequence-labeling-BiLSTM-CRF 时\n- **识别精度低且上下文缺失**：传统规则或简单模型难以区分“苹果”是指水果还是手机品牌，导致实体抽取错误率高，无法处理复杂的语言歧义。\n- **开发门槛高且重复造轮子**：工程师需从零搭建双向 LSTM 与条件随机场（CRF）的底层代码，配置超参数繁琐，耗时数周才能跑通基线模型。\n- **扩展性差难以适配新业务**：当需要新增“情感极性”或“服务网点”等标签体系时，原有代码耦合严重，修改标注方案（如从 BIO 切换到 BIESO）极易引发系统崩溃。\n- **缺乏可视化与调试支持**：训练过程黑盒化，缺少直观的日志监控和 Web 演示界面，排查模型收敛困难或预测偏差如同“盲人摸象”。\n\n### 使用 sequence-labeling-BiLSTM-CRF 后\n- **语义理解精准稳定**：利用 BiLSTM 捕捉长距离上下文依赖，结合 CRF 约束标签转移逻辑，显著提升了品牌与故障词的边界识别准确率，完美解决歧义问题。\n- **开箱即用大幅提效**：基于 TensorFlow 的模块化实现支持通过配置文件一键切换训练\u002F预测模式，团队仅需一天即可完成数据接入并产出高质量模型。\n- **灵活配置适应多变需求**：内置多种编码器（Bi-LSTM\u002FBigru）与标注方案，新增业务标签只需调整配置文件，无需改动核心代码，轻松实现热迭代。\n- **全流程透明可观测**：提供详细的训练指标日志（Precision\u002FRecall\u002FF1）及 Web 演示 Demo，开发人员可实时观察模型表现并快速定位优化方向。\n\nsequence-labeling-BiLSTM-CRF 将复杂的序列标注算法转化为可配置的工程组件，让企业能以最低成本构建高精度的自然语言理解能力。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fscofield7419_sequence-labeling-BiLSTM-CRF_113fdc27.png","scofield7419","Hao Fei","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fscofield7419_5083f788.jpg","AI Researcher","University of Oxford","UK",null,"ScottNLP","https:\u002F\u002Fhaofei.vip\u002F","https:\u002F\u002Fgithub.com\u002Fscofield7419",[86,90,94,98,102,106,110],{"name":87,"color":88,"percentage":89},"JavaScript","#f1e05a",74.4,{"name":91,"color":92,"percentage":93},"CSS","#663399",14.8,{"name":95,"color":96,"percentage":97},"HTML","#e34c26",6.1,{"name":99,"color":100,"percentage":101},"Python","#3572A5",4.4,{"name":103,"color":104,"percentage":105},"CoffeeScript","#244776",0.3,{"name":107,"color":108,"percentage":109},"PHP","#4F5D95",0,{"name":111,"color":112,"percentage":109},"Makefile","#427819",703,255,"2026-01-22T08:04:04","GPL-3.0","","未说明",{"notes":120,"python":121,"dependencies":122},"该项目基于 TensorFlow 1.x 版本（推荐 1.10.0），需注意与新版 TensorFlow 的兼容性问题。支持词级和字符级嵌入，可用于命名实体识别、分词等多种序列标注任务。包含可选的 Django Web 演示服务。",">=3.5",[123,124,125,126,127],"tensorflow>=1.8","numpy","pandas","Django==1.11.8","jieba",[13,52,55,26,14],[130,131,132,133,134,135],"bilstm-crf","tensorflow","python35","sequence-labeling","ner","nlp","2026-03-27T02:49:30.150509","2026-04-06T07:15:02.723760",[139,144,149,154,159,164,169,174],{"id":140,"question_zh":141,"answer_zh":142,"source_url":143},12718,"为什么预测单句话的速度非常慢？","大部分时间消耗在加载模型检查点（checkpoints）上。一旦模型加载完成，后续的推理速度会非常快。因此，首次尝试时感觉解码速度慢是正常的，后续批次处理效率很高。","https:\u002F\u002Fgithub.com\u002Fscofield7419\u002Fsequence-labeling-BiLSTM-CRF\u002Fissues\u002F10",{"id":145,"question_zh":146,"answer_zh":147,"source_url":148},12719,"该模型是否支持中文分词和命名实体识别？","支持。前提是需要设计好相应的标注集（label set），确保数据格式符合模型输入要求即可同时支持中文分词与命名实体识别。","https:\u002F\u002Fgithub.com\u002Fscofield7419\u002Fsequence-labeling-BiLSTM-CRF\u002Fissues\u002F1",{"id":150,"question_zh":151,"answer_zh":152,"source_url":153},12720,"训练时出现 'ZeroDivisionError: division by zero' 错误怎么办？","该错误通常是因为验证集或测试集为空导致的（num_val_iterations 为 0）。请检查您的数据集文件，确保数据格式正确且包含有效的验证数据，避免读取到的数据集大小为 0。","https:\u002F\u002Fgithub.com\u002Fscofield7419\u002Fsequence-labeling-BiLSTM-CRF\u002Fissues\u002F28",{"id":155,"question_zh":156,"answer_zh":157,"source_url":158},12721,"如何生成或构建训练所需的数据集？","虽然具体脚本未在讨论中详细展开，但用户反馈已找到解决方案。通常此类项目需要按照特定格式（如每行一个词和标签，句子间用空行分隔）准备数据。建议参考项目中的 example_datasets 目录或文档了解数据格式规范。","https:\u002F\u002Fgithub.com\u002Fscofield7419\u002Fsequence-labeling-BiLSTM-CRF\u002Fissues\u002F23",{"id":160,"question_zh":161,"answer_zh":162,"source_url":163},12722,"预测时遇到句子长度限制或实体在句尾无法识别的问题如何解决？","1. 预测时句子长度应短于 1000（根据 utils.extractEntity_ 的限制）。\n2. 如果实体结尾位于句子末尾无法预测，是 utils.extractEntity 第 86 行的正则表达式 bug。可将正则修改为：reg_str = r'([0-9][0-9][0-9]B'+label_hyphen + tag_str + r' )([0-9][0-9][0-9]I'+label_hyphen + tag_str + r' )*([0-9][0-9][0-9]E'+label_hyphen + tag_str + r')|([0-9][0-9][0-9]S'+label_hyphen + tag_str + r' )' 以修复该问题。","https:\u002F\u002Fgithub.com\u002Fscofield7419\u002Fsequence-labeling-BiLSTM-CRF\u002Fissues\u002F18",{"id":165,"question_zh":166,"answer_zh":167,"source_url":168},12723,"运行 train.py 时出现 'ValueError: Cannot reshape a tensor' 维度不匹配错误如何解决？","该错误通常由 batch_size 与数据量或标签转移矩阵维度不匹配引起。错误信息显示试图将 28800 个元素重塑为 [128, 6, 6]（仅 4608 个元素）。请检查配置文件中的 batch_size 设置，确保其与标签类别数量（此处为 6 类）及总数据量兼容，或者检查 transitions 张量的初始化逻辑是否正确。","https:\u002F\u002Fgithub.com\u002Fscofield7419\u002Fsequence-labeling-BiLSTM-CRF\u002Fissues\u002F3",{"id":170,"question_zh":171,"answer_zh":172,"source_url":173},12724,"使用新数据集训练时，显示训练集和验证集大小均为 0 是什么原因？","这是 DataManger.py 中 prepare 函数的逻辑问题。当 is_padding 为真时，如果数据读取逻辑未正确将临时列表 tmp_x\u002Ftmp_y 添加到主列表 X\u002Fy 中，会导致最终数组为空。请检查数据文件中是否有正确的空行分隔符，以及代码中是否在遇到空行（c == -1）时正确执行了 append 操作。","https:\u002F\u002Fgithub.com\u002Fscofield7419\u002Fsequence-labeling-BiLSTM-CRF\u002Fissues\u002F26",{"id":175,"question_zh":176,"answer_zh":177,"source_url":178},12725,"如何使用自己的数据进行训练并解决测试时找不到模型的问题？","确保训练过程正常完成并保存了检查点文件。测试时找不到模型通常是因为路径配置错误或训练未成功保存权重。请检查 system.config 或相关配置文件中的模型保存路径，并确认训练日志中没有报错中断。如有必要，可联系维护者获取具体的调试帮助。","https:\u002F\u002Fgithub.com\u002Fscofield7419\u002Fsequence-labeling-BiLSTM-CRF\u002Fissues\u002F11",[]]