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

How to obtain iu_ Ray's label path? #5

Open
yugui01 opened this issue Jul 20, 2023 · 5 comments
Open

How to obtain iu_ Ray's label path? #5

yugui01 opened this issue Jul 20, 2023 · 5 comments

Comments

@yugui01
Copy link

yugui01 commented Jul 20, 2023

No description provided.

@FJYfxt
Copy link

FJYfxt commented Sep 8, 2023

Hello, did you solve the problem?

1 similar comment
@kingbeam
Copy link

kingbeam commented Dec 3, 2023

Hello, did you solve the problem?

@zddd618
Copy link

zddd618 commented Dec 21, 2023

How can I get annotation.json in main_basic.py

@RaySkarken
Copy link

Hi, can you tell me how to obtain /r2gen_ Split/id_ Is label.csv?

Can you share the file?

Thank you!

Try to one hot encode labels from json dataset using pandas.
smth like following code

import pandas as pd
from sklearn.preprocessing import MultiLabelBinarizer


# Create MultiLabelBinarizer object
mlb = MultiLabelBinarizer()


df = pd.read_json(path_or_buf="all.jsonl", lines=True)
df = df[['id', 'label']]
df['label'] = df['label'].apply(lambda x: [] if x == "''" else list(map(lambda s: s.replace("'", ""), x.split("', '"))))
a = mlb.fit_transform(df['label'])
df = df[['id',]].join(pd.DataFrame(a,
                          columns=mlb.classes_,
                          index=df.index))

@Szh2620
Copy link

Szh2620 commented Aug 13, 2024

hello,did you solve this problem? i cant get the label_csv by chexpert

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

6 participants