Skip to content

Query Generation

Input test 1:

Generate 30 query, text pairs for a project aimed at training a BERT-based search model on finding relevant passages in the works of Thich Nhat Hanh. The queries should be a mix of short (30%), medium (50%), and long lengths (20%): - 30% short queries (1-3 words) - 50% medium queries (4-10 words) - 20% long queries (10+ words)

The project focuses on helping users find info about Plum Village practices as well as researching Thay's teachings and Buddhist teachings. The generated queries should capture the key concepts and themes from the text, but also some detailed information specific to the text.

Text:

title Transformation and Healing: Sutra on the Four Establishments of Mindfulness \title

section Mindfulness Exercises \section

exercise Exercise 7| Parts of the Body exercise

Further, the practitioner meditates on his very own body from the soles of the feet upwards and then from the hair on top of the head downwards, a body contained inside the skin and full of all the impurities which belong to the body: ‘Here is the hair of the head, the hairs on the body, the nails, teeth, skin, flesh, sinews, bones, bone marrow, kidneys, heart, liver, diaphragm, spleen, lungs, intestines, bowels, excrement, bile, phlegm, pus, blood, sweat, fat, tears, grease, saliva, mucus, synovic fluid, urine.’

This exercise brings us into even deeper contact with our body. Here we observe the body in all its parts, from the hair on the head to the skin on the soles of the feet. In the process of our observation, we scan all the parts of the body, including the brain, heart, lungs, gall bladder, spleen, blood, urine, and so forth. The Buddha gives us the example of a farmer pouring the contents of a sack filled with a variety of seeds onto the floor and then observing and identifying each kind of seed: “This is rice, these are beans, these are sesame seeds.”

We use our conscious breathing in order to observe mindfully all the parts of the body. For example: “Breathing in, I am aware of the hair on my head. Breathing out, I know that this is the hair on my head.” Breathing consciously helps us dwell in mindfulness more easily and sustain the work of observing each part of the body. In addition to the conscious breathing, we can use the method of silently calling each part of the body by name to enable these parts to become increasingly clear in the light of mindfulness.

Why do we need to observe in mindfulness the different parts of the body? First of all, it is to be in contact with the body. We often have the impression that we’re already totally in touch with our body, but often we’re wrong. Between us and our body there can be a large separation, and our body remains a stranger to us. Sometimes we hate our body. There are even people who see their body as a prison and a place of punishment. To come back to our body is to become familiar with it and to establish harmony with it. We know that if our body isn’t happy, we’re not happy, and so we want our body to be calm and peaceful. To do so, we come back to our body and make peace with it.

We can try touching the different parts of our body to make their acquaintance. We should touch each part in an affectionate and caring way. For several decades, our eyes, feet, and heart have done their work devotedly and faithfully with us and for us, but we never really give them much attention or express our gratitude to them. It’s necessary to establish a close relationship with our body.

The second reason for mindfully observing the different parts of the body is that each part can be the door to liberation and awakening. At first we’ll only recognize the presence of the part of the body being observed, but later we’ll come to see its true nature. Every hair on our head and every cell in our body contains the entire universe. Observing the interdependent nature of a single hair can help us to see into the nature of the universe.

The exercise of observing every part of the body begins with the hair on the head and goes down to the skin on the soles of the feet. Sometimes we observe just one part of the body deeply, such as our eyes, heart, or toe. In the process of observation from the head to the feet, some observations may spring up in our mind. For example, as we pass our heart, we may think, “My friend John has a heart condition. I must visit him soon to see if he’s all right.” We can note these observations and then continue with the work of observing the remaining parts of the body. Later we can return to those observations.

Ouput

Here are 20 query-text pairs for training a BERT-based search model on Thich Nhat Hanh’s work, focusing on the “Transformation and Healing: Sutra on the Four Establishments of Mindfulness,” specifically the mindfulness exercise on “Parts of the Body.”

Short Queries (30%):

1.  Query: Mindfulness breathing

Text: “We use our conscious breathing in order to observe mindfully all the parts of the body…” 2. Query: Body observation Text: “The practitioner meditates on his very own body from the soles of the feet upwards…” 3. Query: Contact with the body Text: “First of all, it is to be in contact with the body. We often have the impression that we’re already totally in touch with our body, but often we’re wrong…” 4. Query: Parts of the body meditation Text: “We scan all the parts of the body, including the brain, heart, lungs, gall bladder, spleen, blood, urine…” 5. Query: Affectionate touch Text: “We should touch each part in an affectionate and caring way. For several decades, our eyes, feet, and heart have done their work devotedly…” 6. Query: Conscious breathing Text: “Breathing consciously helps us dwell in mindfulness more easily and sustain the work of observing each part of the body…”

Medium Queries (50%): 7. Query: How to reconnect with the body Text: “To come back to our body is to become familiar with it and to establish harmony with it. We know that if our body isn’t happy, we’re not happy…”

8.  Query: Meditation on the body’s true nature

Text: “At first we’ll only recognize the presence of the part of the body being observed, but later we’ll come to see its true nature…” 9. Query: Importance of mindful observation Text: “The second reason for mindfully observing the different parts of the body is that each part can be the door to liberation and awakening…” 10. Query: Separation from the body Text: “Between us and our body there can be a large separation, and our body remains a stranger to us. Sometimes we hate our body…” 11. Query: Calling parts of the body by name Text: “In addition to the conscious breathing, we can use the method of silently calling each part of the body by name to enable these parts to become increasingly clear…” 12. Query: Observing interdependence in the body Text: “Every hair on our head and every cell in our body contains the entire universe. Observing the interdependent nature of a single hair can help us to see into the nature of the universe…” 13. Query: Mindfulness and body parts Text: “Why do we need to observe in mindfulness the different parts of the body? First of all, it is to be in contact with the body…” 14. Query: Examples from Buddha’s teachings on mindfulness Text: “The Buddha gives us the example of a farmer pouring the contents of a sack filled with a variety of seeds onto the floor and then observing and identifying each kind of seed…” 15. Query: Importance of making peace with the body Text: “We want our body to be calm and peaceful. To do so, we come back to our body and make peace with it…” 16. Query: Touching the body with care Text: “We can try touching the different parts of our body to make their acquaintance. We should touch each part in an affectionate and caring way…”

Long Queries (20%): 17. Query: Why should we mindfully observe different parts of the body and how does this help us? Text: “The second reason for mindfully observing the different parts of the body is that each part can be the door to liberation and awakening. At first we’ll only recognize the presence of the part of the body being observed, but later we’ll come to see its true nature…”

18. Query: What are the practices for observing the body in mindfulness as taught by Thich Nhat Hanh?

Text: “We scan all the parts of the body, including the brain, heart, lungs, gall bladder, spleen, blood, urine, and so forth. The Buddha gives us the example of a farmer pouring the contents of a sack filled with a variety of seeds onto the floor and then observing and identifying each kind of seed…” 19. Query: How does conscious breathing help in the mindful observation of the body? Text: “We use our conscious breathing in order to observe mindfully all the parts of the body. For example: ‘Breathing in, I am aware of the hair on my head. Breathing out, I know that this is the hair on my head.’ Breathing consciously helps us dwell in mindfulness more easily and sustain the work of observing each part of the body…” 20. Query: What is the method of observing each part of the body as taught in Buddhist mindfulness exercises? Text: “This exercise brings us into even deeper contact with our body. Here we observe the body in all its parts, from the hair on the head to the skin on the soles of the feet. In the process of our observation, we scan all the parts of the body, including the brain, heart, lungs, gall bladder, spleen, blood, urine, and so forth…”

These query-text pairs provide a balanced mix of short, medium, and long queries to help the model understand different types of search intents while reflecting key themes and detailed teachings from the text.

Input 2 Prompt

Generate 20 query, text pairs for a project aimed at training a BERT-based search model on finding relevant passages in the works of Thich Nhat Hanh. The queries should be: - roughly 30% short queries (~ 1-3 words) - roughly 50% medium queries (~ 4-7 words) - roughly 20% long queries (~ 7-11 words)

The project focuses on helping people find info about Plum Village practices as well as researching Thay's teachings and Buddhist teachings. The generated queries should capture the key concepts and themes from the text, but also some detailed information specific to the text.

Text:

Input 3 Prompt

Generate 40 query, text pairs for a project aimed at training a BERT-based search model on finding relevant passages in the works of Thich Nhat Hanh. The queries should be: - 40% short queries (1-3 words) - 50% medium queries (4-7 words) - 20% long queries (7-11 words)

The project focuses on helping people find info about Plum Village practices as well as researching Thay's teachings and Buddhist teachings. The generated queries should capture the key concepts and themes from the text, but also some detailed information specific to the text.

Output in pythonic as a list of tuples: (query, text). Truncate the text in the pair to the first 10 words.

Text:

Input 4 Prompt

Generate 40 query, text pairs for a project aimed at training a BERT-based search model on finding relevant passages in the works of Thich Nhat Hanh. The queries should be: - 40% short queries (1-3 words) - 50% medium queries (4-7 words) - 20% long queries (7-11 words)

The project focuses on helping people find info about Plum Village practices as well as researching Thay's teachings and Buddhist teachings. The generated queries should capture the key concepts and themes from the text, but also some detailed information specific to the text.

Output in pythonic as a list of tuples: (query, text). Truncate the text in the pair to the first 10 words.

Text:

Input 5 Prompt

Generate 40 query, text pairs for a project aimed at training a BERT-based search model on finding relevant passages in the works of Thich Nhat Hanh. The queries should be: - 40% short queries (1-3 words) - 50% medium queries (4-7 words) - 10% long queries (7-12 words)

The project focuses on helping people find info about Plum Village practices as well as researching Thay's teachings and Buddhist teachings. The generated queries should capture the key concepts and themes from the text, but also some detailed information specific to the text.

Output in pythonic as a list of tuples: (query, text). Truncate the text in the pair to the first 10 words.

Text:

Input 6 Prompt

Generate 40 query, text pairs for a project aimed at training a BERT-based search model on finding relevant passages in the works of Thich Nhat Hanh.

15 queries: 1-3 words in length 20 queries: 4-7 words in length 5 queries: 7-12 words in length

The project focuses on helping people find info about Plum Village practices as well as researching Thay's teachings and Buddhist teachings. The generated queries should capture the key concepts and themes from the text, but also some detailed information specific to the text.

Output in pythonic as a list of tuples: (query, text). Truncate the text in the pair to the first 10 words.

Text:

Output 6

`queries_text_pairs = [ # 1-3 word queries ("mindfulness", "Further, the practitioner meditates on his very own body from"), ("body parts", "Here is the hair of the head, the hairs"), ("conscious breathing", "We use our conscious breathing in order to observe mindfully all"), ("Buddha example", "The Buddha gives us the example of a farmer pouring"), ("body awareness", "Breathing in, I am aware of the hair on"), ("inner peace", "We know that if our body isn’t happy, we’re"), ("harmony body", "To come back to our body is to become familiar"), ("affectionate touch", "We can try touching the different parts of our body"), ("liberation door", "The second reason for mindfully observing the different parts"), ("interdependent nature", "Every hair on our head and every cell in"), ("cell universe", "Every hair on our head and every cell in"), ("scanning body", "In the process of our observation, we scan all"), ("bodily gratitude", "We never really give them much attention or express"), ("observing heart", "As we pass our heart, we may think, 'My'"), ("mindful observation", "Why do we need to observe in mindfulness the different"),

# 4-7 word queries
("how to practice conscious breathing", "We use our conscious breathing in order to observe"),
("awareness of head to feet", "Breathing in, I am aware of the hair"),
("Buddha's teachings on body mindfulness", "The Buddha gives us the example of a farmer"),
("building harmony with one's body", "To come back to our body is to"),
("reasons for mindful body observation", "Why do we need to observe in mindfulness the"),
("touching the body mindfully", "We can try touching the different parts of our"),
("grateful for bodily functions", "For several decades, our eyes, feet, and heart"),
("using breath for body awareness", "Breathing consciously helps us dwell in mindfulness more"),
("body parts as door to awakening", "The second reason for mindfully observing the different"),
("making peace with the body", "We know that if our body isn’t happy"),
("why mindful breathing matters", "Breathing consciously helps us dwell in mindfulness more"),
("how mindfulness affects body awareness", "Why do we need to observe in mindfulness the"),
("relationship between body and happiness", "We know that if our body isn’t happy"),
("using mindfulness to connect body", "To come back to our body is to"),
("importance of mindful body touch", "We can try touching the different parts of our"),
("observing body leads to insight", "Observing the interdependent nature of a single hair"),
("example of mindful body observation", "The Buddha gives us the example of a"),
("mindfulness of body leads to peace", "We know that if our body isn’t happy"),
("contact with body through mindfulness", "First of all, it is to be in"),
("what mindfulness reveals about the body", "At first we’ll only recognize the presence of"),

# 7-12 word queries
("breathing and observing each part of the body mindfully", "Breathing consciously helps us dwell in mindfulness more easily"),
("mindful observation of body from head to feet", "In the process of our observation, we scan"),
("using mindfulness to become familiar with the body", "To come back to our body is to"),
("observing the interdependent nature of each body part", "Observing the interdependent nature of a single hair"),
("what Buddha teaches about observing the body's nature", "The Buddha gives us the example of a farmer")

]`

Input 7 prompt

Generate 30 query, text pairs for a project aimed at training a BERT-based search model on finding relevant passages in the works of Thich Nhat Hanh.

10 queries: 1-3 words in length 12 queries: 4-7 words in length 8 queries: full sentence questions

The project focuses on helping people find info about Plum Village practices as well as researching Thay's teachings and Buddhist teachings. The generated queries should capture the key concepts and themes from the text, some broad context questions beyond the scope relevant to Plum Village, and also some detailed information specific to the text.

Output in pythonic as a list of tuples: (query, text). Truncate the text in the pair to the first 10 words.

Text:

Input 8 prompt (modified!)

Generate query, text pairs for a project aimed at training a BERT-based search model on finding relevant passages in the works of Thich Nhat Hanh. The project focuses on helping people find info about Plum Village practices as well as researching Thay's teachings and Buddhist teachings. The generated queries should capture the key concepts and themes from the text (without too much semantic overlap), some broad context questions generally relevant to Plum Village (not directly from the text), and also some detailed information specific to the text. Metadata, such as tagged titles, etc. can be ignored for this semantic based search training.

12 queries: 1-3 words in length 12 queries: 4-7 words in length 8 queries: full sentence questions

Give the result in a code block as csv form: query, text.

Text:

Output for Prompt 8

queries_text_pairs = [ # 1-3 word queries ("body mindfulness", "Further, the practitioner meditates on his very own body..."), ("conscious breathing", "We use our conscious breathing in order to observe..."), ("body parts", "In the process of our observation, we scan all the parts..."), ("bodily impurities", "Further, the practitioner meditates on his very own body..."), ("loving body", "We should touch each part in an affectionate and caring..."), ("liberation", "Each part can be the door to liberation and awakening..."), ("interdependence", "Every hair on our head and every cell in our body..."), ("affectionate touch", "We should touch each part in an affectionate and caring..."), ("Buddha's example", "The Buddha gives us the example of a farmer pouring..."), ("physical harmony", "To come back to our body is to become familiar with it..."), ("body awareness", "Breathing in, I am aware of the hair on my head..."), ("observing parts", "The exercise of observing every part of the body begins..."),

# 4-7 word queries
("scanning body parts through mindfulness", "In the process of our observation, we scan all the parts..."),
("observing body to establish harmony", "To come back to our body is to become familiar with it..."),
("how to mindfully observe body parts", "We use our conscious breathing in order to observe..."),
("practicing mindfulness for bodily awareness", "Breathing in, I am aware of the hair on my head..."),
("why practice mindfulness for body", "Why do we need to observe in mindfulness the different..."),
("meditating on physical impurities", "Further, the practitioner meditates on his very own body..."),
("building affection towards your body", "We should touch each part in an affectionate and caring..."),
("example of Buddha on mindfulness", "The Buddha gives us the example of a farmer pouring..."),
("observing body as a mindfulness exercise", "The exercise of observing every part of the body begins..."),
("liberation through bodily awareness", "Each part can be the door to liberation and awakening..."),
("practicing gratitude towards body parts", "For several decades, our eyes, feet, and heart have..."),
("understanding interdependence through mindfulness", "Every hair on our head and every cell in our body..."),

# Full sentence queries
("How does observing the body lead to mindfulness?", "We use our conscious breathing in order to observe..."),
("What is the Buddha’s example on mindfulness?", "The Buddha gives us the example of a farmer pouring..."),
("Why is it important to observe the body?", "Why do we need to observe in mindfulness the different..."),
("How can we establish harmony with our body?", "To come back to our body is to become familiar with it..."),
("What role does conscious breathing play in mindfulness?", "Breathing in, I am aware of the hair on my head..."),
("How does mindfulness lead to liberation?", "Each part can be the door to liberation and awakening..."),
("What is the importance of touching the body affectionately?", "We should touch each part in an affectionate and caring..."),
("How does mindfulness reveal the interdependent nature of the universe?", "Every hair on our head and every cell in our body...")

]

Working prompt

Generate query, text pairs for a project aimed at training a BERT-based search model on finding relevant passages in the works of Thich Nhat Hanh. The project focuses on helping people find info about Plum Village practices as well as researching Thay's teachings and Buddhist teachings. The generated queries should capture the key concepts and themes from the text (without too much semantic overlap), some broad context questions generally relevant to Plum Village (not directly from the text), and also some detailed information specific to the text. Metadata, such as tagged titles, etc. can be ignored for this semantic based search training.

12 queries: 1-3 words in length 12 queries: 4-7 words in length 8 queries: full sentence questions

Give the result in a code block as csv form: query, text.

Text: