File size: 1,029 Bytes
c7079ea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# -*- coding: utf-8 -*-
"""Redline&Strikethrough.ipynb

Automatically generated by Colaboratory.

Original file is located at
    https://colab.research.google.com/drive/1a1N40WHNhBUoIZ9-xBgFdpb3esvvzVxL
"""

#!pip install gradio
#!pip install Redlines


import gradio  as gr
from redlines import Redlines


def test(input1, input2): 
    
    diff=Redlines(input1,input2)

    otp= diff.output_markdown

    return "<br>"+ "<br>""<br>"+otp+"<br>"+ "<br>"+"<br>"+ "<br>"


with gr.Blocks() as demo:

    gr.Markdown("""# Text Compare -Redline and Strikethrough""")
    gr.Markdown(""" Enter first and second text and hit Start Comparrison button""")
    gr.Markdown(""" """)
    

    with gr.Row(scale=1):
        input1 = gr.Textbox(label="Enter first text ")
        input2     = gr.Textbox(label="Enter second text")    
    run_btn     = gr.Button("Start comparrison")    
    otp = gr.outputs.HTML(label="Redline & Strikethrough")
    run_btn.click(fn=test, inputs=[input1, input2], outputs=[otp])


demo.launch(debug=True)