twigs commited on
Commit
bfb18f7
1 Parent(s): a9e67c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -80,7 +80,7 @@ def full_pipeline(source, simpl_model, simpl_tok, tokens, lexical=False):
80
  def main():
81
 
82
  aug_tok = ['c_', 'lev_', 'dep_', 'rank_', 'rat_', 'n_syl_']
83
- tokens = ['CharRatio', 'LevSim', 'DependencyTreeDepth',
84
  'WordComplexity', 'WordRatio', 'NumberOfSyllables']
85
 
86
  default_values = [0.8, 0.6, 0.9, 0.8, 0.9, 1.9]
@@ -103,7 +103,7 @@ def main():
103
  with st.form(key="simplify"):
104
  input_sentence = st.text_area("Original sentence")
105
  tok = st.multiselect(
106
- label="Tokens to augment the sentence", options=tokens, default=tokens)
107
  if (tok):
108
  st.text("Select the desired intensity")
109
  for idx, t in enumerate(tok):
@@ -114,10 +114,8 @@ def main():
114
  if (submit):
115
 
116
  tokens = [t+str(v) for t, v in zip(aug_tok, user_values)]
117
- #output, words = full_pipeline(input_sentence, simpl_model, simpl_tok, tokens)
118
- output, words = full_pipeline(input_sentence)
119
-
120
-
121
  c1, c2 = st.columns([1,2])
122
 
123
  with c1:
 
80
  def main():
81
 
82
  aug_tok = ['c_', 'lev_', 'dep_', 'rank_', 'rat_', 'n_syl_']
83
+ base_tokens = ['CharRatio', 'LevSim', 'DependencyTreeDepth',
84
  'WordComplexity', 'WordRatio', 'NumberOfSyllables']
85
 
86
  default_values = [0.8, 0.6, 0.9, 0.8, 0.9, 1.9]
 
103
  with st.form(key="simplify"):
104
  input_sentence = st.text_area("Original sentence")
105
  tok = st.multiselect(
106
+ label="Tokens to augment the sentence", options=tokens, default=base_tokens)
107
  if (tok):
108
  st.text("Select the desired intensity")
109
  for idx, t in enumerate(tok):
 
114
  if (submit):
115
 
116
  tokens = [t+str(v) for t, v in zip(aug_tok, user_values)]
117
+ output, words = full_pipeline(input_sentence, simpl_model, simpl_tok, tokens)
118
+
 
 
119
  c1, c2 = st.columns([1,2])
120
 
121
  with c1: