I have this signature which classifies DOJ press releases as whether they have a specific type of fraud or not.
I am a complete beginner to DSPy can someone help me fix this so it compiles and I can run the compiled module on my test set?
Thank you in advance.
class upc(dspy.Signature):
"""Classify cases where medical provider bills for higher levels of service than provided or bills for services not provided. Causing medically unnecessary care is only true if the unnecessary care is not provided. Only classify as true if the provider billed for services not provided NOT for services that are medically unnecessary."""
text = dspy.InputField()
answer = dspy.OutputField(desc='produce 1 for true 0 for false')
# Setup the chain of thought for the upc classifier
class6 = dspy.ChainOfThought(upc)
# Split data
train_df, test_df = train_test_split(DOJ_clean_train, test_size=230, train_size = 20, random_state=42)`
`trainset = [dspy.Example(text= train_df["pr"], answer= train_df["upc"])]
print(trainset)
teleprompter = BootstrapFewShot(
max_bootstrapped_demos=4,
max_labeled_demos=4
)
# Compile the module with the training set
optimized_module = teleprompter.compile(class6, trainset=trainset)
I am trying to train it using 20 manually classified observations. The input column is called “pr” and the output column is called “upc”. The pr column has text in it while the “upc” column is coded as 1s and 0s, 1 for true and 0 for false. For some reason when I try to compile the model with the training set, I get this error “[error ] Failed to run or to evaluate example Example” and at the bottom it says “Bootstrapped 0 full traces after 1 examples in round 0.”
mosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.