LX-doctorAI1 / M2KT

22 stars 0 forks source link

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

Open yugui01 opened 1 year ago

yugui01 commented 1 year ago

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

Can you share the file?

Thank you!

FJYfxt commented 10 months ago

Hello, did you solve the problem?

kingbeam commented 7 months ago

Hello, did you solve the problem?

zddd618 commented 7 months ago

How can I get annotation.json in main_basic.py

RaySkarken commented 4 months ago

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))
Lalalalala-l commented 3 months ago

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))

can you provide me the annotation.json in main_basic.py,please!