{"cells":[{"cell_type":"markdown","metadata":{"id":"96bkibOzb61u"},"source":["# SETUP"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"6_h4g-I2iI86"},"outputs":[],"source":["from google.colab import drive\n","import os\n","\n","drive.mount('/content/gdrive')\n","\n","!ls\n","%cd /content/gdrive/MyDrive/rajat.bans/RAG/\n","# !pip install -r requirements.txt"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"LINKm4utdhNr"},"outputs":[],"source":["%reload_ext autoreload\n","%autoreload 2\n","%load rag.py\n","import rag"]},{"cell_type":"markdown","metadata":{"id":"jQY6GygUcVKq"},"source":["# DB PREPARATION"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":7760,"status":"ok","timestamp":1720075767861,"user":{"displayName":"autoopt GoogleColab","userId":"13240348593990227985"},"user_tz":-330},"id":"dCGU-UwucZqs","outputId":"4e11769c-5fc8-4ff9-b5a7-b4df8d86f12f"},"outputs":[{"name":"stderr","output_type":"stream","text":["/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.\n"," warnings.warn(\n"]},{"name":"stdout","output_type":"stream","text":["Documents are split into 15550 passages\n"]}],"source":["import pandas as pd\n","from langchain_community.embeddings import HuggingFaceEmbeddings\n","df = pd.read_csv('./data/149_adclick_Jun_facty_activeBeat_Health_dupRemoved0.85_campaign.tsv', sep='\\t')\n","# df.dropna(axis=0, how='any', inplace=True)\n","# df.drop_duplicates(subset = ['ad_title', 'ad_desc'], inplace=True)\n","\n","# -------------------------------\n","# ADS DATA PREPROCESSING\n","dfRPC = df[df['RPC'] > 0]\n","dfRPC = dfRPC.dropna()\n","dfCampaign = df[df['type'] == 'campaign']\n","dfCampaign = dfCampaign.fillna('')\n","df = pd.concat([dfRPC, dfCampaign])\n","df\n","\n","content = (df[\"ad_title\"] + \". \" + df[\"ad_desc\"]).tolist()\n","metadata = [\n"," {\"publisher_url\": row[\"publisher_url\"], \"keyword_term\": row[\"keyword_term\"], \"ad_display_url\": row[\"ad_display_url\"], \"revenue\": row[\"revenue\"], \"ad_click_count\": row[\"ad_click_count\"], \"RPC\": row[\"RPC\"], \"Type\": row[\"type\"]}\n"," # {\"revenue\": row[\"revenue\"], \"ad_click_count\": row[\"ad_click_count\"]}\n"," for _, row in df.iterrows()\n"," ]\n","\n","# --------------------------------\n","# WEB DATA PROCESSING\n","# from urllib.parse import urlparse\n","# import re\n","# def get_cleaned_url(url):\n","# path = urlparse(url).path.strip()\n","# cleaned_path = re.sub(r'[^a-zA-Z0-9\\s-]', ' ', path).replace('/', '')\n","# cleaned_path = re.sub(r'[^a-zA-Z0-9\\s]', ' ', path).replace('-', '')\n","# return cleaned_path.strip()\n","\n","# df['cleaned_url'] = df['url'].map(get_cleaned_url)\n","# df.dropna(subset=['cleaned_url', 'url_content', 'url_title'], inplace=True)\n","# df['combined'] = df['cleaned_url'] + \". \" + df['url_title'] + \". \" + df['url_content']\n","# content = df[\"combined\"].tolist()\n","# metadata = [\n","# {\"title\": row[\"url_title\"], \"url\": row[\"url\"]}\n","# for _, row in df.iterrows()\n","# ]\n","\n","embeddings_hf = HuggingFaceEmbeddings(model_name=\"BAAI/bge-m3\", show_progress = True)\n","faiss_db = rag.FAISS_DB()\n","docs = faiss_db.createDocs(content, metadata)"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":706,"status":"ok","timestamp":1720075811583,"user":{"displayName":"autoopt GoogleColab","userId":"13240348593990227985"},"user_tz":-330},"id":"HQFVYBxNgWN3","outputId":"47467d39-c4fc-404d-d265-923bca7590b9"},"outputs":[{"data":{"text/plain":["(15550,\n"," Document(metadata={'publisher_url': '', 'keyword_term': '', 'ad_display_url': '', 'revenue': '', 'ad_click_count': '', 'RPC': '', 'Type': 'campaign'}, page_content=\"How To Bring High Blood Pressure Down Fast. This safe, natural solution doesn't just treat hypertension but actually corrects it!\"))"]},"execution_count":18,"metadata":{},"output_type":"execute_result"}],"source":["print(len(docs), docs[0], docs[len(docs)-1])\n","db = faiss_db.createDBFromDocs(docs, embeddings_hf)\n","faiss_db.saveDB(db, './vectorstore/db_faiss_ads_Jun_facty_activebeat_Health_dupRemoved0.85')"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["# # ************************************************************************\n","# # PARALLELY CREATING DB - BACKUP FOR FUTURE USE\n","# import time\n","# import threading\n","# import os\n","# one_db_docs_size = 1000\n","# starting_i = 0\n","# parallel_processes = 3\n","# def split_list(lst, n):\n","# k, m = divmod(len(lst), n)\n","# return (lst[i * k + min(i, m):(i + 1) * k + min(i + 1, m)] for i in range(n))\n","# def createDBForIndexes(inds):\n","# for i in inds:\n","# ctime = time.time()\n","# print(f\"Processing {i}\")\n","# if not os.path.exists(DB_FAISS_PATH + \"/index_{int(i/one_db_docs_size)}.faiss\"):\n","# db = FAISS.from_documents(split_docs[i:i+one_db_docs_size], embeddings_hf)\n","# db.save_local(DB_FAISS_PATH, index_name = f\"index_{int(i/one_db_docs_size)}\")\n","# ctime = time.time() - ctime\n","# print(f\"{i})Time taken\", ctime)\n","# indexes = split_list(range(starting_i, len(split_docs), one_db_docs_size), parallel_processes)\n","# threads = []\n","# for i, one_process_indexes in enumerate(indexes):\n","# thread = threading.Thread(target=createDBForIndexes, args=(one_process_indexes,))\n","# thread.start()\n","# threads.append(thread)\n","# for thread in threads:\n","# thread.join()\n","# print(\"All threads completed.\")\n","# # ************************************************************************"]},{"cell_type":"markdown","metadata":{"id":"SXm9omkkb_jL"},"source":["# PROCESSING ADS TO FORM QNA FOR URLS"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":813},"executionInfo":{"elapsed":17328,"status":"ok","timestamp":1720078722089,"user":{"displayName":"autoopt GoogleColab","userId":"13240348593990227985"},"user_tz":-330},"id":"ioJQwyy-cDdz","outputId":"2d1e7d56-271c-4160-9a09-27fc23322085"},"outputs":[{"name":"stderr","output_type":"stream","text":["/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.\n"," warnings.warn(\n"]},{"data":{"application/vnd.google.colaboratory.intrinsic+json":{"summary":"{\n \"name\": \"data\",\n \"rows\": 1943,\n \"fields\": [\n {\n \"column\": \"domain_name\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"facty.com\",\n \"activebeat.com\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"stripped_url\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 1943,\n \"samples\": [\n \"https://facty.com/conditions/cancer/10-signs-of-pancreatic-cancer/12\",\n \"https://facty.com/conditions/personality-disorder/10-symptoms-personality-disorder\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"kwd_imp\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 1778,\n \"samples\": [\n \"9,985\",\n \"7,572\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"kwd_click\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 571,\n \"samples\": [\n \"411\",\n \"799\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"ad_click\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 429,\n \"samples\": [\n \"203\",\n \"399\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"revenue\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 1457,\n \"samples\": [\n \"$0.56\",\n \"$2.72\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"rank\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 289,\n \"min\": 1,\n \"max\": 1000,\n \"num_unique_values\": 998,\n \"samples\": [\n 467,\n 827\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"url_title\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 1311,\n \"samples\": [\n \"Fun Facts About the Havanese - Facty\",\n \"10 Signs Your Body Might Be Battling an Ulcer - Facty Health\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"url_content\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 1841,\n \"samples\": [\n \"25 Foods that Help Lower Cholesterol. There is a reason breakfast is the most important meal of the day. Kickstarting your morning with a bowl of warm oatmeal incorporates some healthy elements into your diet, first thing. Whole grains are an ideal source of soluble fiber, and oats top the list. Soluble fiber is a gel that prevents cholesterol from being absorbed into the bloodstream. Eat anywhere from five to ten grams of soluble fiber each day\\u2014at least one and a quarter cups of oatmeal\\u2014to combat bad cholesterol. Adding toppings like chopped apples can further increase the fiber in your first meal.\",\n \"The Pancreas: A Marvel of the Digestive System. The pancreas is a flat, pear-shaped gland behind the stomach, in the abdominal cavity. This six-inch neighbor to the gallbladder and spleen plays an important role in converting food into fuel and also produces and secretes hormones as part of the endocrine system. Often underappreciated, the pancreas carries out various functions, all of which are essential for health. The Pancreas Has Dual Roles. The pancreas is unique in that it is involved in both the digestive and endocrine systems. As part of the former, it secretes enzymes into the small intestine, which help break down food into smaller components for proper digestion and absorption. As an endocrine gland, it secretes two hormones crucial to metabolism. The Pancreas Is Responsible for Blood Sugar Control. As part of the endocrine system, the pancreas releases insulin and glucagon, both of which help regulate blood glucose levels. Without them, there would be no way to control the amount of sugar in the bloodstream. Proper secretion of these regulatory substances is essential for normal function; conditions such as diabetes can result from imbalances in insulin and glucagon. simpson33 / Getty Images. The Pancreas Plays a Large Role in Digestion. One of the pancreas' main functions is to aid in digestion. More specifically, the gland releases pancreatic juices into the small intestine through a small duct \\u2014 one that is normally covered in thin mucus \\u2014 when there is food in the stomach. Together with bile released from the liver, the enzyme helps the body digest and absorb food. The Pancreas Secretes Insulin. If blood glucose levels are too high, the pancreas releases insulin, a hormone that stems from the gland's beta cells. In response, the liver absorbs glucose and stores it as glycogen. Fat and skeletal muscle cells also absorb sugar from the bloodstream. If the pancreas does not produce enough insulin, blood sugar levels will be abnormally high; this is one of the main causes of diabetes. ayo888 / Getty Images. The Pancreas Secretes Glucagon. In response to low blood sugar levels, the pancreas secretes glucagon, a hormone originating from the organ's alpha cells. Similar to insulin in that it acts on the liver, glucagon's main role is to prevent blood glucose levels from dropping too low. In addition to stimulating the conversion of glycogen to glucose \\u2014 a process called glycogenolysis \\u2014 glucagon also promotes the production of glucose from amino acids and reduces the amount of glucose consumed by the liver. Jan-Otto / Getty Images. The Pancreas Secretes Somatostatin. The pancreas also secretes somatostatin, a hormone that inhibits the secretion of insulin and glucagon. As it moves through the bloodstream, somatostatin also helps regulate the release of other substances such as gastrin and growth hormone; in doing so, the hormone maintains a wide variety of physiological functions. In the nervous system, it acts as a neurotransmitter or chemical messenger. designer491 / Getty Images. Pancreatic Fluid Helps Neutralize Stomach Acid. Following a meal, the epithelial cells of the pancreas secrete pancreatic juice \\u2014 an alkaline liquid that contains high concentrations of bicarbonate. These juices are crucial for proper digestion, helping to neutralize stomach acid before it enters the small intestine. A hormone called secretin, which comes from the small intestine, regulates these pancreatic secretions; a deficiency of this regulatory substance may lead to peptic ulcer disease. The Pancreas Produces Lipase. The body cannot absorb dietary fat in its original form. Instead, enzymes must first break down the fats into basic components: fatty acids and glycerol; a pancreatic enzyme called lipase is responsible for this process. Without lipase, the body would be unable to break down fats from digested food, which leads to diarrhea or fatty stools. Significantly low levels of lipase can cause permanent damage to the pancreas. jarun011 / Getty Images. The Pancreas Produces Amylase. Similar to fats, carbohydrates are broken down into simpler compounds prior to absorption. An enzyme called amylase \\u2014 which is produced and secreted by the pancreas and the salivary glands \\u2014 carries out this role. People with a shortage of amylase may experience diarrhea due to the effects of undigested starch in the large intestine. The Pancreas Synthesizes and Secretes Proteases. The pancreas produces two types of proteases or enzymes that break down proteins: trypsin and chymotrypsin. Together with pepsin, a stomach enzyme, they break down protein into amino acids. In addition, proteases help keep the intestine free of pathogens like bacteria. People with protease deficiencies may experience irritability, mood swings, edema, and insomnia; recovery from infections such as those caused by bacteria and viruses may be slower because protease also digests impurities in the blood. shunyufan / Getty Images.\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"core_content\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 1664,\n \"samples\": [\n \"Page Title -: Understanding the Ten Common Causes of Calf Muscle Pain - Facty Health\\nPage Content -: Three muscles make up the section of the leg below the knee that most people call the calf. While any direct injury to these three muscles can cause pain, conditions that affect the surrounding tissue, arteries, nerves, or the muscles themselves can do so, as well. Muscle Cramp. Some of the most common causes of calf pain are muscle cramps , which are involuntary contractions of a muscle. Cramps can be extremely painful and even debilitating. The muscles may feel stiff to the touch or have a visible knot. Though the cramp may not last very long, the pain and soreness can persist for several days\",\n \"Page Title -: The 15 Top Inflammatory Foods to Avoid\\nPage Content -: The 15 Top Inflammatory Foods to Avoid. Inflammation is the body\\u2019s natural response to safeguard against foreign bacteria, viruses, and infection. When it senses a threat, the body will trigger the release of chemicals and white blood cells (our body\\u2019s germ fighters). However, with certain inflammatory conditions, or autoimmune diseases \\u2014such as rheumatoid or osteoarthritis, fibromyalgia, celiac disease, Crohn\\u2019s disease , and multiple sclerosis\\u2014the immune system\\u2019s response is inflammatory even when there is no threat. However avoiding these 15 foods may greatly reduce and soothe the inflammatory response\\u2026. It\\u2019s no surprise that more than half of the world\\u2019s population suffers from cow milk intolerance or milk allergy, which is an allergy to casein (or milk protein). In fact, cow\\u2019s milk and cream cheese has been deemed a highly inflammatory food for the amount of stomach upset, constipation and diarrhea, hives, and breathing issues it causes\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}","type":"dataframe","variable_name":"data"},"text/html":["\n","
\n","
\n","\n","\n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n","
domain_namestripped_urlkwd_impkwd_clickad_clickrevenuerankurl_titleurl_contentcore_content
0activebeat.comhttps://activebeat.com/your-health/10-warning-...447,23410,1295,750$14,749.431Lung Cancer: 22 Early Signs and SymptomsLung Cancer: 22 Early Signs and Symptoms. Lung...Page Title -: Lung Cancer: 22 Early Signs and ...
1activebeat.comhttps://activebeat.com/your-health/women/14-ea...276,5073,6431,957$4,334.21214 Early Signs of Cancer Women Shouldn’t Ignore14 Early Signs of Cancer Women Shouldn’t Ignor...Page Title -: 14 Early Signs of Cancer Women S...
2activebeat.comhttps://activebeat.com/your-health/chronic-kid...187,3613,7222,301$1,601.173Chronic Kidney Disease: 20 Common Symptoms of CKDChronic Kidney Disease: 20 Common Symptoms of ...Page Title -: Chronic Kidney Disease: 20 Commo...
3activebeat.comhttps://activebeat.com/health-news/15-foods-to...183,5044,6052,173$4,567.85415 Foods to Help Manage Diabetes15 Foods to Help Manage Diabetes. Being diagno...Page Title -: 15 Foods to Help Manage Diabetes...
4activebeat.comhttps://activebeat.com/your-health/7-symptoms-...178,5602,0081,102$546.595Signs and Symptoms of Kidney FailureSigns and Symptoms of Kidney Failure. Many peo...Page Title -: Signs and Symptoms of Kidney Fai...
.................................
1938facty.comhttps://facty.com/conditions/alzheimers/10-sym...3,209134$3.13996The Early Signs and Symptoms of Lewy Body Deme...8 . Loss of Balance. It is common for Lewy bod...Page Title -: The Early Signs and Symptoms of ...
1939facty.comhttps://facty.com/network/life/the-top-30-wors...3,208143$0.41997The Top 30 Worst Places to Live in the United ...Updated: Nov 9, 2022. 10 . Idabel, OK. Small-t...Page Title -: The Top 30 Worst Places to Live ...
1940facty.comhttps://facty.com/ailments/kidney/10-causes-of...3,1993113$2.3999810 Causes of Kidney Infection - Facty Health10 Causes of Kidney Infection. A kidney infect...Page Title -: 10 Causes of Kidney Infection - ...
1941facty.comhttps://facty.com/conditions/muscular/10-home-...3,1946037$6.46999Can These 15 Home Treatments Help Your Restles...Can These 15 Home Treatments Help Your Restles...Page Title -: Can These 15 Home Treatments Hel...
1942facty.comhttps://facty.com/conditions/myasthenia-gravis...3,1926846$10.16100010 Symptoms of Myasthenia Gravis - Facty Health10 Symptoms of Myasthenia Gravis. Myasthenia g...Page Title -: 10 Symptoms of Myasthenia Gravis...
\n","

1943 rows × 10 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","\n","
\n"," \n","\n","\n","\n"," \n","
\n","\n","
\n"," \n"," \n"," \n","
\n","\n","
\n","
\n"],"text/plain":[" domain_name stripped_url \\\n","0 activebeat.com https://activebeat.com/your-health/10-warning-... \n","1 activebeat.com https://activebeat.com/your-health/women/14-ea... \n","2 activebeat.com https://activebeat.com/your-health/chronic-kid... \n","3 activebeat.com https://activebeat.com/health-news/15-foods-to... \n","4 activebeat.com https://activebeat.com/your-health/7-symptoms-... \n","... ... ... \n","1938 facty.com https://facty.com/conditions/alzheimers/10-sym... \n","1939 facty.com https://facty.com/network/life/the-top-30-wors... \n","1940 facty.com https://facty.com/ailments/kidney/10-causes-of... \n","1941 facty.com https://facty.com/conditions/muscular/10-home-... \n","1942 facty.com https://facty.com/conditions/myasthenia-gravis... \n","\n"," kwd_imp kwd_click ad_click revenue rank \\\n","0 447,234 10,129 5,750 $14,749.43 1 \n","1 276,507 3,643 1,957 $4,334.21 2 \n","2 187,361 3,722 2,301 $1,601.17 3 \n","3 183,504 4,605 2,173 $4,567.85 4 \n","4 178,560 2,008 1,102 $546.59 5 \n","... ... ... ... ... ... \n","1938 3,209 13 4 $3.13 996 \n","1939 3,208 14 3 $0.41 997 \n","1940 3,199 31 13 $2.39 998 \n","1941 3,194 60 37 $6.46 999 \n","1942 3,192 68 46 $10.16 1000 \n","\n"," url_title \\\n","0 Lung Cancer: 22 Early Signs and Symptoms \n","1 14 Early Signs of Cancer Women Shouldn’t Ignore \n","2 Chronic Kidney Disease: 20 Common Symptoms of CKD \n","3 15 Foods to Help Manage Diabetes \n","4 Signs and Symptoms of Kidney Failure \n","... ... \n","1938 The Early Signs and Symptoms of Lewy Body Deme... \n","1939 The Top 30 Worst Places to Live in the United ... \n","1940 10 Causes of Kidney Infection - Facty Health \n","1941 Can These 15 Home Treatments Help Your Restles... \n","1942 10 Symptoms of Myasthenia Gravis - Facty Health \n","\n"," url_content \\\n","0 Lung Cancer: 22 Early Signs and Symptoms. Lung... \n","1 14 Early Signs of Cancer Women Shouldn’t Ignor... \n","2 Chronic Kidney Disease: 20 Common Symptoms of ... \n","3 15 Foods to Help Manage Diabetes. Being diagno... \n","4 Signs and Symptoms of Kidney Failure. Many peo... \n","... ... \n","1938 8 . Loss of Balance. It is common for Lewy bod... \n","1939 Updated: Nov 9, 2022. 10 . Idabel, OK. Small-t... \n","1940 10 Causes of Kidney Infection. A kidney infect... \n","1941 Can These 15 Home Treatments Help Your Restles... \n","1942 10 Symptoms of Myasthenia Gravis. Myasthenia g... \n","\n"," core_content \n","0 Page Title -: Lung Cancer: 22 Early Signs and ... \n","1 Page Title -: 14 Early Signs of Cancer Women S... \n","2 Page Title -: Chronic Kidney Disease: 20 Commo... \n","3 Page Title -: 15 Foods to Help Manage Diabetes... \n","4 Page Title -: Signs and Symptoms of Kidney Fai... \n","... ... \n","1938 Page Title -: The Early Signs and Symptoms of ... \n","1939 Page Title -: The Top 30 Worst Places to Live ... \n","1940 Page Title -: 10 Causes of Kidney Infection - ... \n","1941 Page Title -: Can These 15 Home Treatments Hel... \n","1942 Page Title -: 10 Symptoms of Myasthenia Gravis... \n","\n","[1943 rows x 10 columns]"]},"execution_count":23,"metadata":{},"output_type":"execute_result"}],"source":["import pandas as pd\n","import rag\n","helper = rag.Helper(\n"," \"./vectorstore/db_faiss_ads_Jun_facty_activebeat_Health_dupRemoved0.85\"\n"," )\n","\n","data = pd.read_csv(\"./data/148_facty_activebeat_24Jun-30Jun_top1000each_urlsContent.tsv\", sep=\"\\t\")\n","data = data.dropna(axis=0, how=\"any\", inplace=True)\n","# data.drop_duplicates(subset = ['ad_title', 'ad_desc'], inplace=True)\n","data[\"core_content\"] = data.apply(lambda row: (\n"," \"Page Title -: \" \n"," + row[\"url_title\"] \n"," + \"\\nPage Content -: \" \n"," + \". \".join(row[\"url_content\"].split(\". \")[:7])\n","), axis=1)\n","\n","total_cost = 0\n","data"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":1000},"executionInfo":{"elapsed":4220886,"status":"ok","timestamp":1720098026186,"user":{"displayName":"autoopt GoogleColab","userId":"13240348593990227985"},"user_tz":-330},"id":"tMWYEVYSeVhL","outputId":"9dda7bba-e7c1-4c36-dc98-ed1062ba1307"},"outputs":[{"name":"stdout","output_type":"stream","text":["31,32,33,34,35,36,37,38,39,40, Total cost is up to now is 0.07723840000000001\n","41,42,43,44,45,46,47,48,49,50, Total cost is up to now is 0.09258700000000002\n","51,52,53,54,55,56,57,58,59,60, Total cost is up to now is 0.10775680000000001\n","61,62,63,64,65,66,67,68,69,70, Total cost is up to now is 0.12251020000000001\n","71,72,73,74,75,76,77,78,79,80, Total cost is up to now is 0.13763380000000003\n","81,82,83,84,85,86,87,88,89,90, Total cost is up to now is 0.1530052\n","91,92,93,94,95,96,97,98,99,100, Total cost is up to now is 0.1679824\n","101,102,103,104,105,106,107,108,109,110, Total cost is up to now is 0.18317620000000004\n","111,112,113,114,115,116,117,118,119,120, Total cost is up to now is 0.19802140000000004\n","121,122,123,124,125,126,127,128,129,130, Total cost is up to now is 0.212821\n","131,132,133,134,135,136,137,138,139,140, Total cost is up to now is 0.22768839999999999\n","141,142,143,144,145,146,147,148,149,150, Total cost is up to now is 0.24157479999999998\n","151,152,153,154,155,156,157,158,159,160, Total cost is up to now is 0.25669899999999995\n","161,162,163,164,165,166,167,168,169,170, Total cost is up to now is 0.27200739999999995\n","171,172,173,174,175,176,177,178,179,180, Total cost is up to now is 0.28564119999999993\n","181,182,183,184,185,186,187,188,189,190, Total cost is up to now is 0.3001438\n","191,192,193,194,195,196,197,198,199,200, Total cost is up to now is 0.31524940000000007\n","201,202,203,204,205,206,207,208,209,210, Total cost is up to now is 0.3304012\n","211,212,213,214,215,216,217,218,219,220, Total cost is up to now is 0.3446187999999999\n","221,222,223,224,225,226,227,228,229,230, Total cost is up to now is 0.35976699999999995\n","231,232,233,234,235,236,237,238,239,240, Total cost is up to now is 0.3748372\n","241,242,243,244,245,246,247,248,249,250, Total cost is up to now is 0.3905626\n","251,252,253,254,255,256,257,258,259,260, Total cost is up to now is 0.4055212000000001\n","261,262,263,264,265,266,267,268,269,270, Total cost is up to now is 0.4207096000000002\n","271,272,273,274,275,276,277,278,279,280, Total cost is up to now is 0.43399360000000015\n","281,282,283,284,285,286,287,288,289,290, Total cost is up to now is 0.4509520000000002\n","291,292,293,294,295,296,297,298,299,300, Total cost is up to now is 0.4658902000000002\n","301,302,303,304,305,306,307,308,309,310, Total cost is up to now is 0.48102340000000016\n","311,312,313,314,315,316,317,318,319,320, Total cost is up to now is 0.49583800000000006\n","321,322,323,324,325,326,327,328,329,330, Total cost is up to now is 0.5106501999999999\n","331,332,333,334,335,336,337,338,339,340, Total cost is up to now is 0.5255217999999999\n","341,342,343,344,345,346,347,348,349,350, Total cost is up to now is 0.5403424\n","351,352,353,354,355,356,357,358,359,360, Total cost is up to now is 0.5549014000000001\n","361,362,363,364,365,366,367,368,369,370, Total cost is up to now is 0.5688946000000001\n","371,372,373,374,375,376,377,378,379,380, Total cost is up to now is 0.5836384000000001\n","381,382,383,384,385,386,387,388,389,390, Total cost is up to now is 0.6003850000000001\n","391,392,393,394,395,396,397,398,399,400, Total cost is up to now is 0.6147501999999999\n","401,402,403,404,405,406,407,408,409,410, Total cost is up to now is 0.6298731999999999\n","411,412,413,414,415,416,417,418,419,420, Total cost is up to now is 0.6432172\n","421,422,423,424,425,426,427,428,429,430, Total cost is up to now is 0.6553924000000002\n","431,432,433,434,435,436,437,438,439,440, Total cost is up to now is 0.6689104000000001\n","441,442,443,444,445,446,447,448,449,450, Total cost is up to now is 0.6830140000000003\n","451,452,453,454,455,456,457,458,459,460, Total cost is up to now is 0.7008556000000002\n","461,462,463,464,465,466,467,468,469,470, Total cost is up to now is 0.7160608000000003\n","471,472,473,474,475,476,477,478,479,480, Total cost is up to now is 0.7316716000000002\n","481,482,483,484,485,486,487,488,489,490, Total cost is up to now is 0.7469524000000001\n","491,492,493,494,495,496,497,498,499,500, Total cost is up to now is 0.7622140000000001\n","501,502,503,504,505,506,507,508,509,510, Total cost is up to now is 0.7764514000000001\n","511,512,513,514,515,516,517,518,519,520, Total cost is up to now is 0.7927186\n","521,522,523,524,525,526,527,528,529,530, Total cost is up to now is 0.8069332\n","531,532,533,534,535,536,537,538,539,540, Total cost is up to now is 0.8218101999999999\n","541,542,543,544,545,546,547,548,549,550, Total cost is up to now is 0.8350263999999998\n","551,552,553,554,555,556,557,558,559,560, Total cost is up to now is 0.8493321999999998\n","561,562,563,564,565,566,567,568,569,570, Total cost is up to now is 0.8618007999999997\n","571,572,573,574,575,576,577,578,579,580, Total cost is up to now is 0.8765361999999998\n","581,582,583,584,585,586,587,588,589,590, Total cost is up to now is 0.8914251999999998\n","591,592,593,594,595,596,597,598,599,600, Total cost is up to now is 0.9067485999999998\n","601,602,603,604,605,606,607,608,609,610, Total cost is up to now is 0.9213837999999996\n","611,612,613,614,615,616,617,618,619,620, Total cost is up to now is 0.9356661999999997\n","621,622,623,624,625,626,627,628,629,630, Total cost is up to now is 0.9509679999999998\n","631,632,633,634,635,636,637,638,639,640, Total cost is up to now is 0.9654699999999998\n","641,642,643,644,645,646,647,648,649,650, Total cost is up to now is 0.9796989999999997\n","651,652,653,654,655,656,657,658,659,660, Total cost is up to now is 0.9939405999999996\n","661,662,663,664,665,666,667,668,669,670, Total cost is up to now is 1.0087125999999997\n","671,672,673,674,675,676,677,678,679,680, Total cost is up to now is 1.0232853999999998\n","681,682,683,684,685,686,687,688,689,690, Total cost is up to now is 1.0368375999999997\n","691,692,693,694,695,696,697,698,699,700, Total cost is up to now is 1.0500963999999997\n","701,702,703,704,705,706,707,708,709,710, Total cost is up to now is 1.0668376\n","711,712,713,714,715,716,717,718,719,720, Total cost is up to now is 1.0805500000000001\n","721,722,723,724,725,726,727,728,729,730, Total cost is up to now is 1.095403\n","731,732,733,734,735,736,737,738,739,740, Total cost is up to now is 1.1107671999999995\n","741,742,743,744,745,746,747,748,749,750, Total cost is up to now is 1.1248239999999994\n","751,752,753,754,755,756,757,758,759,760, Total cost is up to now is 1.1407113999999994\n","761,762,763,764,765,766,767,768,769,770, Total cost is up to now is 1.1562987999999994\n","771,772,773,774,775,776,777,778,779,780, Total cost is up to now is 1.1704701999999994\n","781,782,783,784,785,786,787,788,789,790, Total cost is up to now is 1.1854809999999991\n","791,792,793,794,795,796,797,798,799,800, Total cost is up to now is 1.2011841999999993\n","801,802,803,804,805,806,807,808,809,810, Total cost is up to now is 1.2164727999999991\n","811,812,813,814,815,816,817,818,819,820, Total cost is up to now is 1.2319119999999992\n","821,822,823,824,825,826,827,828,829,830, Total cost is up to now is 1.2470001999999991\n","831,832,833,834,835,836,837,838,839,840, Total cost is up to now is 1.2618885999999994\n","841,842,843,844,845,846,847,848,849,850, Total cost is up to now is 1.2767295999999995\n","851,852,853,854,855,856,857,858,859,860, Total cost is up to now is 1.2918795999999997\n","861,862,863,864,865,866,867,868,869,870, Total cost is up to now is 1.3072737999999995\n","871,872,873,874,875,876,877,878,879,880, Total cost is up to now is 1.3217145999999995\n","881,882,883,884,885,886,887,888,889,890, Total cost is up to now is 1.3361991999999994\n","891,892,893,894,895,896,897,898,899,900, Total cost is up to now is 1.3514901999999993\n","901,902,903,904,905,906,907,908,909,910, Total cost is up to now is 1.3659327999999993\n","911,912,913,914,915,916,917,918,919,920, Total cost is up to now is 1.3801101999999992\n","921,922,923,924,925,926,927,928,929,930, Total cost is up to now is 1.395049599999999\n","931,932,933,934,935,936,937,938,939,940, Total cost is up to now is 1.410941199999999\n","941,942,943,944,945,946,947,948,949,950, Total cost is up to now is 1.425363399999999\n","951,952,953,954,955,956,957,958,959,960, Total cost is up to now is 1.4408199999999993\n","961,962,963,964,965,966,967,968,969,970, Total cost is up to now is 1.4535477999999993\n","971,972,973,974,975,976,977,978,979,980, Total cost is up to now is 1.4666121999999993\n","981,982,983,984,985,986,987,988,989,990, Total cost is up to now is 1.4811627999999994\n","991,992,993,994,995,996,997,998,999,1000, Total cost is up to now is 1.4975211999999993\n","1001,1002,1003,1004,1005,1006,1007,1008,1009,1010, Total cost is up to now is 1.514112999999999\n","1011,1012,1013,1014,1015,1016,1017,1018,1019,1020, Total cost is up to now is 1.529151399999999\n","1021,1022,1023,1024,1025,1026,1027,1028,1029,1030, Total cost is up to now is 1.544032599999999\n","1031,1032,1033,1034,1035,1036,1037,1038,1039,1040, Total cost is up to now is 1.5580485999999991\n","1041,1042,1043,1044,1045,1046,1047,1048,1049,1050, Total cost is up to now is 1.572739599999999\n","1051,1052,1053,1054,1055,1056,1057,1058,1059,1060, Total cost is up to now is 1.5870261999999988\n","1061,1062,1063,1064,1065,1066,1067,1068,1069,1070, Total cost is up to now is 1.5983613999999986\n","1071,1072,1073,1074,1075,1076,1077,1078,1079,1080, Total cost is up to now is 1.6131441999999987\n","1081,1082,1083,1084,1085,1086,1087,1088,1089,1090, Total cost is up to now is 1.6274271999999987\n","1091,1092,1093,1094,1095,1096,1097,1098,1099,1100, Total cost is up to now is 1.642075599999999\n","1101,1102,1103,1104,1105,1106,1107,1108,1109,1110, Total cost is up to now is 1.656018999999999\n","1111,1112,1113,1114,1115,1116,1117,1118,1119,1120, Total cost is up to now is 1.671110799999999\n","1121,1122,1123,1124,1125,1126,1127,1128,1129,1130, Total cost is up to now is 1.6854021999999989\n","1131,1132,1133,1134,1135,1136,1137,1138,1139,1140, Total cost is up to now is 1.697931999999999\n","1141,1142,1143,1144,1145,1146,1147,1148,1149,1150, Total cost is up to now is 1.7121351999999992\n","1151,1152,1153,1154,1155,1156,1157,1158,1159,1160, Total cost is up to now is 1.727621199999999\n","1161,1162,1163,1164,1165,1166,1167,1168,1169,1170, Total cost is up to now is 1.7426433999999988\n","1171,1172,1173,1174,1175,1176,1177,1178,1179,1180, Total cost is up to now is 1.7565399999999987\n","1181,1182,1183,1184,1185,1186,1187,1188,1189,1190, Total cost is up to now is 1.7707413999999984\n","1191,1192,1193,1194,1195,1196,1197,1198,1199,1200, Total cost is up to now is 1.7864535999999984\n","1201,1202,1203,1204,1205,1206,1207,1208,1209,1210, Total cost is up to now is 1.8009813999999982\n","1211,1212,1213,1214,1215,1216,1217,1218,1219,1220, Total cost is up to now is 1.814853399999998\n","1221,1222,1223,1224,1225,1226,1227,1228,1229,1230, Total cost is up to now is 1.8261459999999978\n","1231,1232,1233,1234,1235,1236,1237,1238,1239,1240, Total cost is up to now is 1.8395901999999975\n","1241,1242,1243,1244,1245,1246,1247,1248,1249,1250, Total cost is up to now is 1.8525957999999976\n","1251,1252,1253,1254,1255,1256,1257,1258,1259,1260, Total cost is up to now is 1.8668271999999975\n","1261,1262,1263,1264,1265,1266,1267,1268,1269,1270, Total cost is up to now is 1.8790953999999973\n","1271,1272,1273,1274,1275,1276,1277,1278,1279,1280, Total cost is up to now is 1.8894129999999976\n","1281,1282,1283,1284,1285,1286,1287,1288,1289,1290, Total cost is up to now is 1.9035507999999979\n","1291,1292,1293,1294,1295,1296,1297,1298,1299,1300, Total cost is up to now is 1.9152219999999982\n","1301,1302,1303,1304,1305,1306,1307,1308,1309,1310, Total cost is up to now is 1.9297857999999983\n","1311,1312,1313,1314,1315,1316,1317,1318,1319,1320, Total cost is up to now is 1.9432827999999982\n","1321,1322,1323,1324,1325,1326,1327,1328,1329,1330, Total cost is up to now is 1.9598121999999982\n","1331,1332,1333,1334,1335,1336,1337,1338,1339,1340, Total cost is up to now is 1.9722183999999978\n","1341,1342,1343,1344,1345,1346,1347,1348,1349,1350, Total cost is up to now is 1.9860291999999977\n","1351,1352,1353,1354,1355,1356,1357,1358,1359,1360, Total cost is up to now is 2.0032731999999975\n","1361,1362,1363,1364,1365,1366,1367,1368,1369,1370, Total cost is up to now is 2.018317599999998\n","1371,1372,1373,1374,1375,1376,1377,1378,1379,1380, Total cost is up to now is 2.0330895999999976\n","1381,1382,1383,1384,1385,1386,1387,1388,1389,1390, Total cost is up to now is 2.0482497999999976\n","1391,1392,1393,1394,1395,1396,1397,1398,1399,1400, Total cost is up to now is 2.0615517999999975\n","1401,1402,1403,1404,1405,1406,1407,1408,1409,1410, Total cost is up to now is 2.075643999999998\n","1411,1412,1413,1414,1415,1416,1417,1418,1419,1420, Total cost is up to now is 2.087324199999998\n","1421,1422,1423,1424,1425,1426,1427,1428,1429,1430, Total cost is up to now is 2.1008853999999983\n","1431,1432,1433,1434,1435,1436,1437,1438,1439,1440, Total cost is up to now is 2.1153687999999984\n","1441,1442,1443,1444,1445,1446,1447,1448,1449,1450, Total cost is up to now is 2.128221399999998\n","1451,1452,1453,1454,1455,1456,1457,1458,1459,1460, Total cost is up to now is 2.1404511999999976\n","1461,1462,1463,1464,1465,1466,1467,1468,1469,1470, Total cost is up to now is 2.153955399999998\n","1471,1472,1473,1474,1475,1476,1477,1478,1479,1480, Total cost is up to now is 2.167844799999998\n","1481,1482,1483,1484,1485,1486,1487,1488,1489,1490, Total cost is up to now is 2.180095599999998\n","1491,1492,1493,1494,1495,1496,1497,1498,1500, Total cost is up to now is 2.194220799999998\n","1501,1502,1503,1504,1505,1506,1507,1508,1509,1510, Total cost is up to now is 2.2094805999999974\n","1511,1512,1513,1514,1515,1516,1517,1518,1519,1520, Total cost is up to now is 2.224642599999997\n","1521,1522,1523,1524,1525,1526,1527,1528,1529,1530, Total cost is up to now is 2.239409799999997\n","1531,1532,1533,1534,1535,1536,1537,1538,1539,1540, Total cost is up to now is 2.251494999999997\n","1541,1542,1543,1544,1545,1546,1547,1548,1549,1550, Total cost is up to now is 2.264805999999997\n","1551,1552,1553,1554,1555,1556,1557,1558,1559,1560, Total cost is up to now is 2.280449199999997\n","1561,1562,1563,1564,1565,1566,1567,1568,1569,1570, Total cost is up to now is 2.2951671999999963\n","1571,1572,1573,1574,1575,1576,1577,1578,1579,1580, Total cost is up to now is 2.306950599999996\n","1581,1582,1583,1584,1585,1586,1587,1588,1589,1590, Total cost is up to now is 2.322268599999996\n","1591,1592,1593,1594,1595,1596,1597,1598,1599,1600, Total cost is up to now is 2.3376141999999964\n","1601,1602,1603,1604,1605,1606,1607,1608,1609,1610, Total cost is up to now is 2.3516565999999965\n","1611,1612,1613,1614,1615,1616,1617,1618,1619,1620, Total cost is up to now is 2.3646057999999974\n","1621,1622,1623,1624,1625,1626,1627,1628,1629,1630, Total cost is up to now is 2.3763801999999976\n","1631,1632,1633,1634,1635,1636,1637,1638,1639,1640, Total cost is up to now is 2.390716599999997\n","1641,1642,1643,1644,1645,1646,1647,1648,1649,1650, Total cost is up to now is 2.402082399999997\n","1651,1652,1653,1654,1655,1656,1657,1658,1659,1660, Total cost is up to now is 2.4165567999999964\n","1661,1662,1663,1664,1665,1666,1667,1668,1669,1670, Total cost is up to now is 2.430752199999996\n","1671,1672,1673,1674,1675,1676,1677,1678,1679,1680, Total cost is up to now is 2.4440745999999955\n","1681,1682,1683,1684,1685,1686,1687,1688,1689,1690, Total cost is up to now is 2.4575871999999963\n","1691,1692,1693,1694,1695,1696,1697,1698,1699,1700, Total cost is up to now is 2.4734463999999963\n","1701,1702,1703,1704,1705,1706,1707,1708,1709,1710, Total cost is up to now is 2.4871209999999957\n","1711,1712,1713,1714,1715,1716,1717,1718,1719,1720, Total cost is up to now is 2.5010979999999954\n","1721,1722,1723,1724,1725,1726,1727,1728,1729,1730, Total cost is up to now is 2.516832999999995\n","1731,1732,1733,1734,1735,1736,1737,1738,1739,1740, Total cost is up to now is 2.530495599999995\n","1741,1742,1743,1744,1745,1746,1747,1748,1749,1750, Total cost is up to now is 2.5444191999999957\n","1751,1752,1753,1754,1755,1756,1757,1758,1759,1760, Total cost is up to now is 2.5565721999999957\n","1761,1762,1763,1764,1765,1766,1767,1768,1769,1770, Total cost is up to now is 2.569007799999995\n","1771,1772,1773,1774,1775,1776,1777,1778,1779,1780, Total cost is up to now is 2.5835499999999954\n","1781,1782,1783,1784,1785,1786,1787,1788,1789,1790, Total cost is up to now is 2.5967895999999953\n","1791,1792,1793,1794,1795,1796,1797,1798,1799,1800, Total cost is up to now is 2.6092125999999953\n","1801,1802,1803,1804,1805,1806,1807,1808,1809,1810, Total cost is up to now is 2.6234349999999957\n","1811,1812,1813,1814,1815,1816,1817,1818,1819,1820, Total cost is up to now is 2.6346375999999956\n","1821,1822,1823,1824,1825,1826,1827,1828,1829,1830, Total cost is up to now is 2.6469597999999963\n","1831,1832,1833,1834,1835,1836,1837,1838,1839,1840, Total cost is up to now is 2.6582421999999957\n","1841,1842,1843,1844,1845,1846,1847,1848,1849,1850, Total cost is up to now is 2.6728653999999965\n","1851,1852,1853,1854,1855,1856,1857,1858,1859,1860, Total cost is up to now is 2.6858367999999966\n","1861,1862,1863,1864,1865,1866,1867,1868,1869,1870, Total cost is up to now is 2.699736399999997\n","1871,1872,1873,1874,1875,1876,1877,1878,1879,1880, Total cost is up to now is 2.7123513999999966\n","1881,1882,1883,1884,1885,1886,1887,1888,1889,1890, Total cost is up to now is 2.727578199999997\n","1891,1892,1893,1894,1895,1896,1897,1898,1899,1900, Total cost is up to now is 2.7403113999999964\n","1901,1902,1903,1904,1905,1906,1907,1908,1909,1910, Total cost is up to now is 2.753016999999996\n","1911,1912,1913,1914,1915,1916,1917,1918,1919,1920, Total cost is up to now is 2.766278799999996\n","1921,1922,1923,1924,1925,1926,1927,1928,1929,1930, Total cost is up to now is 2.7776451999999954\n","1931,1932,1933,1934,1935,1936,1937,1938,1939,1940, Total cost is up to now is 2.789379999999996\n","1941,1942,"]},{"data":{"application/vnd.google.colaboratory.intrinsic+json":{"summary":"{\n \"name\": \"responses\",\n \"rows\": 1943,\n \"fields\": [\n {\n \"column\": \"domain_name\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"facty.com\",\n \"activebeat.com\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"url\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 1943,\n \"samples\": [\n \"https://facty.com/conditions/cancer/10-signs-of-pancreatic-cancer/12\",\n \"https://facty.com/conditions/personality-disorder/10-symptoms-personality-disorder\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"kwd_imp\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 1778,\n \"samples\": [\n \"9,985\",\n \"7,572\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"kwd_click\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 571,\n \"samples\": [\n \"411\",\n \"799\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"ad_click\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 429,\n \"samples\": [\n \"203\",\n \"399\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"revenue\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 1457,\n \"samples\": [\n \"$0.56\",\n \"$2.72\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"rank\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 289,\n \"min\": 1,\n \"max\": 1000,\n \"num_unique_values\": 998,\n \"samples\": [\n 467,\n 827\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"url_title\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 1311,\n \"samples\": [\n \"Fun Facts About the Havanese - Facty\",\n \"10 Signs Your Body Might Be Battling an Ulcer - Facty Health\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"url_content\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 1841,\n \"samples\": [\n \"25 Foods that Help Lower Cholesterol. There is a reason breakfast is the most important meal of the day. Kickstarting your morning with a bowl of warm oatmeal incorporates some healthy elements into your diet, first thing. Whole grains are an ideal source of soluble fiber, and oats top the list. Soluble fiber is a gel that prevents cholesterol from being absorbed into the bloodstream. Eat anywhere from five to ten grams of soluble fiber each day\\u2014at least one and a quarter cups of oatmeal\\u2014to combat bad cholesterol. Adding toppings like chopped apples can further increase the fiber in your first meal.\",\n \"The Pancreas: A Marvel of the Digestive System. The pancreas is a flat, pear-shaped gland behind the stomach, in the abdominal cavity. This six-inch neighbor to the gallbladder and spleen plays an important role in converting food into fuel and also produces and secretes hormones as part of the endocrine system. Often underappreciated, the pancreas carries out various functions, all of which are essential for health. The Pancreas Has Dual Roles. The pancreas is unique in that it is involved in both the digestive and endocrine systems. As part of the former, it secretes enzymes into the small intestine, which help break down food into smaller components for proper digestion and absorption. As an endocrine gland, it secretes two hormones crucial to metabolism. The Pancreas Is Responsible for Blood Sugar Control. As part of the endocrine system, the pancreas releases insulin and glucagon, both of which help regulate blood glucose levels. Without them, there would be no way to control the amount of sugar in the bloodstream. Proper secretion of these regulatory substances is essential for normal function; conditions such as diabetes can result from imbalances in insulin and glucagon. simpson33 / Getty Images. The Pancreas Plays a Large Role in Digestion. One of the pancreas' main functions is to aid in digestion. More specifically, the gland releases pancreatic juices into the small intestine through a small duct \\u2014 one that is normally covered in thin mucus \\u2014 when there is food in the stomach. Together with bile released from the liver, the enzyme helps the body digest and absorb food. The Pancreas Secretes Insulin. If blood glucose levels are too high, the pancreas releases insulin, a hormone that stems from the gland's beta cells. In response, the liver absorbs glucose and stores it as glycogen. Fat and skeletal muscle cells also absorb sugar from the bloodstream. If the pancreas does not produce enough insulin, blood sugar levels will be abnormally high; this is one of the main causes of diabetes. ayo888 / Getty Images. The Pancreas Secretes Glucagon. In response to low blood sugar levels, the pancreas secretes glucagon, a hormone originating from the organ's alpha cells. Similar to insulin in that it acts on the liver, glucagon's main role is to prevent blood glucose levels from dropping too low. In addition to stimulating the conversion of glycogen to glucose \\u2014 a process called glycogenolysis \\u2014 glucagon also promotes the production of glucose from amino acids and reduces the amount of glucose consumed by the liver. Jan-Otto / Getty Images. The Pancreas Secretes Somatostatin. The pancreas also secretes somatostatin, a hormone that inhibits the secretion of insulin and glucagon. As it moves through the bloodstream, somatostatin also helps regulate the release of other substances such as gastrin and growth hormone; in doing so, the hormone maintains a wide variety of physiological functions. In the nervous system, it acts as a neurotransmitter or chemical messenger. designer491 / Getty Images. Pancreatic Fluid Helps Neutralize Stomach Acid. Following a meal, the epithelial cells of the pancreas secrete pancreatic juice \\u2014 an alkaline liquid that contains high concentrations of bicarbonate. These juices are crucial for proper digestion, helping to neutralize stomach acid before it enters the small intestine. A hormone called secretin, which comes from the small intestine, regulates these pancreatic secretions; a deficiency of this regulatory substance may lead to peptic ulcer disease. The Pancreas Produces Lipase. The body cannot absorb dietary fat in its original form. Instead, enzymes must first break down the fats into basic components: fatty acids and glycerol; a pancreatic enzyme called lipase is responsible for this process. Without lipase, the body would be unable to break down fats from digested food, which leads to diarrhea or fatty stools. Significantly low levels of lipase can cause permanent damage to the pancreas. jarun011 / Getty Images. The Pancreas Produces Amylase. Similar to fats, carbohydrates are broken down into simpler compounds prior to absorption. An enzyme called amylase \\u2014 which is produced and secreted by the pancreas and the salivary glands \\u2014 carries out this role. People with a shortage of amylase may experience diarrhea due to the effects of undigested starch in the large intestine. The Pancreas Synthesizes and Secretes Proteases. The pancreas produces two types of proteases or enzymes that break down proteins: trypsin and chymotrypsin. Together with pepsin, a stomach enzyme, they break down protein into amino acids. In addition, proteases help keep the intestine free of pathogens like bacteria. People with protease deficiencies may experience irritability, mood swings, edema, and insomnia; recovery from infections such as those caused by bacteria and viruses may be slower because protease also digests impurities in the blood. shunyufan / Getty Images.\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"input\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 1664,\n \"samples\": [\n \"Page Title -: Understanding the Ten Common Causes of Calf Muscle Pain - Facty Health\\nPage Content -: Three muscles make up the section of the leg below the knee that most people call the calf. While any direct injury to these three muscles can cause pain, conditions that affect the surrounding tissue, arteries, nerves, or the muscles themselves can do so, as well. Muscle Cramp. Some of the most common causes of calf pain are muscle cramps , which are involuntary contractions of a muscle. Cramps can be extremely painful and even debilitating. The muscles may feel stiff to the touch or have a visible knot. Though the cramp may not last very long, the pain and soreness can persist for several days\",\n \"Page Title -: The 15 Top Inflammatory Foods to Avoid\\nPage Content -: The 15 Top Inflammatory Foods to Avoid. Inflammation is the body\\u2019s natural response to safeguard against foreign bacteria, viruses, and infection. When it senses a threat, the body will trigger the release of chemicals and white blood cells (our body\\u2019s germ fighters). However, with certain inflammatory conditions, or autoimmune diseases \\u2014such as rheumatoid or osteoarthritis, fibromyalgia, celiac disease, Crohn\\u2019s disease , and multiple sclerosis\\u2014the immune system\\u2019s response is inflammatory even when there is no threat. However avoiding these 15 foods may greatly reduce and soothe the inflammatory response\\u2026. It\\u2019s no surprise that more than half of the world\\u2019s population suffers from cow milk intolerance or milk allergy, which is an allergy to casein (or milk protein). In fact, cow\\u2019s milk and cream cheese has been deemed a highly inflammatory food for the amount of stomach upset, constipation and diarrhea, hives, and breathing issues it causes\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"relation_reasoning\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 251,\n \"samples\": [\n \"Given the user's search for 'How to Solve a Rubik's Cube in 5 Easy Steps,' it is evident that they are looking for information related to solving a Rubik's Cube. Therefore, ads that are related to Rubik's Cube solutions or tutorials would be relevant. However, since there are no ads provided in the ADS_DATA, we cannot determine the relevance of the ads to the user's intent.\",\n \"Given the user's search for 'What to Know About Asperger\\u2019s Syndrome,' it is evident that they are looking for information related to Asperger\\u2019s Syndrome, which falls within the autism spectrum. Therefore, ads that are related to Asperger\\u2019s Syndrome or autism spectrum disorders should be considered relevant. Ads 3, 4, 5, and 6 are all related to Asperger's Syndrome symptoms and signs, making them highly relevant to the user's intent. Ad 7 focuses on Autism Spectrum Disorder symptoms, which is closely related to Asperger's Syndrome. Therefore, all ads from Option 2 and Option 3 are relevant to the user's search.\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"relation_classification\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": -1,\n \"max\": 1,\n \"num_unique_values\": 3,\n \"samples\": [\n 1,\n 0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"relation_tokens_used\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 365,\n \"min\": 0,\n \"max\": 1827,\n \"num_unique_values\": 216,\n \"samples\": [\n 1431,\n 971\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"reasoning\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 1617,\n \"samples\": [\n \"The page content is focused on the common causes of low back pain, indicating that users might be looking for information on symptoms, causes, and treatments related to low back pain. The available ads in the ADS_DATA are categorized into three options related to low back pain symptoms, causes, and related leg pain. These options are directly relevant to the user's potential intent, making them attractive choices for engagement.\",\n \"The page content is specifically about 'Leaky Heart Valve: Symptoms, Causes, and Treatments'. Therefore, the question should be tailored to engage users interested in understanding more about this condition. The options should provide relevant information related to symptoms, causes, and treatments of a leaky heart valve.\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"question\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 1431,\n \"samples\": [\n \"Curious about lung cancer causes and symptoms?\",\n \"Concerned about recognizing heart attack symptoms?\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"options\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 1707,\n \"samples\": [\n \"1. Foods That Impact Blood Sugar Levels\\nAd 1: Foods That Lower Blood Sugar - Safe Foods - Type 2 Diabetes.\\nAd 2: Foods That Lower Blood Sugar - What Can I Eat With Diabetes?\\nAd 3: Best Foods To Reverse Diabetes - What Can I Eat With Diabetes?\\nAd 4: Best Foods To Reverse Diabetes - What Can I Eat With Diabetes?\\nAd 5: Foods To Avoid With Diabetes - Keep Blood Sugar in Check\\nAd 6: Foods That Lower A1c Instantly - Safe Foods - Type 2 Diabetes.\\n\\n2. Heart-Healthy Food Choices\\nAd 7: Foods for Healthy Cholesterol - Healthy Cholesterol Food List.\\n\\n3. Blood Sugar Management Tips\\nAd 13: Reduce Your Blood Sugar Levels - Lower Blood Sugar Naturally.\\nAd 14: diabetes blood sugar levels - Get More Info.\\nAd 15: Diabetes Blood Sugar Level - See Top Results.\\nAd 16: How to Get Blood Sugar Down? - High Blood Glucose Symptoms.\\nAd 17: Control Your Blood Sugar - Signs of High Blood Sugar.\\nAd 18: Blood Sugar Level - Find Results Now.\\n\\n\",\n \"1. Explore Detailed Schizophrenia Causes\\nAd 1: 10 COMMON CAUSES OF DOWN SYNDROME - GET COMPLETE DETAILS ON 10 COMMON CAUSES OF DOWN SYNDROME. EXPLORE MORE INFO ON 10 COMMON CAUSES OF DOWN SYNDROME. FIND RESULTS INSTANTLY!\\nAd 2: 10 Causes of Seizures - See Results For 10 causes of seizures. Get Detailed Info On 10 Causes of Seizures. Visit Us To Know More!\\nAd 3: 10 Stroke Causes - 10 Common Causes - Facty Health. 10 Common Causes of Stroke. Do You Know What Causes Stroke? --\\nAd 4: 14 Down Syndrome Main Causes - Down Syndrome Causes. 14 Common Symptoms of Down Syndrome. Do You Have Down Syndrome Symptoms? Signs and Symptoms, Causes, Diagnosis, and Treatment\\nAd 5: 10 common causes of stroke - See Results For 10 common causes of stroke. Get Detailed Info On 10 common causes of stroke. Visit Us To Know More!\\nAd 6: 10 Causes of Dizziness - Common Dizziness Causes - Facty Health. Do You Have Dizziness? 10 Causes of Dizziness. Learn About What Causes Dizziness and Factors That Can Increase Your Risks\\n\\n2. Schizophrenia Symptoms & Signs\\nAd 7: Schizophrenia Symptoms - Warning Signs For Schizophrenia. Schizophrenia One of the Reason of Mental Disorder You May Have. Schizoaffective Disorder. What Is Emotional Wellness? Find Information About Schizophrenia Symptoms and Signs\\nAd 8: Beginning Signs Of Schizophrenia - Early Signs of Schizophrenia. Schizophrenia One of the Reason of Mental Disorder You May Have. Schizoaffective Disorder. What Is Emotional Wellness? Find Information About Schizophrenia Symptoms and Signs\\nAd 9: Top 10 Signs of Schizophrenia - Recognize Schizophrenia Early. 10 signs childhood schizophrenia. Find Information About Schizophrenia Symptoms and Signs. Schizophrenia One of the Reason of Mental Disorder. What Is Emotional Wellness?\\nAd 10: First Rank Symptoms Schizophrenia - Early Signs of Schizophrenia. Schizophrenia One of the Reason of Mental Disorder You May Have. Schizoaffective Disorder. What Is Emotional Wellness? Find Information About Schizophrenia Symptoms and Signs\\nAd 11: Paranoid Schizophrenia Symptom - Top 10 Signs of Schizophrenia. 10 signs childhood schizophrenia. Find Information About Schizophrenia Symptoms and Signs. Schizophrenia One of the Reason of Mental Disorder. What Is Emotional Wellness?\\nAd 12: Top 10 Signs of Schizophrenia - Causes Schizophrenia in Adults. Schizophrenia One of the Reason of Mental Disorder. What Is Emotional Wellness? 10 signs childhood schizophrenia. Find Information About Schizophrenia Symptoms and Signs\\n\\n3. Schizophrenia Treatment Options\\nAd 13: Signs Of Schizophrenia - Schizophrenia Treatments. Navigate your path to healing with our tailored schizophrenia treatment options. Watch real adults living with Schizophrenia discuss a treatment option and safety info.\\nAd 14: Early Signs Of Schizophrenia - Schizophrenia Treatments. Watch real adults living with Schizophrenia discuss a treatment option and safety info. Navigate your path to healing with our tailored schizophrenia treatment options.\\nAd 15: 5 Symptoms Of Schizophrenia - Schizophrenia Recovery Info. Watch real adults living with Schizophrenia discuss a treatment option and safety info. Navigate your path to healing with our tailored schizophrenia treatment options.\\nAd 16: Know Signs of Schizophrenia - Schizophrenia Symptoms. Sign Up to Stay Up to Date On All Things Related to Schizophrenia. How To Recognize The Full Spectrum Of Symptoms Of Schizophrenia\\nAd 17: Identify Spectrum Of Symptoms - Recognize the Symptoms. Understand the Impact of the Various Symptoms of Schizophrenia. Information On How To Recognize Schizophrenia For Patients & Caregivers\\nAd 18: Schizophrenia - Treatment Information. Diagnosed With Schizophrenia? Discover a Treatment Option & Safety Info for Adults.\\n\\n\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"options_count\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 8,\n \"samples\": [\n 2,\n \"1\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"question_tokens_used\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 760,\n \"min\": 0,\n \"max\": 3295,\n \"num_unique_values\": 883,\n \"samples\": [\n 2028,\n 2847\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"ads_data\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 1575,\n \"samples\": [\n \"*************** Cluster-:1 **************\\nDrinks Bad For Kidneys - Avoid 16 Kidney-Harming Foods. Find out which foods are bad for the health of your kidneys. Discover these foods that you need to avoid that can ruin your kidney health.\\npublisher_url: https://facty.com/conditions/kidney-infection/foods-that-support-your-kidneys/2/ | keyword_term: Beverages to Treat Kidney Problems | ad_display_url: thelifetoday.com/kidney-food | revenue: 0.05565 | ad_click_count: 1.0 | RPC: 0.05565 | Type: vogon\\nValue: 0.68370044\\n\\nKidney Failure Stages - Which Foods Damage Kidneys. Find out which foods are bad for the health of your kidneys. Learn more now Find out about 16 effective ways to lower your blood pressure right now..\\npublisher_url: https://facty.com/ailments/kidney/stage-3-kidney-disease-and-preventing-progression/ | keyword_term: Kidney Failure Stages | ad_display_url: thelifetoday.com/kidney-food | revenue: 0.0477 | ad_click_count: 1.0 | RPC: 0.0477 | Type: vogon\\nValue: 0.6651537\\n\\nReverse Kidney Disease Diet - Avoid 16 Kidney-Harming Foods. Discover these foods that you need to avoid that can ruin your kidney health. Find out which foods are bad for the health of your kidneys.\\npublisher_url: https://activebeat.com/diet-nutrition/foods-good-for-your-kidneys | keyword_term: 10 Foods That Reverse Kidney Disease | ad_display_url: thelifetoday.com/kidney-food | revenue: 0.05565 | ad_click_count: 1.0 | RPC: 0.05565 | Type: vogon\\nValue: 0.70076674\\n\\nExpert Tips on Foods to Avoid - 9 Seriously Bad Foods To Avoid. Find out which foods are bad for the health of your kidneys. Learn more now Find out about 16 effective ways to lower your blood pressure right now..\\npublisher_url: https://activebeat.com/diet-nutrition/foods-to-lower-triglycerides | keyword_term: Foods to Avoid for Triglycerides | ad_display_url: thelifetoday.com/kidney-food | revenue: 0.0477 | ad_click_count: 1.0 | RPC: 0.0477 | Type: vogon\\nValue: 0.6979933\\n\\nAvoid 16 Kidney-Harming Foods - Third Stage Kidney Disease. Discover these foods that you need to avoid that can ruin your kidney health. Learn more now Find out about 16 effective ways to lower your blood pressure right now..\\npublisher_url: https://facty.com/ailments/kidney/stage-3-kidney-disease-and-preventing-progression/ | keyword_term: How to Reverse Chronic Kidney Stage 3 Diseases | ad_display_url: thelifetoday.com/kidney-food | revenue: 0.0477 | ad_click_count: 1.0 | RPC: 0.0477 | Type: vogon\\nValue: 0.69220424\\n\\nHow Can I Lower My Potassium Level Quickly? - 16 Foods To Heal Kidneys. Discover these foods that you need to avoid that can ruin your kidney health. Learn the foods you need to remove from your diet for healthy kidneys today\\npublisher_url: https://facty.com/lifestyle/wellness/causes-of-high-potassium/ | keyword_term: How to Lower Potassium Level Quickly | ad_display_url: thelifetoday.com/kidney-food | revenue: 0.099604 | ad_click_count: 1.0 | RPC: 0.099604 | Type: vogon\\nValue: 0.60648036\\n\\n\\n*************** Cluster-:2 **************\\nBest Foods For Kidney Health - 15 Kidney-Friendly Foods. Explore 15 key kidney supporting foods to add to your diet. Eating a variety of healthy foods can help your kidneys function better for longer.\\npublisher_url: https://activebeat.com/your-health/filtering-out-6-causes-of-chronic-kidney-disease | keyword_term: Foods to Heal Chronic Kidney Disease | ad_display_url: facty.com/Diet/Kidney | revenue: 0.1113 | ad_click_count: 1.0 | RPC: 0.1113 | Type: vogon\\nValue: 0.5559272\\n\\nBest Foods for Your Kidneys - Best Foods for Kidney Health. Choose Foods That Are Healthy For Your Kidney. Improve Kidney Function Easily At Home! How To Prevent Kidney Stones - Learn Easy Home Remedy to Improve Kidney Funtion\\npublisher_url: https://activebeat.com/your-health/8-early-warning-symptoms-of-kidney-stones | keyword_term: How to Pass Kidney Stones Naturally | ad_display_url: kidneyfunctionimproved.com/kidney_stones | revenue: 0.91315 | ad_click_count: 3.0 | RPC: 0.3043833333 | Type: vogon\\nValue: 0.6312908\\n\\nTop 10 Kidney Foods to Eat - 10 Best Foods for The Kidney. Boost Your Kidney Health with Top 10 Nutritious Foods Recommended by Experts! Embrace these 10 foods that promote kidney wellness.Enjoy a healthy renal system.\\npublisher_url: https://facty.com/conditions/kidney-infection/foods-that-support-your-kidneys/ | keyword_term: Super Foods for Kidney Health | ad_display_url: www.arhealthnetwork.com/foods/kidney | revenue: 0.119303 | ad_click_count: 1.0 | RPC: 0.119303 | Type: vogon\\nValue: 0.62664497\\n\\nKidney Disease Diet Food List - Foods to Heal Kidney Disease. Eating right for kidney disease? Discover the top 15 foods for optimal kidney health. Boost your health and happiness with our top tips for eating right with kidney disease!\\npublisher_url: https://facty.com/conditions/kidney-infection/foods-that-support-your-kidneys/ | keyword_term: Best Foods That Reverse Kidney Disease | ad_display_url: www.arhealthnetwork.com/foods/kidney-desease | revenue: 0.0477 | ad_click_count: 1.0 | RPC: 0.0477 | Type: vogon\\nValue: 0.5828047\\n\\n16 Foods To Heal Kidneys - 16 Best Foods for Your Kidney. Find out these common foods that are beneficial for your kidney health. Learn about the list of best foods to help with kidneys.\\npublisher_url: https://facty.com/conditions/kidney-infection/foods-that-support-your-kidneys/ | keyword_term: Best Foods That Reverse Kidney Disease | ad_display_url: thelifetoday.com/kidney-food | revenue: 0.170925 | ad_click_count: 1.0 | RPC: 0.170925 | Type: vogon\\nValue: 0.5853959\\n\\nKidney Disease Diet Food List - Foods to Heal Kidney Disease. Eating right for kidney disease? Discover the top 15 foods for optimal kidney health. Take control of your kidney health with our comprehensive list of top 15 foods!\\npublisher_url: https://facty.com/conditions/kidney-infection/foods-that-support-your-kidneys/ | keyword_term: Best Foods That Reverse Kidney Disease | ad_display_url: www.arhealthnetwork.com/foods/kidney-desease | revenue: 0.274836 | ad_click_count: 2.0 | RPC: 0.137418 | Type: vogon\\nValue: 0.6748874\\n\\n\\n*************** Cluster-:3 **************\\nNeed a Vitamin D Multivitamin? - Get More Vitamin D. Helps Support Full Body Wellness with Key Nutrients Including Antioxidants & Vitamin D. Contains a Daily Value of Vitamin D to Support Immune Health & Muscle Function.\\npublisher_url: https://facty.com/food/nutrition/10-symptoms-of-b12-deficiency/ | keyword_term: 10 Signs You Need More Vitamin B12 | ad_display_url: www.centrum.com/Vitamin-D/Multivitamin | revenue: 0.18285 | ad_click_count: 1.0 | RPC: 0.18285 | Type: vogon\\nValue: 0.6961946\\n\\nVitamin D Benefits - Supports Whole Body Health. Helps Support Full Body Wellness with Key Nutrients Including Antioxidants & Vitamin D. Contains a Daily Value of Vitamin D to Support Immune Health & Muscle Function.\\npublisher_url: https://facty.com/lifestyle/dietary/symptoms-of-a-vitamin-d-overdose-or-toxicity/ | keyword_term: Vitamin D Dementia Symptoms | ad_display_url: www.centrum.com/Vitamin-D/Benefits | revenue: 0.26235 | ad_click_count: 1.0 | RPC: 0.26235 | Type: vogon\\nValue: 0.69998085\\n\\nNeed a Vitamin D Multivitamin? - A Daily Value of Vitamin D. Helps Support Full Body Wellness with Key Nutrients Including Antioxidants & Vitamin D. Contains a Daily Value of Vitamin D to Support Immune Health & Muscle Function.\\npublisher_url: https://facty.com/lifestyle/wellness/symptoms-of-vitamin-d-deficiency/ | keyword_term: Vitamin D for Seniors Over 70 | ad_display_url: www.centrum.com/Vitamin-D/Multivitamin | revenue: 0.297869 | ad_click_count: 1.0 | RPC: 0.297869 | Type: vogon\\nValue: 0.70493495\\n\\nUnderstanding Vitamin D3 - Vitamin D3. Increase Your Vitamin D3 Intake with Our Nutritious and Tasty Foods and Beverages! Boost Your Immune System and Bone Health with Our Vitamin D3-Rich Foods and Drinks!\\npublisher_url: https://facty.com/lifestyle/wellness/symptoms-of-vitamin-d3-deficiency/ | keyword_term: Top 10 Symptoms of Low Vitamin D | ad_display_url: thelifetoday.com/vitamin-d3/learn-more | revenue: 0.042979 | ad_click_count: 1.0 | RPC: 0.042979 | Type: vogon\\nValue: 0.6980094\\n\\nTop 5 Mushrooms For Vitamin D - Top 5 Lion's Mane Benefits. We Went Through Dozens Of Products To Help You Avoid Disreputable And Untrustworthy Brands. Discover The Top Mushroom Supplements For The Brain, Immunity, And Focus.\\npublisher_url: https://facty.com/food/nutrition/15-foods-high-in-calcium/ | keyword_term: Top 5 Calcium Foods for Seniors | ad_display_url: www.reviewscout.org/mushrooms/reviews | revenue: 0.266325 | ad_click_count: 1.0 | RPC: 0.266325 | Type: vogon\\nValue: 0.6301557\\n\\nTop 5 Cordyceps Mushrooms 2024 - Benefits Of Cordyceps Vitamins. We Went Through Dozens Of Products To Help You Avoid Disreputable And Untrustworthy Brands. Discover The Top Mushroom Supplements For The Brain, Immunity, And Focus.\\npublisher_url: https://facty.com/lifestyle/wellness/10-valuable-health-benefits-of-cordyceps/1/ | keyword_term: Side Effects of Cordyceps | ad_display_url: www.reviewscout.org/mushrooms/reviews | revenue: 0.066057 | ad_click_count: 1.0 | RPC: 0.066057 | Type: vogon\\nValue: 0.67078036\\n\\n\\n\",\n \"*************** Cluster-:1 **************\\nSjogren's Syndrome - Sjogren's Autoimmune Disease. Detailed Patient Guide to Sjogren's Syndrome. Causes, Symptoms, Treatments, and Support. Don't Let Sjogren's Syndrome Control Your Life. Get the Patient Guide to Sjogren's Today.\\npublisher_url: https://facty.com/ailments/body/10-symptoms-of-sjogrens-syndrome/ | keyword_term: Top 5 Signs of Sjogren's Syndrome | ad_display_url: wp.sjogrens-guidebook.com | revenue: 0.10335 | ad_click_count: 1.0 | RPC: 0.10335 | Type: vogon\\nValue: 0.67000735\\n\\n10 Common Chronic Diseases - Causes, Symptoms & Treatments. Heart Disease, Multiple Sclerosis & More. Learn Essential Information About The Most Common Chronic Diseases.\\npublisher_url: https://activebeat.com/your-health/chronic-kidney-disease-10-symptoms-of-ckd | keyword_term: Top 10 Symptoms of Chronic Kidney Disease | ad_display_url: facty.com/top-10/chronic-disease | revenue: 0.1113 | ad_click_count: 1.0 | RPC: 0.1113 | Type: vogon\\nValue: 0.67638814\\n\\nCauses, Triggers, & Treatments - Learn More About Psoriasis. Psoriasis symptoms vary from mild to severe. Learn about causes and triggers of psoriasis. Psoriasis is an immune mediated disease caused by systemic inflammation. Learn more here.\\npublisher_url: https://activebeat.com/your-health/common-causes-of-swollen-feet | keyword_term: 10 Causes for Swollen Feet in Seniors | ad_display_url: psoriasis.org/about-psoriasis | revenue: 1.147999 | ad_click_count: 1.0 | RPC: 1.147999 | Type: vogon\\nValue: 0.6848451\\n\\n\\n*************** Cluster-:2 **************\\nMULTIPLE SCLEROSIS SYMPTOMS - See Results For multiple sclerosis symptoms. Get Detailed Info On MULTIPLE SCLEROSIS SYMPTOMS. Visit Us To Know More!\\npublisher_url: https://facty.com/conditions/muscular/8-symptoms-restless-legs-syndrome/ | keyword_term: Multiple Sclerosis Symptoms | ad_display_url: multiplesclerosistest.site/Multiple+Sclerosis+Test | revenue: 0.174875 | ad_click_count: 1.0 | RPC: 0.174875 | Type: vogon\\nValue: 0.5087944\\n\\n10 MULTIPLE SCLEROSIS SYMPTOMS - See Results For 10 multiple sclerosis symptoms. Get Detailed Info On 10 MULTIPLE SCLEROSIS SYMPTOMS. Visit Us To Know More!\\npublisher_url: https://facty.com/conditions/ms/10-symptoms-of-ms/ | keyword_term: 10 Multiple Sclerosis Symptoms | ad_display_url: multiplesclerosistest.site/Multiple+Sclerosis+Test | revenue: 0.239549 | ad_click_count: 1.0 | RPC: 0.239549 | Type: vogon\\nValue: 0.52695084\\n\\nmultiple sclerosis symptoms - See Results For multiple sclerosis symptoms. Get Detailed Info On multiple sclerosis symptoms. Visit Us To Know More!\\npublisher_url: https://activebeat.com/your-health/women/the-early-warning-symptoms-of-multiple-sclerosis | keyword_term: Multiple Sclerosis Symptoms | ad_display_url: whatcauses-multiplesclerosis.site/Multiple+Sclerosis | revenue: 0.22833 | ad_click_count: 1.0 | RPC: 0.22833 | Type: vogon\\nValue: 0.534832\\n\\nRecognize Multiple Sclerosis - 10 Symptoms of MS. Do You Have Multiple Sclerosis (MS) Symptoms? Click Here for Common MS Symptoms.\\npublisher_url: https://activebeat.com/your-health/women/the-early-warning-symptoms-of-multiple-sclerosis | keyword_term: First Sign of Multiple Sclerosis | ad_display_url: facty.com/ms/symtpoms | revenue: 0.0636 | ad_click_count: 1.0 | RPC: 0.0636 | Type: vogon\\nValue: 0.40865055\\n\\nMULTIPLE SCLEROSIS SIGNS - See Results For multiple sclerosis signs. Get Detailed Info On MULTIPLE SCLEROSIS SIGNS. Visit Us To Know More!\\npublisher_url: https://activebeat.com/your-health/women/the-early-warning-symptoms-of-multiple-sclerosis | keyword_term: Multiple Sclerosis Signs | ad_display_url: multiple-sclerosis-signs-us.space/Early+Multiple+Sclerosis+Signs | revenue: 0.24409 | ad_click_count: 1.0 | RPC: 0.24409 | Type: vogon\\nValue: 0.57448536\\n\\n10 Early Symptoms of Multiple Sclerosis - See Results For 10 early symptoms of multiple sclerosis. Get Detailed Info On 10 Early Symptoms of Multiple Sclerosis. Visit Us To Know More!\\npublisher_url: https://activebeat.com/your-health/women/the-early-warning-symptoms-of-multiple-sclerosis | keyword_term: 10 Early Symptoms of Multiple Sclerosis | ad_display_url: symptoms-multiplesclerosis.site/Symptoms+Of+Multiple+Sclerosis | revenue: 0.545372 | ad_click_count: 1.0 | RPC: 0.545372 | Type: vogon\\nValue: 0.5188861\\n\\n\\n*************** Cluster-:3 **************\\nSymptoms Of Myasthenia Gravis - Myasthenia Gravis Symptoms. Learn More About Myasthenia Gravis, a chronic autoimmune disorder causing muscle weakness. Learn About A New Myasthenia Gravis Treatment For Adults.\\npublisher_url: https://facty.com/conditions/myasthenia-gravis/10-symptoms-myasthenia-gravis/ | keyword_term: Stages of Myasthenia Gravis | ad_display_url: discover.myhealthandwellnessinfo.com/myasthenia/gravis | revenue: 0.045931 | ad_click_count: 1.0 | RPC: 0.045931 | Type: vogon\\nValue: 0.6171495\\n\\nCauses of Myasthenia Gravis - Myasthenia Gravis Symptoms. Learn More About Myasthenia Gravis, a chronic autoimmune disorder causing muscle weakness. GMG Symptom Information For Patients - Learn The Impacts of GMG.\\npublisher_url: https://activebeat.com/your-health/6-early-warning-signs-of-parkinsons-disease | keyword_term: Myasthenia Gravis Legs | ad_display_url: discover.myhealthandwellnessinfo.com/myasthenia/gravis | revenue: 0.1804 | ad_click_count: 1.0 | RPC: 0.1804 | Type: vogon\\nValue: 0.6190331\\n\\nEarly Symptoms Of Myasthenia Gravis - Symptoms of Myasthenia Gravis. Learn About A New Myasthenia Gravis Treatment For Adults. Learn More About Myasthenia Gravis, a chronic autoimmune disorder causing muscle weakness\\npublisher_url: https://facty.com/ailments/eyes/causes-symptoms-and-treatments-of-eye-pain/ | keyword_term: Early Symptoms of Myasthenia Gravis | ad_display_url: discover.myhealthandwellnessinfo.com/myasthenia/gravis | revenue: 0.198771 | ad_click_count: 1.0 | RPC: 0.198771 | Type: vogon\\nValue: 0.67467934\\n\\nOcular Myasthenia Gravis - Myasthenia Gravis Symptoms. Learn More About Myasthenia Gravis, a chronic autoimmune disorder causing muscle weakness. GMG Symptom Information For Patients - Learn The Impacts of GMG.\\npublisher_url: https://activebeat.com/your-health/vertigo-symptoms-10-signs-you-may-have-vertigo | keyword_term: Test for Myasthenia Gravis | ad_display_url: discover.myhealthandwellnessinfo.com/myasthenia/gravis | revenue: 0.15105 | ad_click_count: 1.0 | RPC: 0.15105 | Type: vogon\\nValue: 0.63047403\\n\\nEarly Signs Of Myasthenia Gravis - Ocular Myasthenia Gravis. Learn About A New Myasthenia Gravis Treatment For Adults. Learn More About Myasthenia Gravis, a chronic autoimmune disorder causing muscle weakness\\npublisher_url: https://activebeat.com/your-health/8-health-conditions-that-affect-balance | keyword_term: Early Signs of Myasthenia Gravis | ad_display_url: discover.myhealthandwellnessinfo.com/myasthenia/gravis | revenue: 0.16695 | ad_click_count: 1.0 | RPC: 0.16695 | Type: vogon\\nValue: 0.6836282\\n\\nCauses of Muscular Dystrophy - MD Symptoms and Diagnosis. Symptoms, Causes and Diagnosis of Muscular Dystrophy. Read More. Your daily resource of information on Muscular Dystrophy. visit: musculardystrophynews.com\\npublisher_url: https://activebeat.com/your-health/7-health-facts-about-myotonic-dystrophy | keyword_term: Causes of Myotonic Dystrophy | ad_display_url: musculardystrophynews.com | revenue: 0.19875 | ad_click_count: 1.0 | RPC: 0.19875 | Type: vogon\\nValue: 0.65362895\\n\\n\\n\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"cost\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.00035194358468877197,\n \"min\": 0.000321,\n \"max\": 0.0028254,\n \"num_unique_values\": 1043,\n \"samples\": [\n 0.0013218,\n 0.0014333999999999998\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}","type":"dataframe","variable_name":"responses"},"text/html":["\n","
\n","
\n","\n","\n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n","
domain_nameurlkwd_impkwd_clickad_clickrevenuerankurl_titleurl_contentinputrelation_reasoningrelation_classificationrelation_tokens_usedreasoningquestionoptionsoptions_countquestion_tokens_usedads_datacost
0activebeat.comhttps://activebeat.com/your-health/10-warning-...447,23410,1295,750$14,749.431Lung Cancer: 22 Early Signs and SymptomsLung Cancer: 22 Early Signs and Symptoms. Lung...Page Title -: Lung Cancer: 22 Early Signs and ...First retreived document value less than thres...10The content of the page is focused on early si...Concerned about early signs of lung cancer?1. Symptoms and Early Detection\\nAd 1: Symptom...32414*************** Cluster-:1 **************\\nSym...0.001448
1activebeat.comhttps://activebeat.com/your-health/women/14-ea...276,5073,6431,957$4,334.21214 Early Signs of Cancer Women Shouldn’t Ignore14 Early Signs of Cancer Women Shouldn’t Ignor...Page Title -: 14 Early Signs of Cancer Women S...First retreived document value less than thres...10Among the eighteen ads in the ADS_DATA, Ads 7,...Concerned about early signs of breast cancer?1. Symptoms of Early Breast Cancer\\nAd 1: SYMP...22721*************** Cluster-:1 **************\\nSYM...0.001633
2activebeat.comhttps://activebeat.com/your-health/chronic-kid...187,3613,7222,301$1,601.173Chronic Kidney Disease: 20 Common Symptoms of CKDChronic Kidney Disease: 20 Common Symptoms of ...Page Title -: Chronic Kidney Disease: 20 Commo...First retreived document value less than thres...10Among the sixteen ads in the ADS_DATA, Option ...Looking for signs of kidney problems?1. Symptoms of Kidney Problems\\nAd 1: signs of...32307*************** Cluster-:1 **************\\nsig...0.001384
3activebeat.comhttps://activebeat.com/health-news/15-foods-to...183,5044,6052,173$4,567.85415 Foods to Help Manage Diabetes15 Foods to Help Manage Diabetes. Being diagno...Page Title -: 15 Foods to Help Manage Diabetes...First retreived document value less than thres...10Among the fourteen ads in the ADS_DATA, only O...Looking for foods to manage diabetes?1. Foods to Avoid with Diabetes\\nAd 1: 12 Food...22175*************** Cluster-:1 **************\\n12 ...0.001305
4activebeat.comhttps://activebeat.com/your-health/7-symptoms-...178,5602,0081,102$546.595Signs and Symptoms of Kidney FailureSigns and Symptoms of Kidney Failure. Many peo...Page Title -: Signs and Symptoms of Kidney Fai...First retreived document value less than thres...10The content of the page is focused on signs an...Concerned about kidney health?1. Warning Signs Kidney Problems\\nAd 1: First ...32681*************** Cluster-:1 **************\\nFir...0.001609
...............................................................
1938facty.comhttps://facty.com/conditions/alzheimers/10-sym...3,209134$3.13996The Early Signs and Symptoms of Lewy Body Deme...8 . Loss of Balance. It is common for Lewy bod...Page Title -: The Early Signs and Symptoms of ...First retreived document value less than thres...10Among the eighteen ads in the ADS_DATA, Ads 1,...Curious about early signs of dementia?1. Warning Signs & Stages of Dementia\\nAd 1: W...32485*************** Cluster-:1 **************\\nWar...0.001491
1939facty.comhttps://facty.com/network/life/the-top-30-wors...3,208143$0.41997The Top 30 Worst Places to Live in the United ...Updated: Nov 9, 2022. 10 . Idabel, OK. Small-t...Page Title -: The Top 30 Worst Places to Live ...The user is reading an article about the worst...0714000.000428
1940facty.comhttps://facty.com/ailments/kidney/10-causes-of...3,1993113$2.3999810 Causes of Kidney Infection - Facty Health10 Causes of Kidney Infection. A kidney infect...Page Title -: 10 Causes of Kidney Infection - ...First retreived document value less than thres...10Among the seventeen ads in the ADS_DATA, Optio...Concerned about kidney infection causes?1. Symptoms and Causes of Kidney Problems\\nAd ...32766*************** Cluster-:1 **************\\nsig...0.001660
1941facty.comhttps://facty.com/conditions/muscular/10-home-...3,1946037$6.46999Can These 15 Home Treatments Help Your Restles...Can These 15 Home Treatments Help Your Restles...Page Title -: Can These 15 Home Treatments Hel...First retreived document value less than thres...10Among the fifteen home treatments mentioned in...Seeking relief for Restless Leg Syndrome?1. Neuropathy Relief Therapies\\n\\n2. Leg Swell...32425*************** Cluster-:1 **************\\nCur...0.001455
1942facty.comhttps://facty.com/conditions/myasthenia-gravis...3,1926846$10.16100010 Symptoms of Myasthenia Gravis - Facty Health10 Symptoms of Myasthenia Gravis. Myasthenia g...Page Title -: 10 Symptoms of Myasthenia Gravis...First retreived document value less than thres...10Among the eighteen ads in **ADS_DATA**, Option...Concerned about Myasthenia Gravis symptoms?1. Learn about Fibromyalgia Symptoms\\nAd 1: To...23054*************** Cluster-:1 **************\\nTop...0.001832
\n","

1943 rows × 20 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","\n","
\n"," \n","\n","\n","\n"," \n","
\n","\n","
\n"," \n"," \n"," \n","
\n","\n","
\n","
\n"],"text/plain":[" domain_name url \\\n","0 activebeat.com https://activebeat.com/your-health/10-warning-... \n","1 activebeat.com https://activebeat.com/your-health/women/14-ea... \n","2 activebeat.com https://activebeat.com/your-health/chronic-kid... \n","3 activebeat.com https://activebeat.com/health-news/15-foods-to... \n","4 activebeat.com https://activebeat.com/your-health/7-symptoms-... \n","... ... ... \n","1938 facty.com https://facty.com/conditions/alzheimers/10-sym... \n","1939 facty.com https://facty.com/network/life/the-top-30-wors... \n","1940 facty.com https://facty.com/ailments/kidney/10-causes-of... \n","1941 facty.com https://facty.com/conditions/muscular/10-home-... \n","1942 facty.com https://facty.com/conditions/myasthenia-gravis... \n","\n"," kwd_imp kwd_click ad_click revenue rank \\\n","0 447,234 10,129 5,750 $14,749.43 1 \n","1 276,507 3,643 1,957 $4,334.21 2 \n","2 187,361 3,722 2,301 $1,601.17 3 \n","3 183,504 4,605 2,173 $4,567.85 4 \n","4 178,560 2,008 1,102 $546.59 5 \n","... ... ... ... ... ... \n","1938 3,209 13 4 $3.13 996 \n","1939 3,208 14 3 $0.41 997 \n","1940 3,199 31 13 $2.39 998 \n","1941 3,194 60 37 $6.46 999 \n","1942 3,192 68 46 $10.16 1000 \n","\n"," url_title \\\n","0 Lung Cancer: 22 Early Signs and Symptoms \n","1 14 Early Signs of Cancer Women Shouldn’t Ignore \n","2 Chronic Kidney Disease: 20 Common Symptoms of CKD \n","3 15 Foods to Help Manage Diabetes \n","4 Signs and Symptoms of Kidney Failure \n","... ... \n","1938 The Early Signs and Symptoms of Lewy Body Deme... \n","1939 The Top 30 Worst Places to Live in the United ... \n","1940 10 Causes of Kidney Infection - Facty Health \n","1941 Can These 15 Home Treatments Help Your Restles... \n","1942 10 Symptoms of Myasthenia Gravis - Facty Health \n","\n"," url_content \\\n","0 Lung Cancer: 22 Early Signs and Symptoms. Lung... \n","1 14 Early Signs of Cancer Women Shouldn’t Ignor... \n","2 Chronic Kidney Disease: 20 Common Symptoms of ... \n","3 15 Foods to Help Manage Diabetes. Being diagno... \n","4 Signs and Symptoms of Kidney Failure. Many peo... \n","... ... \n","1938 8 . Loss of Balance. It is common for Lewy bod... \n","1939 Updated: Nov 9, 2022. 10 . Idabel, OK. Small-t... \n","1940 10 Causes of Kidney Infection. A kidney infect... \n","1941 Can These 15 Home Treatments Help Your Restles... \n","1942 10 Symptoms of Myasthenia Gravis. Myasthenia g... \n","\n"," input \\\n","0 Page Title -: Lung Cancer: 22 Early Signs and ... \n","1 Page Title -: 14 Early Signs of Cancer Women S... \n","2 Page Title -: Chronic Kidney Disease: 20 Commo... \n","3 Page Title -: 15 Foods to Help Manage Diabetes... \n","4 Page Title -: Signs and Symptoms of Kidney Fai... \n","... ... \n","1938 Page Title -: The Early Signs and Symptoms of ... \n","1939 Page Title -: The Top 30 Worst Places to Live ... \n","1940 Page Title -: 10 Causes of Kidney Infection - ... \n","1941 Page Title -: Can These 15 Home Treatments Hel... \n","1942 Page Title -: 10 Symptoms of Myasthenia Gravis... \n","\n"," relation_reasoning \\\n","0 First retreived document value less than thres... \n","1 First retreived document value less than thres... \n","2 First retreived document value less than thres... \n","3 First retreived document value less than thres... \n","4 First retreived document value less than thres... \n","... ... \n","1938 First retreived document value less than thres... \n","1939 The user is reading an article about the worst... \n","1940 First retreived document value less than thres... \n","1941 First retreived document value less than thres... \n","1942 First retreived document value less than thres... \n","\n"," relation_classification relation_tokens_used \\\n","0 1 0 \n","1 1 0 \n","2 1 0 \n","3 1 0 \n","4 1 0 \n","... ... ... \n","1938 1 0 \n","1939 0 714 \n","1940 1 0 \n","1941 1 0 \n","1942 1 0 \n","\n"," reasoning \\\n","0 The content of the page is focused on early si... \n","1 Among the eighteen ads in the ADS_DATA, Ads 7,... \n","2 Among the sixteen ads in the ADS_DATA, Option ... \n","3 Among the fourteen ads in the ADS_DATA, only O... \n","4 The content of the page is focused on signs an... \n","... ... \n","1938 Among the eighteen ads in the ADS_DATA, Ads 1,... \n","1939 \n","1940 Among the seventeen ads in the ADS_DATA, Optio... \n","1941 Among the fifteen home treatments mentioned in... \n","1942 Among the eighteen ads in **ADS_DATA**, Option... \n","\n"," question \\\n","0 Concerned about early signs of lung cancer? \n","1 Concerned about early signs of breast cancer? \n","2 Looking for signs of kidney problems? \n","3 Looking for foods to manage diabetes? \n","4 Concerned about kidney health? \n","... ... \n","1938 Curious about early signs of dementia? \n","1939 \n","1940 Concerned about kidney infection causes? \n","1941 Seeking relief for Restless Leg Syndrome? \n","1942 Concerned about Myasthenia Gravis symptoms? \n","\n"," options options_count \\\n","0 1. Symptoms and Early Detection\\nAd 1: Symptom... 3 \n","1 1. Symptoms of Early Breast Cancer\\nAd 1: SYMP... 2 \n","2 1. Symptoms of Kidney Problems\\nAd 1: signs of... 3 \n","3 1. Foods to Avoid with Diabetes\\nAd 1: 12 Food... 2 \n","4 1. Warning Signs Kidney Problems\\nAd 1: First ... 3 \n","... ... ... \n","1938 1. Warning Signs & Stages of Dementia\\nAd 1: W... 3 \n","1939 0 \n","1940 1. Symptoms and Causes of Kidney Problems\\nAd ... 3 \n","1941 1. Neuropathy Relief Therapies\\n\\n2. Leg Swell... 3 \n","1942 1. Learn about Fibromyalgia Symptoms\\nAd 1: To... 2 \n","\n"," question_tokens_used ads_data \\\n","0 2414 *************** Cluster-:1 **************\\nSym... \n","1 2721 *************** Cluster-:1 **************\\nSYM... \n","2 2307 *************** Cluster-:1 **************\\nsig... \n","3 2175 *************** Cluster-:1 **************\\n12 ... \n","4 2681 *************** Cluster-:1 **************\\nFir... \n","... ... ... \n","1938 2485 *************** Cluster-:1 **************\\nWar... \n","1939 0 \n","1940 2766 *************** Cluster-:1 **************\\nsig... \n","1941 2425 *************** Cluster-:1 **************\\nCur... \n","1942 3054 *************** Cluster-:1 **************\\nTop... \n","\n"," cost \n","0 0.001448 \n","1 0.001633 \n","2 0.001384 \n","3 0.001305 \n","4 0.001609 \n","... ... \n","1938 0.001491 \n","1939 0.000428 \n","1940 0.001660 \n","1941 0.001455 \n","1942 0.001832 \n","\n","[1943 rows x 20 columns]"]},"execution_count":25,"metadata":{},"output_type":"execute_result"}],"source":["import pandas as pd\n","responses_file_name = './data/150_results_facty_activebeat_24Jun-30Jun_top1000each_urlsContent.tsv'\n","try:\n"," responses = pd.read_csv(responses_file_name, sep='\\t')\n","except FileNotFoundError:\n"," responses = pd.DataFrame()\n","\n","new_rows = []\n","for i in range(len(responses), len(data)):\n"," print(i, end = ',')\n"," row = data.iloc[i, :]\n"," try:\n"," answer = {\n"," 'domain_name': row['domain_name'],\n"," 'url': row['stripped_url'],\n"," # 'input': '. '.join(row['stripped_url'].split('/')[3:]),\n"," 'kwd_imp': row['kwd_imp'],\n"," 'kwd_click': row['kwd_click'],\n"," 'ad_click': row['ad_click'],\n"," 'revenue': row['revenue'],\n"," 'rank': row['rank'],\n"," 'url_title': row['url_title'],\n"," 'url_content': row['url_content'],\n"," 'input': row['core_content'],\n"," }\n","\n"," reply, clustered_docs = my_rag.getRagResponse(row['core_content'])\n"," answer[\"relation_reasoning\"] = reply['relation_answer']['reasoning']\n"," answer[\"relation_classification\"] = reply['relation_answer']['classification']\n"," answer[\"relation_tokens_used\"] = reply['tokens_used_relation']\n","\n"," answer[\"reasoning\"] = reply['question_answer']['reasoning']\n"," answer[\"question\"] = reply['question_answer']['question']\n"," options = reply['question_answer']['options']\n"," options_res = \"\"\n"," for option in options:\n"," options_res += option + \"\\n\"\n"," for ad in options[option]:\n"," options_res += ad + \"\\n\"\n"," options_res += \"\\n\"\n"," answer[\"options\"] = options_res\n"," answer[\"options_count\"] = str(len(options))\n"," answer[\"question_tokens_used\"] = reply['tokens_used_question']\n","\n"," ads_data = \"\"\n"," for ind, cluster in enumerate(clustered_docs):\n"," ads_data += f\"*************** Cluster-:{ind+1} **************\\n\"\n"," for doc in cluster:\n"," ad = doc[0]\n"," ads_data += ad.page_content + \"\\n\"\n"," ads_data += \"publisher_url: \" + ad.metadata['publisher_url'] + \" | \"\n"," ads_data += \"keyword_term: \" + ad.metadata['keyword_term'] + \" | \"\n"," ads_data += \"ad_display_url: \" + ad.metadata['ad_display_url'] + \" | \"\n"," ads_data += \"revenue: \" + str(ad.metadata['revenue']) + \" | \"\n"," ads_data += \"ad_click_count: \" + str(ad.metadata['ad_click_count']) + \" | \"\n"," ads_data += \"RPC: \" + str(ad.metadata['RPC']) + \" | \"\n"," ads_data += \"Type: \" + ad.metadata['Type'] + \"\\n\"\n"," ads_data += \"Value: \" + str(doc[1]) + \"\\n\"\n"," ads_data += \"\\n\"\n"," ads_data += \"\\n\"\n"," answer[\"ads_data\"] = ads_data\n","\n"," cost = (answer[\"relation_tokens_used\"] + answer[\"question_tokens_used\"]) * 0.6/1000000\n"," total_cost += cost\n"," answer['cost'] = float(cost)\n"," except Exception as e:\n"," print(e)\n"," new_rows.append(answer)\n","\n"," if i % 10 == 0:\n"," print(\" Total cost is up to now is\", total_cost)\n"," responses = pd.concat([responses, pd.DataFrame(new_rows)], ignore_index=True)\n"," responses.to_csv(responses_file_name, sep='\\t', index=False)\n"," new_rows = []\n","\n","responses = pd.concat([responses, pd.DataFrame(new_rows)], ignore_index=True)\n","responses.to_csv(responses_file_name, sep='\\t', index=False)\n","responses\n"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":419},"executionInfo":{"elapsed":724,"status":"ok","timestamp":1720098026907,"user":{"displayName":"autoopt GoogleColab","userId":"13240348593990227985"},"user_tz":-330},"id":"8Nr2T6YZtATh","outputId":"894c0459-3a23-4290-dcb2-daf62100fdad"},"outputs":[{"data":{"application/vnd.google.colaboratory.intrinsic+json":{"summary":"{\n \"name\": \"df2\",\n \"rows\": 6054,\n \"fields\": [\n {\n \"column\": \"url\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 1589,\n \"samples\": [\n \"https://facty.com/conditions/ms/10-symptoms-of-ms/13\",\n \"https://activebeat.com/diet-nutrition/8-beneficial-uses-for-apple-cider-vinegar\",\n \"https://facty.com/food/nutrition/11-foods-high-in-vitamin-d\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"keyword\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 4683,\n \"samples\": [\n \"Seeking effective remedies for dizziness?\",\n \"Stretches for Lower Back Pain Relief\",\n \"Natural Ways to Lower Cholesterol\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"rank\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1,\n \"min\": 1,\n \"max\": 5,\n \"num_unique_values\": 5,\n \"samples\": [\n 2,\n 5,\n 3\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"is_question\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": 0,\n \"max\": 1,\n \"num_unique_values\": 2,\n \"samples\": [\n 0,\n 1\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}","type":"dataframe","variable_name":"df2"},"text/html":["\n","
\n","
\n","\n","\n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n","
urlkeywordrankis_question
0https://activebeat.com/your-health/10-warning-...Concerned about early signs of lung cancer?11
1https://activebeat.com/your-health/10-warning-...Symptoms and Early Detection20
2https://activebeat.com/your-health/10-warning-...Early Diagnosis Importance30
3https://activebeat.com/your-health/10-warning-...Awareness and Prevention40
4https://activebeat.com/your-health/women/14-ea...Concerned about early signs of breast cancer?11
...............
6049https://facty.com/conditions/muscular/10-home-...Leg Swelling Home Care30
6050https://facty.com/conditions/muscular/10-home-...Restless Legs Syndrome Solutions40
6051https://facty.com/conditions/myasthenia-gravis...Concerned about Myasthenia Gravis symptoms?11
6052https://facty.com/conditions/myasthenia-gravis...Learn about Fibromyalgia Symptoms20
6053https://facty.com/conditions/myasthenia-gravis...Learn about Myasthenia Gravis Symptoms30
\n","

6054 rows × 4 columns

\n","
\n","
\n","\n","
\n"," \n","\n"," \n","\n"," \n","
\n","\n","\n","
\n"," \n","\n","\n","\n"," \n","
\n","\n","
\n"," \n"," \n"," \n","
\n","\n","
\n","
\n"],"text/plain":[" url \\\n","0 https://activebeat.com/your-health/10-warning-... \n","1 https://activebeat.com/your-health/10-warning-... \n","2 https://activebeat.com/your-health/10-warning-... \n","3 https://activebeat.com/your-health/10-warning-... \n","4 https://activebeat.com/your-health/women/14-ea... \n","... ... \n","6049 https://facty.com/conditions/muscular/10-home-... \n","6050 https://facty.com/conditions/muscular/10-home-... \n","6051 https://facty.com/conditions/myasthenia-gravis... \n","6052 https://facty.com/conditions/myasthenia-gravis... \n","6053 https://facty.com/conditions/myasthenia-gravis... \n","\n"," keyword rank is_question \n","0 Concerned about early signs of lung cancer? 1 1 \n","1 Symptoms and Early Detection 2 0 \n","2 Early Diagnosis Importance 3 0 \n","3 Awareness and Prevention 4 0 \n","4 Concerned about early signs of breast cancer? 1 1 \n","... ... ... ... \n","6049 Leg Swelling Home Care 3 0 \n","6050 Restless Legs Syndrome Solutions 4 0 \n","6051 Concerned about Myasthenia Gravis symptoms? 1 1 \n","6052 Learn about Fibromyalgia Symptoms 2 0 \n","6053 Learn about Myasthenia Gravis Symptoms 3 0 \n","\n","[6054 rows x 4 columns]"]},"execution_count":26,"metadata":{},"output_type":"execute_result"}],"source":["import pandas as pd\n","df = pd.read_csv('./data/150_results_facty_activebeat_24Jun-30Jun_top1000each_urlsContent.tsv', sep='\\t')\n","df = df[(df['options_count'] < 5) & (df['options_count'] > 1)].loc[:, ['url', 'question', 'options']].dropna(how='any')\n","\n","def get_data(row):\n"," res = []\n"," res.append([row['url'], row['question'], 1, 1])\n"," options = [option.split(\"\\n\")[0] for option in row['options'].split(\"\\n\\n\")]\n"," for ind, option in enumerate(options):\n"," if(option != \"\"):\n"," res.append([row['url'], \". \".join(option.split(\". \")[1:]), ind+2, 0])\n"," return res\n","\n","results = [item for sublist in df.apply(get_data, axis=1) for item in sublist]\n","df2 = pd.DataFrame(results, columns=['url', 'keyword', 'rank', 'is_question'])\n","df2.to_csv('./data/151_url_keyword_rank_150data.tsv', sep='\\t', index=False)\n","df2\n"]}],"metadata":{"accelerator":"GPU","colab":{"collapsed_sections":["96bkibOzb61u","jQY6GygUcVKq","SXm9omkkb_jL"],"gpuType":"T4","machine_shape":"hm","provenance":[]},"kernelspec":{"display_name":"Python 3","name":"python3"},"language_info":{"name":"python"},"widgets":{"application/vnd.jupyter.widget-state+json":{"11ad55af107d47b2a5f861a77ea86574":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_bcdc6d46ae7c42499d5b55b3f8760c46","placeholder":"​","style":"IPY_MODEL_2d025277c7ec45919988136307a8a311","value":" 486/486 [03:49<00:00,  4.50it/s]"}},"2d025277c7ec45919988136307a8a311":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"DescriptionStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"47f9bb2ce608434e9e0fe3c10e8db3b5":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_ede8a37dd6304c13aa0702540d959933","IPY_MODEL_98c8060bd8cf4ab78212441c2b0e183b","IPY_MODEL_11ad55af107d47b2a5f861a77ea86574"],"layout":"IPY_MODEL_e3061c3334274696b08f5e923f486ad2"}},"58f0683f6c25470a9c5b41414b8cbc01":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"98c8060bd8cf4ab78212441c2b0e183b":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_e6e5f14adcb94117b71d613049a08c38","max":486,"min":0,"orientation":"horizontal","style":"IPY_MODEL_f64a1e4c8fd84b2880b78662c152e98d","value":486}},"bcdc6d46ae7c42499d5b55b3f8760c46":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"c41a33cf9f944719836e4eb0705b1296":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"DescriptionStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"e3061c3334274696b08f5e923f486ad2":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"e6e5f14adcb94117b71d613049a08c38":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"ede8a37dd6304c13aa0702540d959933":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_58f0683f6c25470a9c5b41414b8cbc01","placeholder":"​","style":"IPY_MODEL_c41a33cf9f944719836e4eb0705b1296","value":"Batches: 100%"}},"f64a1e4c8fd84b2880b78662c152e98d":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}}}}},"nbformat":4,"nbformat_minor":0}