arXiv:2504.09170cs.CL2025-04被引 1

Langformers统一NLP流程,让大模型应用更简单。

Langformers: Unified NLP Pipelines for Language Models

  • 用工厂模式封装任务,自动处理训练、推理和部署
  • 支持对话、文本分类、语义搜索等8类常见NLP任务
  • 适合初学者快速上手,也提升开发者开发效率

基于Transformer的语言模型已彻底改变自然语言处理领域。然而,使用这些模型通常需要应对多种框架和工具,还需编写大量重复代码,这不仅阻碍了非程序员和初学者,也拖慢了经验丰富的开发者的原型设计速度。为此,我们提出Langformers,一个开源Python库,通过统一的工厂式接口,简化大型语言模型(LLM)和掩码语言模型(MLM)任务的NLP流水线。该库整合了对话AI、MLM预训练、文本分类、句子嵌入/重排序、数据标注、语义搜索及知识蒸馏等功能,支持Hugging Face和Ollama等主流平台。核心创新包括:(1) 任务专用工厂抽象训练、推理与部署复杂性;(2) 内置记忆与流式处理能力,用于对话代理;(3) 轻量级模块化设计,强调易用性。文档详见:https://langformers.com

原文摘要 · Abstract (English)

Transformer-based language models have revolutionized the field of natural language processing (NLP). However, using these models often involves navigating multiple frameworks and tools, as well as writing repetitive boilerplate code. This complexity can discourage non-programmers and beginners, and even slow down prototyping for experienced developers. To address these challenges, we introduce Langformers, an open-source Python library designed to streamline NLP pipelines through a unified, factory-based interface for large language model (LLM) and masked language model (MLM) tasks. Langformers integrates conversational AI, MLM pretraining, text classification, sentence embedding/reranking, data labelling, semantic search, and knowledge distillation into a cohesive API, supporting popular platforms such as Hugging Face and Ollama. Key innovations include: (1) task-specific factories that abstract training, inference, and deployment complexities; (2) built-in memory and streaming for conversational agents; and (3) lightweight, modular design that prioritizes ease of use. Documentation: https://langformers.com

NLP工具大模型流水线Python库

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。