julien-c HF staff commited on
Commit
3d19163
β€’
1 Parent(s): 70044c0

Migrate model card from transformers-repo

Browse files

Read announcement at https://discuss.huggingface.co/t/announcement-all-model-cards-will-be-migrated-to-hf-co-model-repos/2755
Original file history: https://github.com/huggingface/transformers/commits/master/model_cards/mrm8488/distilbert-base-multi-cased-finetuned-typo-detection/README.md

Files changed (1) hide show
  1. README.md +53 -0
README.md ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: multilingual
3
+ thumbnail:
4
+ ---
5
+
6
+ # DISTILBERT 🌎 + Typo Detection βœβŒβœβœ”
7
+
8
+ [distilbert-base-multilingual-cased](https://huggingface.co/distilbert-base-multilingual-cased) fine-tuned on [GitHub Typo Corpus](https://github.com/mhagiwara/github-typo-corpus) for **typo detection** (using *NER* style)
9
+
10
+ ## Details of the downstream task (Typo detection as NER)
11
+
12
+ - Dataset: [GitHub Typo Corpus](https://github.com/mhagiwara/github-typo-corpus) πŸ“š for 15 languages
13
+
14
+ - [Fine-tune script on NER dataset provided by Huggingface](https://github.com/huggingface/transformers/blob/master/examples/token-classification/run_ner_old.py) πŸ‹οΈβ€β™‚οΈ
15
+
16
+ ## Metrics on test set πŸ“‹
17
+
18
+ | Metric | # score |
19
+ | :-------: | :-------: |
20
+ | F1 | **93.51** |
21
+ | Precision | **96.08** |
22
+ | Recall | **91.06** |
23
+
24
+ ## Model in action πŸ”¨
25
+
26
+ Fast usage with **pipelines** πŸ§ͺ
27
+
28
+ ```python
29
+ from transformers import pipeline
30
+
31
+ typo_checker = pipeline(
32
+ "ner",
33
+ model="mrm8488/distilbert-base-multi-cased-finetuned-typo-detection",
34
+ tokenizer="mrm8488/distilbert-base-multi-cased-finetuned-typo-detection"
35
+ )
36
+
37
+ result = typo_checker("Adddd validation midelware")
38
+ result[1:-1]
39
+
40
+ # Output:
41
+ [{'entity': 'ok', 'score': 0.7128152847290039, 'word': 'add'},
42
+ {'entity': 'typo', 'score': 0.5388424396514893, 'word': '##dd'},
43
+ {'entity': 'ok', 'score': 0.94792640209198, 'word': 'validation'},
44
+ {'entity': 'typo', 'score': 0.5839331746101379, 'word': 'mid'},
45
+ {'entity': 'ok', 'score': 0.5195121765136719, 'word': '##el'},
46
+ {'entity': 'ok', 'score': 0.7222476601600647, 'word': '##ware'}]
47
+ ```
48
+ It worksπŸŽ‰! We typed wrong ```Add and middleware```
49
+
50
+
51
+ > Created by [Manuel Romero/@mrm8488](https://twitter.com/mrm8488)
52
+
53
+ > Made with <span style="color: #e25555;">&hearts;</span> in Spain