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?
😞
😐
🀩