neelsahu commited on
Commit
a10a6f5
1 Parent(s): 2513a9d

Codes attached with Abusive Not abusive and Unknown keywords

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
 
app.py CHANGED
@@ -28,16 +28,16 @@ def predict_abusive_lang(text):
28
  prediction = model.predict(text)
29
  print("prediction ", prediction)
30
  if len(prediction)!=0 and prediction[0]==0:
31
- return ["Not Abusive", cleaned_text]
32
  elif len(prediction)!=0 and prediction[0]==1:
33
- return ["Abusive",cleaned_text]
34
  else :
35
  return ["Please write something in the comment box..","No cleaned text"]
36
  elif lang=='hi':
37
  print("using hugging face api")
38
  return ["Hindi Text abusive part coming soon.....","No cleaned text"]
39
  else :
40
- return ["Unknown language","No cleaned text"]
41
 
42
 
43
  # text = '":::::: 128514 - & % ! @ # $ % ^ & * ( ) _ + I got blocked for 30 minutes, you got blocked for more than days. You is lost. www.google.com, #happydiwali, @amangupta And I don\'t even know who the fuck are you. It\'s a zero! \n"'
 
28
  prediction = model.predict(text)
29
  print("prediction ", prediction)
30
  if len(prediction)!=0 and prediction[0]==0:
31
+ return ["NA", cleaned_text]
32
  elif len(prediction)!=0 and prediction[0]==1:
33
+ return ["AB",cleaned_text]
34
  else :
35
  return ["Please write something in the comment box..","No cleaned text"]
36
  elif lang=='hi':
37
  print("using hugging face api")
38
  return ["Hindi Text abusive part coming soon.....","No cleaned text"]
39
  else :
40
+ return ["UN","No cleaned text"]
41
 
42
 
43
  # text = '":::::: 128514 - & % ! @ # $ % ^ & * ( ) _ + I got blocked for 30 minutes, you got blocked for more than days. You is lost. www.google.com, #happydiwali, @amangupta And I don\'t even know who the fuck are you. It\'s a zero! \n"'