Skip to content

搜狐2022推荐nlp_training里报错TypeError: list indices must be integers or slices, not str #8

@ArtificialZeng

Description

@ArtificialZeng

TypeError Traceback (most recent call last)
/tmp/ipykernel_33/3809147022.py in
6 di['id'] = f'{row["id"]}_{entity}'
7 di['text'] = f'实体: {entity} [SEP] ' + row['content']
----> 8 di['label'] = row['entity'][entity]
9 train_data.append(di)
10

TypeError: list indices must be integers or slices, not str

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions