File size: 1,926 Bytes
3f6af0f
 
 
 
261f98d
 
3f6af0f
 
 
261f98d
 
3f6af0f
261f98d
 
 
 
 
3f6af0f
261f98d
 
 
 
3f6af0f
261f98d
 
3f6af0f
261f98d
 
 
3f6af0f
261f98d
 
 
 
 
 
 
 
 
 
df4e370
a64f9f2
261f98d
 
 
 
 
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
43
44
45
46
47
48
import streamlit as st
import os

def read_markdown(path, folder="./About/"):
    with open(os.path.join(folder, path)) as f:
        return f.read()

def load_page():

    st.markdown(""" # T5 for Sentence Split in English """)
    st.markdown(""" ### Sentence Split is task of dividing complex sentence in two simple sentences """)

    st.markdown(""" ## Goal """)
    st.markdown(""" To make best sentence split model available till now """)
    
    st.markdown(""" ## How to use the Model """)
    st.markdown(""" 
  
    ```python
    from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
    tokenizer = AutoTokenizer.from_pretrained("flax-community/t5-base-wikisplit")
    model = AutoModelForSeq2SeqLM.from_pretrained("flax-community/t5-base-wikisplit")

    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 ."
    sample_tokenized = tokenizer(complex_sentence, return_tensors="pt")

    answer = model.generate(sample_tokenized['input_ids'], attention_mask = sample_tokenized['attention_mask'], max_length=256, num_beams=5)
    gene_sentence = tokenizer.decode(answer[0], skip_special_tokens=True)
    gene_sentence

    \"""
    Output:
    This comedy drama is produced by Tidy. She co-founded Tidy in 2008 with her husband David Peet, who is managing director.
    \"""
    
    ``` """)
    
    st.markdown(read_markdown("datasets.md"))
    st.markdown(read_markdown("applications.md"))
    #st.markdown(read_markdown("baseline.md"))
    st.markdown(""" ## Current Basline from [paper](https://arxiv.org/abs/1907.12461) """)
    st.image('./images/baseline.png')
    st.markdown(read_markdown("results.md"))
    st.markdown(read_markdown("accomplishments.md"))
    st.markdown(read_markdown("gitrepo.md"))
    st.markdown(read_markdown("contributors.md"))
    st.markdown(read_markdown("credits.md"))