Add multilingual to the language tag
#1
by
lbourdois
- opened
README.md
CHANGED
@@ -5,26 +5,28 @@ language:
|
|
5 |
- fr
|
6 |
- it
|
7 |
- nl
|
|
|
|
|
8 |
tags:
|
9 |
- punctuation prediction
|
10 |
- punctuation
|
11 |
-
datasets:
|
12 |
- wmt/europarl
|
13 |
- SoNaR
|
14 |
-
license: mit
|
15 |
-
widget:
|
16 |
-
- text: "Ho sentito che ti sei laureata il che mi fa molto piacere"
|
17 |
-
example_title: "Italian"
|
18 |
-
- text: "Tous les matins vers quatre heures mon père ouvrait la porte de ma chambre"
|
19 |
-
example_title: "French"
|
20 |
-
- text: "Ist das eine Frage Frau Müller"
|
21 |
-
example_title: "German"
|
22 |
-
- text: "My name is Clara and I live in Berkeley California"
|
23 |
-
example_title: "English"
|
24 |
-
- text: "hervatting van de zitting ik verklaar de zitting van het europees parlement die op vrijdag 17 december werd onderbroken te zijn hervat"
|
25 |
-
example_title: "Dutch"
|
26 |
metrics:
|
27 |
- f1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
---
|
29 |
|
30 |
|
@@ -49,13 +51,13 @@ pip install deepmultilingualpunctuation
|
|
49 |
from deepmultilingualpunctuation import PunctuationModel
|
50 |
|
51 |
model = PunctuationModel(model="oliverguhr/fullstop-punctuation-multilingual-sonar-base")
|
52 |
-
text = "My name is Clara and I live in Berkeley California Ist das eine Frage Frau
|
53 |
result = model.restore_punctuation(text)
|
54 |
print(result)
|
55 |
```
|
56 |
|
57 |
**output**
|
58 |
-
> My name is Clara and I live in Berkeley, California. Ist das eine Frage, Frau
|
59 |
|
60 |
|
61 |
### Predict Labels
|
@@ -63,7 +65,7 @@ print(result)
|
|
63 |
from deepmultilingualpunctuation import PunctuationModel
|
64 |
|
65 |
model = PunctuationModel(model="oliverguhr/fullstop-punctuation-multilingual-sonar-base")
|
66 |
-
text = "My name is Clara and I live in Berkeley California Ist das eine Frage Frau
|
67 |
clean_text = model.preprocess(text)
|
68 |
labled_words = model.predict(clean_text)
|
69 |
print(labled_words)
|
@@ -71,7 +73,7 @@ print(labled_words)
|
|
71 |
|
72 |
**output**
|
73 |
|
74 |
-
> [['My', '0', 0.99998856], ['name', '0', 0.9999708], ['is', '0', 0.99975926], ['Clara', '0', 0.6117834], ['and', '0', 0.9999014], ['I', '0', 0.9999808], ['live', '0', 0.9999666], ['in', '0', 0.99990165], ['Berkeley', ',', 0.9941764], ['California', '.', 0.9952892], ['Ist', '0', 0.9999577], ['das', '0', 0.9999678], ['eine', '0', 0.99998224], ['Frage', ',', 0.9952265], ['Frau', '0', 0.99995995], ['
|
75 |
|
76 |
|
77 |
|
|
|
5 |
- fr
|
6 |
- it
|
7 |
- nl
|
8 |
+
- multilingual
|
9 |
+
license: mit
|
10 |
tags:
|
11 |
- punctuation prediction
|
12 |
- punctuation
|
13 |
+
datasets:
|
14 |
- wmt/europarl
|
15 |
- SoNaR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
metrics:
|
17 |
- f1
|
18 |
+
widget:
|
19 |
+
- text: Ho sentito che ti sei laureata il che mi fa molto piacere
|
20 |
+
example_title: Italian
|
21 |
+
- text: Tous les matins vers quatre heures mon p�re ouvrait la porte de ma chambre
|
22 |
+
example_title: French
|
23 |
+
- text: Ist das eine Frage Frau M�ller
|
24 |
+
example_title: German
|
25 |
+
- text: My name is Clara and I live in Berkeley California
|
26 |
+
example_title: English
|
27 |
+
- text: hervatting van de zitting ik verklaar de zitting van het europees parlement
|
28 |
+
die op vrijdag 17 december werd onderbroken te zijn hervat
|
29 |
+
example_title: Dutch
|
30 |
---
|
31 |
|
32 |
|
|
|
51 |
from deepmultilingualpunctuation import PunctuationModel
|
52 |
|
53 |
model = PunctuationModel(model="oliverguhr/fullstop-punctuation-multilingual-sonar-base")
|
54 |
+
text = "My name is Clara and I live in Berkeley California Ist das eine Frage Frau M�ller"
|
55 |
result = model.restore_punctuation(text)
|
56 |
print(result)
|
57 |
```
|
58 |
|
59 |
**output**
|
60 |
+
> My name is Clara and I live in Berkeley, California. Ist das eine Frage, Frau M�ller?
|
61 |
|
62 |
|
63 |
### Predict Labels
|
|
|
65 |
from deepmultilingualpunctuation import PunctuationModel
|
66 |
|
67 |
model = PunctuationModel(model="oliverguhr/fullstop-punctuation-multilingual-sonar-base")
|
68 |
+
text = "My name is Clara and I live in Berkeley California Ist das eine Frage Frau M�ller"
|
69 |
clean_text = model.preprocess(text)
|
70 |
labled_words = model.predict(clean_text)
|
71 |
print(labled_words)
|
|
|
73 |
|
74 |
**output**
|
75 |
|
76 |
+
> [['My', '0', 0.99998856], ['name', '0', 0.9999708], ['is', '0', 0.99975926], ['Clara', '0', 0.6117834], ['and', '0', 0.9999014], ['I', '0', 0.9999808], ['live', '0', 0.9999666], ['in', '0', 0.99990165], ['Berkeley', ',', 0.9941764], ['California', '.', 0.9952892], ['Ist', '0', 0.9999577], ['das', '0', 0.9999678], ['eine', '0', 0.99998224], ['Frage', ',', 0.9952265], ['Frau', '0', 0.99995995], ['M�ller', '?', 0.972517]]
|
77 |
|
78 |
|
79 |
|