HuggingFace镜像/bert-small-finetuned-typo-detection-1
模型介绍文件和版本分析
下载使用量0

BERT SMALL + 拼写错误检测 ✍❌✍✔

BERT SMALL 在 GitHub Typo Corpus 上进行了微调,用于拼写错误检测(采用 NER 风格)

下游任务详情(作为 NER 的拼写错误检测)

  • 数据集:GitHub Typo Corpus 📚

测试集上的指标 📋

指标得分
F189.12
精确率93.82
召回率84.87

模型实际应用 🔨

使用 pipelines 的快速用法 🧪

from transformers import pipeline

typo_checker = pipeline(
    "ner",
    model="mrm8488/bert-small-finetuned-typo-detection",
    tokenizer="mrm8488/bert-small-finetuned-typo-detection"
)

result = typo_checker("here there is an error in coment")
result[1:-1]

# Output:
[{'entity': 'ok', 'score': 0.9021041989326477, 'word': 'here'},
 {'entity': 'ok', 'score': 0.7975626587867737, 'word': 'there'},
 {'entity': 'ok', 'score': 0.8596242070198059, 'word': 'is'},
 {'entity': 'ok', 'score': 0.7071516513824463, 'word': 'an'},
 {'entity': 'ok', 'score': 0.943381130695343, 'word': 'error'},
 {'entity': 'ok', 'score': 0.8047608733177185, 'word': 'in'},
 {'entity': 'ok', 'score': 0.8240702152252197, 'word': 'come'},
 {'entity': 'typo', 'score': 0.5004884004592896, 'word': '##nt'}]

它成功了🎉!我们输入的是 coment,而不是 comment

让我们再试一个例子

result = typo_checker("Adddd validation midelware")
result[1:-1]

# Output:
[{'entity': 'ok', 'score': 0.7128152847290039, 'word': 'add'},
 {'entity': 'typo', 'score': 0.5388424396514893, 'word': '##dd'},
 {'entity': 'ok', 'score': 0.94792640209198, 'word': 'validation'},
 {'entity': 'typo', 'score': 0.5839331746101379, 'word': 'mid'},
 {'entity': 'ok', 'score': 0.5195121765136719, 'word': '##el'},
 {'entity': 'ok', 'score': 0.7222476601600647, 'word': '##ware'}]

好的!我们打错了 Add and middleware

由 Manuel Romero/@mrm8488 创建

在西班牙用 ♥ 制作