-
Notifications
You must be signed in to change notification settings - Fork 1
/
serp.py
39 lines (31 loc) · 1.41 KB
/
serp.py
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
from datetime import datetime
import streamlit as st
def render_serp_generic(item):
st.markdown(f"""**{item["id"]}**""")
with st.expander("see content"):
st.write(item["content"])
def render_serp_pubmed(item):
st.markdown(f"""
[**{item["title"]}**](https://pubmed.ncbi.nlm.nih.gov/{item["pmid"]}/)
:green[PMID:{item["pmid"]} {item["publication_type"]} {datetime.fromtimestamp(item["date"])}]
""")
if "abstract" in item and item["abstract"] is not None:
with st.expander("see abstract"):
st.write(item["abstract"])
def render_serp_iranthology(item):
st.markdown(f"""
[**{item["title"]}**]({item["url"]})
{", ".join([author for author in item.getlist("authors") if "authors" in item and item["authors"] is not None])}
:green[{item["venue"]} {item["year"]}]
""")
if "abstract" in item and item["abstract"] is not None:
with st.expander("see abstract"):
st.write(item["abstract"])
def render_serp_treccovid(item):
st.markdown(f"""
**{item["title"]}**
:green[{item["doc_id"]} {datetime.fromtimestamp(item["date"])} {item["doi"] if item["doi"] is not None else ""}]
""")
if "abstract" in item and item["abstract"] is not None:
with st.expander("see abstract"):
st.write(item["abstract"])