{ "cells": [ { "cell_type": "markdown", "source": [ "# Challenge: Analyzing Text about Data Science\n", "\n", "> *For dis notebook, we go try use different URL - wikipedia article wey talk about Machine Learning. You fit see say, unlike Data Science, dis article get plenty terms, wey make di analysis more wahala. We need find another way to clean di data after we don do keyword extraction, so we fit commot some frequent but no-meaningful word combinations.*\n", "\n", "For dis example, make we do one simple exercise wey go cover all di steps for traditional data science process. You no need write any code, just click di cells wey dey below to run dem and see wetin e go give you. As challenge, we dey encourage you to try dis code with different data.\n", "\n", "## Goal\n", "\n", "For dis lesson, we don dey talk about different concepts wey relate to Data Science. Make we try find more related concepts by doing **text mining**. We go start with text about Data Science, extract keywords from am, and then try visualize di result.\n", "\n", "As di text, I go use di page about Data Science from Wikipedia:\n" ], "metadata": {} }, { "cell_type": "markdown", "source": [], "metadata": {} }, { "cell_type": "code", "execution_count": 2, "source": [ "url = 'https://en.wikipedia.org/wiki/Data_science'\r\n", "url = 'https://en.wikipedia.org/wiki/Machine_learning'" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "## Step 1: How to Collect Data\n", "\n", "Di first step for any data science process na to collect di data. We go use `requests` library do am:\n" ], "metadata": {} }, { "cell_type": "code", "execution_count": 3, "source": [ "import requests\r\n", "\r\n", "text = requests.get(url).content.decode('utf-8')\r\n", "print(text[:1000])" ], "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "\n", "\n", "\n", "\n", "Machine learning - Wikipedia\n", "