wldmr commited on
Commit
cc4ad4c
·
1 Parent(s): 01196e5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -7,7 +7,7 @@ def cap(match):
7
  return(match.group().capitalize())
8
 
9
 
10
- def predict(input_text, brakes):
11
 
12
  model = PunctuationModel()
13
  output_text = model.restore_punctuation(input_text)
@@ -40,8 +40,7 @@ def predict(input_text, brakes):
40
  # assemble the array back to a string
41
  pcnt_file_cr=' '.join(pcnt_file_array_hash).replace('#','\n')
42
 
43
-
44
- if 'sentences' in brakes:
45
  pass
46
 
47
  regex1 = r"\bi\b"
@@ -61,7 +60,7 @@ Model restores punctuation and case i.e. of the following punctuations -- [! ? .
61
  #examples = [['sentences', "my name is clara i live in berkeley california"]]
62
 
63
  interface = gr.Interface(fn = predict,
64
- inputs = [gr.CheckboxGroup(["sentences", "timelines"], label="brakes"),
65
  "text"],
66
  outputs = ["text"],
67
  title = title,
 
7
  return(match.group().capitalize())
8
 
9
 
10
+ def predict(brakes, input_text):
11
 
12
  model = PunctuationModel()
13
  output_text = model.restore_punctuation(input_text)
 
40
  # assemble the array back to a string
41
  pcnt_file_cr=' '.join(pcnt_file_array_hash).replace('#','\n')
42
 
43
+ elif 'sentences' in brakes:
 
44
  pass
45
 
46
  regex1 = r"\bi\b"
 
60
  #examples = [['sentences', "my name is clara i live in berkeley california"]]
61
 
62
  interface = gr.Interface(fn = predict,
63
+ inputs = [gr.Radio(["sentences", "timelines"], label="brakes"),
64
  "text"],
65
  outputs = ["text"],
66
  title = title,