Tutorial: Managing Feedback Entries Through REST API
Learn to add, update, and delete feedback entries using REST API endpoints.
- Level: Basic
- Time to complete: 10 minutes
- Prerequisites:
- You must have a basic understanding of REST API: HTTP methods, response and request structure, and basic concepts.
- Basic programming knowledge is a plus.
- You must have a deepset Cloud API key. For instructions, see Generate an API Key.
- You must have a deepset Cloud pipeline and some files in your workspace. (You can use the sample files we provide). For help, see Create a Pipeline and Upload Files.
- Goal: After completing this tutorial, you will know how to add, update, and delete feedback for your pipeline's answers using the REST API.
Get Pipeline and Workspace IDs
The feedback API uses workspace and pipeline IDs to identify them.
Get Pipeline ID
Use the Get Pipeline endpoint. You can use the following code snippet (cURL or Python). Fill in:
- workspace name and pipeline name (in the URL).
- your deepset Cloud API key (in headers).
import requests
url = "https://api.cloud.deepset.ai/api/v1/workspaces/<YOUR_WORKSPACE_NAME>/pipelines/<YOUR_PIPELINE_NAME>"
headers = {
"accept": "application/json",
"authorization": "Bearer <DEEPSET_CLOUD_API_KEY>"
}
response = requests.get(url, headers=headers)
print(response.text)
curl --request GET \
--url https://api.cloud.deepset.ai/api/v1/workspaces/<YOUR_WORKSPACE_NAME>/pipelines/<YOUR_PIPELINE_NAME> \
--header 'accept: application/json' \
--header 'authorization: Bearer <DEEPSET_CLOUD_API_KEY>'
Sample response
{
"name": "RAG-QA-Llama3.1-405b",
"pipeline_id": "07b04f1a-e053-4bd1-b3d5-e740b0dd6f2d", /* the pipeline ID*/
"status": "DEPLOYED",
"desired_status": "DEPLOYED",
"created_at": "2024-12-09T11:35:38.218604Z",
"deleted": false,
"is_default": false,
"created_by": {
"given_name": "Jane",
"family_name": "Smith",
"user_id": "f6398740-5555-445d-8ae3-ef980ea4191d"
},
"last_edited_by": {
"given_name": "Jane",
"family_name": "Smith",
"user_id": "f6398740-5555-445d-8ae3-ef980ea4191d"
},
"last_edited_at": "2024-12-09T11:35:44.219398Z",
"supports_prompt": true,
"output_type": "GENERATIVE",
"last_deployed_at": "2024-12-09T11:39:34.767557Z",
"service_level": "DEVELOPMENT",
"idle_timeout_in_seconds": 43200,
"deepset_cloud_version": "v2",
"indexing": {
"pending_file_count": 0,
"failed_file_count": 0
}
}
Get Workspace ID
Use the Get Workspace endpoint. You can also use the code sample below. Make sure you replace:
- workspace name (in the URL).
- your deepset Cloud API key (in headers
import requests
url = "https://api.cloud.deepset.ai/api/v1/workspaces/<YOUR_WORKSPACE_NAME>"
headers = {
"accept": "application/json",
"authorization": "Bearer <DEEPSET_CLOUD_API_KEY>"
}
response = requests.get(url, headers=headers)
print(response.text)
curl --request GET \
--url https://api.cloud.deepset.ai/api/v1/workspaces/<YOUR_WORKSPACE_NAME> \
--header 'accept: application/json' \
--header 'authorization: Bearer <DEEPSET_CLOUD_API_KEY>'
Sample response
{
"name": "legal-chat",
"workspace_id": "b7f048eb-7b48-4ad8-b7b0-443cdddb81c5",
"languages": {},
"default_idle_timeout_in_seconds": 43200
}
Run a Search on Your Pipeline
Ask a query to get a response you can then give feedback on. Use the Search endpoint. You can use this code sample (cURL or Python) as a starting point. In the URL, replace:
YOUR_WORKSPACE_NAME
with the name of the workspace containing the pipeline.YOUR_PIPELINE_NAME
with the name of the pipeline you want to run the search with.
In header
, replace DEEPSET_CLOUD_API_KEY
with your deepset Cloud API key.
import requests
url = "https://api.cloud.deepset.ai/api/v1/workspaces/<YOUR_WORKSPACE_NAME>/pipelines/<YOUR_PIPELINE_NAME>/search"
payload = {
"debug": False,
"view_prompts": False,
"queries": ["what are the symptomps of milk allegry?"]
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"authorization": "Bearer <DEEPSET_CLOUD_API_KEY>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
curl --request POST \
--url https://api.cloud.deepset.ai/api/v1/workspaces/<YOUR_WORKSPACE_NAME>/pipelines/<YOUR_PIPELINE_NAME>/search \
--header 'accept: application/json' \
--header 'authorization: Bearer <DEEPSET_CLOUD_API_KEY>' \
--header 'content-type: application/json' \
--data '
{
"debug": false,
"view_prompts": false,
"queries": [
"what are the symptomps of milk allegry?"
]
}
'
The response contains the query and the result ID, which you'll need to add, update, or delete feedback entries.
Finding the Correct Result and Query IDs
To add a feedback entry, you’ll need the result ID associated with the answer. In the example response below, the result ID is
7e07bd73-c099-44fe-9d65-ec0ba5e83c41
.Keep in mind that each document also has its own result ID. Make sure to use the result ID from the answer itself when adding your feedback.
For the query ID, make sure to use the query ID located in the
results
object. In the example below, it's37547edb-48ec-49c0-96e8-1fcb5f37bd0c
.
Sample response
{
"query_id": "37547edb-48ec-49c0-96e8-1fcb5f37bd0c",
"results": [
{
"query_id": "37547edb-48ec-49c0-96e8-1fcb5f37bd0c",
"query": "What are milk allergy symptomps?",
"answers": [
{
"answer": "Milk allergy symptoms can be immediate or take more time to develop. Immediate signs and symptoms of milk allergy might include:\n\n* Hives\n* Wheezing\n* Itching or tingling feeling around the lips or mouth\n* Swelling of the lips, tongue or throat\n* Coughing or shortness of breath\n* Vomiting\n\nSigns and symptoms that may take more time to develop include:\n\n* Loose stools or diarrhea, which may contain blood\n* Abdominal cramps\n* Runny nose\n* Watery eyes\n* Colic, in babies\n\nAdditionally, mentions some general allergy symptoms that may also apply to milk allergy, including:\n\n* Itchy, irritated skin\n* Nasal stuffiness (congestion)\n* Belly (abdominal) pain\n* Dizziness, lightheadedness or fainting\n\nNote that is not specifically about milk allergy, but about allergies in general. However, the symptoms listed may still be relevant to milk allergy.",
"type": "generative",
"score": null,
"context": null,
"offsets_in_document": [],
"offsets_in_context": [],
"document_id": null,
"document_ids": [
"e7d2cc416005d62d2732e33b0c73c8a29b19e5689dd31c3635eca3d13a4d28d6",
"6ce80daeb86e789ebf57837a5bd539c60835bb3ad6c4fc8405f3365b382fbb61",
"13a4046915e3b7f1ddce5cb4a69494da53972863c2a93470a9bd579787a76902",
"01374947009de69505ab48ce77aff8579c75986101ed3e2b16c9a637b576e293",
"cf0faa27a97156c1fcd25b1970bf77c407267a8110cb5143482e980ba6438e31",
"0813ca29e002b219399bdbbf8ec1ad4a82f206e67e29126d5cdd7639b9894525",
"e81e29ab84fd3d190876a323afb80cffa291c18a54b19e735ae96056346432ba",
"488b2156989f3b1745a7a9bbc8382833e7a94fa228b7d849c03a7b46832bb8e7"
],
"meta": {
"_references": [
{
"answer_end_idx": 13,
"answer_start_idx": 13,
"document_id": "e7d2cc416005d62d2732e33b0c73c8a29b19e5689dd31c3635eca3d13a4d28d6",
"document_position": 1,
"label": "grounded",
"score": 0,
"doc_end_idx": 1559,
"doc_start_idx": 0,
"origin": "llm"
},
{
"answer_end_idx": 18,
"answer_start_idx": 18,
"document_id": "6ce80daeb86e789ebf57837a5bd539c60835bb3ad6c4fc8405f3365b382fbb61",
"document_position": 2,
"label": "grounded",
"score": 0,
"doc_end_idx": 1402,
"doc_start_idx": 0,
"origin": "llm"
},
{
"answer_end_idx": 507,
"answer_start_idx": 507,
"document_id": "488b2156989f3b1745a7a9bbc8382833e7a94fa228b7d849c03a7b46832bb8e7",
"document_position": 8,
"label": "grounded",
"score": 0,
"doc_end_idx": 1576,
"doc_start_idx": 0,
"origin": "llm"
},
{
"answer_end_idx": 729,
"answer_start_idx": 729,
"document_id": "488b2156989f3b1745a7a9bbc8382833e7a94fa228b7d849c03a7b46832bb8e7",
"document_position": 8,
"label": "grounded",
"score": 0,
"doc_end_idx": 1576,
"doc_start_idx": 0,
"origin": "llm"
}
]
},
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"files": [
{
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
{
"id": "04d06fa7-c3ef-4a7d-9244-55c83924e230",
"name": "https___www.mayoclinic.org_diseases-conditions_shellfish-allergy_symptoms-causes_syc-20377503_63c3a1.txt"
}
],
"result_id": "7e07bd73-c099-44fe-9d65-ec0ba5e83c41", /* the result ID you'll need */
"prompt": "<|begin_of_text|><|start_header_id|>user<|end_header_id|>\n\nYou answer questions truthfully based on provided documents.\nFor each document check whether it is related to the question.\nOnly use documents that are related to the question to answer it.\nIgnore documents that are not related to the question.\nIf the answer exists in several documents, summarize them.\nOnly answer based on the documents provided. Don't make things up.\nIf the documents can't answer the question or you are unsure say: 'The answer can't be found in the text'.\nAlways use references in the form [NUMBER OF DOCUMENT] when using information from a document, e.g. [3] for Document[3].\nNever name the documents, only enter a number in square brackets as a reference.\nThe reference must only refer to the number that comes in square brackets after the document.\nOtherwise, do not use brackets in your answer and reference ONLY the number of the document without mentioning the word document.\nThese are the documents:\n\nDocument[1]:\nOverview\nMilk allergy is an atypical immune system response to milk and products containing milk. It's one of the most common food allergies in children. Cow's milk is the usual cause of milk allergy, but milk from sheep, goats, buffalo and other mammals also can cause a reaction.\nAn allergic reaction usually occurs soon after you or your child consumes milk. Signs and symptoms of milk allergy range from mild to severe and can include wheezing, vomiting, hives and digestive problems. Milk allergy can also cause anaphylaxis — a severe, life-threatening reaction.\nAvoiding milk and milk products is the primary treatment for milk allergy. Fortunately, most children outgrow milk allergy. Those who don't outgrow it may need to continue to avoid milk products.\nSymptoms\nMilk allergy symptoms, which differ from person to person, occur a few minutes to a few hours after you or your child drinks milk or eats milk products.\nImmediate signs and symptoms of milk allergy might include:\nHives\nWheezing\nItching or tingling feeling around the lips or mouth\nSwelling of the lips, tongue or throat\nCoughing or shortness of breath\nVomiting\nSigns and symptoms that may take more time to develop include:\nLoose stools or diarrhea, which may contain blood\nAbdominal cramps\nRunny nose\nWatery eyes\nColic, in babies\nMilk allergy or milk intolerance?\nA true milk allergy differs from milk protein intolerance and lactose intolerance. Unlike milk allergy, intolerance doesn't involve the immune system. Milk intolerance requires different treatment from true milk allergy.\n\n\nDocument[2]:\nImmediate signs and symptoms of milk allergy might include:\nHives\nWheezing\nItching or tingling feeling around the lips or mouth\nSwelling of the lips, tongue or throat\nCoughing or shortness of breath\nVomiting\nSigns and symptoms that may take more time to develop include:\nLoose stools or diarrhea, which may contain blood\nAbdominal cramps\nRunny nose\nWatery eyes\nColic, in babies\nMilk allergy or milk intolerance?\nA true milk allergy differs from milk protein intolerance and lactose intolerance. Unlike milk allergy, intolerance doesn't involve the immune system. Milk intolerance requires different treatment from true milk allergy.\nCommon signs and symptoms of milk protein intolerance or lactose intolerance include digestive problems, such as bloating, gas or diarrhea, after consuming milk or products containing milk.\nAnaphylaxis\nMilk allergy can cause anaphylaxis, a life-threatening reaction that narrows the airways and can block breathing. Milk is the third most common food — after peanuts and tree nuts — to cause anaphylaxis.\nIf you or your child has a reaction to milk, tell your health care provider, no matter how mild the reaction. Tests can help confirm milk allergy, so you can avoid future and potentially worse reactions.\nAnaphylaxis is a medical emergency and requires treatment with an epinephrine (adrenaline) shot (EpiPen, Adrenaclick, others) and a trip to the emergency room. \n\nDocument[3]:\nTests can help confirm milk allergy, so you can avoid future and potentially worse reactions.\nAnaphylaxis is a medical emergency and requires treatment with an epinephrine (adrenaline) shot (EpiPen, Adrenaclick, others) and a trip to the emergency room. Signs and symptoms start soon after milk consumption and can include:\nConstriction of airways, including a swollen throat that makes it difficult to breathe\nFacial flushing\nItching\nShock, with a marked drop in blood pressure\nWhen to see a doctor\nSee your provider or an allergist if you or your child experiences milk allergy symptoms shortly after consuming milk. If possible, see your provider during the allergic reaction to help make a diagnosis. Seek emergency treatment if you or your child develops signs or symptoms of anaphylaxis.\nCauses\nAll true food allergies are caused by an immune system malfunction. If you have milk allergy, your immune system identifies certain milk proteins as harmful, triggering the production of immunoglobulin E (IgE) antibodies to neutralize the protein (allergen). The next time you come in contact with these proteins, immunoglobulin E (IgE) antibodies recognize them and signal your immune system to release histamine and other chemicals, causing a range of allergic signs and symptoms.\n\n\nDocument[4]:\nThe next time you come in contact with these proteins, immunoglobulin E (IgE) antibodies recognize them and signal your immune system to release histamine and other chemicals, causing a range of allergic signs and symptoms.\nThere are two main proteins in cow's milk that can cause an allergic reaction:\nCasein, found in the solid part (curd) of milk that curdles\nWhey, found in the liquid part of milk that remains after milk curdles\nYou or your child may be allergic to only one milk protein or to both. These proteins may be hard to avoid because they're also in some processed foods. And most people who react to cow's milk will react to sheep, goat and buffalo milk.\nFood protein-induced enterocolitis syndrome (FPIES)\nA food allergen can also cause what's sometimes called a delayed food allergy. Although any food can be a trigger, milk is one of the most common. The reaction, commonly vomiting and diarrhea, usually occurs within hours after eating the trigger rather than within minutes.\nUnlike some food allergies, food protein-induced enterocolitis syndrome (FPIES) usually resolves over time. As with milk allergy, preventing an FPIES reaction involves avoiding milk and milk products.\nRisk factors\nCertain factors may increase the risk of developing milk allergy:\nOther allergies. Many children who are allergic to milk also have other allergies. Milk allergy may develop before other allergies.\nAtopic dermatitis. \n\nDocument[5]:\nRisk factors\nCertain factors may increase the risk of developing milk allergy:\nOther allergies. Many children who are allergic to milk also have other allergies. Milk allergy may develop before other allergies.\nAtopic dermatitis. Children who have atopic dermatitis — a common, chronic inflammation of the skin — are much more likely to develop a food allergy.\nFamily history. A person's risk of a food allergy increases if one or both parents have a food allergy or another type of allergy or allergic disease — such as hay fever, asthma, hives or eczema.\nAge. Milk allergy is more common in children. As they age, their digestive systems mature, and their bodies are less likely to react to milk.\nComplications\nChildren who are allergic to milk are more likely to develop certain other health problems, including:\nNutritional deficiencies. Because of dietary restrictions and feeding challenges, children with milk allergy may have slowed growth as well as vitamin and mineral deficiencies.\nReduced quality of life. Many common, and sometimes unexpected, foods contain milk, including some salad dressings or even hot dogs. If you or your child is severely allergic, avoiding milk exposure may increase stress or anxiety levels when it comes to making food choices.\nPrevention\nThere's no sure way to prevent a food allergy, but you can prevent reactions by avoiding the food that causes them. If you know you or your child is allergic to milk, avoid milk and milk products.\nRead food labels carefully. \n\nDocument[6]:\nSoy formulas are fortified to be nutritionally complete — but, unfortunately, some children with a milk allergy also develop an allergy to soy.\nIf you're breastfeeding and your child is allergic to milk, cow's milk proteins passed through your breast milk may cause an allergic reaction. You may need to exclude from your diet all products that contain milk. Talk to your health care provider if you know — or suspect — that your child has milk allergy and develops allergy signs and symptoms after breastfeeding.\nIf you or your child is on a milk-free diet, your health care provider or dietitian can help you plan nutritionally balanced meals. You or your child may need to take supplements to replace calcium and nutrients found in milk, such as vitamin D and riboflavin.\n\nDocument[7]:\nDoes your steak have melted butter on it? Was your seafood dipped in milk before cooking?\nIf you're at risk of a serious allergic reaction, talk with your health care provider about carrying and using emergency epinephrine (adrenaline). If you have already had a severe reaction, wear a medical alert bracelet or necklace that lets others know you have a food allergy.\nMilk alternatives for infants\nIn children who are allergic to milk, breastfeeding and the use of hypoallergenic formula can prevent allergic reactions.\nBreastfeeding is the best source of nutrition for your infant. Breastfeeding for as long as possible is recommended, especially if your infant is at high risk of developing milk allergy.\nHypoallergenic formulas are produced by using enzymes to break down (hydrolyze) milk proteins, such as casein or whey. Further processing can include heat and filtering. Depending on their level of processing, products are classified as either partially or extensively hydrolyzed. Or they may also be called elemental formulas.\nSome hypoallergenic formulas aren't milk based, but instead contain amino acids. Besides extensively hydrolyzed products, amino-acid-based formulas are the least likely to cause an allergic reaction.\nSoy-based formulas are based on soy protein instead of milk. Soy formulas are fortified to be nutritionally complete — but, unfortunately, some children with a milk allergy also develop an allergy to soy.\nIf you're breastfeeding and your child is allergic to milk, cow's milk proteins passed through your breast milk may cause an allergic reaction. \n\nDocument[8]:\nThey may include:\nHives\nItchy, irritated skin\nNasal stuffiness (congestion)\nSwelling of the lips, face, tongue and throat, or other parts of the body\nWheezing or trouble breathing\nCoughing and choking or a tight feeling in the throat\nBelly (abdominal) pain, diarrhea, nausea or vomiting\nDizziness, lightheadedness or fainting\nAnaphylaxis\nAllergies can cause a severe, potentially life-threatening allergic reaction known as anaphylaxis. It can occur within seconds to minutes after exposure to something you're allergic to — and worsens quickly.\nAn anaphylactic reaction to shellfish is a medical emergency. Anaphylaxis requires immediate treatment with an epinephrine (adrenaline) injection and a follow-up trip to the emergency room. If anaphylaxis isn't treated right away, it can be fatal.\nAnaphylaxis causes the immune system to release a flood of chemicals that can cause you to go into shock. Signs and symptoms of anaphylaxis include:\nA swollen throat or tongue or a tightness in the throat (airway constriction) that makes it difficult for you to breathe\nCoughing, choking or wheezing with trouble breathing\nShock, with a severe drop in your blood pressure and a rapid or weak pulse\nSevere skin rash, hives, itching or swelling\nNausea, vomiting or diarrhea\nDizziness, lightheadedness or fainting\nWhen to see a doctor\nSeek emergency treatment if you develop signs or symptoms of anaphylaxis.\nSee a health care provider or allergy specialist if you have food allergy symptoms shortly after eating.\nCauses\nAll food allergies are caused by an immune system overreaction. \n\nQuestion: What are milk allergy symptomps? <|eot_id|><|start_header_id|>assistant<|end_header_id|>"
}
],
"documents": [
{
"id": "e7d2cc416005d62d2732e33b0c73c8a29b19e5689dd31c3635eca3d13a4d28d6",
"content": "Overview\nMilk allergy is an atypical immune system response to milk and products containing milk. It's one of the most common food allergies in children. Cow's milk is the usual cause of milk allergy, but milk from sheep, goats, buffalo and other mammals also can cause a reaction.\nAn allergic reaction usually occurs soon after you or your child consumes milk. Signs and symptoms of milk allergy range from mild to severe and can include wheezing, vomiting, hives and digestive problems. Milk allergy can also cause anaphylaxis — a severe, life-threatening reaction.\nAvoiding milk and milk products is the primary treatment for milk allergy. Fortunately, most children outgrow milk allergy. Those who don't outgrow it may need to continue to avoid milk products.\nSymptoms\nMilk allergy symptoms, which differ from person to person, occur a few minutes to a few hours after you or your child drinks milk or eats milk products.\nImmediate signs and symptoms of milk allergy might include:\nHives\nWheezing\nItching or tingling feeling around the lips or mouth\nSwelling of the lips, tongue or throat\nCoughing or shortness of breath\nVomiting\nSigns and symptoms that may take more time to develop include:\nLoose stools or diarrhea, which may contain blood\nAbdominal cramps\nRunny nose\nWatery eyes\nColic, in babies\nMilk allergy or milk intolerance?\nA true milk allergy differs from milk protein intolerance and lactose intolerance. Unlike milk allergy, intolerance doesn't involve the immune system. Milk intolerance requires different treatment from true milk allergy.\n",
"content_type": "text",
"meta": {
"_split_overlap": [
{
"range": [
0,
633
],
"doc_id": "6ce80daeb86e789ebf57837a5bd539c60835bb3ad6c4fc8405f3365b382fbb61"
}
],
"split_idx_start": 0,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"_file_created_at": "2024-12-09T11:08:47.728733+00:00",
"split_id": 0,
"dataset_name": "Healthcare",
"_file_size": 4962,
"page_number": 1,
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e"
},
"score": 0.76318359375,
"embedding": null,
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"result_id": "bc8173bd-0164-4668-999d-ab579681077a"
},
{
"id": "6ce80daeb86e789ebf57837a5bd539c60835bb3ad6c4fc8405f3365b382fbb61",
"content": "Immediate signs and symptoms of milk allergy might include:\nHives\nWheezing\nItching or tingling feeling around the lips or mouth\nSwelling of the lips, tongue or throat\nCoughing or shortness of breath\nVomiting\nSigns and symptoms that may take more time to develop include:\nLoose stools or diarrhea, which may contain blood\nAbdominal cramps\nRunny nose\nWatery eyes\nColic, in babies\nMilk allergy or milk intolerance?\nA true milk allergy differs from milk protein intolerance and lactose intolerance. Unlike milk allergy, intolerance doesn't involve the immune system. Milk intolerance requires different treatment from true milk allergy.\nCommon signs and symptoms of milk protein intolerance or lactose intolerance include digestive problems, such as bloating, gas or diarrhea, after consuming milk or products containing milk.\nAnaphylaxis\nMilk allergy can cause anaphylaxis, a life-threatening reaction that narrows the airways and can block breathing. Milk is the third most common food — after peanuts and tree nuts — to cause anaphylaxis.\nIf you or your child has a reaction to milk, tell your health care provider, no matter how mild the reaction. Tests can help confirm milk allergy, so you can avoid future and potentially worse reactions.\nAnaphylaxis is a medical emergency and requires treatment with an epinephrine (adrenaline) shot (EpiPen, Adrenaclick, others) and a trip to the emergency room. ",
"content_type": "text",
"meta": {
"_split_overlap": [
{
"range": [
926,
1559
],
"doc_id": "e7d2cc416005d62d2732e33b0c73c8a29b19e5689dd31c3635eca3d13a4d28d6"
},
{
"range": [
0,
254
],
"doc_id": "13a4046915e3b7f1ddce5cb4a69494da53972863c2a93470a9bd579787a76902"
}
],
"split_idx_start": 926,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"_file_created_at": "2024-12-09T11:08:47.728733+00:00",
"split_id": 1,
"dataset_name": "Healthcare",
"_file_size": 4962,
"page_number": 1,
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e"
},
"score": 0.6025390625,
"embedding": null,
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"result_id": "8c702ffb-9170-4b8d-a5f4-6a35a6b2ff36"
},
{
"id": "13a4046915e3b7f1ddce5cb4a69494da53972863c2a93470a9bd579787a76902",
"content": "Tests can help confirm milk allergy, so you can avoid future and potentially worse reactions.\nAnaphylaxis is a medical emergency and requires treatment with an epinephrine (adrenaline) shot (EpiPen, Adrenaclick, others) and a trip to the emergency room. Signs and symptoms start soon after milk consumption and can include:\nConstriction of airways, including a swollen throat that makes it difficult to breathe\nFacial flushing\nItching\nShock, with a marked drop in blood pressure\nWhen to see a doctor\nSee your provider or an allergist if you or your child experiences milk allergy symptoms shortly after consuming milk. If possible, see your provider during the allergic reaction to help make a diagnosis. Seek emergency treatment if you or your child develops signs or symptoms of anaphylaxis.\nCauses\nAll true food allergies are caused by an immune system malfunction. If you have milk allergy, your immune system identifies certain milk proteins as harmful, triggering the production of immunoglobulin E (IgE) antibodies to neutralize the protein (allergen). The next time you come in contact with these proteins, immunoglobulin E (IgE) antibodies recognize them and signal your immune system to release histamine and other chemicals, causing a range of allergic signs and symptoms.\n",
"content_type": "text",
"meta": {
"_split_overlap": [
{
"range": [
1148,
1402
],
"doc_id": "6ce80daeb86e789ebf57837a5bd539c60835bb3ad6c4fc8405f3365b382fbb61"
},
{
"range": [
0,
224
],
"doc_id": "01374947009de69505ab48ce77aff8579c75986101ed3e2b16c9a637b576e293"
}
],
"split_idx_start": 2074,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"_file_created_at": "2024-12-09T11:08:47.728733+00:00",
"split_id": 2,
"dataset_name": "Healthcare",
"_file_size": 4962,
"page_number": 1,
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e"
},
"score": 0.1593017578125,
"embedding": null,
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"result_id": "b4e68189-dfb3-4fa3-a987-28529dfbba05"
},
{
"id": "01374947009de69505ab48ce77aff8579c75986101ed3e2b16c9a637b576e293",
"content": "The next time you come in contact with these proteins, immunoglobulin E (IgE) antibodies recognize them and signal your immune system to release histamine and other chemicals, causing a range of allergic signs and symptoms.\nThere are two main proteins in cow's milk that can cause an allergic reaction:\nCasein, found in the solid part (curd) of milk that curdles\nWhey, found in the liquid part of milk that remains after milk curdles\nYou or your child may be allergic to only one milk protein or to both. These proteins may be hard to avoid because they're also in some processed foods. And most people who react to cow's milk will react to sheep, goat and buffalo milk.\nFood protein-induced enterocolitis syndrome (FPIES)\nA food allergen can also cause what's sometimes called a delayed food allergy. Although any food can be a trigger, milk is one of the most common. The reaction, commonly vomiting and diarrhea, usually occurs within hours after eating the trigger rather than within minutes.\nUnlike some food allergies, food protein-induced enterocolitis syndrome (FPIES) usually resolves over time. As with milk allergy, preventing an FPIES reaction involves avoiding milk and milk products.\nRisk factors\nCertain factors may increase the risk of developing milk allergy:\nOther allergies. Many children who are allergic to milk also have other allergies. Milk allergy may develop before other allergies.\nAtopic dermatitis. ",
"content_type": "text",
"meta": {
"_split_overlap": [
{
"range": [
1060,
1284
],
"doc_id": "13a4046915e3b7f1ddce5cb4a69494da53972863c2a93470a9bd579787a76902"
},
{
"range": [
0,
230
],
"doc_id": "cf0faa27a97156c1fcd25b1970bf77c407267a8110cb5143482e980ba6438e31"
}
],
"split_idx_start": 3134,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"_file_created_at": "2024-12-09T11:08:47.728733+00:00",
"split_id": 3,
"dataset_name": "Healthcare",
"_file_size": 4962,
"page_number": 1,
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e"
},
"score": 0.1376953125,
"embedding": null,
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"result_id": "774c03b5-87ee-453d-9ca4-7688a8f70335"
},
{
"id": "cf0faa27a97156c1fcd25b1970bf77c407267a8110cb5143482e980ba6438e31",
"content": "Risk factors\nCertain factors may increase the risk of developing milk allergy:\nOther allergies. Many children who are allergic to milk also have other allergies. Milk allergy may develop before other allergies.\nAtopic dermatitis. Children who have atopic dermatitis — a common, chronic inflammation of the skin — are much more likely to develop a food allergy.\nFamily history. A person's risk of a food allergy increases if one or both parents have a food allergy or another type of allergy or allergic disease — such as hay fever, asthma, hives or eczema.\nAge. Milk allergy is more common in children. As they age, their digestive systems mature, and their bodies are less likely to react to milk.\nComplications\nChildren who are allergic to milk are more likely to develop certain other health problems, including:\nNutritional deficiencies. Because of dietary restrictions and feeding challenges, children with milk allergy may have slowed growth as well as vitamin and mineral deficiencies.\nReduced quality of life. Many common, and sometimes unexpected, foods contain milk, including some salad dressings or even hot dogs. If you or your child is severely allergic, avoiding milk exposure may increase stress or anxiety levels when it comes to making food choices.\nPrevention\nThere's no sure way to prevent a food allergy, but you can prevent reactions by avoiding the food that causes them. If you know you or your child is allergic to milk, avoid milk and milk products.\nRead food labels carefully. ",
"content_type": "text",
"meta": {
"_split_overlap": [
{
"range": [
1198,
1428
],
"doc_id": "01374947009de69505ab48ce77aff8579c75986101ed3e2b16c9a637b576e293"
},
{
"range": [
0,
236
],
"doc_id": "f7571820008fb10ef49414199539bbdffc6dc28cbdaf775a63cd05ae00a6d155"
}
],
"split_idx_start": 4332,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"_file_created_at": "2024-12-09T11:08:47.728733+00:00",
"split_id": 4,
"dataset_name": "Healthcare",
"_file_size": 4962,
"page_number": 1,
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e"
},
"score": 0.05224609375,
"embedding": null,
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"result_id": "b304143d-5c83-40be-b9f3-422fee1e9952"
},
{
"id": "0813ca29e002b219399bdbbf8ec1ad4a82f206e67e29126d5cdd7639b9894525",
"content": "Soy formulas are fortified to be nutritionally complete — but, unfortunately, some children with a milk allergy also develop an allergy to soy.\nIf you're breastfeeding and your child is allergic to milk, cow's milk proteins passed through your breast milk may cause an allergic reaction. You may need to exclude from your diet all products that contain milk. Talk to your health care provider if you know — or suspect — that your child has milk allergy and develops allergy signs and symptoms after breastfeeding.\nIf you or your child is on a milk-free diet, your health care provider or dietitian can help you plan nutritionally balanced meals. You or your child may need to take supplements to replace calcium and nutrients found in milk, such as vitamin D and riboflavin.",
"content_type": "text",
"meta": {
"_split_overlap": [
{
"range": [
1297,
1585
],
"doc_id": "e81e29ab84fd3d190876a323afb80cffa291c18a54b19e735ae96056346432ba"
}
],
"split_idx_start": 8221,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"_file_created_at": "2024-12-09T11:08:47.728733+00:00",
"split_id": 7,
"dataset_name": "Healthcare",
"_file_size": 4962,
"page_number": 1,
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e"
},
"score": 0.051666259765625,
"embedding": null,
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"result_id": "9c033d90-a592-46aa-976f-d884047a1a6e"
},
{
"id": "e81e29ab84fd3d190876a323afb80cffa291c18a54b19e735ae96056346432ba",
"content": "Does your steak have melted butter on it? Was your seafood dipped in milk before cooking?\nIf you're at risk of a serious allergic reaction, talk with your health care provider about carrying and using emergency epinephrine (adrenaline). If you have already had a severe reaction, wear a medical alert bracelet or necklace that lets others know you have a food allergy.\nMilk alternatives for infants\nIn children who are allergic to milk, breastfeeding and the use of hypoallergenic formula can prevent allergic reactions.\nBreastfeeding is the best source of nutrition for your infant. Breastfeeding for as long as possible is recommended, especially if your infant is at high risk of developing milk allergy.\nHypoallergenic formulas are produced by using enzymes to break down (hydrolyze) milk proteins, such as casein or whey. Further processing can include heat and filtering. Depending on their level of processing, products are classified as either partially or extensively hydrolyzed. Or they may also be called elemental formulas.\nSome hypoallergenic formulas aren't milk based, but instead contain amino acids. Besides extensively hydrolyzed products, amino-acid-based formulas are the least likely to cause an allergic reaction.\nSoy-based formulas are based on soy protein instead of milk. Soy formulas are fortified to be nutritionally complete — but, unfortunately, some children with a milk allergy also develop an allergy to soy.\nIf you're breastfeeding and your child is allergic to milk, cow's milk proteins passed through your breast milk may cause an allergic reaction. ",
"content_type": "text",
"meta": {
"_split_overlap": [
{
"range": [
1324,
1561
],
"doc_id": "f7571820008fb10ef49414199539bbdffc6dc28cbdaf775a63cd05ae00a6d155"
},
{
"range": [
0,
288
],
"doc_id": "0813ca29e002b219399bdbbf8ec1ad4a82f206e67e29126d5cdd7639b9894525"
}
],
"split_idx_start": 6924,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"_file_created_at": "2024-12-09T11:08:47.728733+00:00",
"split_id": 6,
"dataset_name": "Healthcare",
"_file_size": 4962,
"page_number": 1,
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e"
},
"score": 0.0341796875,
"embedding": null,
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"result_id": "1b5869e2-0233-4255-a875-65748b4151b9"
},
{
"id": "488b2156989f3b1745a7a9bbc8382833e7a94fa228b7d849c03a7b46832bb8e7",
"content": "They may include:\nHives\nItchy, irritated skin\nNasal stuffiness (congestion)\nSwelling of the lips, face, tongue and throat, or other parts of the body\nWheezing or trouble breathing\nCoughing and choking or a tight feeling in the throat\nBelly (abdominal) pain, diarrhea, nausea or vomiting\nDizziness, lightheadedness or fainting\nAnaphylaxis\nAllergies can cause a severe, potentially life-threatening allergic reaction known as anaphylaxis. It can occur within seconds to minutes after exposure to something you're allergic to — and worsens quickly.\nAn anaphylactic reaction to shellfish is a medical emergency. Anaphylaxis requires immediate treatment with an epinephrine (adrenaline) injection and a follow-up trip to the emergency room. If anaphylaxis isn't treated right away, it can be fatal.\nAnaphylaxis causes the immune system to release a flood of chemicals that can cause you to go into shock. Signs and symptoms of anaphylaxis include:\nA swollen throat or tongue or a tightness in the throat (airway constriction) that makes it difficult for you to breathe\nCoughing, choking or wheezing with trouble breathing\nShock, with a severe drop in your blood pressure and a rapid or weak pulse\nSevere skin rash, hives, itching or swelling\nNausea, vomiting or diarrhea\nDizziness, lightheadedness or fainting\nWhen to see a doctor\nSeek emergency treatment if you develop signs or symptoms of anaphylaxis.\nSee a health care provider or allergy specialist if you have food allergy symptoms shortly after eating.\nCauses\nAll food allergies are caused by an immune system overreaction. ",
"content_type": "text",
"meta": {
"_split_overlap": [
{
"range": [
977,
1585
],
"doc_id": "9b92616ee62b77dd44659f9b3589516d24587eea08bddc375bc2dc7fc6deb84a"
},
{
"range": [
0,
676
],
"doc_id": "c894391a5e0feafe8251959fc0aa0942cf95bc085998374c9936ad693e00e979"
}
],
"split_idx_start": 977,
"file_name": "https___www.mayoclinic.org_diseases-conditions_shellfish-allergy_symptoms-causes_syc-20377503_63c3a1.txt",
"_file_created_at": "2024-12-09T11:08:47.728733+00:00",
"split_id": 1,
"dataset_name": "Healthcare",
"_file_size": 9017,
"page_number": 1,
"source_id": "35308e27d89136421775a7c1d7e7c709e7b938ebff990548bcdd383940031f4c"
},
"score": 0.026763916015625,
"embedding": null,
"file": {
"id": "04d06fa7-c3ef-4a7d-9244-55c83924e230",
"name": "https___www.mayoclinic.org_diseases-conditions_shellfish-allergy_symptoms-causes_syc-20377503_63c3a1.txt"
},
"result_id": "bfc1a187-4654-48d6-9339-2b81dbe4f5b2"
}
],
"_debug": null,
"prompts": null
}
]
}
Add, Update, and Delete Feedback
Add a Feedback Entry
Add feedback to an answer your pipeline returned. Use the Create Feedback endpoint. You can assign one of the feedback scores:
ACCURATE
(corresponds to the thumbs up icon in the UI)INACCURATE
(corresponds to the thumbs down icon in the UI)FAIRLY_ACCURATE
(corresponds to the mixed/neutral icon in the UI)
You need the following IDs to make the request:
- Workspace ID (from the Get Workspace endpoint)
- Pipeline ID (from the Get Pipeline endpoint)
- Query ID (from the Search endpoint)
- Result ID (from the Search endpoint)
You can use this code replacing the IDs and your deepset Cloud API key:
import requests
url = "https://api.cloud.deepset.ai/api/v2/workspaces/<WORKSPACE_ID>/pipelines/<PIPELINE_ID>/feedback"
payload = {
"query_id": "<QUERY_ID>",
"result_id": "<RESULT_ID>",
"score": "<SCORE>"
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"authorization": "Bearer <DEEPSET_CLOUD_API_KEY>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
curl --request POST \
--url https://api.cloud.deepset.ai/api/v2/workspaces/<WORKSPACE_ID>/pipelines/<PIPELINE_ID>/feedback \
--header 'accept: application/json' \
--header 'authorization: Bearer <DEEPSET_CLOUD_API_KEY>' \
--header 'content-type: application/json' \
--data '
{
"query_id": "<QUERY_ID>",
"result_id": "<RESULT_ID>",
"score": "<SCORE>"
}
'
The response includes the feedback ID, which you will need to update or delete the feedback entry.
Sample response
{
"score": "ACCURATE",
"comment": null,
"bookmarked": false,
"tags": [],
"result_id": "7e07bd73-c099-44fe-9d65-ec0ba5e83c41",
"feedback_id": "2fcba96d-8ae3-4572-af4c-47a9aed536a7", /*this is the feedback ID*/
"organization_id": "4f26a3b2-03fc-4742-a4b1-8c3dae2b2d2a",
"workspace_id": "b7f048eb-7b48-4ad8-b7b0-443cdddb81c5",
"pipeline_id": "07b04f1a-e053-4bd1-b3d5-e740b0dd6f2d",
"created_by": {
"user_id": "f6398740-5555-445d-8ae3-ef980ea4191d",
"given_name": "Jane",
"family_name": "Smith"
},
"created_at": "2024-12-10T11:56:13.884352Z",
"search_history": {
"search_history_result_id": "7e07bd73-c099-44fe-9d65-ec0ba5e83c41",
"query_id": "37547edb-48ec-49c0-96e8-1fcb5f37bd0c",
"documents": [
{
"id": "e7d2cc416005d62d2732e33b0c73c8a29b19e5689dd31c3635eca3d13a4d28d6",
"content": "Overview\nMilk allergy is an atypical immune system response to milk and products containing milk. It's one of the most common food allergies in children. Cow's milk is the usual cause of milk allergy, but milk from sheep, goats, buffalo and other mammals also can cause a reaction.\nAn allergic reaction usually occurs soon after you or your child consumes milk. Signs and symptoms of milk allergy range from mild to severe and can include wheezing, vomiting, hives and digestive problems. Milk allergy can also cause anaphylaxis — a severe, life-threatening reaction.\nAvoiding milk and milk products is the primary treatment for milk allergy. Fortunately, most children outgrow milk allergy. Those who don't outgrow it may need to continue to avoid milk products.\nSymptoms\nMilk allergy symptoms, which differ from person to person, occur a few minutes to a few hours after you or your child drinks milk or eats milk products.\nImmediate signs and symptoms of milk allergy might include:\nHives\nWheezing\nItching or tingling feeling around the lips or mouth\nSwelling of the lips, tongue or throat\nCoughing or shortness of breath\nVomiting\nSigns and symptoms that may take more time to develop include:\nLoose stools or diarrhea, which may contain blood\nAbdominal cramps\nRunny nose\nWatery eyes\nColic, in babies\nMilk allergy or milk intolerance?\nA true milk allergy differs from milk protein intolerance and lactose intolerance. Unlike milk allergy, intolerance doesn't involve the immune system. Milk intolerance requires different treatment from true milk allergy.\n",
"content_type": "text",
"meta": {
"_split_overlap": [
{
"range": [
0,
633
],
"doc_id": "6ce80daeb86e789ebf57837a5bd539c60835bb3ad6c4fc8405f3365b382fbb61"
}
],
"split_idx_start": 0,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"_file_created_at": "2024-12-09T11:08:47.728733+00:00",
"split_id": 0,
"dataset_name": "Healthcare",
"_file_size": 4962,
"page_number": 1,
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e"
},
"score": 0.76318359375,
"embedding": null,
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"result_id": "bc8173bd-0164-4668-999d-ab579681077a"
},
{
"id": "6ce80daeb86e789ebf57837a5bd539c60835bb3ad6c4fc8405f3365b382fbb61",
"content": "Immediate signs and symptoms of milk allergy might include:\nHives\nWheezing\nItching or tingling feeling around the lips or mouth\nSwelling of the lips, tongue or throat\nCoughing or shortness of breath\nVomiting\nSigns and symptoms that may take more time to develop include:\nLoose stools or diarrhea, which may contain blood\nAbdominal cramps\nRunny nose\nWatery eyes\nColic, in babies\nMilk allergy or milk intolerance?\nA true milk allergy differs from milk protein intolerance and lactose intolerance. Unlike milk allergy, intolerance doesn't involve the immune system. Milk intolerance requires different treatment from true milk allergy.\nCommon signs and symptoms of milk protein intolerance or lactose intolerance include digestive problems, such as bloating, gas or diarrhea, after consuming milk or products containing milk.\nAnaphylaxis\nMilk allergy can cause anaphylaxis, a life-threatening reaction that narrows the airways and can block breathing. Milk is the third most common food — after peanuts and tree nuts — to cause anaphylaxis.\nIf you or your child has a reaction to milk, tell your health care provider, no matter how mild the reaction. Tests can help confirm milk allergy, so you can avoid future and potentially worse reactions.\nAnaphylaxis is a medical emergency and requires treatment with an epinephrine (adrenaline) shot (EpiPen, Adrenaclick, others) and a trip to the emergency room. ",
"content_type": "text",
"meta": {
"_split_overlap": [
{
"range": [
926,
1559
],
"doc_id": "e7d2cc416005d62d2732e33b0c73c8a29b19e5689dd31c3635eca3d13a4d28d6"
},
{
"range": [
0,
254
],
"doc_id": "13a4046915e3b7f1ddce5cb4a69494da53972863c2a93470a9bd579787a76902"
}
],
"split_idx_start": 926,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"_file_created_at": "2024-12-09T11:08:47.728733+00:00",
"split_id": 1,
"dataset_name": "Healthcare",
"_file_size": 4962,
"page_number": 1,
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e"
},
"score": 0.6025390625,
"embedding": null,
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"result_id": "8c702ffb-9170-4b8d-a5f4-6a35a6b2ff36"
},
{
"id": "13a4046915e3b7f1ddce5cb4a69494da53972863c2a93470a9bd579787a76902",
"content": "Tests can help confirm milk allergy, so you can avoid future and potentially worse reactions.\nAnaphylaxis is a medical emergency and requires treatment with an epinephrine (adrenaline) shot (EpiPen, Adrenaclick, others) and a trip to the emergency room. Signs and symptoms start soon after milk consumption and can include:\nConstriction of airways, including a swollen throat that makes it difficult to breathe\nFacial flushing\nItching\nShock, with a marked drop in blood pressure\nWhen to see a doctor\nSee your provider or an allergist if you or your child experiences milk allergy symptoms shortly after consuming milk. If possible, see your provider during the allergic reaction to help make a diagnosis. Seek emergency treatment if you or your child develops signs or symptoms of anaphylaxis.\nCauses\nAll true food allergies are caused by an immune system malfunction. If you have milk allergy, your immune system identifies certain milk proteins as harmful, triggering the production of immunoglobulin E (IgE) antibodies to neutralize the protein (allergen). The next time you come in contact with these proteins, immunoglobulin E (IgE) antibodies recognize them and signal your immune system to release histamine and other chemicals, causing a range of allergic signs and symptoms.\n",
"content_type": "text",
"meta": {
"_split_overlap": [
{
"range": [
1148,
1402
],
"doc_id": "6ce80daeb86e789ebf57837a5bd539c60835bb3ad6c4fc8405f3365b382fbb61"
},
{
"range": [
0,
224
],
"doc_id": "01374947009de69505ab48ce77aff8579c75986101ed3e2b16c9a637b576e293"
}
],
"split_idx_start": 2074,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"_file_created_at": "2024-12-09T11:08:47.728733+00:00",
"split_id": 2,
"dataset_name": "Healthcare",
"_file_size": 4962,
"page_number": 1,
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e"
},
"score": 0.1593017578125,
"embedding": null,
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"result_id": "b4e68189-dfb3-4fa3-a987-28529dfbba05"
},
{
"id": "01374947009de69505ab48ce77aff8579c75986101ed3e2b16c9a637b576e293",
"content": "The next time you come in contact with these proteins, immunoglobulin E (IgE) antibodies recognize them and signal your immune system to release histamine and other chemicals, causing a range of allergic signs and symptoms.\nThere are two main proteins in cow's milk that can cause an allergic reaction:\nCasein, found in the solid part (curd) of milk that curdles\nWhey, found in the liquid part of milk that remains after milk curdles\nYou or your child may be allergic to only one milk protein or to both. These proteins may be hard to avoid because they're also in some processed foods. And most people who react to cow's milk will react to sheep, goat and buffalo milk.\nFood protein-induced enterocolitis syndrome (FPIES)\nA food allergen can also cause what's sometimes called a delayed food allergy. Although any food can be a trigger, milk is one of the most common. The reaction, commonly vomiting and diarrhea, usually occurs within hours after eating the trigger rather than within minutes.\nUnlike some food allergies, food protein-induced enterocolitis syndrome (FPIES) usually resolves over time. As with milk allergy, preventing an FPIES reaction involves avoiding milk and milk products.\nRisk factors\nCertain factors may increase the risk of developing milk allergy:\nOther allergies. Many children who are allergic to milk also have other allergies. Milk allergy may develop before other allergies.\nAtopic dermatitis. ",
"content_type": "text",
"meta": {
"_split_overlap": [
{
"range": [
1060,
1284
],
"doc_id": "13a4046915e3b7f1ddce5cb4a69494da53972863c2a93470a9bd579787a76902"
},
{
"range": [
0,
230
],
"doc_id": "cf0faa27a97156c1fcd25b1970bf77c407267a8110cb5143482e980ba6438e31"
}
],
"split_idx_start": 3134,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"_file_created_at": "2024-12-09T11:08:47.728733+00:00",
"split_id": 3,
"dataset_name": "Healthcare",
"_file_size": 4962,
"page_number": 1,
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e"
},
"score": 0.1376953125,
"embedding": null,
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"result_id": "774c03b5-87ee-453d-9ca4-7688a8f70335"
},
{
"id": "cf0faa27a97156c1fcd25b1970bf77c407267a8110cb5143482e980ba6438e31",
"content": "Risk factors\nCertain factors may increase the risk of developing milk allergy:\nOther allergies. Many children who are allergic to milk also have other allergies. Milk allergy may develop before other allergies.\nAtopic dermatitis. Children who have atopic dermatitis — a common, chronic inflammation of the skin — are much more likely to develop a food allergy.\nFamily history. A person's risk of a food allergy increases if one or both parents have a food allergy or another type of allergy or allergic disease — such as hay fever, asthma, hives or eczema.\nAge. Milk allergy is more common in children. As they age, their digestive systems mature, and their bodies are less likely to react to milk.\nComplications\nChildren who are allergic to milk are more likely to develop certain other health problems, including:\nNutritional deficiencies. Because of dietary restrictions and feeding challenges, children with milk allergy may have slowed growth as well as vitamin and mineral deficiencies.\nReduced quality of life. Many common, and sometimes unexpected, foods contain milk, including some salad dressings or even hot dogs. If you or your child is severely allergic, avoiding milk exposure may increase stress or anxiety levels when it comes to making food choices.\nPrevention\nThere's no sure way to prevent a food allergy, but you can prevent reactions by avoiding the food that causes them. If you know you or your child is allergic to milk, avoid milk and milk products.\nRead food labels carefully. ",
"content_type": "text",
"meta": {
"_split_overlap": [
{
"range": [
1198,
1428
],
"doc_id": "01374947009de69505ab48ce77aff8579c75986101ed3e2b16c9a637b576e293"
},
{
"range": [
0,
236
],
"doc_id": "f7571820008fb10ef49414199539bbdffc6dc28cbdaf775a63cd05ae00a6d155"
}
],
"split_idx_start": 4332,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"_file_created_at": "2024-12-09T11:08:47.728733+00:00",
"split_id": 4,
"dataset_name": "Healthcare",
"_file_size": 4962,
"page_number": 1,
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e"
},
"score": 0.05224609375,
"embedding": null,
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"result_id": "b304143d-5c83-40be-b9f3-422fee1e9952"
},
{
"id": "0813ca29e002b219399bdbbf8ec1ad4a82f206e67e29126d5cdd7639b9894525",
"content": "Soy formulas are fortified to be nutritionally complete — but, unfortunately, some children with a milk allergy also develop an allergy to soy.\nIf you're breastfeeding and your child is allergic to milk, cow's milk proteins passed through your breast milk may cause an allergic reaction. You may need to exclude from your diet all products that contain milk. Talk to your health care provider if you know — or suspect — that your child has milk allergy and develops allergy signs and symptoms after breastfeeding.\nIf you or your child is on a milk-free diet, your health care provider or dietitian can help you plan nutritionally balanced meals. You or your child may need to take supplements to replace calcium and nutrients found in milk, such as vitamin D and riboflavin.",
"content_type": "text",
"meta": {
"_split_overlap": [
{
"range": [
1297,
1585
],
"doc_id": "e81e29ab84fd3d190876a323afb80cffa291c18a54b19e735ae96056346432ba"
}
],
"split_idx_start": 8221,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"_file_created_at": "2024-12-09T11:08:47.728733+00:00",
"split_id": 7,
"dataset_name": "Healthcare",
"_file_size": 4962,
"page_number": 1,
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e"
},
"score": 0.051666259765625,
"embedding": null,
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"result_id": "9c033d90-a592-46aa-976f-d884047a1a6e"
},
{
"id": "e81e29ab84fd3d190876a323afb80cffa291c18a54b19e735ae96056346432ba",
"content": "Does your steak have melted butter on it? Was your seafood dipped in milk before cooking?\nIf you're at risk of a serious allergic reaction, talk with your health care provider about carrying and using emergency epinephrine (adrenaline). If you have already had a severe reaction, wear a medical alert bracelet or necklace that lets others know you have a food allergy.\nMilk alternatives for infants\nIn children who are allergic to milk, breastfeeding and the use of hypoallergenic formula can prevent allergic reactions.\nBreastfeeding is the best source of nutrition for your infant. Breastfeeding for as long as possible is recommended, especially if your infant is at high risk of developing milk allergy.\nHypoallergenic formulas are produced by using enzymes to break down (hydrolyze) milk proteins, such as casein or whey. Further processing can include heat and filtering. Depending on their level of processing, products are classified as either partially or extensively hydrolyzed. Or they may also be called elemental formulas.\nSome hypoallergenic formulas aren't milk based, but instead contain amino acids. Besides extensively hydrolyzed products, amino-acid-based formulas are the least likely to cause an allergic reaction.\nSoy-based formulas are based on soy protein instead of milk. Soy formulas are fortified to be nutritionally complete — but, unfortunately, some children with a milk allergy also develop an allergy to soy.\nIf you're breastfeeding and your child is allergic to milk, cow's milk proteins passed through your breast milk may cause an allergic reaction. ",
"content_type": "text",
"meta": {
"_split_overlap": [
{
"range": [
1324,
1561
],
"doc_id": "f7571820008fb10ef49414199539bbdffc6dc28cbdaf775a63cd05ae00a6d155"
},
{
"range": [
0,
288
],
"doc_id": "0813ca29e002b219399bdbbf8ec1ad4a82f206e67e29126d5cdd7639b9894525"
}
],
"split_idx_start": 6924,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"_file_created_at": "2024-12-09T11:08:47.728733+00:00",
"split_id": 6,
"dataset_name": "Healthcare",
"_file_size": 4962,
"page_number": 1,
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e"
},
"score": 0.0341796875,
"embedding": null,
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"result_id": "1b5869e2-0233-4255-a875-65748b4151b9"
},
{
"id": "488b2156989f3b1745a7a9bbc8382833e7a94fa228b7d849c03a7b46832bb8e7",
"content": "They may include:\nHives\nItchy, irritated skin\nNasal stuffiness (congestion)\nSwelling of the lips, face, tongue and throat, or other parts of the body\nWheezing or trouble breathing\nCoughing and choking or a tight feeling in the throat\nBelly (abdominal) pain, diarrhea, nausea or vomiting\nDizziness, lightheadedness or fainting\nAnaphylaxis\nAllergies can cause a severe, potentially life-threatening allergic reaction known as anaphylaxis. It can occur within seconds to minutes after exposure to something you're allergic to — and worsens quickly.\nAn anaphylactic reaction to shellfish is a medical emergency. Anaphylaxis requires immediate treatment with an epinephrine (adrenaline) injection and a follow-up trip to the emergency room. If anaphylaxis isn't treated right away, it can be fatal.\nAnaphylaxis causes the immune system to release a flood of chemicals that can cause you to go into shock. Signs and symptoms of anaphylaxis include:\nA swollen throat or tongue or a tightness in the throat (airway constriction) that makes it difficult for you to breathe\nCoughing, choking or wheezing with trouble breathing\nShock, with a severe drop in your blood pressure and a rapid or weak pulse\nSevere skin rash, hives, itching or swelling\nNausea, vomiting or diarrhea\nDizziness, lightheadedness or fainting\nWhen to see a doctor\nSeek emergency treatment if you develop signs or symptoms of anaphylaxis.\nSee a health care provider or allergy specialist if you have food allergy symptoms shortly after eating.\nCauses\nAll food allergies are caused by an immune system overreaction. ",
"content_type": "text",
"meta": {
"_split_overlap": [
{
"range": [
977,
1585
],
"doc_id": "9b92616ee62b77dd44659f9b3589516d24587eea08bddc375bc2dc7fc6deb84a"
},
{
"range": [
0,
676
],
"doc_id": "c894391a5e0feafe8251959fc0aa0942cf95bc085998374c9936ad693e00e979"
}
],
"split_idx_start": 977,
"file_name": "https___www.mayoclinic.org_diseases-conditions_shellfish-allergy_symptoms-causes_syc-20377503_63c3a1.txt",
"_file_created_at": "2024-12-09T11:08:47.728733+00:00",
"split_id": 1,
"dataset_name": "Healthcare",
"_file_size": 9017,
"page_number": 1,
"source_id": "35308e27d89136421775a7c1d7e7c709e7b938ebff990548bcdd383940031f4c"
},
"score": 0.026763916015625,
"embedding": null,
"file": {
"id": "04d06fa7-c3ef-4a7d-9244-55c83924e230",
"name": "https___www.mayoclinic.org_diseases-conditions_shellfish-allergy_symptoms-causes_syc-20377503_63c3a1.txt"
},
"result_id": "bfc1a187-4654-48d6-9339-2b81dbe4f5b2"
}
],
"type": "generative",
"rank": 1,
"score": null,
"files": [
{
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
{
"id": "04d06fa7-c3ef-4a7d-9244-55c83924e230",
"name": "https___www.mayoclinic.org_diseases-conditions_shellfish-allergy_symptoms-causes_syc-20377503_63c3a1.txt"
}
],
"context": null,
"answer": "According to and , milk allergy symptoms can be immediate or take more time to develop. Immediate signs and symptoms of milk allergy might include:\n\n* Hives\n* Wheezing\n* Itching or tingling feeling around the lips or mouth\n* Swelling of the lips, tongue or throat\n* Coughing or shortness of breath\n* Vomiting\n\nSigns and symptoms that may take more time to develop include:\n\n* Loose stools or diarrhea, which may contain blood\n* Abdominal cramps\n* Runny nose\n* Watery eyes\n* Colic, in babies\n\nAdditionally, mentions some general allergy symptoms that may also apply to milk allergy, including:\n\n* Itchy, irritated skin\n* Nasal stuffiness (congestion)\n* Belly (abdominal) pain\n* Dizziness, lightheadedness or fainting\n\nNote that is not specifically about milk allergy, but about allergies in general. However, the symptoms listed may still be relevant to milk allergy.",
"meta": {
"_references": [
{
"answer_end_idx": 13,
"answer_start_idx": 13,
"document_id": "e7d2cc416005d62d2732e33b0c73c8a29b19e5689dd31c3635eca3d13a4d28d6",
"document_position": 1,
"label": "grounded",
"score": 0,
"doc_end_idx": 1559,
"doc_start_idx": 0,
"origin": "llm"
},
{
"answer_end_idx": 18,
"answer_start_idx": 18,
"document_id": "6ce80daeb86e789ebf57837a5bd539c60835bb3ad6c4fc8405f3365b382fbb61",
"document_position": 2,
"label": "grounded",
"score": 0,
"doc_end_idx": 1402,
"doc_start_idx": 0,
"origin": "llm"
},
{
"answer_end_idx": 507,
"answer_start_idx": 507,
"document_id": "488b2156989f3b1745a7a9bbc8382833e7a94fa228b7d849c03a7b46832bb8e7",
"document_position": 8,
"label": "grounded",
"score": 0,
"doc_end_idx": 1576,
"doc_start_idx": 0,
"origin": "llm"
},
{
"answer_end_idx": 729,
"answer_start_idx": 729,
"document_id": "488b2156989f3b1745a7a9bbc8382833e7a94fa228b7d849c03a7b46832bb8e7",
"document_position": 8,
"label": "grounded",
"score": 0,
"doc_end_idx": 1576,
"doc_start_idx": 0,
"origin": "llm"
}
]
},
"offsets_in_context": [],
"prompt": "<|begin_of_text|><|start_header_id|>user<|end_header_id|>\n\nYou answer questions truthfully based on provided documents.\nFor each document check whether it is related to the question.\nOnly use documents that are related to the question to answer it.\nIgnore documents that are not related to the question.\nIf the answer exists in several documents, summarize them.\nOnly answer based on the documents provided. Don't make things up.\nIf the documents can't answer the question or you are unsure say: 'The answer can't be found in the text'.\nAlways use references in the form [NUMBER OF DOCUMENT] when using information from a document, e.g. [3] for Document[3].\nNever name the documents, only enter a number in square brackets as a reference.\nThe reference must only refer to the number that comes in square brackets after the document.\nOtherwise, do not use brackets in your answer and reference ONLY the number of the document without mentioning the word document.\nThese are the documents:\n\nDocument[1]:\nOverview\nMilk allergy is an atypical immune system response to milk and products containing milk. It's one of the most common food allergies in children. Cow's milk is the usual cause of milk allergy, but milk from sheep, goats, buffalo and other mammals also can cause a reaction.\nAn allergic reaction usually occurs soon after you or your child consumes milk. Signs and symptoms of milk allergy range from mild to severe and can include wheezing, vomiting, hives and digestive problems. Milk allergy can also cause anaphylaxis — a severe, life-threatening reaction.\nAvoiding milk and milk products is the primary treatment for milk allergy. Fortunately, most children outgrow milk allergy. Those who don't outgrow it may need to continue to avoid milk products.\nSymptoms\nMilk allergy symptoms, which differ from person to person, occur a few minutes to a few hours after you or your child drinks milk or eats milk products.\nImmediate signs and symptoms of milk allergy might include:\nHives\nWheezing\nItching or tingling feeling around the lips or mouth\nSwelling of the lips, tongue or throat\nCoughing or shortness of breath\nVomiting\nSigns and symptoms that may take more time to develop include:\nLoose stools or diarrhea, which may contain blood\nAbdominal cramps\nRunny nose\nWatery eyes\nColic, in babies\nMilk allergy or milk intolerance?\nA true milk allergy differs from milk protein intolerance and lactose intolerance. Unlike milk allergy, intolerance doesn't involve the immune system. Milk intolerance requires different treatment from true milk allergy.\n\n\nDocument[2]:\nImmediate signs and symptoms of milk allergy might include:\nHives\nWheezing\nItching or tingling feeling around the lips or mouth\nSwelling of the lips, tongue or throat\nCoughing or shortness of breath\nVomiting\nSigns and symptoms that may take more time to develop include:\nLoose stools or diarrhea, which may contain blood\nAbdominal cramps\nRunny nose\nWatery eyes\nColic, in babies\nMilk allergy or milk intolerance?\nA true milk allergy differs from milk protein intolerance and lactose intolerance. Unlike milk allergy, intolerance doesn't involve the immune system. Milk intolerance requires different treatment from true milk allergy.\nCommon signs and symptoms of milk protein intolerance or lactose intolerance include digestive problems, such as bloating, gas or diarrhea, after consuming milk or products containing milk.\nAnaphylaxis\nMilk allergy can cause anaphylaxis, a life-threatening reaction that narrows the airways and can block breathing. Milk is the third most common food — after peanuts and tree nuts — to cause anaphylaxis.\nIf you or your child has a reaction to milk, tell your health care provider, no matter how mild the reaction. Tests can help confirm milk allergy, so you can avoid future and potentially worse reactions.\nAnaphylaxis is a medical emergency and requires treatment with an epinephrine (adrenaline) shot (EpiPen, Adrenaclick, others) and a trip to the emergency room. \n\nDocument[3]:\nTests can help confirm milk allergy, so you can avoid future and potentially worse reactions.\nAnaphylaxis is a medical emergency and requires treatment with an epinephrine (adrenaline) shot (EpiPen, Adrenaclick, others) and a trip to the emergency room. Signs and symptoms start soon after milk consumption and can include:\nConstriction of airways, including a swollen throat that makes it difficult to breathe\nFacial flushing\nItching\nShock, with a marked drop in blood pressure\nWhen to see a doctor\nSee your provider or an allergist if you or your child experiences milk allergy symptoms shortly after consuming milk. If possible, see your provider during the allergic reaction to help make a diagnosis. Seek emergency treatment if you or your child develops signs or symptoms of anaphylaxis.\nCauses\nAll true food allergies are caused by an immune system malfunction. If you have milk allergy, your immune system identifies certain milk proteins as harmful, triggering the production of immunoglobulin E (IgE) antibodies to neutralize the protein (allergen). The next time you come in contact with these proteins, immunoglobulin E (IgE) antibodies recognize them and signal your immune system to release histamine and other chemicals, causing a range of allergic signs and symptoms.\n\n\nDocument[4]:\nThe next time you come in contact with these proteins, immunoglobulin E (IgE) antibodies recognize them and signal your immune system to release histamine and other chemicals, causing a range of allergic signs and symptoms.\nThere are two main proteins in cow's milk that can cause an allergic reaction:\nCasein, found in the solid part (curd) of milk that curdles\nWhey, found in the liquid part of milk that remains after milk curdles\nYou or your child may be allergic to only one milk protein or to both. These proteins may be hard to avoid because they're also in some processed foods. And most people who react to cow's milk will react to sheep, goat and buffalo milk.\nFood protein-induced enterocolitis syndrome (FPIES)\nA food allergen can also cause what's sometimes called a delayed food allergy. Although any food can be a trigger, milk is one of the most common. The reaction, commonly vomiting and diarrhea, usually occurs within hours after eating the trigger rather than within minutes.\nUnlike some food allergies, food protein-induced enterocolitis syndrome (FPIES) usually resolves over time. As with milk allergy, preventing an FPIES reaction involves avoiding milk and milk products.\nRisk factors\nCertain factors may increase the risk of developing milk allergy:\nOther allergies. Many children who are allergic to milk also have other allergies. Milk allergy may develop before other allergies.\nAtopic dermatitis. \n\nDocument[5]:\nRisk factors\nCertain factors may increase the risk of developing milk allergy:\nOther allergies. Many children who are allergic to milk also have other allergies. Milk allergy may develop before other allergies.\nAtopic dermatitis. Children who have atopic dermatitis — a common, chronic inflammation of the skin — are much more likely to develop a food allergy.\nFamily history. A person's risk of a food allergy increases if one or both parents have a food allergy or another type of allergy or allergic disease — such as hay fever, asthma, hives or eczema.\nAge. Milk allergy is more common in children. As they age, their digestive systems mature, and their bodies are less likely to react to milk.\nComplications\nChildren who are allergic to milk are more likely to develop certain other health problems, including:\nNutritional deficiencies. Because of dietary restrictions and feeding challenges, children with milk allergy may have slowed growth as well as vitamin and mineral deficiencies.\nReduced quality of life. Many common, and sometimes unexpected, foods contain milk, including some salad dressings or even hot dogs. If you or your child is severely allergic, avoiding milk exposure may increase stress or anxiety levels when it comes to making food choices.\nPrevention\nThere's no sure way to prevent a food allergy, but you can prevent reactions by avoiding the food that causes them. If you know you or your child is allergic to milk, avoid milk and milk products.\nRead food labels carefully. \n\nDocument[6]:\nSoy formulas are fortified to be nutritionally complete — but, unfortunately, some children with a milk allergy also develop an allergy to soy.\nIf you're breastfeeding and your child is allergic to milk, cow's milk proteins passed through your breast milk may cause an allergic reaction. You may need to exclude from your diet all products that contain milk. Talk to your health care provider if you know — or suspect — that your child has milk allergy and develops allergy signs and symptoms after breastfeeding.\nIf you or your child is on a milk-free diet, your health care provider or dietitian can help you plan nutritionally balanced meals. You or your child may need to take supplements to replace calcium and nutrients found in milk, such as vitamin D and riboflavin.\n\nDocument[7]:\nDoes your steak have melted butter on it? Was your seafood dipped in milk before cooking?\nIf you're at risk of a serious allergic reaction, talk with your health care provider about carrying and using emergency epinephrine (adrenaline). If you have already had a severe reaction, wear a medical alert bracelet or necklace that lets others know you have a food allergy.\nMilk alternatives for infants\nIn children who are allergic to milk, breastfeeding and the use of hypoallergenic formula can prevent allergic reactions.\nBreastfeeding is the best source of nutrition for your infant. Breastfeeding for as long as possible is recommended, especially if your infant is at high risk of developing milk allergy.\nHypoallergenic formulas are produced by using enzymes to break down (hydrolyze) milk proteins, such as casein or whey. Further processing can include heat and filtering. Depending on their level of processing, products are classified as either partially or extensively hydrolyzed. Or they may also be called elemental formulas.\nSome hypoallergenic formulas aren't milk based, but instead contain amino acids. Besides extensively hydrolyzed products, amino-acid-based formulas are the least likely to cause an allergic reaction.\nSoy-based formulas are based on soy protein instead of milk. Soy formulas are fortified to be nutritionally complete — but, unfortunately, some children with a milk allergy also develop an allergy to soy.\nIf you're breastfeeding and your child is allergic to milk, cow's milk proteins passed through your breast milk may cause an allergic reaction. \n\nDocument[8]:\nThey may include:\nHives\nItchy, irritated skin\nNasal stuffiness (congestion)\nSwelling of the lips, face, tongue and throat, or other parts of the body\nWheezing or trouble breathing\nCoughing and choking or a tight feeling in the throat\nBelly (abdominal) pain, diarrhea, nausea or vomiting\nDizziness, lightheadedness or fainting\nAnaphylaxis\nAllergies can cause a severe, potentially life-threatening allergic reaction known as anaphylaxis. It can occur within seconds to minutes after exposure to something you're allergic to — and worsens quickly.\nAn anaphylactic reaction to shellfish is a medical emergency. Anaphylaxis requires immediate treatment with an epinephrine (adrenaline) injection and a follow-up trip to the emergency room. If anaphylaxis isn't treated right away, it can be fatal.\nAnaphylaxis causes the immune system to release a flood of chemicals that can cause you to go into shock. Signs and symptoms of anaphylaxis include:\nA swollen throat or tongue or a tightness in the throat (airway constriction) that makes it difficult for you to breathe\nCoughing, choking or wheezing with trouble breathing\nShock, with a severe drop in your blood pressure and a rapid or weak pulse\nSevere skin rash, hives, itching or swelling\nNausea, vomiting or diarrhea\nDizziness, lightheadedness or fainting\nWhen to see a doctor\nSeek emergency treatment if you develop signs or symptoms of anaphylaxis.\nSee a health care provider or allergy specialist if you have food allergy symptoms shortly after eating.\nCauses\nAll food allergies are caused by an immune system overreaction. \n\nQuestion: What are milk allergy symptomps? <|eot_id|><|start_header_id|>assistant<|end_header_id|>",
"search": {
"created_at": "2024-12-09T12:33:30.371439Z",
"duration": 19.983364582061768,
"query": "What are milk allergy symptomps?",
"filters": {}
}
}
}
Update Feedback
You can always update the feedback you gave earlier using the Update Feedback endpoint. You need the following IDs for this:
- Workspace ID (from the Get Workspace endpoint)
- Pipeline ID (from the Get Pipeline endpoint)
- Feedback ID (from the Create Feedback endpoint)
Here is the code you can use to update a feedback entry. Make sure you replace workspace, pipeline, and feedback IDs in the URL and deepset Cloud API key in headers. Pass the new feedback score in payload:
import requests
url = "https://api.cloud.deepset.ai/api/v2/workspaces/<WORKSPACE_ID>/pipelines/<PIPELINE_ID>/feedback/<FEEDBACK_ID>"
payload = { "score": "ACCURATE" }
headers = {
"accept": "application/json",
"content-type": "application/json",
"authorization": "Bearer <DEEPSET_CLOUD_API_KEY>"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)
curl --request PATCH \
--url https://api.cloud.deepset.ai/api/v2/workspaces/WORKSPACE_ID/pipelines/PIPELINE_ID/feedback/FEEDBACK_ID \
--header 'accept: application/json' \
--header 'authorization: Bearer api_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI3NTQ1YzBhYi0xNTA2LTQ3MGUtYmY4YS04YTIxMTNiY2UzMGZ8NjQzY2Y5YTlmNzExNDg0MmUwNzk5ZDQ3IiwiZXhwIjoxNzM4Mjc4MDAwLCJhdWQiOlsiaHR0cHM6Ly9hcGkuY2xvdWQuZGVlcHNldC5haSJdfQ.jcQMPeb3Qo18425jdr_NeEv6ZGXEqHJbpG7hNU3Sohs' \
--header 'content-type: application/json' \
--data '{"score":"ACCURATE"}'
Sample response
{
"score": "FAIRLY_ACCURATE", /*the updated score*/
"comment": null,
"bookmarked": false,
"tags": [],
"result_id": "7e07bd73-c099-44fe-9d65-ec0ba5e83c41",
"feedback_id": "2fcba96d-8ae3-4572-af4c-47a9aed536a7",
"organization_id": "4f26a3b2-03fc-4742-a4b1-8c3dae2b2d2a",
"workspace_id": "b7f048eb-7b48-4ad8-b7b0-443cdddb81c5",
"pipeline_id": "07b04f1a-e053-4bd1-b3d5-e740b0dd6f2d",
"created_by": {
"user_id": "f6398740-5555-445d-8ae3-ef980ea4191d",
"given_name": "Agnieszka",
"family_name": "Marzec"
},
"created_at": "2024-12-10T11:56:13.884352Z",
"search_history": {
"search_history_result_id": "7e07bd73-c099-44fe-9d65-ec0ba5e83c41",
"query_id": "37547edb-48ec-49c0-96e8-1fcb5f37bd0c",
"documents": [
{
"id": "e7d2cc416005d62d2732e33b0c73c8a29b19e5689dd31c3635eca3d13a4d28d6",
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"meta": {
"split_id": 0,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e",
"_file_size": 4962,
"page_number": 1,
"dataset_name": "Healthcare",
"_split_overlap": [
{
"range": [
0,
633
],
"doc_id": "6ce80daeb86e789ebf57837a5bd539c60835bb3ad6c4fc8405f3365b382fbb61"
}
],
"split_idx_start": 0,
"_file_created_at": "2024-12-09T11:08:47.728733+00:00"
},
"score": 0.76318359375,
"content": "Overview\nMilk allergy is an atypical immune system response to milk and products containing milk. It's one of the most common food allergies in children. Cow's milk is the usual cause of milk allergy, but milk from sheep, goats, buffalo and other mammals also can cause a reaction.\nAn allergic reaction usually occurs soon after you or your child consumes milk. Signs and symptoms of milk allergy range from mild to severe and can include wheezing, vomiting, hives and digestive problems. Milk allergy can also cause anaphylaxis — a severe, life-threatening reaction.\nAvoiding milk and milk products is the primary treatment for milk allergy. Fortunately, most children outgrow milk allergy. Those who don't outgrow it may need to continue to avoid milk products.\nSymptoms\nMilk allergy symptoms, which differ from person to person, occur a few minutes to a few hours after you or your child drinks milk or eats milk products.\nImmediate signs and symptoms of milk allergy might include:\nHives\nWheezing\nItching or tingling feeling around the lips or mouth\nSwelling of the lips, tongue or throat\nCoughing or shortness of breath\nVomiting\nSigns and symptoms that may take more time to develop include:\nLoose stools or diarrhea, which may contain blood\nAbdominal cramps\nRunny nose\nWatery eyes\nColic, in babies\nMilk allergy or milk intolerance?\nA true milk allergy differs from milk protein intolerance and lactose intolerance. Unlike milk allergy, intolerance doesn't involve the immune system. Milk intolerance requires different treatment from true milk allergy.\n",
"embedding": null,
"result_id": "bc8173bd-0164-4668-999d-ab579681077a",
"content_type": "text"
},
{
"id": "6ce80daeb86e789ebf57837a5bd539c60835bb3ad6c4fc8405f3365b382fbb61",
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"meta": {
"split_id": 1,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e",
"_file_size": 4962,
"page_number": 1,
"dataset_name": "Healthcare",
"_split_overlap": [
{
"range": [
926,
1559
],
"doc_id": "e7d2cc416005d62d2732e33b0c73c8a29b19e5689dd31c3635eca3d13a4d28d6"
},
{
"range": [
0,
254
],
"doc_id": "13a4046915e3b7f1ddce5cb4a69494da53972863c2a93470a9bd579787a76902"
}
],
"split_idx_start": 926,
"_file_created_at": "2024-12-09T11:08:47.728733+00:00"
},
"score": 0.6025390625,
"content": "Immediate signs and symptoms of milk allergy might include:\nHives\nWheezing\nItching or tingling feeling around the lips or mouth\nSwelling of the lips, tongue or throat\nCoughing or shortness of breath\nVomiting\nSigns and symptoms that may take more time to develop include:\nLoose stools or diarrhea, which may contain blood\nAbdominal cramps\nRunny nose\nWatery eyes\nColic, in babies\nMilk allergy or milk intolerance?\nA true milk allergy differs from milk protein intolerance and lactose intolerance. Unlike milk allergy, intolerance doesn't involve the immune system. Milk intolerance requires different treatment from true milk allergy.\nCommon signs and symptoms of milk protein intolerance or lactose intolerance include digestive problems, such as bloating, gas or diarrhea, after consuming milk or products containing milk.\nAnaphylaxis\nMilk allergy can cause anaphylaxis, a life-threatening reaction that narrows the airways and can block breathing. Milk is the third most common food — after peanuts and tree nuts — to cause anaphylaxis.\nIf you or your child has a reaction to milk, tell your health care provider, no matter how mild the reaction. Tests can help confirm milk allergy, so you can avoid future and potentially worse reactions.\nAnaphylaxis is a medical emergency and requires treatment with an epinephrine (adrenaline) shot (EpiPen, Adrenaclick, others) and a trip to the emergency room. ",
"embedding": null,
"result_id": "8c702ffb-9170-4b8d-a5f4-6a35a6b2ff36",
"content_type": "text"
},
{
"id": "13a4046915e3b7f1ddce5cb4a69494da53972863c2a93470a9bd579787a76902",
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"meta": {
"split_id": 2,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e",
"_file_size": 4962,
"page_number": 1,
"dataset_name": "Healthcare",
"_split_overlap": [
{
"range": [
1148,
1402
],
"doc_id": "6ce80daeb86e789ebf57837a5bd539c60835bb3ad6c4fc8405f3365b382fbb61"
},
{
"range": [
0,
224
],
"doc_id": "01374947009de69505ab48ce77aff8579c75986101ed3e2b16c9a637b576e293"
}
],
"split_idx_start": 2074,
"_file_created_at": "2024-12-09T11:08:47.728733+00:00"
},
"score": 0.1593017578125,
"content": "Tests can help confirm milk allergy, so you can avoid future and potentially worse reactions.\nAnaphylaxis is a medical emergency and requires treatment with an epinephrine (adrenaline) shot (EpiPen, Adrenaclick, others) and a trip to the emergency room. Signs and symptoms start soon after milk consumption and can include:\nConstriction of airways, including a swollen throat that makes it difficult to breathe\nFacial flushing\nItching\nShock, with a marked drop in blood pressure\nWhen to see a doctor\nSee your provider or an allergist if you or your child experiences milk allergy symptoms shortly after consuming milk. If possible, see your provider during the allergic reaction to help make a diagnosis. Seek emergency treatment if you or your child develops signs or symptoms of anaphylaxis.\nCauses\nAll true food allergies are caused by an immune system malfunction. If you have milk allergy, your immune system identifies certain milk proteins as harmful, triggering the production of immunoglobulin E (IgE) antibodies to neutralize the protein (allergen). The next time you come in contact with these proteins, immunoglobulin E (IgE) antibodies recognize them and signal your immune system to release histamine and other chemicals, causing a range of allergic signs and symptoms.\n",
"embedding": null,
"result_id": "b4e68189-dfb3-4fa3-a987-28529dfbba05",
"content_type": "text"
},
{
"id": "01374947009de69505ab48ce77aff8579c75986101ed3e2b16c9a637b576e293",
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"meta": {
"split_id": 3,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e",
"_file_size": 4962,
"page_number": 1,
"dataset_name": "Healthcare",
"_split_overlap": [
{
"range": [
1060,
1284
],
"doc_id": "13a4046915e3b7f1ddce5cb4a69494da53972863c2a93470a9bd579787a76902"
},
{
"range": [
0,
230
],
"doc_id": "cf0faa27a97156c1fcd25b1970bf77c407267a8110cb5143482e980ba6438e31"
}
],
"split_idx_start": 3134,
"_file_created_at": "2024-12-09T11:08:47.728733+00:00"
},
"score": 0.1376953125,
"content": "The next time you come in contact with these proteins, immunoglobulin E (IgE) antibodies recognize them and signal your immune system to release histamine and other chemicals, causing a range of allergic signs and symptoms.\nThere are two main proteins in cow's milk that can cause an allergic reaction:\nCasein, found in the solid part (curd) of milk that curdles\nWhey, found in the liquid part of milk that remains after milk curdles\nYou or your child may be allergic to only one milk protein or to both. These proteins may be hard to avoid because they're also in some processed foods. And most people who react to cow's milk will react to sheep, goat and buffalo milk.\nFood protein-induced enterocolitis syndrome (FPIES)\nA food allergen can also cause what's sometimes called a delayed food allergy. Although any food can be a trigger, milk is one of the most common. The reaction, commonly vomiting and diarrhea, usually occurs within hours after eating the trigger rather than within minutes.\nUnlike some food allergies, food protein-induced enterocolitis syndrome (FPIES) usually resolves over time. As with milk allergy, preventing an FPIES reaction involves avoiding milk and milk products.\nRisk factors\nCertain factors may increase the risk of developing milk allergy:\nOther allergies. Many children who are allergic to milk also have other allergies. Milk allergy may develop before other allergies.\nAtopic dermatitis. ",
"embedding": null,
"result_id": "774c03b5-87ee-453d-9ca4-7688a8f70335",
"content_type": "text"
},
{
"id": "cf0faa27a97156c1fcd25b1970bf77c407267a8110cb5143482e980ba6438e31",
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"meta": {
"split_id": 4,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e",
"_file_size": 4962,
"page_number": 1,
"dataset_name": "Healthcare",
"_split_overlap": [
{
"range": [
1198,
1428
],
"doc_id": "01374947009de69505ab48ce77aff8579c75986101ed3e2b16c9a637b576e293"
},
{
"range": [
0,
236
],
"doc_id": "f7571820008fb10ef49414199539bbdffc6dc28cbdaf775a63cd05ae00a6d155"
}
],
"split_idx_start": 4332,
"_file_created_at": "2024-12-09T11:08:47.728733+00:00"
},
"score": 0.05224609375,
"content": "Risk factors\nCertain factors may increase the risk of developing milk allergy:\nOther allergies. Many children who are allergic to milk also have other allergies. Milk allergy may develop before other allergies.\nAtopic dermatitis. Children who have atopic dermatitis — a common, chronic inflammation of the skin — are much more likely to develop a food allergy.\nFamily history. A person's risk of a food allergy increases if one or both parents have a food allergy or another type of allergy or allergic disease — such as hay fever, asthma, hives or eczema.\nAge. Milk allergy is more common in children. As they age, their digestive systems mature, and their bodies are less likely to react to milk.\nComplications\nChildren who are allergic to milk are more likely to develop certain other health problems, including:\nNutritional deficiencies. Because of dietary restrictions and feeding challenges, children with milk allergy may have slowed growth as well as vitamin and mineral deficiencies.\nReduced quality of life. Many common, and sometimes unexpected, foods contain milk, including some salad dressings or even hot dogs. If you or your child is severely allergic, avoiding milk exposure may increase stress or anxiety levels when it comes to making food choices.\nPrevention\nThere's no sure way to prevent a food allergy, but you can prevent reactions by avoiding the food that causes them. If you know you or your child is allergic to milk, avoid milk and milk products.\nRead food labels carefully. ",
"embedding": null,
"result_id": "b304143d-5c83-40be-b9f3-422fee1e9952",
"content_type": "text"
},
{
"id": "0813ca29e002b219399bdbbf8ec1ad4a82f206e67e29126d5cdd7639b9894525",
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"meta": {
"split_id": 7,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e",
"_file_size": 4962,
"page_number": 1,
"dataset_name": "Healthcare",
"_split_overlap": [
{
"range": [
1297,
1585
],
"doc_id": "e81e29ab84fd3d190876a323afb80cffa291c18a54b19e735ae96056346432ba"
}
],
"split_idx_start": 8221,
"_file_created_at": "2024-12-09T11:08:47.728733+00:00"
},
"score": 0.051666259765625,
"content": "Soy formulas are fortified to be nutritionally complete — but, unfortunately, some children with a milk allergy also develop an allergy to soy.\nIf you're breastfeeding and your child is allergic to milk, cow's milk proteins passed through your breast milk may cause an allergic reaction. You may need to exclude from your diet all products that contain milk. Talk to your health care provider if you know — or suspect — that your child has milk allergy and develops allergy signs and symptoms after breastfeeding.\nIf you or your child is on a milk-free diet, your health care provider or dietitian can help you plan nutritionally balanced meals. You or your child may need to take supplements to replace calcium and nutrients found in milk, such as vitamin D and riboflavin.",
"embedding": null,
"result_id": "9c033d90-a592-46aa-976f-d884047a1a6e",
"content_type": "text"
},
{
"id": "e81e29ab84fd3d190876a323afb80cffa291c18a54b19e735ae96056346432ba",
"file": {
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
"meta": {
"split_id": 6,
"file_name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt",
"source_id": "95731bef674bd1f778c2b8ffa3de3eddf9eaf1d0b3dd33567287780041ab517e",
"_file_size": 4962,
"page_number": 1,
"dataset_name": "Healthcare",
"_split_overlap": [
{
"range": [
1324,
1561
],
"doc_id": "f7571820008fb10ef49414199539bbdffc6dc28cbdaf775a63cd05ae00a6d155"
},
{
"range": [
0,
288
],
"doc_id": "0813ca29e002b219399bdbbf8ec1ad4a82f206e67e29126d5cdd7639b9894525"
}
],
"split_idx_start": 6924,
"_file_created_at": "2024-12-09T11:08:47.728733+00:00"
},
"score": 0.0341796875,
"content": "Does your steak have melted butter on it? Was your seafood dipped in milk before cooking?\nIf you're at risk of a serious allergic reaction, talk with your health care provider about carrying and using emergency epinephrine (adrenaline). If you have already had a severe reaction, wear a medical alert bracelet or necklace that lets others know you have a food allergy.\nMilk alternatives for infants\nIn children who are allergic to milk, breastfeeding and the use of hypoallergenic formula can prevent allergic reactions.\nBreastfeeding is the best source of nutrition for your infant. Breastfeeding for as long as possible is recommended, especially if your infant is at high risk of developing milk allergy.\nHypoallergenic formulas are produced by using enzymes to break down (hydrolyze) milk proteins, such as casein or whey. Further processing can include heat and filtering. Depending on their level of processing, products are classified as either partially or extensively hydrolyzed. Or they may also be called elemental formulas.\nSome hypoallergenic formulas aren't milk based, but instead contain amino acids. Besides extensively hydrolyzed products, amino-acid-based formulas are the least likely to cause an allergic reaction.\nSoy-based formulas are based on soy protein instead of milk. Soy formulas are fortified to be nutritionally complete — but, unfortunately, some children with a milk allergy also develop an allergy to soy.\nIf you're breastfeeding and your child is allergic to milk, cow's milk proteins passed through your breast milk may cause an allergic reaction. ",
"embedding": null,
"result_id": "1b5869e2-0233-4255-a875-65748b4151b9",
"content_type": "text"
},
{
"id": "488b2156989f3b1745a7a9bbc8382833e7a94fa228b7d849c03a7b46832bb8e7",
"file": {
"id": "04d06fa7-c3ef-4a7d-9244-55c83924e230",
"name": "https___www.mayoclinic.org_diseases-conditions_shellfish-allergy_symptoms-causes_syc-20377503_63c3a1.txt"
},
"meta": {
"split_id": 1,
"file_name": "https___www.mayoclinic.org_diseases-conditions_shellfish-allergy_symptoms-causes_syc-20377503_63c3a1.txt",
"source_id": "35308e27d89136421775a7c1d7e7c709e7b938ebff990548bcdd383940031f4c",
"_file_size": 9017,
"page_number": 1,
"dataset_name": "Healthcare",
"_split_overlap": [
{
"range": [
977,
1585
],
"doc_id": "9b92616ee62b77dd44659f9b3589516d24587eea08bddc375bc2dc7fc6deb84a"
},
{
"range": [
0,
676
],
"doc_id": "c894391a5e0feafe8251959fc0aa0942cf95bc085998374c9936ad693e00e979"
}
],
"split_idx_start": 977,
"_file_created_at": "2024-12-09T11:08:47.728733+00:00"
},
"score": 0.026763916015625,
"content": "They may include:\nHives\nItchy, irritated skin\nNasal stuffiness (congestion)\nSwelling of the lips, face, tongue and throat, or other parts of the body\nWheezing or trouble breathing\nCoughing and choking or a tight feeling in the throat\nBelly (abdominal) pain, diarrhea, nausea or vomiting\nDizziness, lightheadedness or fainting\nAnaphylaxis\nAllergies can cause a severe, potentially life-threatening allergic reaction known as anaphylaxis. It can occur within seconds to minutes after exposure to something you're allergic to — and worsens quickly.\nAn anaphylactic reaction to shellfish is a medical emergency. Anaphylaxis requires immediate treatment with an epinephrine (adrenaline) injection and a follow-up trip to the emergency room. If anaphylaxis isn't treated right away, it can be fatal.\nAnaphylaxis causes the immune system to release a flood of chemicals that can cause you to go into shock. Signs and symptoms of anaphylaxis include:\nA swollen throat or tongue or a tightness in the throat (airway constriction) that makes it difficult for you to breathe\nCoughing, choking or wheezing with trouble breathing\nShock, with a severe drop in your blood pressure and a rapid or weak pulse\nSevere skin rash, hives, itching or swelling\nNausea, vomiting or diarrhea\nDizziness, lightheadedness or fainting\nWhen to see a doctor\nSeek emergency treatment if you develop signs or symptoms of anaphylaxis.\nSee a health care provider or allergy specialist if you have food allergy symptoms shortly after eating.\nCauses\nAll food allergies are caused by an immune system overreaction. ",
"embedding": null,
"result_id": "bfc1a187-4654-48d6-9339-2b81dbe4f5b2",
"content_type": "text"
}
],
"type": "generative",
"rank": 1,
"score": null,
"files": [
{
"id": "c83a91f9-6206-478d-8838-938431ccd410",
"name": "https___www.mayoclinic.org_diseases-conditions_milk-allergy_symptoms-causes_syc-20375101_3d1d6c.txt"
},
{
"id": "04d06fa7-c3ef-4a7d-9244-55c83924e230",
"name": "https___www.mayoclinic.org_diseases-conditions_shellfish-allergy_symptoms-causes_syc-20377503_63c3a1.txt"
}
],
"context": null,
"answer": "According to and , milk allergy symptoms can be immediate or take more time to develop. Immediate signs and symptoms of milk allergy might include:\n\n* Hives\n* Wheezing\n* Itching or tingling feeling around the lips or mouth\n* Swelling of the lips, tongue or throat\n* Coughing or shortness of breath\n* Vomiting\n\nSigns and symptoms that may take more time to develop include:\n\n* Loose stools or diarrhea, which may contain blood\n* Abdominal cramps\n* Runny nose\n* Watery eyes\n* Colic, in babies\n\nAdditionally, mentions some general allergy symptoms that may also apply to milk allergy, including:\n\n* Itchy, irritated skin\n* Nasal stuffiness (congestion)\n* Belly (abdominal) pain\n* Dizziness, lightheadedness or fainting\n\nNote that is not specifically about milk allergy, but about allergies in general. However, the symptoms listed may still be relevant to milk allergy.",
"meta": {
"_references": [
{
"label": "grounded",
"score": 0,
"origin": "llm",
"doc_end_idx": 1559,
"document_id": "e7d2cc416005d62d2732e33b0c73c8a29b19e5689dd31c3635eca3d13a4d28d6",
"doc_start_idx": 0,
"answer_end_idx": 13,
"answer_start_idx": 13,
"document_position": 1
},
{
"label": "grounded",
"score": 0,
"origin": "llm",
"doc_end_idx": 1402,
"document_id": "6ce80daeb86e789ebf57837a5bd539c60835bb3ad6c4fc8405f3365b382fbb61",
"doc_start_idx": 0,
"answer_end_idx": 18,
"answer_start_idx": 18,
"document_position": 2
},
{
"label": "grounded",
"score": 0,
"origin": "llm",
"doc_end_idx": 1576,
"document_id": "488b2156989f3b1745a7a9bbc8382833e7a94fa228b7d849c03a7b46832bb8e7",
"doc_start_idx": 0,
"answer_end_idx": 507,
"answer_start_idx": 507,
"document_position": 8
},
{
"label": "grounded",
"score": 0,
"origin": "llm",
"doc_end_idx": 1576,
"document_id": "488b2156989f3b1745a7a9bbc8382833e7a94fa228b7d849c03a7b46832bb8e7",
"doc_start_idx": 0,
"answer_end_idx": 729,
"answer_start_idx": 729,
"document_position": 8
}
]
},
"offsets_in_context": [],
"prompt": "<|begin_of_text|><|start_header_id|>user<|end_header_id|>\n\nYou answer questions truthfully based on provided documents.\nFor each document check whether it is related to the question.\nOnly use documents that are related to the question to answer it.\nIgnore documents that are not related to the question.\nIf the answer exists in several documents, summarize them.\nOnly answer based on the documents provided. Don't make things up.\nIf the documents can't answer the question or you are unsure say: 'The answer can't be found in the text'.\nAlways use references in the form [NUMBER OF DOCUMENT] when using information from a document, e.g. [3] for Document[3].\nNever name the documents, only enter a number in square brackets as a reference.\nThe reference must only refer to the number that comes in square brackets after the document.\nOtherwise, do not use brackets in your answer and reference ONLY the number of the document without mentioning the word document.\nThese are the documents:\n\nDocument[1]:\nOverview\nMilk allergy is an atypical immune system response to milk and products containing milk. It's one of the most common food allergies in children. Cow's milk is the usual cause of milk allergy, but milk from sheep, goats, buffalo and other mammals also can cause a reaction.\nAn allergic reaction usually occurs soon after you or your child consumes milk. Signs and symptoms of milk allergy range from mild to severe and can include wheezing, vomiting, hives and digestive problems. Milk allergy can also cause anaphylaxis — a severe, life-threatening reaction.\nAvoiding milk and milk products is the primary treatment for milk allergy. Fortunately, most children outgrow milk allergy. Those who don't outgrow it may need to continue to avoid milk products.\nSymptoms\nMilk allergy symptoms, which differ from person to person, occur a few minutes to a few hours after you or your child drinks milk or eats milk products.\nImmediate signs and symptoms of milk allergy might include:\nHives\nWheezing\nItching or tingling feeling around the lips or mouth\nSwelling of the lips, tongue or throat\nCoughing or shortness of breath\nVomiting\nSigns and symptoms that may take more time to develop include:\nLoose stools or diarrhea, which may contain blood\nAbdominal cramps\nRunny nose\nWatery eyes\nColic, in babies\nMilk allergy or milk intolerance?\nA true milk allergy differs from milk protein intolerance and lactose intolerance. Unlike milk allergy, intolerance doesn't involve the immune system. Milk intolerance requires different treatment from true milk allergy.\n\n\nDocument[2]:\nImmediate signs and symptoms of milk allergy might include:\nHives\nWheezing\nItching or tingling feeling around the lips or mouth\nSwelling of the lips, tongue or throat\nCoughing or shortness of breath\nVomiting\nSigns and symptoms that may take more time to develop include:\nLoose stools or diarrhea, which may contain blood\nAbdominal cramps\nRunny nose\nWatery eyes\nColic, in babies\nMilk allergy or milk intolerance?\nA true milk allergy differs from milk protein intolerance and lactose intolerance. Unlike milk allergy, intolerance doesn't involve the immune system. Milk intolerance requires different treatment from true milk allergy.\nCommon signs and symptoms of milk protein intolerance or lactose intolerance include digestive problems, such as bloating, gas or diarrhea, after consuming milk or products containing milk.\nAnaphylaxis\nMilk allergy can cause anaphylaxis, a life-threatening reaction that narrows the airways and can block breathing. Milk is the third most common food — after peanuts and tree nuts — to cause anaphylaxis.\nIf you or your child has a reaction to milk, tell your health care provider, no matter how mild the reaction. Tests can help confirm milk allergy, so you can avoid future and potentially worse reactions.\nAnaphylaxis is a medical emergency and requires treatment with an epinephrine (adrenaline) shot (EpiPen, Adrenaclick, others) and a trip to the emergency room. \n\nDocument[3]:\nTests can help confirm milk allergy, so you can avoid future and potentially worse reactions.\nAnaphylaxis is a medical emergency and requires treatment with an epinephrine (adrenaline) shot (EpiPen, Adrenaclick, others) and a trip to the emergency room. Signs and symptoms start soon after milk consumption and can include:\nConstriction of airways, including a swollen throat that makes it difficult to breathe\nFacial flushing\nItching\nShock, with a marked drop in blood pressure\nWhen to see a doctor\nSee your provider or an allergist if you or your child experiences milk allergy symptoms shortly after consuming milk. If possible, see your provider during the allergic reaction to help make a diagnosis. Seek emergency treatment if you or your child develops signs or symptoms of anaphylaxis.\nCauses\nAll true food allergies are caused by an immune system malfunction. If you have milk allergy, your immune system identifies certain milk proteins as harmful, triggering the production of immunoglobulin E (IgE) antibodies to neutralize the protein (allergen). The next time you come in contact with these proteins, immunoglobulin E (IgE) antibodies recognize them and signal your immune system to release histamine and other chemicals, causing a range of allergic signs and symptoms.\n\n\nDocument[4]:\nThe next time you come in contact with these proteins, immunoglobulin E (IgE) antibodies recognize them and signal your immune system to release histamine and other chemicals, causing a range of allergic signs and symptoms.\nThere are two main proteins in cow's milk that can cause an allergic reaction:\nCasein, found in the solid part (curd) of milk that curdles\nWhey, found in the liquid part of milk that remains after milk curdles\nYou or your child may be allergic to only one milk protein or to both. These proteins may be hard to avoid because they're also in some processed foods. And most people who react to cow's milk will react to sheep, goat and buffalo milk.\nFood protein-induced enterocolitis syndrome (FPIES)\nA food allergen can also cause what's sometimes called a delayed food allergy. Although any food can be a trigger, milk is one of the most common. The reaction, commonly vomiting and diarrhea, usually occurs within hours after eating the trigger rather than within minutes.\nUnlike some food allergies, food protein-induced enterocolitis syndrome (FPIES) usually resolves over time. As with milk allergy, preventing an FPIES reaction involves avoiding milk and milk products.\nRisk factors\nCertain factors may increase the risk of developing milk allergy:\nOther allergies. Many children who are allergic to milk also have other allergies. Milk allergy may develop before other allergies.\nAtopic dermatitis. \n\nDocument[5]:\nRisk factors\nCertain factors may increase the risk of developing milk allergy:\nOther allergies. Many children who are allergic to milk also have other allergies. Milk allergy may develop before other allergies.\nAtopic dermatitis. Children who have atopic dermatitis — a common, chronic inflammation of the skin — are much more likely to develop a food allergy.\nFamily history. A person's risk of a food allergy increases if one or both parents have a food allergy or another type of allergy or allergic disease — such as hay fever, asthma, hives or eczema.\nAge. Milk allergy is more common in children. As they age, their digestive systems mature, and their bodies are less likely to react to milk.\nComplications\nChildren who are allergic to milk are more likely to develop certain other health problems, including:\nNutritional deficiencies. Because of dietary restrictions and feeding challenges, children with milk allergy may have slowed growth as well as vitamin and mineral deficiencies.\nReduced quality of life. Many common, and sometimes unexpected, foods contain milk, including some salad dressings or even hot dogs. If you or your child is severely allergic, avoiding milk exposure may increase stress or anxiety levels when it comes to making food choices.\nPrevention\nThere's no sure way to prevent a food allergy, but you can prevent reactions by avoiding the food that causes them. If you know you or your child is allergic to milk, avoid milk and milk products.\nRead food labels carefully. \n\nDocument[6]:\nSoy formulas are fortified to be nutritionally complete — but, unfortunately, some children with a milk allergy also develop an allergy to soy.\nIf you're breastfeeding and your child is allergic to milk, cow's milk proteins passed through your breast milk may cause an allergic reaction. You may need to exclude from your diet all products that contain milk. Talk to your health care provider if you know — or suspect — that your child has milk allergy and develops allergy signs and symptoms after breastfeeding.\nIf you or your child is on a milk-free diet, your health care provider or dietitian can help you plan nutritionally balanced meals. You or your child may need to take supplements to replace calcium and nutrients found in milk, such as vitamin D and riboflavin.\n\nDocument[7]:\nDoes your steak have melted butter on it? Was your seafood dipped in milk before cooking?\nIf you're at risk of a serious allergic reaction, talk with your health care provider about carrying and using emergency epinephrine (adrenaline). If you have already had a severe reaction, wear a medical alert bracelet or necklace that lets others know you have a food allergy.\nMilk alternatives for infants\nIn children who are allergic to milk, breastfeeding and the use of hypoallergenic formula can prevent allergic reactions.\nBreastfeeding is the best source of nutrition for your infant. Breastfeeding for as long as possible is recommended, especially if your infant is at high risk of developing milk allergy.\nHypoallergenic formulas are produced by using enzymes to break down (hydrolyze) milk proteins, such as casein or whey. Further processing can include heat and filtering. Depending on their level of processing, products are classified as either partially or extensively hydrolyzed. Or they may also be called elemental formulas.\nSome hypoallergenic formulas aren't milk based, but instead contain amino acids. Besides extensively hydrolyzed products, amino-acid-based formulas are the least likely to cause an allergic reaction.\nSoy-based formulas are based on soy protein instead of milk. Soy formulas are fortified to be nutritionally complete — but, unfortunately, some children with a milk allergy also develop an allergy to soy.\nIf you're breastfeeding and your child is allergic to milk, cow's milk proteins passed through your breast milk may cause an allergic reaction. \n\nDocument[8]:\nThey may include:\nHives\nItchy, irritated skin\nNasal stuffiness (congestion)\nSwelling of the lips, face, tongue and throat, or other parts of the body\nWheezing or trouble breathing\nCoughing and choking or a tight feeling in the throat\nBelly (abdominal) pain, diarrhea, nausea or vomiting\nDizziness, lightheadedness or fainting\nAnaphylaxis\nAllergies can cause a severe, potentially life-threatening allergic reaction known as anaphylaxis. It can occur within seconds to minutes after exposure to something you're allergic to — and worsens quickly.\nAn anaphylactic reaction to shellfish is a medical emergency. Anaphylaxis requires immediate treatment with an epinephrine (adrenaline) injection and a follow-up trip to the emergency room. If anaphylaxis isn't treated right away, it can be fatal.\nAnaphylaxis causes the immune system to release a flood of chemicals that can cause you to go into shock. Signs and symptoms of anaphylaxis include:\nA swollen throat or tongue or a tightness in the throat (airway constriction) that makes it difficult for you to breathe\nCoughing, choking or wheezing with trouble breathing\nShock, with a severe drop in your blood pressure and a rapid or weak pulse\nSevere skin rash, hives, itching or swelling\nNausea, vomiting or diarrhea\nDizziness, lightheadedness or fainting\nWhen to see a doctor\nSeek emergency treatment if you develop signs or symptoms of anaphylaxis.\nSee a health care provider or allergy specialist if you have food allergy symptoms shortly after eating.\nCauses\nAll food allergies are caused by an immune system overreaction. \n\nQuestion: What are milk allergy symptomps? <|eot_id|><|start_header_id|>assistant<|end_header_id|>",
"search": {
"created_at": "2024-12-09T12:33:30.371439Z",
"duration": 19.983364582061768,
"query": "What are milk allergy symptomps?",
"filters": {}
}
}
}
Delete Feedback
You can delete feedback entries using the Delete Feedback endpoint. You need the following IDs to do this:
- Workspace ID (from the Get Workspace endpoint)
- Pipeline ID (from the Get Pipeline endpoint)
- Feedback ID (from the Create Feedback or Get Paginated Feedback endpoints)
You can use this code to construct your request. Make sure you update the variables: the IDs and the deepset Cloud API key:
import requests
url = "https://api.cloud.deepset.ai/api/v2/workspaces/<WORKSPACE_ID>/pipelines/<PIPELINE_ID>/feedback/<FEEDBACK_ID>"
headers = {
"accept": "application/json",
"authorization": "Bearer <DEEPSET_CLOUD_API_KEY>"
}
response = requests.delete(url, headers=headers)
print(response)
curl --request DELETE \
--url https://api.cloud.deepset.ai/api/v2/workspaces/<WORKSPACE_ID>/pipelines/<PIPELINE_ID>/feedback/<FEEDBACK_ID> \
--header 'accept: application/json' \
--header 'authorization: Bearer <DEEPSET_CLOUD_API_KEY>'
Example Colab Notebook
Use this Feedback API Notebook to see how working with feedback through REST API works in practice. In the notebook, you:
- run a search on a pipeline.
- obtain all the necessary IDs.
- add, update, and delete feedback entries.
Updated 11 days ago