Jan Mühlnikel commited on
Commit
923adf2
1 Parent(s): 8e13033

added flags

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
__pycache__/similarity_page.cpython-310.pyc CHANGED
Binary files a/__pycache__/similarity_page.cpython-310.pyc and b/__pycache__/similarity_page.cpython-310.pyc differ
 
modules/__pycache__/result_table.cpython-310.pyc CHANGED
Binary files a/modules/__pycache__/result_table.cpython-310.pyc and b/modules/__pycache__/result_table.cpython-310.pyc differ
 
modules/result_table.py CHANGED
@@ -15,6 +15,7 @@ def show_table(p1_df, p2_df):
15
  row_from_p1 = p1_df.iloc[[i]]
16
  row_from_p2 = p2_df.iloc[[i]]
17
 
 
18
  # transform strings to list
19
  row_from_p1["crs_3_code_list"] = [row_from_p1['crs_3_code'].item().split(";")[:-1]]
20
  row_from_p2["crs_3_code_list"] = [row_from_p2['crs_3_code'].item().split(";")[:-1]]
@@ -25,6 +26,15 @@ def show_table(p1_df, p2_df):
25
  row_from_p1["sdg_list"] = [row_from_p1['sgd_pred_code'].item()]
26
  row_from_p2["sdg_list"] = [row_from_p2['sgd_pred_code'].item()]
27
 
 
 
 
 
 
 
 
 
 
28
  # Correctly append rows to match_df
29
  st.subheader(f"#{actual_ind}")
30
  st.caption(f"Similarity: {round(row_from_p1['similarity'].item(), 4) * 100}%")
@@ -35,58 +45,65 @@ def show_table(p1_df, p2_df):
35
  #AgGrid(match_df)
36
 
37
  st.dataframe(
38
- match_df[["iati_id", "title_main", "orga_abbreviation", "client", "description_main", "country", "sdg_list", "crs_3_code_list", "crs_5_code_list"]],
39
  use_container_width = True,
40
  height = 35 + 35 * len(match_df),
41
  column_config={
42
- """
43
- "similarity": st.column_config.TextColumn(
44
- "Similarity",
45
- help="simialrity",
46
- disabled=True
47
- ),
48
- """
49
  "iati_id": st.column_config.TextColumn(
50
  "IATI ID",
51
  help="IATI Project ID",
52
- disabled=True
 
53
  ),
54
  "orga_abbreviation": st.column_config.TextColumn(
55
  "Organization",
56
  help="If description not in English, description in other language provided",
57
- disabled=True
 
58
  ),
59
  "client": st.column_config.TextColumn(
60
  "Client",
61
  help="Client organization of customer",
62
- disabled=True
 
63
  ),
64
  "title_main": st.column_config.TextColumn(
65
  "Title",
66
  help="If title not in English, title in other language provided",
67
- disabled=True
 
68
  ),
69
  "description_main": st.column_config.TextColumn(
70
  "Description",
71
  help="If description not in English, description in other language provided",
72
- disabled=True
 
73
  ),
74
  "country": st.column_config.TextColumn(
75
  "Country",
76
  help="Country of project",
77
- disabled=True
 
 
 
 
 
 
78
  ),
79
  "sdg_list": st.column_config.ListColumn(
80
  "SDG Prediction",
81
  help="Prediction of SDG's",
 
82
  ),
83
  "crs_3_code_list": st.column_config.ListColumn(
84
  "CRS 3",
85
  help="CRS 3 code given by organization",
 
86
  ),
87
  "crs_5_code_list": st.column_config.ListColumn(
88
  "CRS 5",
89
- help="CRS 5 code given by organization"
 
90
  ),
91
  },
92
  hide_index=True,
 
15
  row_from_p1 = p1_df.iloc[[i]]
16
  row_from_p2 = p2_df.iloc[[i]]
17
 
18
+ # INTEGRATE IN PREPROCESSING !!!
19
  # transform strings to list
20
  row_from_p1["crs_3_code_list"] = [row_from_p1['crs_3_code'].item().split(";")[:-1]]
21
  row_from_p2["crs_3_code_list"] = [row_from_p2['crs_3_code'].item().split(";")[:-1]]
 
26
  row_from_p1["sdg_list"] = [row_from_p1['sgd_pred_code'].item()]
27
  row_from_p2["sdg_list"] = [row_from_p2['sgd_pred_code'].item()]
28
 
29
+ try:
30
+ row_from_p1["flag"] = f"https://flagicons.lipis.dev/flags/4x3/{row_from_p1['country'].item()[:2].lower()}.svg"
31
+ row_from_p2["flag"] = f"https://flagicons.lipis.dev/flags/4x3/{row_from_p2['country'].item()[:2].lower()}.svg"
32
+ except:
33
+ row_from_p1["flag"] = "https://flagicons.lipis.dev/flags/4x3/xx.svg"
34
+ row_from_p2["flag"] = "https://flagicons.lipis.dev/flags/4x3/xx.svg"
35
+
36
+ print(row_from_p1["flag"].item())
37
+
38
  # Correctly append rows to match_df
39
  st.subheader(f"#{actual_ind}")
40
  st.caption(f"Similarity: {round(row_from_p1['similarity'].item(), 4) * 100}%")
 
45
  #AgGrid(match_df)
46
 
47
  st.dataframe(
48
+ match_df[["iati_id", "title_main", "orga_abbreviation", "client", "description_main", "country", "flag", "sdg_list", "crs_3_code_list", "crs_5_code_list"]],
49
  use_container_width = True,
50
  height = 35 + 35 * len(match_df),
51
  column_config={
 
 
 
 
 
 
 
52
  "iati_id": st.column_config.TextColumn(
53
  "IATI ID",
54
  help="IATI Project ID",
55
+ disabled=True,
56
+ width="small"
57
  ),
58
  "orga_abbreviation": st.column_config.TextColumn(
59
  "Organization",
60
  help="If description not in English, description in other language provided",
61
+ disabled=True,
62
+ width="small"
63
  ),
64
  "client": st.column_config.TextColumn(
65
  "Client",
66
  help="Client organization of customer",
67
+ disabled=True,
68
+ width="small"
69
  ),
70
  "title_main": st.column_config.TextColumn(
71
  "Title",
72
  help="If title not in English, title in other language provided",
73
+ disabled=True,
74
+ width="large"
75
  ),
76
  "description_main": st.column_config.TextColumn(
77
  "Description",
78
  help="If description not in English, description in other language provided",
79
+ disabled=True,
80
+ width="large"
81
  ),
82
  "country": st.column_config.TextColumn(
83
  "Country",
84
  help="Country of project",
85
+ disabled=True,
86
+ width="small"
87
+ ),
88
+ "flag": st.column_config.ImageColumn(
89
+ "Flag",
90
+ help="country flag",
91
+ width="small"
92
  ),
93
  "sdg_list": st.column_config.ListColumn(
94
  "SDG Prediction",
95
  help="Prediction of SDG's",
96
+ width="small"
97
  ),
98
  "crs_3_code_list": st.column_config.ListColumn(
99
  "CRS 3",
100
  help="CRS 3 code given by organization",
101
+ width="small"
102
  ),
103
  "crs_5_code_list": st.column_config.ListColumn(
104
  "CRS 5",
105
+ help="CRS 5 code given by organization",
106
+ width="small"
107
  ),
108
  },
109
  hide_index=True,
src/flag-icons/AC.png DELETED
Binary file (1.07 kB)
 
src/flag-icons/AD.png DELETED
Binary file (601 Bytes)
 
src/flag-icons/AE.png DELETED
Binary file (140 Bytes)
 
src/flag-icons/AF.png DELETED
Binary file (861 Bytes)
 
src/flag-icons/AG.png DELETED
Binary file (760 Bytes)
 
src/flag-icons/AI-alt.png DELETED
Binary file (511 Bytes)
 
src/flag-icons/AI.png DELETED
Binary file (994 Bytes)
 
src/flag-icons/AL.png DELETED
Binary file (530 Bytes)
 
src/flag-icons/AM.png DELETED
Binary file (107 Bytes)
 
src/flag-icons/AO.png DELETED
Binary file (528 Bytes)
 
src/flag-icons/AQ.png DELETED
Binary file (455 Bytes)
 
src/flag-icons/AR.png DELETED
Binary file (257 Bytes)
 
src/flag-icons/AS.png DELETED
Binary file (1.09 kB)
 
src/flag-icons/AT.png DELETED
Binary file (93 Bytes)
 
src/flag-icons/AU.png DELETED
Binary file (908 Bytes)
 
src/flag-icons/AW.png DELETED
Binary file (239 Bytes)
 
src/flag-icons/AX.png DELETED
Binary file (211 Bytes)
 
src/flag-icons/AZ.png DELETED
Binary file (267 Bytes)
 
src/flag-icons/BA.png DELETED
Binary file (521 Bytes)
 
src/flag-icons/BB.png DELETED
Binary file (339 Bytes)
 
src/flag-icons/BD.png DELETED
Binary file (310 Bytes)
 
src/flag-icons/BE.png DELETED
Binary file (105 Bytes)
 
src/flag-icons/BF.png DELETED
Binary file (227 Bytes)
 
src/flag-icons/BG.png DELETED
Binary file (107 Bytes)
 
src/flag-icons/BH.png DELETED
Binary file (319 Bytes)
 
src/flag-icons/BI.png DELETED
Binary file (704 Bytes)
 
src/flag-icons/BJ.png DELETED
Binary file (119 Bytes)
 
src/flag-icons/BL.png DELETED
Binary file (1.13 kB)
 
src/flag-icons/BM.png DELETED
Binary file (1.14 kB)
 
src/flag-icons/BN.png DELETED
Binary file (1.06 kB)
 
src/flag-icons/BO-alt.png DELETED
Binary file (107 Bytes)
 
src/flag-icons/BO.png DELETED
Binary file (369 Bytes)
 
src/flag-icons/BQ.png DELETED
Binary file (867 Bytes)
 
src/flag-icons/BR.png DELETED
Binary file (678 Bytes)
 
src/flag-icons/BS.png DELETED
Binary file (343 Bytes)
 
src/flag-icons/BT.png DELETED
Binary file (1.13 kB)
 
src/flag-icons/BV.png DELETED
Binary file (331 Bytes)
 
src/flag-icons/BW.png DELETED
Binary file (122 Bytes)
 
src/flag-icons/BY-alt.png DELETED
Binary file (93 Bytes)
 
src/flag-icons/BY.png DELETED
Binary file (481 Bytes)
 
src/flag-icons/BZ.png DELETED
Binary file (881 Bytes)
 
src/flag-icons/CA.png DELETED
Binary file (431 Bytes)
 
src/flag-icons/CC.png DELETED
Binary file (917 Bytes)
 
src/flag-icons/CD.png DELETED
Binary file (898 Bytes)
 
src/flag-icons/CF.png DELETED
Binary file (308 Bytes)
 
src/flag-icons/CG.png DELETED
Binary file (209 Bytes)
 
src/flag-icons/CH.png DELETED
Binary file (197 Bytes)