Getting bloom to return structured data

#44
by fgatti675 - opened

Hi everyone! I am trying bloom and I'm really enjoying the results so far.
I would like to know if it is possible to get bloom to return structured data.
Let's say I have a bunch of objects, and I would like to fill the data for the missing fields:

[
        {
            "title": "Adopt a Pescatarian diet",
            "completed_question": "Have you managed to adopt a Pescatarian diet?",
        }, {
            "title": "Regulate the temperature at home",
            "completed_question": "", // I would like to fill this in
        },
        // Ideally have additional objects or fields here!
    ]

Any help is greatly appreciated!!

BigScience Workshop org

I tried prompting BLOOM with the following prompt:

What are the "question" and "objects" in the following python script:

def get_json(question, objects):
    return [
        {
            "title": "Adopt a Pescatarian diet",
            "completed_question": "Have you managed to adopt a Pescatarian diet?",
        }, {
            "title": "Regulate the temperature at home",
            "completed_question": question,
        },
        *objects
    ]

json_object = get_json(question="

It's one way I tried prompting it, but you can try other things that are probably going to work better. Essentially the key is to figure out how exactly you want to translate your task in a "language modeling" task, ie so that the model when generating the next tokens is going to be able to solve your task. Good luck with your prompt experiments!

Hi @TimeRobber
Thanks for your answer :)
I have tried with different prompts and configs. It generates the correct completed_question I would expect, but I can't get the data right, which makes it hard to extract the result in reliant way.
I would typically get results like:

{'title': 'Adopt a Pescatarian diet', 'completed_question': 'Have you managed to adopt a Pescatarian diet?'}, 
{'title': 'Regulate the temperature at home', 'completed_question':  'Have you managed to regulate the temperature at home?'}, 
{'title':

In this case I could find a workaround, but I'm trying to generate an autocompletion system based on existing data which I don't know the shape of. (this data is just an example)
Ideally it could suggest additional fields, not just one.
Thanks for your suggestions!

Sign up or log in to comment