File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed
asreviewcontrib/preprocess/io Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change 22
33import numpy as np
44import pandas as pd
5- from asreview .io .utils import _standardize_dataframe
6- from asreviewcontrib .preprocess .config import COLS_FOR_DEDUPE
5+ from asreview .config import COLUMN_DEFINITIONS
6+ from asreview .io .utils import _standardize_dataframe , type_from_column
7+ from asreviewcontrib .preprocess .config import (
8+ COLS_FOR_DEDUPE ,
9+ DEDUPLICATION_COLUMN_DEFINITIONS ,
10+ )
711
812
913def _standardize_dataframe_for_deduplication (df , column_spec = {}):
@@ -70,3 +74,22 @@ def _standardize_dataframe_for_deduplication(df, column_spec={}):
7074 )
7175
7276 return df , all_column_spec
77+
78+
79+ def _get_column_spec (df ):
80+ all_column_spec = {}
81+
82+ # map columns on column specification
83+ col_names = list (df )
84+ for column_name in col_names :
85+
86+ data_type = type_from_column (column_name , DEDUPLICATION_COLUMN_DEFINITIONS )
87+ if data_type is not None :
88+ all_column_spec [data_type ] = column_name
89+ continue
90+
91+ data_type = type_from_column (column_name , COLUMN_DEFINITIONS )
92+ if data_type is not None :
93+ all_column_spec [data_type ] = column_name
94+
95+ return all_column_spec
You can’t perform that action at this time.
0 commit comments