{"id":551,"date":"2016-09-05T15:46:51","date_gmt":"2016-09-05T15:46:51","guid":{"rendered":"http:\/\/intelligentonlinetools.com\/blog\/?p=551"},"modified":"2017-10-15T01:43:04","modified_gmt":"2017-10-15T01:43:04","slug":"getting-wordnet-information-and-building-and-building-graph-with-python-and-networkx","status":"publish","type":"post","link":"http:\/\/intelligentonlinetools.com\/blog\/2016\/09\/05\/getting-wordnet-information-and-building-and-building-graph-with-python-and-networkx\/","title":{"rendered":"Getting WordNet Information and Building Graph with Python and NetworkX"},"content":{"rendered":"<p>WordNet and Wikipedia are often utilized in text mining algorithms for enriching short text representation [1] or for extracting additional knowledge about words. [2] WordNet&#8217;s structure makes it a useful tool for computational linguistics and natural language processing.[3] In this post we will look how to pull information from WordNet using python. Also we will look how to build graph for relations between words using python and NetworkX.<\/p>\n<p>WordNet groups English words into sets of synonyms called synsets, provides short definitions and usage examples, and records a number of relations among these synonym sets or their members. WordNet can thus be seen as a combination of dictionary and thesaurus. While it is accessible to human users via a web browser, its primary use is in automatic text analysis and artificial intelligence applications. [4]<\/p>\n<p>Here is how to get all synsets for the word &#8216;good&#8217; using NLTK package:<\/p>\n<pre><code>\r\nfrom nltk.corpus import wordnet as wn\r\n\r\nprint (wn.synsets('good'))\r\n\r\n#This is the output of above line:\r\n#[Synset('good.n.01'), Synset('good.n.02'), Synset('good.n.03'), Synset('commodity.n.01'), Synset('good.a.01'), Synset('full.s.06'), Synset('good.a.03'), Synset('estimable.s.02'), Synset('beneficial.s.01'), Synset('good.s.06'), Synset('good.s.07'), Synset('adept.s.01'), Synset('good.s.09'), Synset('dear.s.02'), Synset('dependable.s.04'), Synset('good.s.12'), Synset('good.s.13'), Synset('effective.s.04'), Synset('good.s.15'), Synset('good.s.16'), Synset('good.s.17'), Synset('good.s.18'), Synset('good.s.19'), Synset('good.s.20'), Synset('good.s.21'), Synset('well.r.01'), Synset('thoroughly.r.02')]\r\n<\/code><\/pre>\n<p>All synsets are connected to other synsets by means of semantic relations. These relations, which are not all shared by all lexical categories, include:<\/p>\n<p>hypernyms: Y is a hypernym of X if every X is a (kind of) Y (canine is a hypernym of dog)<br \/>\nhyponyms: Y is a hyponym of X if every Y is a (kind of) X (dog is a hyponym of canine)<br \/>\nmeronym: Y is a meronym of X if Y is a part of X (window is a meronym of building)<br \/>\nholonym: Y is a holonym of X if X is a part of Y (building is a holonym of window)    [4]<\/p>\n<p>Here is how can we can get hypernyms and hyponyms from WordNet.<\/p>\n<p>car = wn.synset(&#8216;car.n.01&#8217;)<br \/>\nprint (&#8220;HYPERNYMS&#8221;)<br \/>\nprint (car.hypernyms())<br \/>\nprint (&#8220;HYPONYMS&#8221;)<br \/>\nprint (car.hyponyms())<\/p>\n<p>Here is the output from above code:<br \/>\nHYPERNYMS<br \/>\n[Synset(&#8216;motor_vehicle.n.01&#8217;)]<br \/>\nHYPONYMS<br \/>\n[Synset(&#8216;ambulance.n.01&#8217;), Synset(&#8216;beach_wagon.n.01&#8217;), Synset(&#8216;bus.n.04&#8217;), Synset(&#8216;cab.n.03&#8217;), Synset(&#8216;compact.n.03&#8217;), Synset(&#8216;convertible.n.01&#8217;), Synset(&#8216;coupe.n.01&#8217;), Synset(&#8216;cruiser.n.01&#8217;), Synset(&#8216;electric.n.01&#8217;), Synset(&#8216;gas_guzzler.n.01&#8217;), Synset(&#8216;hardtop.n.01&#8217;), Synset(&#8216;hatchback.n.01&#8217;), Synset(&#8216;horseless_carriage.n.01&#8217;), Synset(&#8216;hot_rod.n.01&#8217;), Synset(&#8216;jeep.n.01&#8217;), Synset(&#8216;limousine.n.01&#8217;), Synset(&#8216;loaner.n.02&#8217;), Synset(&#8216;minicar.n.01&#8217;), Synset(&#8216;minivan.n.01&#8217;), Synset(&#8216;model_t.n.01&#8217;), Synset(&#8216;pace_car.n.01&#8217;), Synset(&#8216;racer.n.02&#8217;), Synset(&#8216;roadster.n.01&#8217;), Synset(&#8216;sedan.n.01&#8217;), Synset(&#8216;sport_utility.n.01&#8217;), Synset(&#8216;sports_car.n.01&#8217;), Synset(&#8216;stanley_steamer.n.01&#8217;), Synset(&#8216;stock_car.n.01&#8217;), Synset(&#8216;subcompact.n.01&#8217;), Synset(&#8216;touring_car.n.01&#8217;), Synset(&#8216;used-car.n.01&#8217;)]<br \/>\n<\/code><\/p>\n<p>Here is how to get synonyms, antonyms ,  lemmas and similarity: [5]<\/p>\n<pre><code>\r\nsynonyms = []\r\nantonyms = []\r\n\r\nfor syn in wn.synsets(\"good\"):\r\n    for l in syn.lemmas():\r\n        synonyms.append(l.name())\r\n        if l.antonyms():\r\n            antonyms.append(l.antonyms()[0].name())\r\n\r\nprint(set(synonyms))\r\nprint(set(antonyms))\r\nprint (syn.lemmas())\r\n\r\n\r\nw1 = wn.synset('ship.n.01')\r\nw2 = wn.synset('cat.n.01')\r\nprint(w1.wup_similarity(w2))\r\n<\/code><\/pre>\n<p>Here is how we can use Textblob package [6] and represent some word relations via graph. The output graph is shown below.<\/p>\n<pre><code>\r\nfrom textblob import Word\r\nword = Word(\"plant\")\r\nprint (word.synsets[:5])\r\nprint (word.definitions[:5])\r\n\r\nword = Word(\"computer\")\r\nfor syn in word.synsets:\r\n    for l in syn.lemma_names():\r\n        synonyms.append(l)\r\n        \r\nimport networkx as nx\r\nimport matplotlib.pyplot as plt\r\nG=nx.Graph()\r\n\r\n\r\nw=word.synsets[1]\r\n\r\n\r\nG.add_node(w.name())\r\nfor h in w.hypernyms():\r\n      print (h)\r\n      G.add_node(h.name())\r\n      G.add_edge(w.name(),h.name())\r\n\r\n\r\nfor h in w.hyponyms():\r\n      print (h)\r\n      G.add_node(h.name())\r\n      G.add_edge(w.name(),h.name())\r\n\r\nprint (G.nodes(data=True))\r\nplt.show()\r\nnx.draw(G, width=2, with_labels=True)\r\nplt.savefig(\"path.png\")\r\n<\/code><\/pre>\n<p><img data-attachment-id=\"560\" data-permalink=\"http:\/\/intelligentonlinetools.com\/blog\/2016\/09\/05\/getting-wordnet-information-and-building-and-building-graph-with-python-and-networkx\/wordnet_graph\/#main\" data-orig-file=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2016\/09\/Wordnet_graph.png\" data-orig-size=\"467,280\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Wordnet_graph\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2016\/09\/Wordnet_graph-300x180.png\" data-large-file=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2016\/09\/Wordnet_graph.png\" decoding=\"async\" loading=\"lazy\" src=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2016\/09\/Wordnet_graph-300x180.png\" alt=\"Wordnet_graph\" width=\"600\" height=\"360\" class=\"alignnone size-medium wp-image-560\" srcset=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2016\/09\/Wordnet_graph-300x180.png 300w, http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2016\/09\/Wordnet_graph.png 467w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>Here is the full source code<\/p>\n<pre><code>\r\nfrom nltk.corpus import wordnet as wn\r\n\r\nprint (wn.synsets('good'))\r\n\r\ncar = wn.synset('car.n.01')\r\nprint (\"HYPERNYMS\")\r\nprint (car.hypernyms())\r\nprint (\"HYPONYMS\")\r\nprint (car.hyponyms())\r\n\r\nsynonyms = []\r\nantonyms = []\r\n\r\nfor syn in wn.synsets(\"good\"):\r\n    for l in syn.lemmas():\r\n        synonyms.append(l.name())\r\n        if l.antonyms():\r\n            antonyms.append(l.antonyms()[0].name())\r\n\r\nprint(set(synonyms))\r\nprint(set(antonyms))\r\nprint (syn.lemmas())\r\n\r\n\r\n\r\nw1 = wn.synset('ship.n.01')\r\nw2 = wn.synset('cat.n.01')\r\nprint(w1.wup_similarity(w2))\r\n\r\n\r\nfrom textblob import Word\r\nword = Word(\"plant\")\r\nprint (word.synsets[:5])\r\nprint (word.definitions[:5])\r\n\r\nword = Word(\"computer\")\r\nfor syn in word.synsets:\r\n    for l in syn.lemma_names():\r\n        synonyms.append(l)\r\n\r\n\r\nimport networkx as nx\r\nimport matplotlib.pyplot as plt\r\nG=nx.Graph()\r\n\r\n\r\nw=word.synsets[1]\r\n\r\n\r\nG.add_node(w.name())\r\nfor h in w.hypernyms():\r\n      print (h)\r\n      G.add_node(h.name())\r\n      G.add_edge(w.name(),h.name())\r\n     \r\n\r\n\r\n\r\nfor h in w.hyponyms():\r\n      print (h)\r\n      G.add_node(h.name())\r\n      G.add_edge(w.name(),h.name())\r\n\r\n\r\n\r\nprint (G.nodes(data=True))\r\nplt.show()\r\nnx.draw(G, width=2, with_labels=True)\r\nplt.savefig(\"path.png\")\r\n\r\n<\/code><\/pre>\n<p><strong>References<\/strong><br \/>\n1. <a href=http:\/\/dmml.asu.edu\/users\/xufei\/Papers\/FCS-11167-JLT.pdf target=\"_blank\">Enriching short text representation in microblog for clustering<\/a><br \/>\n2. <a href=http:\/\/www.dh2012.uni-hamburg.de\/conference\/programme\/abstracts\/automatic-topic-hierarchy-generation-using-wordnet.1.html target=\"_blank\">Automatic Topic Hierarchy Generation Using WordNet<\/a><br \/>\n3. <a href=https:\/\/wordnet.princeton.edu target=\"_blank\"> WordNet <\/a><br \/>\n4. <a href=https:\/\/en.wikipedia.org\/wiki\/WordNet target=\"_blank\"> WordNet <\/a><br \/>\n5. <a href=https:\/\/pythonprogramming.net\/wordnet-nltk-tutorial\/ target=\"_blank\"> WordNet NLTK Tutorial <\/a><br \/>\n6. <a href=http:\/\/stevenloria.com\/tutorial-wordnet-textblob target=\"_blank\">Tutorial: What is WordNet? A Conceptual Introduction Using Python<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordNet and Wikipedia are often utilized in text mining algorithms for enriching short text representation [1] or for extracting additional knowledge about words. [2] WordNet&#8217;s structure makes it a useful tool for computational linguistics and natural language processing.[3] In this post we will look how to pull information from WordNet using python. Also we will &#8230; <a title=\"Getting WordNet Information and Building Graph with Python and NetworkX\" class=\"read-more\" href=\"http:\/\/intelligentonlinetools.com\/blog\/2016\/09\/05\/getting-wordnet-information-and-building-and-building-graph-with-python-and-networkx\/\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":[]},"categories":[10],"tags":[],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Getting WordNet Information and Building Graph with Python and NetworkX - Machine Learning Applications<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/intelligentonlinetools.com\/blog\/2016\/09\/05\/getting-wordnet-information-and-building-and-building-graph-with-python-and-networkx\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Getting WordNet Information and Building Graph with Python and NetworkX - Machine Learning Applications\" \/>\n<meta property=\"og:description\" content=\"WordNet and Wikipedia are often utilized in text mining algorithms for enriching short text representation [1] or for extracting additional knowledge about words. [2] WordNet&#8217;s structure makes it a useful tool for computational linguistics and natural language processing.[3] In this post we will look how to pull information from WordNet using python. Also we will ... Read more\" \/>\n<meta property=\"og:url\" content=\"http:\/\/intelligentonlinetools.com\/blog\/2016\/09\/05\/getting-wordnet-information-and-building-and-building-graph-with-python-and-networkx\/\" \/>\n<meta property=\"og:site_name\" content=\"Machine Learning Applications\" \/>\n<meta property=\"article:published_time\" content=\"2016-09-05T15:46:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-10-15T01:43:04+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2016\/09\/Wordnet_graph-300x180.png\" \/>\n<meta name=\"author\" content=\"owygs156\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"owygs156\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/2016\/09\/05\/getting-wordnet-information-and-building-and-building-graph-with-python-and-networkx\/\",\"url\":\"http:\/\/intelligentonlinetools.com\/blog\/2016\/09\/05\/getting-wordnet-information-and-building-and-building-graph-with-python-and-networkx\/\",\"name\":\"Getting WordNet Information and Building Graph with Python and NetworkX - Machine Learning Applications\",\"isPartOf\":{\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/#website\"},\"datePublished\":\"2016-09-05T15:46:51+00:00\",\"dateModified\":\"2017-10-15T01:43:04+00:00\",\"author\":{\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/7a886dc5eb9758369af2f6d2cb342478\"},\"breadcrumb\":{\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/2016\/09\/05\/getting-wordnet-information-and-building-and-building-graph-with-python-and-networkx\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/intelligentonlinetools.com\/blog\/2016\/09\/05\/getting-wordnet-information-and-building-and-building-graph-with-python-and-networkx\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/2016\/09\/05\/getting-wordnet-information-and-building-and-building-graph-with-python-and-networkx\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/intelligentonlinetools.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Getting WordNet Information and Building Graph with Python and NetworkX\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/#website\",\"url\":\"http:\/\/intelligentonlinetools.com\/blog\/\",\"name\":\"Machine Learning Applications\",\"description\":\"Artificial intelligence, data mining and machine learning for building web based tools and services.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/intelligentonlinetools.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/7a886dc5eb9758369af2f6d2cb342478\",\"name\":\"owygs156\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/2.gravatar.com\/avatar\/b351def598609cb4c0b5bca26497c7e5?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/2.gravatar.com\/avatar\/b351def598609cb4c0b5bca26497c7e5?s=96&d=mm&r=g\",\"caption\":\"owygs156\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Getting WordNet Information and Building Graph with Python and NetworkX - Machine Learning Applications","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/intelligentonlinetools.com\/blog\/2016\/09\/05\/getting-wordnet-information-and-building-and-building-graph-with-python-and-networkx\/","og_locale":"en_US","og_type":"article","og_title":"Getting WordNet Information and Building Graph with Python and NetworkX - Machine Learning Applications","og_description":"WordNet and Wikipedia are often utilized in text mining algorithms for enriching short text representation [1] or for extracting additional knowledge about words. [2] WordNet&#8217;s structure makes it a useful tool for computational linguistics and natural language processing.[3] In this post we will look how to pull information from WordNet using python. Also we will ... Read more","og_url":"http:\/\/intelligentonlinetools.com\/blog\/2016\/09\/05\/getting-wordnet-information-and-building-and-building-graph-with-python-and-networkx\/","og_site_name":"Machine Learning Applications","article_published_time":"2016-09-05T15:46:51+00:00","article_modified_time":"2017-10-15T01:43:04+00:00","og_image":[{"url":"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2016\/09\/Wordnet_graph-300x180.png"}],"author":"owygs156","twitter_card":"summary_large_image","twitter_misc":{"Written by":"owygs156","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/intelligentonlinetools.com\/blog\/2016\/09\/05\/getting-wordnet-information-and-building-and-building-graph-with-python-and-networkx\/","url":"http:\/\/intelligentonlinetools.com\/blog\/2016\/09\/05\/getting-wordnet-information-and-building-and-building-graph-with-python-and-networkx\/","name":"Getting WordNet Information and Building Graph with Python and NetworkX - Machine Learning Applications","isPartOf":{"@id":"http:\/\/intelligentonlinetools.com\/blog\/#website"},"datePublished":"2016-09-05T15:46:51+00:00","dateModified":"2017-10-15T01:43:04+00:00","author":{"@id":"http:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/7a886dc5eb9758369af2f6d2cb342478"},"breadcrumb":{"@id":"http:\/\/intelligentonlinetools.com\/blog\/2016\/09\/05\/getting-wordnet-information-and-building-and-building-graph-with-python-and-networkx\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/intelligentonlinetools.com\/blog\/2016\/09\/05\/getting-wordnet-information-and-building-and-building-graph-with-python-and-networkx\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/intelligentonlinetools.com\/blog\/2016\/09\/05\/getting-wordnet-information-and-building-and-building-graph-with-python-and-networkx\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/intelligentonlinetools.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Getting WordNet Information and Building Graph with Python and NetworkX"}]},{"@type":"WebSite","@id":"http:\/\/intelligentonlinetools.com\/blog\/#website","url":"http:\/\/intelligentonlinetools.com\/blog\/","name":"Machine Learning Applications","description":"Artificial intelligence, data mining and machine learning for building web based tools and services.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/intelligentonlinetools.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"http:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/7a886dc5eb9758369af2f6d2cb342478","name":"owygs156","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/image\/","url":"http:\/\/2.gravatar.com\/avatar\/b351def598609cb4c0b5bca26497c7e5?s=96&d=mm&r=g","contentUrl":"http:\/\/2.gravatar.com\/avatar\/b351def598609cb4c0b5bca26497c7e5?s=96&d=mm&r=g","caption":"owygs156"}}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7h1IJ-8T","jetpack-related-posts":[{"id":1422,"url":"http:\/\/intelligentonlinetools.com\/blog\/2017\/11\/02\/data-visualization-of-word-correlations-with-networkx\/","url_meta":{"origin":551,"position":0},"title":"Data Visualization of Word Correlations with NetworkX","date":"November 2, 2017","format":false,"excerpt":"This is a continuation of my previous post, found here Combining Machine Learning and Data Scraping. Data visualization is added to show correlations between words. The graph was built using NetworkX python library. The input for the graph is the array corr_data with 3 columns : pair of words and\u2026","rel":"","context":"In &quot;Data Mining&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2017\/11\/NetworkX_graph-300x211.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1857,"url":"http:\/\/intelligentonlinetools.com\/blog\/2018\/02\/10\/how-to-create-data-visualization-for-association-rules-in-data-mining\/","url_meta":{"origin":551,"position":1},"title":"How to Create Data Visualization for Association Rules in Data Mining","date":"February 10, 2018","format":false,"excerpt":"Association rule learning is used in machine learning for discovering interesting relations between variables. Apriori algorithm is a popular algorithm for association rules mining and extracting frequent itemsets with applications in association rule learning. It has been designed to operate on databases containing transactions, such as purchases by customers of\u2026","rel":"","context":"In &quot;Data Mining&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/02\/association_rules_scatter_plot_for_retailer_dataset.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1385,"url":"http:\/\/intelligentonlinetools.com\/blog\/2017\/10\/15\/scraping\/","url_meta":{"origin":551,"position":2},"title":"Combining Machine Learning and Data Scraping","date":"October 15, 2017","format":false,"excerpt":"I often come across web posts about extracting data (data scraping) from websites. For example recently in [1] Scrapy tool was used for web scraping with Python. Once we get scraping data we can use extracted information in many different ways. As computer algorithms evolve and can do more, the\u2026","rel":"","context":"In &quot;Data Mining&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":966,"url":"http:\/\/intelligentonlinetools.com\/blog\/2017\/02\/18\/building-decision-trees-in-python\/","url_meta":{"origin":551,"position":3},"title":"Building Decision Trees in Python","date":"February 18, 2017","format":false,"excerpt":"A decision tree is a decision support tool that uses a tree-like graph or model of decisions and their possible consequences, including chance event outcomes, resource costs, and utility. It is one way to display an algorithm. Decision trees are commonly used in operations research, specifically in decision analysis, to\u2026","rel":"","context":"In &quot;Artificial Intelligence&quot;","img":{"alt_text":"Decision Tree","src":"https:\/\/i0.wp.com\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2017\/02\/dt_post1_N_CTQ_Cost_regr1-2-use-this-300x103.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":383,"url":"http:\/\/intelligentonlinetools.com\/blog\/2016\/07\/03\/getting-the-data-from-the-web-using-php-for-api-using-the-api-with-php\/","url_meta":{"origin":551,"position":4},"title":"Getting the Data from the Web using PHP or Python for API","date":"July 3, 2016","format":false,"excerpt":"In the previous posts [1],[2] perl was used to get content from the web through Faroo API and Guardian APIs. In this post PHP and Pyhton will be used to get web data using same APIs. PHP has a powerful JSON parsing mechanism, which, because PHP is a dynamic language,\u2026","rel":"","context":"In &quot;API Programming&quot;","img":{"alt_text":"Trend for Python, Perl, PHP","src":"https:\/\/i0.wp.com\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2016\/07\/trend_for_python_perl_php-300x144.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":533,"url":"http:\/\/intelligentonlinetools.com\/blog\/2016\/08\/28\/web-scraping-with-beautifulsoup\/","url_meta":{"origin":551,"position":5},"title":"Web Scraping with BeautifulSoup with Python 3","date":"August 28, 2016","format":false,"excerpt":"Keeping up-to-date on your industry is very important as it will help make better decisions, spot threats and opportunities early on and identify the changes that you need to think about.[1] There are many ways to stay informed and getting automatically data from the web is one of them. In\u2026","rel":"","context":"In &quot;Artificial Intelligence&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/posts\/551"}],"collection":[{"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/comments?post=551"}],"version-history":[{"count":21,"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/posts\/551\/revisions"}],"predecessor-version":[{"id":1393,"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/posts\/551\/revisions\/1393"}],"wp:attachment":[{"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/media?parent=551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/categories?post=551"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/tags?post=551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}