MUSCAT41 commited on
Commit
c7079ea
1 Parent(s): 297c265

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +42 -0
app.py ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ """Redline&Strikethrough.ipynb
3
+
4
+ Automatically generated by Colaboratory.
5
+
6
+ Original file is located at
7
+ https://colab.research.google.com/drive/1a1N40WHNhBUoIZ9-xBgFdpb3esvvzVxL
8
+ """
9
+
10
+ #!pip install gradio
11
+ #!pip install Redlines
12
+
13
+
14
+ import gradio as gr
15
+ from redlines import Redlines
16
+
17
+
18
+ def test(input1, input2):
19
+
20
+ diff=Redlines(input1,input2)
21
+
22
+ otp= diff.output_markdown
23
+
24
+ return "<br>"+ "<br>""<br>"+otp+"<br>"+ "<br>"+"<br>"+ "<br>"
25
+
26
+
27
+ with gr.Blocks() as demo:
28
+
29
+ gr.Markdown("""# Text Compare -Redline and Strikethrough""")
30
+ gr.Markdown(""" Enter first and second text and hit Start Comparrison button""")
31
+ gr.Markdown(""" """)
32
+
33
+
34
+ with gr.Row(scale=1):
35
+ input1 = gr.Textbox(label="Enter first text ")
36
+ input2 = gr.Textbox(label="Enter second text")
37
+ run_btn = gr.Button("Start comparrison")
38
+ otp = gr.outputs.HTML(label="Redline & Strikethrough")
39
+ run_btn.click(fn=test, inputs=[input1, input2], outputs=[otp])
40
+
41
+
42
+ demo.launch(debug=True)