Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nvinayvarma189 opened this issue Dec 7, 2021 · 0 comments
Open

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

nvinayvarma189 opened this issue Dec 7, 2021 · 0 comments

Comments

@nvinayvarma189
Copy link
Contributor

nvinayvarma189 commented Dec 7, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant