Wootang01 commited on
Commit
0e678a7
·
1 Parent(s): 283e2f9

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from happytransformer import HappyTextToText, TTSettings
3
+ from annotated_text import annotated_text
4
+ import difflib
5
+ from bokeh.models.widgets import Button
6
+ from bokeh.models import CustomJS
7
+ from streamlit_bokeh_events import streamlit_bokeh_events
8
+
9
+ checkpoint = "team-writing-assistant/t5-base-c4jfleg"
10
+
11
+ def diff_strings(a, b):
12
+ result = []
13
+ diff = difflib.Differ().compare(a.split(), b.split())
14
+ replacement = ""
15
+ for line in diff:
16
+ if line.startswith(" "):
17
+ if len(replacement) == 0:
18
+ result.append(" ")
19
+ result.append(line[2:])
20
+ else:
21
+