dominguesm
commited on
Commit
·
b02fa88
1
Parent(s):
cc5e011
Update README.md
Browse files
README.md
CHANGED
@@ -42,10 +42,9 @@ widget:
|
|
42 |
|
43 |
|
44 |
* 🪄 [W&B Dashboard](https://wandb.ai/dominguesm/RestorePunctuationPTBR)
|
|
|
45 |
|
46 |
|
47 |
-
**Coming soon python package for simpler use.**
|
48 |
-
|
49 |
This is a [bert-base-portuguese-cased](https://huggingface.co/neuralmind/bert-base-portuguese-cased) model finetuned for punctuation restoration on [WikiLingua](https://github.com/esdurmus/Wikilingua).
|
50 |
|
51 |
This model is intended for direct use as a punctuation restoration model for the general Portuguese language. Alternatively, you can use this for further fine-tuning on domain-specific texts for punctuation restoration tasks.
|
@@ -54,6 +53,34 @@ Model restores the following punctuations -- **[! ? . , - : ; ' ]**
|
|
54 |
|
55 |
The model also restores the upper-casing of words.
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
-----------------------------------------------
|
58 |
## 🎯 Accuracy
|
59 |
|
@@ -80,84 +107,7 @@ The model also restores the upper-casing of words.
|
|
80 |
| **weighted avg** | 0.96 | 0.96 | 0.96 | 1047818
|
81 |
|
82 |
-----------------------------------------------
|
83 |
-
## 🤷 Output
|
84 |
-
|
85 |
-
Example:
|
86 |
-
|
87 |
-
```json
|
88 |
-
[
|
89 |
-
{
|
90 |
-
"entity_group": "OU",
|
91 |
-
"score": 0.8026431202888489,
|
92 |
-
"word": "henrique",
|
93 |
-
"start": 0,
|
94 |
-
"end": 8
|
95 |
-
},
|
96 |
-
{
|
97 |
-
"entity_group": "OO",
|
98 |
-
"score": 0.9925149083137512,
|
99 |
-
"word": "foi no lago pescar com o",
|
100 |
-
"start": 9,
|
101 |
-
"end": 33
|
102 |
-
},
|
103 |
-
{
|
104 |
-
"entity_group": ".U",
|
105 |
-
"score": 0.8426014184951782,
|
106 |
-
"word": "pedro",
|
107 |
-
"start": 34,
|
108 |
-
"end": 39
|
109 |
-
},
|
110 |
-
{
|
111 |
-
"entity_group": "OU",
|
112 |
-
"score": 0.9519776105880737,
|
113 |
-
"word": "mais",
|
114 |
-
"start": 40,
|
115 |
-
"end": 44
|
116 |
-
},
|
117 |
-
{
|
118 |
-
"entity_group": ",O",
|
119 |
-
"score": 0.8551820516586304,
|
120 |
-
"word": "tarde",
|
121 |
-
"start": 45,
|
122 |
-
"end": 50
|
123 |
-
},
|
124 |
-
{
|
125 |
-
"entity_group": "OO",
|
126 |
-
"score": 0.9902807474136353,
|
127 |
-
"word": "foram para a casa do",
|
128 |
-
"start": 51,
|
129 |
-
"end": 71
|
130 |
-
},
|
131 |
-
{
|
132 |
-
"entity_group": "OU",
|
133 |
-
"score": 0.9227372407913208,
|
134 |
-
"word": "pedro",
|
135 |
-
"start": 72,
|
136 |
-
"end": 77
|
137 |
-
},
|
138 |
-
{
|
139 |
-
"entity_group": "OO",
|
140 |
-
"score": 0.9997054934501648,
|
141 |
-
"word": "fritar os",
|
142 |
-
"start": 78,
|
143 |
-
"end": 87
|
144 |
-
},
|
145 |
-
{
|
146 |
-
"entity_group": ".O",
|
147 |
-
"score": 0.9813661575317383,
|
148 |
-
"word": "peixes",
|
149 |
-
"start": 88,
|
150 |
-
"end": 94
|
151 |
-
}
|
152 |
-
]
|
153 |
-
```
|
154 |
-
|
155 |
-
This output refers to:
|
156 |
|
157 |
-
```
|
158 |
-
Henrique foi no lago pescar com o Pedro. Mais tarde, foram para a casa do Pedro fritar os peixes.
|
159 |
-
```
|
160 |
-
-----------------------------------------------
|
161 |
|
162 |
## 🤙 Contact
|
163 |
|
|
|
42 |
|
43 |
|
44 |
* 🪄 [W&B Dashboard](https://wandb.ai/dominguesm/RestorePunctuationPTBR)
|
45 |
+
* ⛭ [GitHub](https://github.com/DominguesM/respunct)
|
46 |
|
47 |
|
|
|
|
|
48 |
This is a [bert-base-portuguese-cased](https://huggingface.co/neuralmind/bert-base-portuguese-cased) model finetuned for punctuation restoration on [WikiLingua](https://github.com/esdurmus/Wikilingua).
|
49 |
|
50 |
This model is intended for direct use as a punctuation restoration model for the general Portuguese language. Alternatively, you can use this for further fine-tuning on domain-specific texts for punctuation restoration tasks.
|
|
|
53 |
|
54 |
The model also restores the upper-casing of words.
|
55 |
|
56 |
+
-----------------------------------------------
|
57 |
+
|
58 |
+
## 🤷 Usage
|
59 |
+
|
60 |
+
🇧🇷 easy-to-use package to restore punctuation of portuguese texts.
|
61 |
+
|
62 |
+
**Below is a quick way to use the template.**
|
63 |
+
|
64 |
+
1. First, install the package.
|
65 |
+
|
66 |
+
```
|
67 |
+
pip install respunct
|
68 |
+
```
|
69 |
+
|
70 |
+
2. Sample python code.
|
71 |
+
|
72 |
+
``` python
|
73 |
+
from respunct import RestorePuncts
|
74 |
+
|
75 |
+
model = RestorePuncts()
|
76 |
+
|
77 |
+
model.restore_puncts("""
|
78 |
+
henrique foi no lago pescar com o pedro mais tarde foram para a casa do pedro fritar os peixes""")
|
79 |
+
# output:
|
80 |
+
# Henrique foi no lago pescar com o Pedro. Mais tarde, foram para a casa do Pedro fritar os peixes.
|
81 |
+
|
82 |
+
```
|
83 |
+
|
84 |
-----------------------------------------------
|
85 |
## 🎯 Accuracy
|
86 |
|
|
|
107 |
| **weighted avg** | 0.96 | 0.96 | 0.96 | 1047818
|
108 |
|
109 |
-----------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
|
|
|
|
|
|
|
|
|
111 |
|
112 |
## 🤙 Contact
|
113 |
|