Abid commited on
Commit
7bcf8d4
1 Parent(s): 5b4c081

Unicodedata added to normalize urdu text

Browse files

Files changed (2) hide show
  1. Gradio/app.py +2 -1
  2. notebook.ipynb +1 -1
Gradio/app.py CHANGED
@@ -1,4 +1,5 @@
1
  import os
 
2
  from datasets import load_dataset, Audio
3
  from transformers import pipeline
4
  import gradio as gr
@@ -29,7 +30,7 @@ def asr(audio):
29
 
30
  asr = pipeline("automatic-speech-recognition", model=Model)
31
  prediction = asr(audio, chunk_length_s=5, stride_length_s=1)
32
- return prediction["text"]
33
 
34
 
35
  ################### Gradio Web APP ################################
1
  import os
2
+ import unicodedata
3
  from datasets import load_dataset, Audio
4
  from transformers import pipeline
5
  import gradio as gr
30
 
31
  asr = pipeline("automatic-speech-recognition", model=Model)
32
  prediction = asr(audio, chunk_length_s=5, stride_length_s=1)
33
+ return unicodedata.normalize("NFC",prediction["text"])
34
 
35
 
36
  ################### Gradio Web APP ################################
notebook.ipynb CHANGED
@@ -1535,7 +1535,7 @@
1535
  "name": "python",
1536
  "nbconvert_exporter": "python",
1537
  "pygments_lexer": "ipython3",
1538
- "version": "3.8.8"
1539
  },
1540
  "widgets": {
1541
  "application/vnd.jupyter.widget-state+json": {
1535
  "name": "python",
1536
  "nbconvert_exporter": "python",
1537
  "pygments_lexer": "ipython3",
1538
+ "version": "3.9.7"
1539
  },
1540
  "widgets": {
1541
  "application/vnd.jupyter.widget-state+json": {