LabelFusion is a fusion ensemble for text classification that learns to combine a traditional transformer-based classifier (e.g., RoBERTa) with one or more Large Language Models (LLMs such as OpenAI GPT, Google Gemini, or DeepSeek) to deliver accurate and cost-aware predictions across multi-class and multi-label tasks. The package provides a simple high-level interface (AutoFusionClassifier) that trains the full pipeline end-to-end with minimal configuration, and a flexible API for advanced users. Under the hood, LabelFusion integrates vector signals from both sources by concatenating the ML backbone's embeddings with the LLM-derived per-class scores -- obtained through structured prompt-engineering strategies -- and feeds this joint representation into a compact multi-layer perceptron (FusionMLP) that produces the final prediction. This learned fusion approach captures complementary strengths of LLM reasoning and traditional transformer-based classifiers, yielding robust performance across domains -- achieving 92.4% accuracy on AG News and 92.3% on 10-class Reuters 21578 topic classification -- while enabling practical trade-offs between accuracy, latency, and cost.
翻译:LabelFusion是一种用于文本分类的融合集成方法,通过学习将传统的基于Transformer的分类器(例如RoBERTa)与一个或多个大语言模型(如OpenAI GPT、Google Gemini或DeepSeek)相结合,为多类别和多标签任务提供准确且成本感知的预测。该软件包提供了一个简单的高级接口(AutoFusionClassifier),可通过最小配置端到端地训练整个流程,并为高级用户提供灵活的API。在底层,LabelFusion通过将机器学习骨干网络的嵌入向量与大语言模型衍生的每类分数(通过结构化提示工程策略获得)进行拼接,整合来自两个来源的向量信号,并将此联合表示输入一个紧凑的多层感知机(FusionMLP)以生成最终预测。这种学习式融合方法捕捉了大语言模型推理与传统基于Transformer的分类器的互补优势,在各个领域实现了鲁棒的性能——在AG News数据集上达到92.4%的准确率,在10类Reuters 21578主题分类上达到92.3%——同时允许在准确性、延迟和成本之间进行实际权衡。