Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,6 @@ import urllib
|
|
14 |
import pydub
|
15 |
from os import path
|
16 |
from pydub import AudioSegment
|
17 |
-
import emoji
|
18 |
import re
|
19 |
|
20 |
MUBERT_LICENSE = os.environ.get('MUBERT_LICENSE')
|
@@ -243,7 +242,13 @@ def convert_mp3_to_wav(mp3_filepath):
|
|
243 |
return wave_file
|
244 |
|
245 |
def remove_emoji(text):
|
246 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
|
248 |
def remove_nonalphanumeric(text):
|
249 |
return re.sub(r'[^a-zA-Z0-9\s]', '', text)
|
|
|
14 |
import pydub
|
15 |
from os import path
|
16 |
from pydub import AudioSegment
|
|
|
17 |
import re
|
18 |
|
19 |
MUBERT_LICENSE = os.environ.get('MUBERT_LICENSE')
|
|
|
242 |
return wave_file
|
243 |
|
244 |
def remove_emoji(text):
|
245 |
+
emoji_pattern = re.compile("["
|
246 |
+
u"\U0001F600-\U0001F64F" # emoticons
|
247 |
+
u"\U0001F300-\U0001F5FF" # symbols & pictographs
|
248 |
+
u"\U0001F680-\U0001F6FF" # transport & map symbols
|
249 |
+
u"\U0001F1E0-\U0001F1FF" # flags (iOS)
|
250 |
+
"]+", flags=re.UNICODE)
|
251 |
+
return emoji_pattern.sub(r'', text)
|
252 |
|
253 |
def remove_nonalphanumeric(text):
|
254 |
return re.sub(r'[^a-zA-Z0-9\s]', '', text)
|