rbughao commited on
Commit
05a1140
1 Parent(s): 2b2ea85

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -13
app.py CHANGED
@@ -35,20 +35,19 @@ def measure_readability(message,history):
35
  answer = vline1+vline2+vline3+vline4+vline5+vline6+vline7+vline8+vline9+vline10+vline11+vline12+vline13+vline14
36
  #answer = "Flesch Reading Ease (90-100 = Easy to read, 0-29 = Very confusing to read) is "+str(textstat.flesch_reading_ease(text))
37
  return answer
38
-
39
-
40
-
41
 
42
- #def reply(message, history):
43
- # if message == 'initialize':
44
- # initialization()
45
- # return 'Application re-initialized'
46
- # purged = client.purge_by_url([message])
47
- # answer = str(purged.result())
48
- # return answer
49
-
50
- Conversing = gr.ChatInterface(measure_readability, chatbot=gr.Chatbot(height=600,label = "Enter Brand.com URL to evaluate"), retry_btn=None,theme=gr.themes.Monochrome(),
51
- title = 'Ecommerce Site Readability Tool', description = "Algorithm for this site is based on Readability Wiki - https://en.wikipedia.org/wiki/Readability " ,undo_btn = None, clear_btn = None, css='footer {visibility: hidden}').launch()
 
 
52
 
53
  if __name__ == "__main__":
54
  Conversing.launch()
 
35
  answer = vline1+vline2+vline3+vline4+vline5+vline6+vline7+vline8+vline9+vline10+vline11+vline12+vline13+vline14
36
  #answer = "Flesch Reading Ease (90-100 = Easy to read, 0-29 = Very confusing to read) is "+str(textstat.flesch_reading_ease(text))
37
  return answer
 
 
 
38
 
39
+ DEFAULT_SYSTEM_PROMPT = """
40
+ The following links are the detailed references:
41
+ 1. https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests#Flesch_reading_ease
42
+ 2. https://en.wikipedia.org/wiki/SMOG
43
+ 3. https://en.wikipedia.org/wiki/Coleman%E2%80%93Liau_index
44
+ 4. https://en.wikipedia.org/wiki/Dale%E2%80%93Chall_readability_formula
45
+ """
46
+
47
+ with gr.Blocks() as Conversing:
48
+ gr.ChatInterface(measure_readability, chatbot=gr.Chatbot(height=600,label = "Enter Brand.com URL to evaluate"), retry_btn=None,theme=gr.themes.Monochrome(),
49
+ title = 'Ecommerce Site Readability Tool', description = "Algorithm for this site is based on Readability Wiki - https://en.wikipedia.org/wiki/Readability " ,undo_btn = None, clear_btn = None, css='footer {visibility: hidden}')
50
+ system_prompt = gr.Textbox(label="References", value=DEFAULT_SYSTEM_PROMPT, lines=15, interactive=True)
51
 
52
  if __name__ == "__main__":
53
  Conversing.launch()