Spaces:
Sleeping
Sleeping
BilalSardar
commited on
Commit
•
a2865c1
1
Parent(s):
0bc287c
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,24 @@ import os
|
|
3 |
from moviepy.editor import *
|
4 |
import gradio as gr
|
5 |
import re
|
|
|
|
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
def parse_string(string, dataset):
|
8 |
parsed_list = []
|
9 |
start = 0
|
@@ -67,8 +84,10 @@ def texttoSign(text):
|
|
67 |
for word in listofwords:
|
68 |
if word not in VideosNames:
|
69 |
listofwords[index]=(list(word))
|
|
|
70 |
index+=1
|
71 |
listofwords=flatten_lists(listofwords)
|
|
|
72 |
clips=[]
|
73 |
for i in range(len(listofwords)):
|
74 |
|
|
|
3 |
from moviepy.editor import *
|
4 |
import gradio as gr
|
5 |
import re
|
6 |
+
import nltk
|
7 |
+
from nltk.stem import WordNetLemmatizer
|
8 |
|
9 |
+
|
10 |
+
|
11 |
+
|
12 |
+
def get_lemma(word):
|
13 |
+
nltk.download('wordnet')
|
14 |
+
lemmatizer = WordNetLemmatizer()
|
15 |
+
lemma = lemmatizer.lemmatize(word)
|
16 |
+
return lemma
|
17 |
+
|
18 |
+
def apply_lemma_to_list(word_list):
|
19 |
+
updated_list = []
|
20 |
+
for word in word_list:
|
21 |
+
updated_list.append(get_lemma(word))
|
22 |
+
return updated_list
|
23 |
+
|
24 |
def parse_string(string, dataset):
|
25 |
parsed_list = []
|
26 |
start = 0
|
|
|
84 |
for word in listofwords:
|
85 |
if word not in VideosNames:
|
86 |
listofwords[index]=(list(word))
|
87 |
+
|
88 |
index+=1
|
89 |
listofwords=flatten_lists(listofwords)
|
90 |
+
listofwords=apply_lemma_to_list(listofwords)
|
91 |
clips=[]
|
92 |
for i in range(len(listofwords)):
|
93 |
|