ShynBui commited on
Commit
17eec93
·
1 Parent(s): f462bd2

update trong so

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -12,13 +12,13 @@ def final_result(input_text):
12
  for i in list_do:
13
  if i == 0:
14
  ##character_replacement
15
- input_text_process, num_change = character_replacement(input_text_process, total_change / len(input_text), error_rate=0.02)
16
  elif i == 1:
17
  ##character_insertion
18
- input_text_process, num_change = character_insertion(input_text_process,total_change / len(input_text), error_rate=0.03)
19
  elif i == 2:
20
  ##character_deletion
21
- input_text_process, num_change = character_deletion(input_text_process,total_change / len(input_text), error_rate=0.03)
22
  elif i == 3:
23
  ##character_transposition
24
  input_text_process, num_change = character_transposition(input_text_process,total_change / len(input_text), error_rate=0.01)
@@ -36,10 +36,10 @@ def final_result(input_text):
36
  input_text_process, num_change = random_space_insertion(input_text_process,total_change / len(input_text), error_rate=0.01)
37
  elif i == 8:
38
  ##random_space_removal
39
- input_text_process, num_change = random_space_removal(input_text_process, total_change / len(input_text), error_rate=0.03)
40
  elif i == 9:
41
  ##remove_vietnamese_accents
42
- input_text_process, num_change = remove_vietnamese_accents(input_text_process, total_change / len(input_text), error_rate=0.03)
43
  total_change = total_change + num_change
44
 
45
  print("Total change: ", total_change)
 
12
  for i in list_do:
13
  if i == 0:
14
  ##character_replacement
15
+ input_text_process, num_change = character_replacement(input_text_process, total_change / len(input_text), error_rate=0.01)
16
  elif i == 1:
17
  ##character_insertion
18
+ input_text_process, num_change = character_insertion(input_text_process,total_change / len(input_text), error_rate=0.01)
19
  elif i == 2:
20
  ##character_deletion
21
+ input_text_process, num_change = character_deletion(input_text_process,total_change / len(input_text), error_rate=0.01)
22
  elif i == 3:
23
  ##character_transposition
24
  input_text_process, num_change = character_transposition(input_text_process,total_change / len(input_text), error_rate=0.01)
 
36
  input_text_process, num_change = random_space_insertion(input_text_process,total_change / len(input_text), error_rate=0.01)
37
  elif i == 8:
38
  ##random_space_removal
39
+ input_text_process, num_change = random_space_removal(input_text_process, total_change / len(input_text), error_rate=0.01)
40
  elif i == 9:
41
  ##remove_vietnamese_accents
42
+ input_text_process, num_change = remove_vietnamese_accents(input_text_process, total_change / len(input_text), error_rate=0.01)
43
  total_change = total_change + num_change
44
 
45
  print("Total change: ", total_change)