marmg commited on
Commit
9f45711
1 Parent(s): 3d1e19f

Initial space commit

Browse files
.DS_Store ADDED
Binary file (6.15 kB). View file
 
.idea/.gitignore ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Editor-based HTTP Client requests
5
+ /httpRequests/
6
+ # Datasource local storage ignored files
7
+ /dataSources/
8
+ /dataSources.local.xml
.idea/inspectionProfiles/profiles_settings.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="USE_PROJECT_PROFILE" value="false" />
4
+ <version value="1.0" />
5
+ </settings>
6
+ </component>
.idea/misc.xml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (zeroshot)" project-jdk-type="Python SDK" />
4
+ </project>
.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/zshot.iml" filepath="$PROJECT_DIR$/.idea/zshot.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
.idea/zshot.iml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="PYTHON_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$" />
5
+ <orderEntry type="jdk" jdkName="Python 3.10 (zeroshot)" jdkType="Python SDK" />
6
+ <orderEntry type="sourceFolder" forTests="false" />
7
+ </component>
8
+ </module>
app.py ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ st.set_page_config(
4
+ layout="wide", # Can be "centered" or "wide". In the future also "dashboard", etc.
5
+ initial_sidebar_state="auto", # Can be "auto", "expanded", "collapsed"
6
+ page_title='ZShot', # String or None. Strings get appended with "• Streamlit".
7
+ page_icon='./logo_zshot.png', # String, anything supported by st.image, or None.
8
+ )
9
+
10
+ import os
11
+ import sys
12
+
13
+ import spacy
14
+ from zshot.linker import LinkerSMXM, LinkerTARS, LinkerRegen
15
+ from zshot.utils.data_models import Entity
16
+ from zshot.mentions_extractor import MentionsExtractorSpacy
17
+ from zshot.mentions_extractor.utils import ExtractorType
18
+ from zshot import PipelineConfig
19
+ from spacy import displacy
20
+
21
+ sys.path.append(os.path.abspath('./'))
22
+ import streamlit_apps_config as config
23
+
24
+ ## Marking down NER Style
25
+ st.markdown(config.STYLE_CONFIG, unsafe_allow_html=True)
26
+
27
+ ########## To Remove the Main Menu Hamburger ########
28
+
29
+ hide_menu_style = """
30
+ <style>
31
+ #MainMenu {visibility: hidden;}
32
+ </style>
33
+ """
34
+ st.markdown(hide_menu_style, unsafe_allow_html=True)
35
+
36
+ ########## Side Bar ########
37
+
38
+ ## loading logo(newer version with href)
39
+ import base64
40
+
41
+
42
+ @st.cache(allow_output_mutation=True)
43
+ def get_base64_of_bin_file(bin_file):
44
+ with open(bin_file, 'rb') as f:
45
+ data = f.read()
46
+ return base64.b64encode(data).decode()
47
+
48
+
49
+ @st.cache(allow_output_mutation=True)
50
+ def get_img_with_href(local_img_path, target_url, size='big'):
51
+ img_format = os.path.splitext(local_img_path)[-1].replace('.', '')
52
+ bin_str = get_base64_of_bin_file(local_img_path)
53
+ height = '90%' if size == 'big' else '45%'
54
+ width = '90%' if size == 'big' else '45%'
55
+ html_code = f'''
56
+ <a href="{target_url}" style='text-align: center;'>
57
+ <img height="{height}" width="{width}" style='display: block; margin-left: auto; margin-right: auto;' src="data:image/{img_format};base64,{bin_str}" />
58
+ </a>'''
59
+ return html_code
60
+
61
+
62
+ logo_html = get_img_with_href('./logo.png', 'https://www.ibm.com/')
63
+ st.sidebar.markdown(logo_html, unsafe_allow_html=True)
64
+ logo_html = get_img_with_href('./logo_zshot.png', 'https://github.com/IBM/zshot', size='small')
65
+ st.sidebar.markdown(logo_html, unsafe_allow_html=True)
66
+
67
+ # sidebar info
68
+ linkers = ["REGEN", "SMXM", "TARS"]
69
+ st.sidebar.title("Linker to test")
70
+ selected_model = st.sidebar.selectbox("", linkers)
71
+
72
+ ######## Main Page #########
73
+
74
+ if selected_model == "REGEN":
75
+ app_title = "GENRE Linker"
76
+ app_description = "GENRE performs retrieval generating the unique entity name conditioned on the input text using constrained beam search to only generate valid identifiers."
77
+ st.title(app_title)
78
+ st.markdown("<h2>" + app_description + "</h2>", unsafe_allow_html=True)
79
+
80
+ elif selected_model == "SMXM":
81
+ app_title = "SMXM Linker"
82
+ app_description = "SMXM model uses the description of the entities to give the model information about the entities."
83
+ st.title(app_title)
84
+ st.markdown("<h2>" + app_description + "</h2>", unsafe_allow_html=True)
85
+
86
+ elif selected_model == "TARS":
87
+ app_title = "TARS Linker"
88
+ app_description = "TARS doesn't need the descriptions of the entities, so if you can't provide the descriptions of the entities maybe this is the approach you're looking for."
89
+ st.title(app_title)
90
+ st.markdown("<h2>" + app_description + "</h2>", unsafe_allow_html=True)
91
+
92
+ st.subheader("")
93
+
94
+ if 'entities' not in st.session_state:
95
+ st.session_state['entities'] = [
96
+ Entity(name="company", description="The name of a company"),
97
+ Entity(name="location", description="A physical location"),
98
+ Entity(name="chemical compound", description="Any substance composed of identical molecules consisting of atoms of two or more chemical elements.")
99
+ ]
100
+
101
+ def add_ent():
102
+ st.session_state['entities'].append(Entity(name=st.session_state["name"], description=st.session_state["description"]))
103
+ st.session_state['name'] = ""
104
+ st.session_state['description'] = ''
105
+ st.write(st.session_state["name"])
106
+ st.write(st.session_state["description"])
107
+
108
+ for i, entity in enumerate(st.session_state['entities']):
109
+ col1, col2, col3 = st.columns([2, 5, 1])
110
+ with col1:
111
+ st.text(entity.name)
112
+ with col2:
113
+ st.text(entity.description)
114
+ with col3:
115
+ b = st.button('Remove', key=f"ent_{i}")
116
+ if b:
117
+ st.session_state['entities'].pop(i)
118
+ st.experimental_rerun() # This causes the app to rerun
119
+
120
+ with st.form(key="form"):
121
+ col1, col2, col3 = st.columns([2, 5, 1])
122
+ with col1:
123
+ st.text_input("Entity Name", key="name")
124
+ with col2:
125
+ st.text_input("Entity Description", key="description")
126
+ with col3:
127
+ st.form_submit_button('Add', on_click=add_ent)
128
+
129
+ st.markdown("________")
130
+ text = st.text_input("Type here your text and press enter to run:",
131
+ value="CH2O2 is a chemical compound similar to Acetamide used in International Business "
132
+ "Machines Corporation (IBM) to create new materials that act like PAGs.")
133
+
134
+ def build_pipeline(model_name=selected_model):
135
+ nlp = spacy.blank('en')
136
+ mentions_extractor = None
137
+
138
+ if model_name == "REGEN":
139
+ linker = LinkerRegen()
140
+ nlp = spacy.load('en_core_web_sm')
141
+ mentions_extractor = MentionsExtractorSpacy(ExtractorType.NER)
142
+ elif model_name == "TARS":
143
+ linker = LinkerTARS()
144
+ elif model_name == "SMXM":
145
+ linker = LinkerSMXM()
146
+
147
+ config = PipelineConfig(
148
+ entities=st.session_state['entities'],
149
+ mentions_extractor=mentions_extractor,
150
+ linker=linker
151
+ )
152
+ nlp.add_pipe("zshot", config=config, last=True)
153
+
154
+ return nlp
155
+
156
+ predict = st.button("Run ZShot")
157
+ if predict:
158
+ # placeholder for warning
159
+ placeholder = st.empty()
160
+ placeholder.info("Processing...")
161
+
162
+ nlp = build_pipeline()
163
+ doc = nlp(text)
164
+ placeholder.empty()
165
+
166
+ ent_html = displacy.render(doc, style="ent", jupyter=False) # Display the entity visualization in the browser:
167
+ st.markdown(ent_html, unsafe_allow_html=True)
168
+
169
+ st.sidebar.info("""See more:
170
+ - Check ZShot Github [here](https://github.com/IBM/zshot)
171
+ - Check ZShot documentation [here](https://ibm.github.io/zshot/)""")
logo.png ADDED
logo_zshot.png ADDED
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ spacy
2
+ zshot
3
+ flair
requirements.txt.py ADDED
@@ -0,0 +1 @@
 
 
1
+ zshot
streamlit_apps_config.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #APP STYLE
2
+ MAX_WIDTH = 1600
3
+ PADDING_TOP = 0.25
4
+ PADDING_BOTTOM = 0.25
5
+ PADDING_RIGHT = 4
6
+ PADDING_LEFT = 4
7
+ COLOR = 'black'
8
+ BACKGROUND_COLOR = 'white'
9
+
10
+ HTML_WRAPPER = """<div class="scroll entities" style="overflow-x: auto; border: 1px solid #e6e9ef; border-radius: 0.25rem; padding: 0.25rem; margin-bottom: 2.5rem; white-space:pre-wrap">{}</div>"""
11
+ HTML_INDEX_WRAPPER = """<div ">{}</div>"""
12
+
13
+ STYLE_CONFIG_OLD = f"""
14
+ <style>
15
+ @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');
16
+ *:not(text){{
17
+ font-family: Montserrat;
18
+ }}
19
+
20
+ .reportview-container .main .block-container{{
21
+ max-width: {MAX_WIDTH}px;
22
+ padding-top: {PADDING_TOP}rem;
23
+ padding-right: {PADDING_RIGHT}rem;
24
+ padding-left: {PADDING_LEFT}rem;
25
+ padding-bottom: {PADDING_BOTTOM}rem;
26
+ }}
27
+ .reportview-container .main {{
28
+ color: {COLOR};
29
+ background-color: {BACKGROUND_COLOR};
30
+ }}
31
+ div.scroll {{
32
+ margin:1px, 1px;
33
+ padding:1px;
34
+ width: 100%;
35
+ height: 500px;
36
+ overflow-x: hidden;
37
+ overflow-x: auto;
38
+ }}
39
+ .reportview-container .markdown-text-container{{
40
+ font-family: roboto !important;
41
+ color: dimgray !important;
42
+ line-height: normal !important;
43
+ }}
44
+ .reportview-container h2
45
+ {{
46
+ font-weight: 400 !important;
47
+ font-size: 1.5rem !important;
48
+ line-height: 1.6!important;
49
+ }}
50
+ .reportview-container h2
51
+ {{
52
+ font-weight: 300 !important;
53
+ font-size: 1.3rem !important;
54
+ line-height: 1.4!important;
55
+ }}
56
+
57
+
58
+ </style>
59
+ """
60
+
61
+ with open('./style.css') as f:
62
+ STYLE_CONFIG_NEW = f.read()
63
+ STYLE_CONFIG = STYLE_CONFIG_OLD + '<style>{}</style>'.format(STYLE_CONFIG_NEW)
style.css ADDED
@@ -0,0 +1,292 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');
2
+
3
+ header div[data-testid="stDecoration"] {
4
+ display: none;
5
+ }
6
+
7
+ /* sidebar */
8
+ section[data-testid="stSidebar"] > div:first-child {
9
+ background: #ecf9ff;
10
+ }
11
+
12
+ section[data-testid="stSidebar"] div[data-testid="stMarkdownContainer"] h1 {
13
+ font-family: 'Montserrat', sans-serif;
14
+ font-weight: 500;
15
+ font-size: 18px;
16
+ line-height: 22px;
17
+ background: none;
18
+ color: #1E77B7;
19
+ margin-bottom: 10px;
20
+ }
21
+
22
+ section[data-testid="stSidebar"] button[title="View fullscreen"] {
23
+ right: 9px;
24
+ top: 5px;
25
+ }
26
+
27
+ section[data-testid="stSidebar"] button[kind="icon"] svg path,
28
+ section[data-testid="stSidebar"] button[title="View fullscreen"] svg path {
29
+ fill: #3e4095;
30
+ }
31
+
32
+ section[data-testid="stSidebar"] button[title="View fullscreen"] svg {
33
+ position: relative;
34
+ top: -2px;
35
+ }
36
+
37
+ section[data-testid="stSidebar"] button[kind="icon"]:active {
38
+ background-color: #fff;
39
+ }
40
+
41
+ section[data-testid="stSidebar"] button[kind="icon"]:active,
42
+ section[data-testid="stSidebar"] button[kind="icon"]:focus {
43
+ box-shadow: #3e4095 0px 0px 0px 0.2rem;
44
+ border-color: #3e4095;
45
+ color: #3e4095;
46
+ }
47
+ section[data-testid="stSidebar"] button[kind="icon"]:hover {
48
+ border-color: #3e4095;
49
+ color: #3e4095;
50
+ }
51
+
52
+ section[data-testid="stSidebar"] .stMultiSelect input[role="combobox"] {
53
+ display: none;
54
+ }
55
+
56
+ /* markdown container */
57
+ div[data-testid="stMarkdownContainer"] {
58
+ font-family: Montserrat, sans-serif;
59
+ }
60
+
61
+ section[data-testid="stSidebar"] .element-container .stSelectbox label:empty {
62
+ display: none;
63
+ }
64
+
65
+ section[data-testid="stSidebar"] .element-container label {
66
+ margin-top: 50px;
67
+ }
68
+
69
+ section[data-testid="stSidebar"] div[data-testid="stTable"] {
70
+ padding: 0;
71
+ }
72
+
73
+ section[data-testid="stSidebar"] div[data-testid="stMarkdownContainer"] p {
74
+ margin: 0;
75
+ }
76
+
77
+ div[data-testid="stMarkdownContainer"] h1 {
78
+ font-family: Montserrat, sans-serif;
79
+ font-weight: 800;
80
+ font-size: 45px;
81
+ line-height: 55px;
82
+ color: #1E77B7;
83
+ }
84
+
85
+ div[data-testid="stMarkdownContainer"] h2 {
86
+ font-family: Montserrat, sans-serif;
87
+ font-weight: 500;
88
+ font-size: 18px;
89
+ line-height: 26px;
90
+ color: #1E77B7;
91
+ }
92
+
93
+ div[data-testid="stMarkdownContainer"] h3 {
94
+ font-family: Montserrat, sans-serif;
95
+ font-weight: 500;
96
+ font-size: 18px;
97
+ line-height: 22px;
98
+ color: #1E77B7;
99
+ }
100
+
101
+ div[data-testid="stMarkdownContainer"] code {
102
+ font-family: Montserrat, sans-serif;
103
+ }
104
+
105
+ /* selectbox */
106
+ div[data-baseweb="select"] > div {
107
+ box-shadow: 0px 4px 10px rgba(0, 152, 218, 0.3);
108
+ border-radius: 2px;
109
+ min-height: 40px;
110
+ background: #ffffff;
111
+ border: none;
112
+ }
113
+
114
+ div[data-baseweb="select"] .st-bb.st-bc.st-b4.st-cy.st-by.st-cz.st-d0 svg {
115
+ fill: #BAD0DA;
116
+ height: 20px;
117
+ width: 20px;
118
+ padding: 0;
119
+ }
120
+
121
+ .stSelectbox > label {
122
+ font-family: 'Montserrat', sans-serif;
123
+ font-weight: 500;
124
+ font-size: 18px;
125
+ line-height: 22px;
126
+ color: #1E77B7;
127
+ }
128
+
129
+ div[data-baseweb="select"] > div > div > div {
130
+ font-family: Montserrat, sans-serif;
131
+ font-size: 14px !important;
132
+ line-height: 26px !important;
133
+ color: #536B76 !important;
134
+ }
135
+
136
+ div[role="listbox"] ul li {
137
+ color: rgb(128, 132, 149);
138
+ }
139
+
140
+ div[role="listbox"] ul li[aria-selected="true"],
141
+ div[role="listbox"] ul li:hover {
142
+ color: #000;
143
+ }
144
+
145
+ /* multiselect */
146
+ .stMultiSelect label {
147
+ font-family: 'Montserrat', sans-serif !important;
148
+ font-weight: 500;
149
+ font-size: 18px !important;
150
+ line-height: 22px;
151
+ background: none;
152
+ color: #1E77B7 !important;
153
+ margin-bottom: 10px !important;
154
+ }
155
+
156
+ .stMarkdown>div {
157
+ margin: 0;
158
+ }
159
+
160
+ .stMultiSelect span[data-baseweb="tag"] {
161
+ font-family: Montserrat, sans-serif;
162
+ background: #1E77B7;
163
+ color: #fff !important;
164
+ font-size: 12px !important;
165
+ line-height: 20px !important;
166
+ }
167
+
168
+ .stMultiSelect span[data-baseweb="tag"] span[role="presentation"] {
169
+ width: 21px;
170
+ height: 21px;
171
+ fill: #BAD0DA;
172
+ }
173
+
174
+ /* checkbox */
175
+ label[data-baseweb="checkbox"] > span[role="checkbox"] {
176
+ border-color: #5334AE;
177
+ background-color: #5334AE;
178
+ }
179
+
180
+ label[data-baseweb="checkbox"] > div {
181
+ }
182
+
183
+ label[data-baseweb="checkbox"] label.st-ex {
184
+ background: red !important;
185
+ }
186
+
187
+ /* table */
188
+ div[data-testid="stTable"] table {
189
+ width: 100%;
190
+ background: #ffffff;
191
+ }
192
+
193
+ div[data-testid="stTable"] th {
194
+ background: #3E4095;
195
+ vertical-align: middle;
196
+ color: #fff;
197
+ font-family: 'Montserrat', sans-serif;
198
+ font-weight: 800;
199
+ font-size: 16px;
200
+ line-height: 28px;
201
+ height: 30px;
202
+ padding: 10px;
203
+ text-align: left;
204
+ min-width: 103px;
205
+ }
206
+
207
+ div[data-testid="stTable"] tbody tr th,
208
+ div[data-testid="stTable"] thead tr th:first-child {
209
+ display: none;
210
+ }
211
+
212
+ div[data-testid="stTable"] table tbody tr td {
213
+ font-family: Montserrat, sans-serif;
214
+ height: 50px;
215
+ padding: 10px;
216
+ font-size: 14px;
217
+ line-height: 20px;
218
+ color:#536B76;
219
+ border-bottom: 1px solid #E7EDF0;
220
+ text-align: left;
221
+ }
222
+
223
+ div[data-testid="stTable"] tr:nth-child(odd) {
224
+ box-shadow: inset 0px 0px 35px rgba(0, 152, 218, 0.05);
225
+ }
226
+
227
+ div[data-testid="stTable"] tr:nth-child(even) {
228
+ box-shadow: 0px 0px 35px rgba(0, 152, 218, 0.05);
229
+ }
230
+
231
+ /* entities */
232
+ .scroll.entities {
233
+ border: 1px solid #E7EDF0;
234
+ border-radius: 3px;
235
+ text-align: justify;
236
+ }
237
+
238
+ .scroll.entities span {
239
+ font-size: 14px;
240
+ line-height: 24px;
241
+ color: #536B76;
242
+ font-family: Montserrat, sans-serif;
243
+ }
244
+ .entity-wrapper {
245
+ border-radius: 3px;
246
+ padding: 1px;
247
+ margin: 0 2px 5px 2px;
248
+ }
249
+
250
+ .scroll.entities span .entity-type {
251
+ font-weight: 500;
252
+ color: #ffffff;
253
+ display: block;
254
+ padding: 3px 5px;
255
+ }
256
+
257
+ .scroll.entities span .entity-name {
258
+ border-radius: 3px;
259
+ padding: 2px 5px;
260
+ display: block;
261
+ margin: 3px 2px;
262
+ }
263
+
264
+ @media (max-width: 1199px) {
265
+ .reportview-container .main .block-container {
266
+ padding: 1rem;
267
+ }
268
+ }
269
+
270
+ @media (max-width: 991px) {
271
+ div[data-testid="stMarkdownContainer"] h1 {
272
+ font-size: 32px;
273
+ line-height: 38px;
274
+ }
275
+ section[data-testid="stSidebar"] > div:first-child {
276
+ padding: 2rem 1rem;
277
+ }
278
+ div[data-testid="stMarkdownContainer"] h2 {
279
+ padding-top: 0;
280
+ margin-top: 0;
281
+ }
282
+ }
283
+
284
+ @media (max-width: 767px) {
285
+ div[data-testid="stMarkdownContainer"] h1 {
286
+ font-size: 27px;
287
+ line-height: 33px;
288
+ }
289
+ .block-container .element-container .scroll.entities {
290
+ padding: 10px !important;
291
+ }
292
+ }