Commit 
							
							Β·
						
						af2e0d6
	
1
								Parent(s):
							
							f7a5281
								
Create app.py
Browse files
    	
        app.py
    ADDED
    
    | @@ -0,0 +1,48 @@ | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            import streamlit as st
         | 
| 2 | 
            +
            from chatnoir_api.v1 import search
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            st.set_page_config(
         | 
| 5 | 
            +
                page_title="ChatNoir",
         | 
| 6 | 
            +
                page_icon="π",
         | 
| 7 | 
            +
                layout="centered"
         | 
| 8 | 
            +
            )
         | 
| 9 | 
            +
             | 
| 10 | 
            +
            cola, colb, colc = st.columns([5,4,5])
         | 
| 11 | 
            +
            with colb:
         | 
| 12 | 
            +
                st.image("https://www.chatnoir.eu/static/img/chatnoir.svg")
         | 
| 13 | 
            +
             | 
| 14 | 
            +
            col1, col2 = st.columns([9, 1])
         | 
| 15 | 
            +
            with col1:
         | 
| 16 | 
            +
                search_query = st.text_input(label="",
         | 
| 17 | 
            +
                            placeholder="Search"
         | 
| 18 | 
            +
                        )
         | 
| 19 | 
            +
             | 
| 20 | 
            +
            with col2:
         | 
| 21 | 
            +
                st.write('#')
         | 
| 22 | 
            +
                button_clicked = st.button("π")
         | 
| 23 | 
            +
            with st.expander("π About", expanded=False):
         | 
| 24 | 
            +
             | 
| 25 | 
            +
                st.markdown(
         | 
| 26 | 
            +
                    """     
         | 
| 27 | 
            +
            ```
         | 
| 28 | 
            +
            @InProceedings{bevendorff:2018,
         | 
| 29 | 
            +
              address =               {Berlin Heidelberg New York},
         | 
| 30 | 
            +
              author =                {Janek Bevendorff and Benno Stein and Matthias Hagen and Martin Potthast},
         | 
| 31 | 
            +
              booktitle =             {Advances in Information Retrieval. 40th European Conference on IR Research (ECIR 2018)},
         | 
| 32 | 
            +
              editor =                {Leif Azzopardi and Allan Hanbury and Gabriella Pasi and Benjamin Piwowarski},
         | 
| 33 | 
            +
              ids =                   {potthast:2018c,stein:2018c},
         | 
| 34 | 
            +
              month =                 mar,
         | 
| 35 | 
            +
              publisher =             {Springer},
         | 
| 36 | 
            +
              series =                {Lecture Notes in Computer Science},
         | 
| 37 | 
            +
              site =                  {Grenoble, France},
         | 
| 38 | 
            +
              title =                 {{Elastic ChatNoir: Search Engine for the ClueWeb and the Common Crawl}},
         | 
| 39 | 
            +
              year =                  2018
         | 
| 40 | 
            +
            }
         | 
| 41 | 
            +
            ```
         | 
| 42 | 
            +
            	    """
         | 
| 43 | 
            +
                )
         | 
| 44 | 
            +
             | 
| 45 | 
            +
                st.markdown("")
         | 
| 46 | 
            +
             | 
| 47 | 
            +
            if button_clicked:
         | 
| 48 | 
            +
                st.write(search_query)
         | 

