Spaces:
Runtime error
Runtime error
neelsahu
commited on
Commit
·
e8bae94
1
Parent(s):
65610be
75% to 70%
Browse files
__pycache__/language_detection.cpython-39.pyc
CHANGED
Binary files a/__pycache__/language_detection.cpython-39.pyc and b/__pycache__/language_detection.cpython-39.pyc differ
|
|
flagged/log.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
text,Result,Cleaned text,flag,username,timestamp
|
2 |
+
Edit review not workibg please do something,UN,No cleaned text,,,2023-06-04 14:34:38.389497
|
language_detection.py
CHANGED
@@ -257,9 +257,11 @@ def en_hi_detection(text):
|
|
257 |
# print(f"{word} ({pos}): {lemmatizer.lemmatize(word, pos)}")
|
258 |
lem_word = lemmatizer.lemmatize(word, pos)
|
259 |
if lem_word in wordnet.words():
|
|
|
260 |
count_en+=1
|
261 |
break
|
262 |
elif lem_word in stop_words:
|
|
|
263 |
count_en+=1
|
264 |
break
|
265 |
#print("total english words found :", count_en)
|
@@ -282,7 +284,7 @@ def en_hi_detection(text):
|
|
282 |
#print(f"Word '{word}' does not contain any Hindi letters.")
|
283 |
|
284 |
#print(count/len(words)*100, "% Hindi words found")
|
285 |
-
if count_en/len(words)*100>
|
286 |
return "eng"
|
287 |
elif count/len(words)*100>75:
|
288 |
return "hi"
|
|
|
257 |
# print(f"{word} ({pos}): {lemmatizer.lemmatize(word, pos)}")
|
258 |
lem_word = lemmatizer.lemmatize(word, pos)
|
259 |
if lem_word in wordnet.words():
|
260 |
+
print("wordnet :",lem_word)
|
261 |
count_en+=1
|
262 |
break
|
263 |
elif lem_word in stop_words:
|
264 |
+
print("stop_words :",lem_word)
|
265 |
count_en+=1
|
266 |
break
|
267 |
#print("total english words found :", count_en)
|
|
|
284 |
#print(f"Word '{word}' does not contain any Hindi letters.")
|
285 |
|
286 |
#print(count/len(words)*100, "% Hindi words found")
|
287 |
+
if count_en/len(words)*100>70:
|
288 |
return "eng"
|
289 |
elif count/len(words)*100>75:
|
290 |
return "hi"
|