You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently generate_data_for_columnand fewshot_example_columns are used as the prefixs for the prompt.
E.g.:
fromdatasetsimportDatasetfromai_dataset_generator.promptsimportBasePromptfewshot_examples=Dataset.from_dict({
"text": ["This movie is great!", "This movie is bad!"],
"label": ["positive", "negative"]
})
prompt_template=BasePrompt(
task_description="Annotate movie reviews as either: {label_options}",
label_options=["positive", "negative"],
generate_data_for_column="label",
fewshot_example_columns="text",
)
Has Output:
Annotate movie reviews as either: positive, negative
text: This movie is great!
label: positive
text: This movie is bad!
label: negative
text: {text}
label:
With text: and label: as the prefixes.
Proposal/Motivation
What if I use a custom fine-tuned model, that does not work well with textand label as prefixes in the prompt, but was trained with sentence and prediction.
For more flexibility, those prefixes should be optionally configurable. For example:
fromdatasetsimportDatasetfromai_dataset_generator.promptsimportBasePromptfewshot_examples=Dataset.from_dict({
"text": ["This movie is great!", "This movie is bad!"],
"label": ["positive", "negative"]
})
prompt_template=BasePrompt(
task_description="Annotate movie reviews as either: {label_options}",
label_options=["positive", "negative"],
generate_data_for_column=("label", "sentence"), # Second tuple item contains the new prefix stringfewshot_example_columns=("text", "prediction"), # Second tuple item contains the new prefix string
)
Has Output:
Annotate movie reviews as either: positive, negative
sentence: This movie is great!
prediction: positive
sentence: This movie is bad!
prediction: negative
sentence: {text}
prediction:
The default behaviour could stay the same and the column name is used as the prefix. If it is a tuple (or other structure) then the second item is used.
The text was updated successfully, but these errors were encountered:
Currently
generate_data_for_column
andfewshot_example_columns
are used as the prefixs for the prompt.E.g.:
Has Output:
With
text:
andlabel:
as the prefixes.Proposal/Motivation
What if I use a custom fine-tuned model, that does not work well with
text
andlabel
as prefixes in the prompt, but was trained withsentence
andprediction
.For more flexibility, those prefixes should be optionally configurable. For example:
Has Output:
The default behaviour could stay the same and the column name is used as the prefix. If it is a tuple (or other structure) then the second item is used.
The text was updated successfully, but these errors were encountered: