SuperAPI AI 工具集

hebrew-nlp-toolkit

通用与其它

查看项目

更新于 10-16 07:23

技能介绍

用途:为开发者提供希伯来语 NLP 模型与工具的选型和使用指引,涵盖 Dicta 系列(DictaLM、DictaBERT、NeoDictaBERT)、AlephBERT 与 ivrit.ai Whisper。

主要能力与选型:文本生成可用 DictaLM 3.0 24B Base(Apache-2.0)、12B Nemotron Instruct、24B Thinking 及 1.7B Thinking GGUF;分类/填空用 DictaBERT(184M,需微调);NER、情感、形态与依存、抽取式问答分别有 dictabert-ner、dictabert-sentiment、dictabert-joint、dictabert-heq;句嵌入用 NeoDictaBERT 双语嵌入(768 维);语音转写用 ivrit.ai Whisper v3 及 turbo-ct2(faster-whisper)。

使用方式:通过 transformers pipeline 或 AutoModel 加载,部分模型需 trust_remote_code=True(Nemotron、dictabert-joint、neodictabert-bilingual-embed 等),生产环境应固定 revision。NER 需 aggregation_strategy='simple' 并设置 WordPiece 解码器。嵌入查询需保留 query: 前缀。语音转写用 faster_whisper.WhisperModel,language='he',CPU 可设 device="cpu"、compute_type="int8"。Dicta 还提供托管 REST API(Nakdan、形态分析等),接入前需查阅官方开发者文档确认端点与条款。

预处理与限制:建议做 Unicode NFC 归一化、去除 niqqud(保留 maqaf)、清理空白;注意希伯来语无大小写、词可带多个前缀、有五个词尾形,且现代文本通常无 niqqud。加注元音(diacritization)可用 dictabert-large-char-menaked,但结果存在歧义,且不适用于圣经、拉比或诗歌文本。各模型许可证不同(DictaBERT 为 CC-BY-4.0,DictaLM 24B 为 Apache-2.0,Nemotron 12B 为 NVIDIA Open Model License),商用前需核对。24B 模型 BF16 权重约需 48GB 显存,12B 约 24GB,可改用更小或量化版本。HebSpacy 与 Stanza 也提供希伯来语管线,但 Dicta 模型准确度通常更高。