{"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"," | domain_name | \n","stripped_url | \n","kwd_imp | \n","kwd_click | \n","ad_click | \n","revenue | \n","rank | \n","url_title | \n","url_content | \n","core_content | \n","
---|---|---|---|---|---|---|---|---|---|---|
0 | \n","activebeat.com | \n","https://activebeat.com/your-health/10-warning-... | \n","447,234 | \n","10,129 | \n","5,750 | \n","$14,749.43 | \n","1 | \n","Lung Cancer: 22 Early Signs and Symptoms | \n","Lung Cancer: 22 Early Signs and Symptoms. Lung... | \n","Page Title -: Lung Cancer: 22 Early Signs and ... | \n","
1 | \n","activebeat.com | \n","https://activebeat.com/your-health/women/14-ea... | \n","276,507 | \n","3,643 | \n","1,957 | \n","$4,334.21 | \n","2 | \n","14 Early Signs of Cancer Women Shouldn’t Ignore | \n","14 Early Signs of Cancer Women Shouldn’t Ignor... | \n","Page Title -: 14 Early Signs of Cancer Women S... | \n","
2 | \n","activebeat.com | \n","https://activebeat.com/your-health/chronic-kid... | \n","187,361 | \n","3,722 | \n","2,301 | \n","$1,601.17 | \n","3 | \n","Chronic Kidney Disease: 20 Common Symptoms of CKD | \n","Chronic Kidney Disease: 20 Common Symptoms of ... | \n","Page Title -: Chronic Kidney Disease: 20 Commo... | \n","
3 | \n","activebeat.com | \n","https://activebeat.com/health-news/15-foods-to... | \n","183,504 | \n","4,605 | \n","2,173 | \n","$4,567.85 | \n","4 | \n","15 Foods to Help Manage Diabetes | \n","15 Foods to Help Manage Diabetes. Being diagno... | \n","Page Title -: 15 Foods to Help Manage Diabetes... | \n","
4 | \n","activebeat.com | \n","https://activebeat.com/your-health/7-symptoms-... | \n","178,560 | \n","2,008 | \n","1,102 | \n","$546.59 | \n","5 | \n","Signs and Symptoms of Kidney Failure | \n","Signs and Symptoms of Kidney Failure. Many peo... | \n","Page Title -: Signs and Symptoms of Kidney Fai... | \n","
... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","
1938 | \n","facty.com | \n","https://facty.com/conditions/alzheimers/10-sym... | \n","3,209 | \n","13 | \n","4 | \n","$3.13 | \n","996 | \n","The Early Signs and Symptoms of Lewy Body Deme... | \n","8 . Loss of Balance. It is common for Lewy bod... | \n","Page Title -: The Early Signs and Symptoms of ... | \n","
1939 | \n","facty.com | \n","https://facty.com/network/life/the-top-30-wors... | \n","3,208 | \n","14 | \n","3 | \n","$0.41 | \n","997 | \n","The Top 30 Worst Places to Live in the United ... | \n","Updated: Nov 9, 2022. 10 . Idabel, OK. Small-t... | \n","Page Title -: The Top 30 Worst Places to Live ... | \n","
1940 | \n","facty.com | \n","https://facty.com/ailments/kidney/10-causes-of... | \n","3,199 | \n","31 | \n","13 | \n","$2.39 | \n","998 | \n","10 Causes of Kidney Infection - Facty Health | \n","10 Causes of Kidney Infection. A kidney infect... | \n","Page Title -: 10 Causes of Kidney Infection - ... | \n","
1941 | \n","facty.com | \n","https://facty.com/conditions/muscular/10-home-... | \n","3,194 | \n","60 | \n","37 | \n","$6.46 | \n","999 | \n","Can These 15 Home Treatments Help Your Restles... | \n","Can These 15 Home Treatments Help Your Restles... | \n","Page Title -: Can These 15 Home Treatments Hel... | \n","
1942 | \n","facty.com | \n","https://facty.com/conditions/myasthenia-gravis... | \n","3,192 | \n","68 | \n","46 | \n","$10.16 | \n","1000 | \n","10 Symptoms of Myasthenia Gravis - Facty Health | \n","10 Symptoms of Myasthenia Gravis. Myasthenia g... | \n","Page Title -: 10 Symptoms of Myasthenia Gravis... | \n","
1943 rows × 10 columns
\n","\n"," | domain_name | \n","url | \n","kwd_imp | \n","kwd_click | \n","ad_click | \n","revenue | \n","rank | \n","url_title | \n","url_content | \n","input | \n","relation_reasoning | \n","relation_classification | \n","relation_tokens_used | \n","reasoning | \n","question | \n","options | \n","options_count | \n","question_tokens_used | \n","ads_data | \n","cost | \n","
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n","activebeat.com | \n","https://activebeat.com/your-health/10-warning-... | \n","447,234 | \n","10,129 | \n","5,750 | \n","$14,749.43 | \n","1 | \n","Lung Cancer: 22 Early Signs and Symptoms | \n","Lung Cancer: 22 Early Signs and Symptoms. Lung... | \n","Page Title -: Lung Cancer: 22 Early Signs and ... | \n","First retreived document value less than thres... | \n","1 | \n","0 | \n","The content of the page is focused on early si... | \n","Concerned about early signs of lung cancer? | \n","1. Symptoms and Early Detection\\nAd 1: Symptom... | \n","3 | \n","2414 | \n","*************** Cluster-:1 **************\\nSym... | \n","0.001448 | \n","
1 | \n","activebeat.com | \n","https://activebeat.com/your-health/women/14-ea... | \n","276,507 | \n","3,643 | \n","1,957 | \n","$4,334.21 | \n","2 | \n","14 Early Signs of Cancer Women Shouldn’t Ignore | \n","14 Early Signs of Cancer Women Shouldn’t Ignor... | \n","Page Title -: 14 Early Signs of Cancer Women S... | \n","First retreived document value less than thres... | \n","1 | \n","0 | \n","Among the eighteen ads in the ADS_DATA, Ads 7,... | \n","Concerned about early signs of breast cancer? | \n","1. Symptoms of Early Breast Cancer\\nAd 1: SYMP... | \n","2 | \n","2721 | \n","*************** Cluster-:1 **************\\nSYM... | \n","0.001633 | \n","
2 | \n","activebeat.com | \n","https://activebeat.com/your-health/chronic-kid... | \n","187,361 | \n","3,722 | \n","2,301 | \n","$1,601.17 | \n","3 | \n","Chronic Kidney Disease: 20 Common Symptoms of CKD | \n","Chronic Kidney Disease: 20 Common Symptoms of ... | \n","Page Title -: Chronic Kidney Disease: 20 Commo... | \n","First retreived document value less than thres... | \n","1 | \n","0 | \n","Among the sixteen ads in the ADS_DATA, Option ... | \n","Looking for signs of kidney problems? | \n","1. Symptoms of Kidney Problems\\nAd 1: signs of... | \n","3 | \n","2307 | \n","*************** Cluster-:1 **************\\nsig... | \n","0.001384 | \n","
3 | \n","activebeat.com | \n","https://activebeat.com/health-news/15-foods-to... | \n","183,504 | \n","4,605 | \n","2,173 | \n","$4,567.85 | \n","4 | \n","15 Foods to Help Manage Diabetes | \n","15 Foods to Help Manage Diabetes. Being diagno... | \n","Page Title -: 15 Foods to Help Manage Diabetes... | \n","First retreived document value less than thres... | \n","1 | \n","0 | \n","Among the fourteen ads in the ADS_DATA, only O... | \n","Looking for foods to manage diabetes? | \n","1. Foods to Avoid with Diabetes\\nAd 1: 12 Food... | \n","2 | \n","2175 | \n","*************** Cluster-:1 **************\\n12 ... | \n","0.001305 | \n","
4 | \n","activebeat.com | \n","https://activebeat.com/your-health/7-symptoms-... | \n","178,560 | \n","2,008 | \n","1,102 | \n","$546.59 | \n","5 | \n","Signs and Symptoms of Kidney Failure | \n","Signs and Symptoms of Kidney Failure. Many peo... | \n","Page Title -: Signs and Symptoms of Kidney Fai... | \n","First retreived document value less than thres... | \n","1 | \n","0 | \n","The content of the page is focused on signs an... | \n","Concerned about kidney health? | \n","1. Warning Signs Kidney Problems\\nAd 1: First ... | \n","3 | \n","2681 | \n","*************** Cluster-:1 **************\\nFir... | \n","0.001609 | \n","
... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","
1938 | \n","facty.com | \n","https://facty.com/conditions/alzheimers/10-sym... | \n","3,209 | \n","13 | \n","4 | \n","$3.13 | \n","996 | \n","The Early Signs and Symptoms of Lewy Body Deme... | \n","8 . Loss of Balance. It is common for Lewy bod... | \n","Page Title -: The Early Signs and Symptoms of ... | \n","First retreived document value less than thres... | \n","1 | \n","0 | \n","Among the eighteen ads in the ADS_DATA, Ads 1,... | \n","Curious about early signs of dementia? | \n","1. Warning Signs & Stages of Dementia\\nAd 1: W... | \n","3 | \n","2485 | \n","*************** Cluster-:1 **************\\nWar... | \n","0.001491 | \n","
1939 | \n","facty.com | \n","https://facty.com/network/life/the-top-30-wors... | \n","3,208 | \n","14 | \n","3 | \n","$0.41 | \n","997 | \n","The Top 30 Worst Places to Live in the United ... | \n","Updated: Nov 9, 2022. 10 . Idabel, OK. Small-t... | \n","Page Title -: The Top 30 Worst Places to Live ... | \n","The user is reading an article about the worst... | \n","0 | \n","714 | \n","\n"," | \n"," | \n"," | 0 | \n","0 | \n","\n"," | 0.000428 | \n","
1940 | \n","facty.com | \n","https://facty.com/ailments/kidney/10-causes-of... | \n","3,199 | \n","31 | \n","13 | \n","$2.39 | \n","998 | \n","10 Causes of Kidney Infection - Facty Health | \n","10 Causes of Kidney Infection. A kidney infect... | \n","Page Title -: 10 Causes of Kidney Infection - ... | \n","First retreived document value less than thres... | \n","1 | \n","0 | \n","Among the seventeen ads in the ADS_DATA, Optio... | \n","Concerned about kidney infection causes? | \n","1. Symptoms and Causes of Kidney Problems\\nAd ... | \n","3 | \n","2766 | \n","*************** Cluster-:1 **************\\nsig... | \n","0.001660 | \n","
1941 | \n","facty.com | \n","https://facty.com/conditions/muscular/10-home-... | \n","3,194 | \n","60 | \n","37 | \n","$6.46 | \n","999 | \n","Can These 15 Home Treatments Help Your Restles... | \n","Can These 15 Home Treatments Help Your Restles... | \n","Page Title -: Can These 15 Home Treatments Hel... | \n","First retreived document value less than thres... | \n","1 | \n","0 | \n","Among the fifteen home treatments mentioned in... | \n","Seeking relief for Restless Leg Syndrome? | \n","1. Neuropathy Relief Therapies\\n\\n2. Leg Swell... | \n","3 | \n","2425 | \n","*************** Cluster-:1 **************\\nCur... | \n","0.001455 | \n","
1942 | \n","facty.com | \n","https://facty.com/conditions/myasthenia-gravis... | \n","3,192 | \n","68 | \n","46 | \n","$10.16 | \n","1000 | \n","10 Symptoms of Myasthenia Gravis - Facty Health | \n","10 Symptoms of Myasthenia Gravis. Myasthenia g... | \n","Page Title -: 10 Symptoms of Myasthenia Gravis... | \n","First retreived document value less than thres... | \n","1 | \n","0 | \n","Among the eighteen ads in **ADS_DATA**, Option... | \n","Concerned about Myasthenia Gravis symptoms? | \n","1. Learn about Fibromyalgia Symptoms\\nAd 1: To... | \n","2 | \n","3054 | \n","*************** Cluster-:1 **************\\nTop... | \n","0.001832 | \n","
1943 rows × 20 columns
\n","\n"," | url | \n","keyword | \n","rank | \n","is_question | \n","
---|---|---|---|---|
0 | \n","https://activebeat.com/your-health/10-warning-... | \n","Concerned about early signs of lung cancer? | \n","1 | \n","1 | \n","
1 | \n","https://activebeat.com/your-health/10-warning-... | \n","Symptoms and Early Detection | \n","2 | \n","0 | \n","
2 | \n","https://activebeat.com/your-health/10-warning-... | \n","Early Diagnosis Importance | \n","3 | \n","0 | \n","
3 | \n","https://activebeat.com/your-health/10-warning-... | \n","Awareness and Prevention | \n","4 | \n","0 | \n","
4 | \n","https://activebeat.com/your-health/women/14-ea... | \n","Concerned about early signs of breast cancer? | \n","1 | \n","1 | \n","
... | \n","... | \n","... | \n","... | \n","... | \n","
6049 | \n","https://facty.com/conditions/muscular/10-home-... | \n","Leg Swelling Home Care | \n","3 | \n","0 | \n","
6050 | \n","https://facty.com/conditions/muscular/10-home-... | \n","Restless Legs Syndrome Solutions | \n","4 | \n","0 | \n","
6051 | \n","https://facty.com/conditions/myasthenia-gravis... | \n","Concerned about Myasthenia Gravis symptoms? | \n","1 | \n","1 | \n","
6052 | \n","https://facty.com/conditions/myasthenia-gravis... | \n","Learn about Fibromyalgia Symptoms | \n","2 | \n","0 | \n","
6053 | \n","https://facty.com/conditions/myasthenia-gravis... | \n","Learn about Myasthenia Gravis Symptoms | \n","3 | \n","0 | \n","
6054 rows × 4 columns
\n","