-
Notifications
You must be signed in to change notification settings - Fork 1
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
Comments
Hello, did you solve the problem? |
1 similar comment
Hello, did you solve the problem? |
How can I get annotation.json in main_basic.py |
Try to one hot encode labels from json dataset using pandas. 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)) |
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
No description provided.
The text was updated successfully, but these errors were encountered: