GuysRGithub commited on
Commit
7ddc82f
1 Parent(s): fd1accb
Files changed (1) hide show
  1. app.py +15 -14
app.py CHANGED
@@ -27,12 +27,13 @@ map_words = {
27
  }
28
 
29
  word_remove_sentence = [
30
- "hello",
31
- "hi",
32
- "regards",
33
- "dr.",
34
- "physician",
35
- "welcome",
 
36
  ]
37
 
38
 
@@ -145,16 +146,16 @@ def chat():
145
 
146
  def post_process(output):
147
 
148
- output = textwrap.fill(textwrap.dedent(output).strip(), width=120)
149
- # lines = output.split(".")
150
  # print(lines)
151
- # for line in lines:
152
- # for word in word_remove_sentence:
153
- # if word in line.lower():
154
- # lines.remove(line)
155
- # break
156
 
157
- # output = "\.".join(lines)
158
  for item in map_words.keys():
159
  output = re.sub(item, map_words[item], output, re.I)
160
 
 
27
  }
28
 
29
  word_remove_sentence = [
30
+ "Hello and Welcome to",
31
+ # "hello",
32
+ # "hi",
33
+ # "regards",
34
+ # "dr.",
35
+ # "physician",
36
+ # "welcome",
37
  ]
38
 
39
 
 
146
 
147
  def post_process(output):
148
 
149
+ # output = textwrap.fill(textwrap.dedent(output).strip(), width=120)
150
+ lines = output.split(".")
151
  # print(lines)
152
+ for line in lines:
153
+ for word in word_remove_sentence:
154
+ if word in line.lower():
155
+ lines.remove(line)
156
+ break
157
 
158
+ output = ".".join(lines)
159
  for item in map_words.keys():
160
  output = re.sub(item, map_words[item], output, re.I)
161