missing metadata column bugfix
@@ -293,7 +293,7 @@ class NLUPipeline(BasePipe):
logger.info(f'Parsing field for {field}')
if not keep_stranger_features and field in stranger_features: continue
- else :
+ elif field in stranger_features :
field_types_dict[field] = 'document'
continue
if field == 'origin_index':
@@ -301,7 +301,7 @@ class NLUPipeline(BasePipe):
continue
if field == self.raw_text_column: continue
- # todo label output level inference
+ # todo label output level inference. fpr mpw , for now label column is always treated as a document level
# if 'label' in field: continue # speciel case for input lables
# print(field)
# For empty DF this will crash
@@ -325,7 +325,7 @@ class NLUPipeline(BasePipe):
def rename_columns_and_extract_map_values_same_level(self, ptmp, fields_to_rename, same_output_level,
- stranger_features=[], meta=True):
+ stranger_features=[], meta=False):
'''
Extract features of Spark DF after they where exploded it was exploded
:param ptmp: The dataframe which contains the columns wto be renamed
@@ -924,11 +924,11 @@ class NLUPipeline(BasePipe):
'''
Annotates a Pandas Dataframe/Pandas Series/Numpy Array/Spark DataFrame/Python List strings /Python String
- :param data:
- :param output_level:
- :param positions:
- :param keep_stranger_features:
- :param metadata:weather to keep additonal metadata in final df or not
+ :param data: Data to predict on
+ :param output_level: output level, either document/sentence/chunk/token
+ :param positions: wether to output indexes that map predictions back to position in origin string
+ :param keep_stranger_features: wether to keep columns in the dataframe that are not generated by pandas. I.e. when you s a dataframe with 10 columns and only one of them is named text, the returned dataframe will only contain the text column when set to false
+ :param metadata: wether to keep additonal metadata in final df or not like confidiences of every possible class for preidctions.
:param multithread: Whether to use multithreading based lightpipeline. In some cases, this may cause errors.
:param drop_irellevant_cols: Wether to drop cols of different output levels, i.e. when predicting token level and dro_irrelevant_cols = True then chunk, sentence and Doc will be dropped
:return:
