Skip to content

Commit

Permalink
Merge pull request #237 from JohnSnowLabs/release/523/lp-bugfix
Browse files Browse the repository at this point in the history
Release/523/lp bugfix
  • Loading branch information
C-K-Loan committed Jan 20, 2024
2 parents b392597 + c7572f3 commit 97cd134
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion nlu/pipe/col_substitution/col_name_substitution_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ def get_final_output_cols_of_component(c, df, anno_2_ex) -> List[str]:
"""Get's a list of all columns that have been derived in the pythonify procedure from the component_to_resolve
os_components in dataframe df for anno_2_ex configs """
og_output_col = c.spark_output_column_names[0]

# may be missing because finisher cleaning
if og_output_col not in df.columns: return []
if og_output_col not in anno_2_ex: return []
configs = anno_2_ex[og_output_col]

if c.name == NLP_NODE_IDS.FINISHER:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
def extract_light_pipe_rows(df):
"""Extract Annotations from Light Pipeline into same represenation as other extractors in thos module"""
ff = lambda row: list(map(f, row)) if isinstance(row, List) else row
f = lambda anno: dict(annotatorType=anno.annotator_type,
f = lambda anno: dict(
# annotatorType=anno.annotator_type,
begin=anno.begin, end=anno.end,
result=anno.result,
metadata=anno.metadata,
Expand Down
2 changes: 1 addition & 1 deletion nlu/pipe/utils/predict_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def predict_multi_threaded_light_pipe(pipe, data, output_level, positions, keep_
data, stranger_features, output_datatype = DataConversionUtils.to_pandas_df(data, pipe.raw_text_column)

# Predict -> Cast to PDF -> Join with original inputs. It does NOT yield EMBEDDINGS.
data = data.join(pd.DataFrame(pipe.light_transformer_pipe.fullAnnotate(data.text.values)))
data = data.join(pd.DataFrame(pipe.light_transformer_pipe.fullAnnotate(data.text.values.tolist())))

return pipe.pythonify_spark_dataframe(data,
keep_stranger_features=keep_stranger_features,
Expand Down

0 comments on commit 97cd134

Please sign in to comment.