Extracting data from text

You can use Smart Write to even extract data in a specific format,

 
💡
Here are some fruits and their benefits. Extract the data in the following format: {list of each fruit} Color:color_of_the_fruit, Fruits: comma-separated fruit names Prevents: list of disease names {linebreak} Red foods – like tomatoes and watermelon. These contain lycopene, which is thought to be important for fighting prostate cancer and heart disease Green vegetables – like spinach and kale. These contain lutein and zeaxanthin, which may help protect against age-related eye disease Blue and purple foods – like blueberries and eggplant. These contain anthocyanins, which may help protect the body from cancer White foods – like cauliflower. These contain sulforaphane and may also help protect against some cancers.
 
 

Output:

Color: red,

Fruits: tomatoes, watermelon,

Prevents: prostate cancer, heart disease

 

Color: green,

Fruits: spinach, kale,

Prevents: age-related eye disease

 

Color: blue, purple,

Fruits: blueberries, eggplant,

Prevents: cancer

 

Color: white,

Fruits: cauliflower,

Prevents: some cancers

 

You can use this to do two things,

  1. Extract any data, like names, locations, or any patterns.
  1. Output that in any format you like.
 

Let's try to get the above data in a JSON format,

💡
Here are some fruits and their benefits. Extract the data in the following format: {list of each fruit} {"COLOR_NAME":["LIST_OF_FRUITS"]} Red foods – like tomatoes and watermelon. These contain lycopene, which is thought to be important for fighting prostate cancer and heart disease Green vegetables – like spinach and kale. These contain lutein and zeaxanthin, which may help protect against age-related eye disease Blue and purple foods – like blueberries and eggplant. These contain anthocyanins, which may help protect the body from cancer White foods – like cauliflower. These contain sulforaphane and may also help protect against some cancers.
 

Output:

{"Red":["Tomatoes", "Watermelon"], "Green":["Spinach", "Kale"], "Blue":["Blueberries", "Eggplant"], "White":["Cauliflower"]}

 
Did this answer your question?
😞
😐
🤩