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

Pipeline.fit() got multiple values for argument 'text_input' #92

Open
Jasydom opened this issue Aug 10, 2023 · 2 comments
Open

Pipeline.fit() got multiple values for argument 'text_input' #92

Jasydom opened this issue Aug 10, 2023 · 2 comments

Comments

@Jasydom
Copy link

Jasydom commented Aug 10, 2023

Hello,

I would like to do MultiLabel Text-Classification

My code:

model        = OpenAI(api_key)
prompter     = Prompter('multilabel_classification.jinja')
pipe         = Pipeline(prompter, model)

classes = ['Medicine','Oncology','Metastasis','Breast cancer','Lung cancer','Cerebrospinal fluid','Tumor microenvironment','Single-cell RNA sequencing','Idiopathic intracranial hypertension']

sent = "The patient is a 93-year-old female with a medical history of chronic right hip pain, osteoporosis, hypertension, depression, and chronic atrial fibrillation admitted for evaluation and management of severe nausea and vomiting and urinary tract infection"
result = pipe.fit('multilabel_classification.jinja',
                          n_output_labels = len(classes),
                          domain          = 'Clinical',
                          text_input      = sent,
                          labels          = classes)

print(eval(result['text']))

I got this error Pipeline.fit() got multiple values for argument 'text_input'

Thank you for taking the time to respond to me.

Have a good day

@monk1337
Copy link
Contributor

monk1337 commented Aug 11, 2023

You don't need to pass 'jinja' multiple times, you are passing template in prompter and again in pipe.fit function.

Try this:

result = pipe.fit(sent, 
n_output_labels = len(classes),
domain          = 'Clinical',
labels          = classes)

also no need to eval on output, it will be handle internally.

@Jasydom
Copy link
Author

Jasydom commented Aug 11, 2023

Thanks for the reply

Have a good day

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

2 participants