eljanmahammadli commited on
Commit
398f756
1 Parent(s): 883ea44

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py CHANGED
@@ -5,6 +5,7 @@ from predictors import predict_bc_scores, predict_mc_scores, predict_1on1_scores
5
  from analysis import depth_analysis
6
  from predictors import predict_quillbot
7
  from plagiarism import plagiarism_check, build_date
 
8
  from utils import extract_text_from_pdf, len_validator
9
  import yaml
10
 
@@ -137,6 +138,9 @@ with gr.Blocks() as demo:
137
  with gr.Row():
138
  quillbot_check = gr.Button("Humanized Text Check")
139
 
 
 
 
140
  with gr.Row():
141
  depth_analysis_btn = gr.Button("Detailed Writing Analysis")
142
 
@@ -158,6 +162,15 @@ with gr.Blocks() as demo:
158
  # mc1on1Label = gr.Label(label="Creator(1 on 1 Approach)")
159
  with gr.Row():
160
  QLabel = gr.Label(label="Humanized")
 
 
 
 
 
 
 
 
 
161
  with gr.Group():
162
  with gr.Row():
163
  month_from = gr.Dropdown(
@@ -271,6 +284,14 @@ with gr.Blocks() as demo:
271
  api_name="depth_analysis",
272
  )
273
 
 
 
 
 
 
 
 
 
274
  date_from = ""
275
  date_to = ""
276
 
 
5
  from analysis import depth_analysis
6
  from predictors import predict_quillbot
7
  from plagiarism import plagiarism_check, build_date
8
+ from highlighter import analyze_and_highlight
9
  from utils import extract_text_from_pdf, len_validator
10
  import yaml
11
 
 
138
  with gr.Row():
139
  quillbot_check = gr.Button("Humanized Text Check")
140
 
141
+ with gr.Row():
142
+ quillbot_highlighter = gr.Button("Humanized highlighter")
143
+
144
  with gr.Row():
145
  depth_analysis_btn = gr.Button("Detailed Writing Analysis")
146
 
 
162
  # mc1on1Label = gr.Label(label="Creator(1 on 1 Approach)")
163
  with gr.Row():
164
  QLabel = gr.Label(label="Humanized")
165
+ with gr.Row():
166
+ highlighter_iface = gr.Interface(
167
+ inputs=gr.Textbox(lines=10, label="Input Text"),
168
+ outputs=gr.HTML(label="Highlighted Sentences"),
169
+ examples=[
170
+ ["I love sunny days. However, I hate the rain. Today is an okay day."]
171
+ ])
172
+
173
+
174
  with gr.Group():
175
  with gr.Row():
176
  month_from = gr.Dropdown(
 
284
  api_name="depth_analysis",
285
  )
286
 
287
+ quillbot_highlighter.click(
288
+ fn=analyze_and_highlight,
289
+ inputs=[input_text],
290
+ outputs=[highlighter_iface],
291
+ api_name="quillbot_highlighter",
292
+ )
293
+
294
+
295
  date_from = ""
296
  date_to = ""
297