Skip to content

TypeError: can only concatenate str (not "list") to str #70

@nvinayvarma189

Description

@nvinayvarma189

Issue

  1. I used this script to apply new Charon format to the old dataset.

  2. Later, when I tried to train a model, I receive the below error

 File "/root/.pyenv/versions/3.8.2/envs/tvs_india2/lib/python3.8/site-packages/dialogy/plugins/text/duckling_plugin/__init__.py", line 501, in transform
    row[self.output_column] + entities
TypeError: can only concatenate str (not "list") to str
  1. This is because the entities column (in the new Charon output format) has lists as strings( "[]" instead of [] ) so it breaks.

Possible solutions

  1. Replace row[self.output_column] + entities with json.loads(row[self.output_column]) + entities here and in dialogy here.
  2. Set use_transform=False for dukcling and list entity plugins in [processor.py](https://github.com/skit-ai/dialogy-template-simple-transformers/blob/main/slu/slu/src/controller/processors.py)

I think solution 1 is the proper fix.

credits: @biswaroop1547

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions