mlkorra commited on
Commit
261f98d
1 Parent(s): 77aa827

Update pages/about.py

Browse files
Files changed (1) hide show
  1. pages/about.py +33 -32
pages/about.py CHANGED
@@ -2,43 +2,44 @@ import streamlit as st
2
  import os
3
 
4
  def read_markdown(path, folder="./About/"):
5
- with open(os.path.join(folder, path)) as f:
6
- return f.read()
7
 
8
  def load_page():
9
 
10
- st.markdown(""" # T5 for Sentence Split in English """)
11
- st.markdown(""" ### Sentence Split is task of dividing complex sentence in two simple sentences """)
12
 
13
- st.markdown(""" ## Goal """)
14
- st.markdown(""" To make best sentence split model available till now """)
15
-
16
- st.markdown(""" ## How to use the Model """)
17
- st.markdown("""
18
 
19
- ```python
20
- from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
21
- tokenizer = AutoTokenizer.from_pretrained("flax-community/t5-base-wikisplit")
22
- model = AutoModelForSeq2SeqLM.from_pretrained("flax-community/t5-base-wikisplit")
23
 
24
- complex_sentence = "This comedy drama is produced by Tidy , the company she co-founded in 2008 with her husband David Peet , who is managing director ."
25
- sample_tokenized = tokenizer(complex_sentence, return_tensors="pt")
26
 
27
- answer = model.generate(sample_tokenized['input_ids'], attention_mask = sample_tokenized['attention_mask'], max_length=256, num_beams=5)
28
- gene_sentence = tokenizer.decode(answer[0], skip_special_tokens=True)
29
- gene_sentence
30
 
31
- \"""
32
- Output:
33
- This comedy drama is produced by Tidy. She co-founded Tidy in 2008 with her husband David Peet, who is managing director.
34
- \"""
35
-
36
- ``` """)
37
- st.markdown(read_markdown("datasets.md"))
38
- st.markdown(read_markdown("applications.md"))
39
- st.markdown(read_markdown("baseline.md"))
40
- st.markdown(read_markdown("results.md"))
41
- st.markdown(read_markdown("accomplishments.md"))
42
- st.markdown(read_markdown("gitrepo.md"))
43
- st.markdown(read_markdown("contributors.md"))
44
- st.markdown(read_markdown("credits.md"))
 
 
2
  import os
3
 
4
  def read_markdown(path, folder="./About/"):
5
+ with open(os.path.join(folder, path)) as f:
6
+ return f.read()
7
 
8
  def load_page():
9
 
10
+ st.markdown(""" # T5 for Sentence Split in English """)
11
+ st.markdown(""" ### Sentence Split is task of dividing complex sentence in two simple sentences """)
12
 
13
+ st.markdown(""" ## Goal """)
14
+ st.markdown(""" To make best sentence split model available till now """)
15
+
16
+ st.markdown(""" ## How to use the Model """)
17
+ st.markdown("""
18
 
19
+ ```python
20
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
21
+ tokenizer = AutoTokenizer.from_pretrained("flax-community/t5-base-wikisplit")
22
+ model = AutoModelForSeq2SeqLM.from_pretrained("flax-community/t5-base-wikisplit")
23
 
24
+ complex_sentence = "This comedy drama is produced by Tidy , the company she co-founded in 2008 with her husband David Peet , who is managing director ."
25
+ sample_tokenized = tokenizer(complex_sentence, return_tensors="pt")
26
 
27
+ answer = model.generate(sample_tokenized['input_ids'], attention_mask = sample_tokenized['attention_mask'], max_length=256, num_beams=5)
28
+ gene_sentence = tokenizer.decode(answer[0], skip_special_tokens=True)
29
+ gene_sentence
30
 
31
+ \"""
32
+ Output:
33
+ This comedy drama is produced by Tidy. She co-founded Tidy in 2008 with her husband David Peet, who is managing director.
34
+ \"""
35
+
36
+ ``` """)
37
+
38
+ st.markdown(read_markdown("datasets.md"))
39
+ st.markdown(read_markdown("applications.md"))
40
+ #st.markdown(read_markdown("baseline.md"))
41
+ st.markdown(read_markdown("results.md"))
42
+ st.markdown(read_markdown("accomplishments.md"))
43
+ st.markdown(read_markdown("gitrepo.md"))
44
+ st.markdown(read_markdown("contributors.md"))
45
+ st.markdown(read_markdown("credits.md"))