PolyLingua: 基于边界的跨领域语言识别变换器
PolyLingua: Margin-based Inter-class Transformer for Robust Cross-domain Language Detection
AI总结:
PolyLingua是一种轻量级变换器模型,通过两级对比学习框架实现精确的跨领域语言识别,以高准确率和低资源消耗应对复杂语言识别挑战。
摘要:
语言识别是多语言系统如聊天机器人和虚拟助手中的关键第一步,能够实现语言和文化上的准确用户体验。该阶段的错误可能引发下游故障,对准确性提出了高要求。然而,现有的语言识别工具在关键案例中表现不佳,例如音乐请求中歌曲标题和用户语言不同的情况。开源工具如LangDetect、FastText虽然快速但准确性较低,而大语言模型虽然有效,但往往在低延迟或低资源环境下成本过高。我们引入了PolyLingua,一种轻量级的基于变换器的模型,用于领域内语言识别和细粒度语言分类。它采用两级对比学习框架,结合实例级分离和类级对齐,使用自适应边距,即使对于密切相关语言也能生成紧凑且分离的嵌入。在两个具有挑战性的数据集上进行了评估——Amazon Massive(多语言数字助手语句)和歌曲数据集(包含频繁代码切换的音乐请求)——PolyLingua分别实现了99.25%的F1和98.15%的F1,超越了Sonnet 3.5,同时使用10倍更少的参数,使其成为计算和延迟受限环境的理想选择。
英文摘要:
Language identification is a crucial first step in multilingual systems such as chatbots and virtual assistants, enabling linguistically and culturally accurate user experiences. Errors at this stage can cascade into downstream failures, setting a high bar for accuracy. Yet, existing language identification tools struggle with key cases -- such as music requests where the song title and user language differ. Open-source tools like LangDetect, FastText are fast but less accurate, while large language models, though effective, are often too costly for low-latency or low-resource settings. We introduce PolyLingua, a lightweight Transformer-based model for in-domain language detection and fine-grained language classification. It employs a two-level contrastive learning framework combining instance-level separation and class-level alignment with adaptive margins, yielding compact and well-separated embeddings even for closely related languages. Evaluated on two challenging datasets -- Amazon Massive (multilingual digital assistant utterances) and a Song dataset (music requests with frequent code-switching) -- PolyLingua achieves 99.25% F1 and 98.15% F1, respectively, surpassing Sonnet 3.5 while using 10x fewer parameters, making it ideal for compute- and latency-constrained environments.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。