Jan Mühlnikel commited on
Commit
dbd3423
1 Parent(s): 00341f5

enhanced documentation

Browse files
app_matching_page.py CHANGED
@@ -12,8 +12,8 @@ import pickle
12
  from sentence_transformers import SentenceTransformer
13
  from modules.multimatch_result_table import show_multi_table
14
  from modules.singlematch_result_table import show_single_table
15
- from functions.filter_projects import filter_projects
16
- from functions.filter_single import filter_single
17
  from functions.multi_project_matching import calc_multi_matches
18
  from functions.same_country_filter import same_country_filter
19
  from functions.single_project_matching import find_similar
@@ -242,7 +242,7 @@ def show_multi_matching_page():
242
 
243
  # FILTER DF WITH SELECTED FILTER OPTIONS
244
  TOP_X_PROJECTS = 30
245
- filtered_df = filter_projects(projects_df, crs3_list, crs5_list, sdg_str, country_code_list, orga_code_list, query, model, embeddings, TOP_X_PROJECTS)
246
  if isinstance(filtered_df, pd.DataFrame) and len(filtered_df) != 0:
247
  # FIND MATCHES
248
  ## If only same country checkbox i sactivated
 
12
  from sentence_transformers import SentenceTransformer
13
  from modules.multimatch_result_table import show_multi_table
14
  from modules.singlematch_result_table import show_single_table
15
+ from functions.multi_project_matching import filter_multi
16
+ from functions.filter_single_project_matching import filter_single
17
  from functions.multi_project_matching import calc_multi_matches
18
  from functions.same_country_filter import same_country_filter
19
  from functions.single_project_matching import find_similar
 
242
 
243
  # FILTER DF WITH SELECTED FILTER OPTIONS
244
  TOP_X_PROJECTS = 30
245
+ filtered_df = filter_multi(projects_df, crs3_list, crs5_list, sdg_str, country_code_list, orga_code_list, query, model, embeddings, TOP_X_PROJECTS)
246
  if isinstance(filtered_df, pd.DataFrame) and len(filtered_df) != 0:
247
  # FIND MATCHES
248
  ## If only same country checkbox i sactivated
functions/{filter_projects.py → filter_multi_project_matching.py} RENAMED
@@ -5,7 +5,7 @@ def contains_code(crs_codes, code_list):
5
  codes = str(crs_codes).split(';')
6
  return any(code in code_list for code in codes)
7
 
8
- def filter_projects(df, crs3_list, crs5_list, sdg_str, country_code_list, orga_code_list, query, model, embeddings, TOP_X_PROJECTS=30):
9
  # Check if filters where not all should be selected are empty
10
  if crs3_list != [] or crs5_list != [] or sdg_str != "" or query != "":
11
 
 
5
  codes = str(crs_codes).split(';')
6
  return any(code in code_list for code in codes)
7
 
8
+ def filter_multi(df, crs3_list, crs5_list, sdg_str, country_code_list, orga_code_list, query, model, embeddings, TOP_X_PROJECTS=30):
9
  # Check if filters where not all should be selected are empty
10
  if crs3_list != [] or crs5_list != [] or sdg_str != "" or query != "":
11
 
functions/{filter_single.py → filter_single_project_matching.py} RENAMED
@@ -1,5 +1,8 @@
1
  import pandas as pd
2
- from functions.semantic_search import search
 
 
 
3
 
4
  def contains_code(crs_codes, code_list):
5
  codes = str(crs_codes).split(';')
 
1
  import pandas as pd
2
+
3
+ """
4
+ Filter for the single project matching
5
+ """
6
 
7
  def contains_code(crs_codes, code_list):
8
  codes = str(crs_codes).split(';')