File size: 1,316 Bytes
77f423a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a43b72c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
license: apache-2.0
---
<h2>Re-Punctuate:</h2>

Re-Punctuate is a T5 model that attempts to correct Capitalization and Punctuations in the sentences.

<h3>DataSet:</h3>

DialogSum dataset (115056 Records) was used to fine-tune the model for Punctuation and Capitalization correction.

<h3>Usage:</h3>

<pre>

from transformers import T5Tokenizer, TFT5ForConditionalGeneration

tokenizer = T5Tokenizer.from_pretrained('SJ-Ray/Re-Punctuate')
model = TFT5ForConditionalGeneration.from_pretrained('SJ-Ray/Re-Punctuate')

input_text = 'the story of this brave brilliant athlete whose very being was questioned so publicly is one that still captures the imagination'
inputs = tokenizer.encode("punctuate: " + input_text, return_tensors="tf") 
result = model.generate(inputs)

decoded_output = tokenizer.decode(result[0], skip_special_tokens=True)
print(decoded_output)

</pre>
<h4> Example: </h4>
<b>Input:</b>  the story of this brave brilliant athlete whose very being was questioned so publicly is one that still captures the imagination <br>
<b>Output:</b> The story of this brave, brilliant athlete, whose very being was questioned so publicly, is one that still captures the imagination.

<h4> Connect on: <a href="https://www.linkedin.com/in/suraj-kumar-710382a7" target="_blank">LinkedIn : Suraj Kumar</a></h4>