Spaces:
Runtime error
Runtime error
Commit
·
508c3e2
1
Parent(s):
fd840b4
added try exmple button
Browse files
app.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import AutoTokenizer,AutoModelForSeq2SeqLM
|
|
|
|
|
3 |
|
4 |
@st.cache(show_spinner=False, persist=True)
|
5 |
def load_model(input_complex_sentence,model):
|
@@ -32,9 +34,21 @@ def main():
|
|
32 |
* Sentence Rephrase
|
33 |
''')
|
34 |
|
|
|
|
|
35 |
st.sidebar.write("[More Exploration](https://github.com/bhadreshpsavani/t5-sentence-split)")
|
36 |
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
input_complex_sentence = st.text_area("Please type a Complex Sentence to split",example)
|
39 |
|
40 |
if st.button('Split✂️'):
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import AutoTokenizer,AutoModelForSeq2SeqLM
|
3 |
+
import random
|
4 |
+
|
5 |
|
6 |
@st.cache(show_spinner=False, persist=True)
|
7 |
def load_model(input_complex_sentence,model):
|
|
|
34 |
* Sentence Rephrase
|
35 |
''')
|
36 |
|
37 |
+
change_example = st.sidebar.button("Try Different Example")
|
38 |
+
|
39 |
st.sidebar.write("[More Exploration](https://github.com/bhadreshpsavani/t5-sentence-split)")
|
40 |
|
41 |
+
examples = [
|
42 |
+
"Mary likes to play football in her freetime whenever she meets with her friends that are very nice people.",
|
43 |
+
"It broadcasts on AM frequency 1600 kHz and is under ownership of Multicultural Broadcasting with studios in Surrey , British Columbia .",
|
44 |
+
"On March 1 , the Blackhawks played in their 2nd outdoor game in franchise history at Soldier Field in part of the new NHL Stadium Series ",
|
45 |
+
"'' The Rain Song '' is a love ballad , over 7 minutes in length , and is considered by singer Robert Plant to be his best overall vocal performance .",
|
46 |
+
"The resulting knowledge about human kinesiology and sport nutrition combined with his distinctive posing styles makes Kamali a sought out bodybuilder for seminars and guest appearances and has been featured in many bodybuilding articles , as well as being on the cover of MUSCLEMAG magazine .",
|
47 |
+
"The East London Line closed on 22 December 2007 and reopened on 27 April 2010 , becoming part of the new London Overground system ."
|
48 |
+
]
|
49 |
+
example = examples[random.randint(0, len(examples)-1)]
|
50 |
+
if change_example:
|
51 |
+
example = examples[random.randint(0, len(examples)-1)]
|
52 |
input_complex_sentence = st.text_area("Please type a Complex Sentence to split",example)
|
53 |
|
54 |
if st.button('Split✂️'):
|