UI fix
Browse files- app.py +3 -3
- appStore/target.py +14 -3
app.py
CHANGED
|
@@ -43,10 +43,10 @@ with st.expander("ℹ️ - About this app", expanded=False):
|
|
| 43 |
Information Extraction.
|
| 44 |
|
| 45 |
Classifers:
|
| 46 |
-
- **Netzero**: Detects if any Netzero commitment is
|
| 47 |
- **GHG**: Detects if any GHG related information present in paragraph or not.
|
| 48 |
-
- **Sector**: Detects which sectors are spoken/
|
| 49 |
-
- **Adaptation-Mitigation**: Detects if the
|
| 50 |
|
| 51 |
|
| 52 |
""")
|
|
|
|
| 43 |
Information Extraction.
|
| 44 |
|
| 45 |
Classifers:
|
| 46 |
+
- **Netzero**: Detects if any Netzero commitment is present in paragraph or not.
|
| 47 |
- **GHG**: Detects if any GHG related information present in paragraph or not.
|
| 48 |
+
- **Sector**: Detects which sectors are spoken/discussed about in paragraph.
|
| 49 |
+
- **Adaptation-Mitigation**: Detects if the paragraph is related to Adaptation and/or Mitigation.
|
| 50 |
|
| 51 |
|
| 52 |
""")
|
appStore/target.py
CHANGED
|
@@ -34,9 +34,9 @@ def to_excel(df):
|
|
| 34 |
df.to_excel(writer, index=False, sheet_name='Sheet1')
|
| 35 |
workbook = writer.book
|
| 36 |
worksheet = writer.sheets['Sheet1']
|
| 37 |
-
worksheet.data_validation('E2:E{}'.format(len_df),
|
| 38 |
-
|
| 39 |
-
|
| 40 |
writer.save()
|
| 41 |
processed_data = output.getvalue()
|
| 42 |
return processed_data
|
|
@@ -84,6 +84,7 @@ def app():
|
|
| 84 |
def target_display():
|
| 85 |
if 'key1' in st.session_state:
|
| 86 |
df = st.session_state.key1
|
|
|
|
| 87 |
hits = df[df['Target Label'] == 'TARGET']
|
| 88 |
_lab_dict = {
|
| 89 |
'LABEL_0':'NEGATIVE',
|
|
@@ -146,6 +147,16 @@ def target_display():
|
|
| 146 |
hits.iloc[i]['GHG Label'],hits.iloc[i]['Adapt-Mitig Label']))
|
| 147 |
st.write("\t Text: \t{}".format(hits.iloc[i]['text'].replace("\n", " ")))
|
| 148 |
hits = hits.reset_index(drop =True)
|
|
|
|
|
|
|
| 149 |
st.write(hits)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
else:
|
| 151 |
st.info("🤔 No Targets found")
|
|
|
|
| 34 |
df.to_excel(writer, index=False, sheet_name='Sheet1')
|
| 35 |
workbook = writer.book
|
| 36 |
worksheet = writer.sheets['Sheet1']
|
| 37 |
+
# worksheet.data_validation('E2:E{}'.format(len_df),
|
| 38 |
+
# {'validate': 'list',
|
| 39 |
+
# 'source': ['No', 'Yes', 'Discard']})
|
| 40 |
writer.save()
|
| 41 |
processed_data = output.getvalue()
|
| 42 |
return processed_data
|
|
|
|
| 84 |
def target_display():
|
| 85 |
if 'key1' in st.session_state:
|
| 86 |
df = st.session_state.key1
|
| 87 |
+
df_xlsx = to_excel(df)
|
| 88 |
hits = df[df['Target Label'] == 'TARGET']
|
| 89 |
_lab_dict = {
|
| 90 |
'LABEL_0':'NEGATIVE',
|
|
|
|
| 147 |
hits.iloc[i]['GHG Label'],hits.iloc[i]['Adapt-Mitig Label']))
|
| 148 |
st.write("\t Text: \t{}".format(hits.iloc[i]['text'].replace("\n", " ")))
|
| 149 |
hits = hits.reset_index(drop =True)
|
| 150 |
+
st.write('----------------')
|
| 151 |
+
st.write('Explore the data')
|
| 152 |
st.write(hits)
|
| 153 |
+
|
| 154 |
+
|
| 155 |
+
with st.sidebar:
|
| 156 |
+
st.write('-------------')
|
| 157 |
+
st.download_button(label='📥 Download Result',
|
| 158 |
+
data=df_xlsx ,
|
| 159 |
+
file_name= 'cpu_analysis.xlsx')
|
| 160 |
+
|
| 161 |
else:
|
| 162 |
st.info("🤔 No Targets found")
|