Spaces:
Sleeping
Sleeping
ASG Models
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -58,7 +58,7 @@ class DataViewerApp:
|
|
| 58 |
#self.sdata = df['audio'].to_list() # Separate audio data storage
|
| 59 |
#self.current_page = 0
|
| 60 |
#self.current_selected = -1
|
| 61 |
-
|
| 62 |
def settt(self,df):
|
| 63 |
self.df=pd.DataFrame()
|
| 64 |
self.data =pd.DataFrame()
|
|
@@ -71,6 +71,18 @@ class DataViewerApp:
|
|
| 71 |
self.current_selected =1
|
| 72 |
self.speaker_id= -1
|
| 73 |
return self.data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
def splitt(self,link,num):
|
| 75 |
df=download_youtube_video(link,num)
|
| 76 |
v=self.settt(df)
|
|
@@ -390,6 +402,7 @@ class DataViewerApp:
|
|
| 390 |
#inputs=gr.CheckboxGroup(["John", "Mary", "Peter", "Susan"])
|
| 391 |
self.but_cleartxt=gr.Button("clear Text",variant="primary")
|
| 392 |
self.btn_all_enhance=gr.Button("All enhance",size="sm",variant="primary")
|
|
|
|
| 393 |
|
| 394 |
|
| 395 |
|
|
@@ -422,6 +435,7 @@ class DataViewerApp:
|
|
| 422 |
self.txt_dataset=gr.Text("save dataset",interactive=True)
|
| 423 |
self.btn_convertDataset=gr.Button("Dir Output Bitch :",variant="primary")
|
| 424 |
self.label_dataset=gr.Label("count:")
|
|
|
|
| 425 |
self.but_send_dir.click(self.getdataset, [self.txt_filepath_dir],[self.data_table,self.labell])
|
| 426 |
#self.but_send_dateSet_cut.click(self.splitt, [self.txt_filepath_dateSet,self.num],[self.data_table,self.labell])
|
| 427 |
#self.txt_audio.Style(container=False, css=".txt_audio { direction: rtl; }")
|
|
|
|
| 58 |
#self.sdata = df['audio'].to_list() # Separate audio data storage
|
| 59 |
#self.current_page = 0
|
| 60 |
#self.current_selected = -1
|
| 61 |
+
|
| 62 |
def settt(self,df):
|
| 63 |
self.df=pd.DataFrame()
|
| 64 |
self.data =pd.DataFrame()
|
|
|
|
| 71 |
self.current_selected =1
|
| 72 |
self.speaker_id= -1
|
| 73 |
return self.data
|
| 74 |
+
def clear(self,text):
|
| 75 |
+
text=re.sub(r'[a-zA-Z]', '', text)
|
| 76 |
+
return text
|
| 77 |
+
def clearenglish(self):
|
| 78 |
+
for i in range(len(self.df)):
|
| 79 |
+
x=self.clear(self.df['text'][i])
|
| 80 |
+
x1=self.df['text'][i]
|
| 81 |
+
if x!=x1:
|
| 82 |
+
self.df.drop(i, inplace=True)
|
| 83 |
+
|
| 84 |
+
self.df.reset_index(drop=True, inplace=True)
|
| 85 |
+
return self.settt(self.df)
|
| 86 |
def splitt(self,link,num):
|
| 87 |
df=download_youtube_video(link,num)
|
| 88 |
v=self.settt(df)
|
|
|
|
| 402 |
#inputs=gr.CheckboxGroup(["John", "Mary", "Peter", "Susan"])
|
| 403 |
self.but_cleartxt=gr.Button("clear Text",variant="primary")
|
| 404 |
self.btn_all_enhance=gr.Button("All enhance",size="sm",variant="primary")
|
| 405 |
+
self.btn_ClearEnglish=gr.Button("ClearEnglish",size="sm",variant="primary")
|
| 406 |
|
| 407 |
|
| 408 |
|
|
|
|
| 435 |
self.txt_dataset=gr.Text("save dataset",interactive=True)
|
| 436 |
self.btn_convertDataset=gr.Button("Dir Output Bitch :",variant="primary")
|
| 437 |
self.label_dataset=gr.Label("count:")
|
| 438 |
+
self.btn_ClearEnglish.click(self.clearenglish,[],[self.data_table])
|
| 439 |
self.but_send_dir.click(self.getdataset, [self.txt_filepath_dir],[self.data_table,self.labell])
|
| 440 |
#self.but_send_dateSet_cut.click(self.splitt, [self.txt_filepath_dateSet,self.num],[self.data_table,self.labell])
|
| 441 |
#self.txt_audio.Style(container=False, css=".txt_audio { direction: rtl; }")
|