Skip to content

Bug when no Named Entities found in document #275

Description

@tkilias

Situation

What Works

    SELECT {ai_lab_config.db_schema}.TE_TOKEN_CLASSIFICATION_UDF_WITH_SPAN(
        NULL,
        '{ai_lab_config.te_bfs_connection}',
        '{ai_lab_config.te_models_bfs_dir}',
        'guishe/nuner-v2_fewnerd_fine_super',
        'Foreign governments may be spying on your smartphone notifications, senator says. Washington (CNN) — Foreign governments have reportedly attempted to spy on iPhone and Android users through the mobile app notifications they receive on their smartphones - and the US government has forced Apple and Google to keep quiet about it, according to a top US senator. Through legal demands sent to the tech giants, governments have allegedly tried to force Apple and Google to turn over sensitive information that could include the contents of a notification - such as previews of a text message displayed on a lock screen, or an update about app activity, Oregon Democratic Sen. Ron Wyden said in a new report. Wyden''s report reflects the latest example of long-running tensions between tech companies and governments over law enforcement demands, which have stretched on for more than a decade. Governments around the world have particularly battled with tech companies over encryption, which provides critical protections to users and businesses while in some cases preventing law enforcement from pursuing investigations into messages sent over the internet.',
        0,
        0,
        1000,
        NULL
    )

What doesn't work

    SELECT {ai_lab_config.db_schema}.TE_TOKEN_CLASSIFICATION_UDF_WITH_SPAN(
        NULL,
        '{ai_lab_config.te_bfs_connection}',
        '{ai_lab_config.te_models_bfs_dir}',
        'guishe/nuner-v2_fewnerd_fine_super',
        'This is a test.',
        0,
        0,
        1000,
        NULL
    )

Error Message

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/exasol_transformers_extension/udfs/models/base_model_udf.py", line 129, in get_prediction_from_unique_param_based_dataframes
    result_df = self.get_prediction(param_based_model_df)
  File "/usr/local/lib/python3.10/dist-packages/exasol_transformers_extension/udfs/models/base_model_udf.py", line 226, in get_prediction
    pred_df_list = self.create_dataframes_from_predictions(predictions)
  File "/usr/local/lib/python3.10/dist-packages/exasol_transformers_extension/udfs/models/token_classification_udf.py", line 147, in create_dataframes_from_predictions
    result_df = result_df[self._desired_fields_in_prediction].rename(
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/frame.py", line 3813, in __getitem__
    indexer = self.columns._get_indexer_strict(key, "columns")[1]
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/indexes/base.py", line 6070, in _get_indexer_strict
    self._raise_if_missing(keyarr, indexer, axis_name)
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/indexes/base.py", line 6130, in _raise_if_missing
    raise KeyError(f"None of [{key}] are in the [{axis_name}]")
KeyError: "None of [Index(['start', 'end', 'word', 'entity_group', 'score'], dtype='object')] are in the [columns]"

Metadata

Metadata

Labels

bugUnwanted / harmful behavior

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions