<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Alena Gorb on Medium]]></title>
        <description><![CDATA[Stories by Alena Gorb on Medium]]></description>
        <link>https://medium.com/@alenagorb02?source=rss-51d81d71969e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VvvBO1hMq_T8zu4N8zwELg.jpeg</url>
            <title>Stories by Alena Gorb on Medium</title>
            <link>https://medium.com/@alenagorb02?source=rss-51d81d71969e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 06:54:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alenagorb02/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Battle of the Bots (2024 Update): ChatGPT vs. Gemini vs. Pi vs. Claude 2]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@alenagorb02/battle-of-the-bots-2024-update-chatgpt-vs-gemini-vs-pi-vs-claude-2-07dd8da2e6c0?source=rss-51d81d71969e------2"><img src="https://cdn-images-1.medium.com/max/2600/1*XKDL5ssGkk-o-lO9oZV1cQ.png" width="4000"></a></p><p class="medium-feed-snippet">I originally posted this article on Medium last year, but with the latest updates to ChatGPT, Google&#x2019;s Gemini, and Anthropic&#x2019;s Claude, I&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@alenagorb02/battle-of-the-bots-2024-update-chatgpt-vs-gemini-vs-pi-vs-claude-2-07dd8da2e6c0?source=rss-51d81d71969e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@alenagorb02/battle-of-the-bots-2024-update-chatgpt-vs-gemini-vs-pi-vs-claude-2-07dd8da2e6c0?source=rss-51d81d71969e------2</link>
            <guid isPermaLink="false">https://medium.com/p/07dd8da2e6c0</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[pi-ai-chatbot]]></category>
            <category><![CDATA[google-gemini-ai]]></category>
            <category><![CDATA[claude-2]]></category>
            <dc:creator><![CDATA[Alena Gorb]]></dc:creator>
            <pubDate>Sun, 18 Feb 2024 13:29:41 GMT</pubDate>
            <atom:updated>2024-02-18T13:29:41.156Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Whisper AI: Your Gateway to Free Speech-to-Text Transcription and Translation in Python]]></title>
            <link>https://medium.com/@alenagorb02/whisper-ai-your-gateway-to-free-speech-to-text-transcription-and-translation-in-python-b5a0af251710?source=rss-51d81d71969e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5a0af251710</guid>
            <category><![CDATA[transcription]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[speech-to-text-conversion]]></category>
            <category><![CDATA[whisper-ai]]></category>
            <category><![CDATA[translation]]></category>
            <dc:creator><![CDATA[Alena Gorb]]></dc:creator>
            <pubDate>Sun, 11 Feb 2024 13:58:04 GMT</pubDate>
            <atom:updated>2024-02-11T13:58:04.802Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Mseb2s5dk6Kqc34a.png" /><figcaption>Image credit: <a href="https://www.voicegain.ai/post/openai-whisper-voicegain-api">Voicegain</a></figcaption></figure><p>If you know me, you probably know about my obsession with using ChatGPT 3.5 to help me with my writing, coding, and other random tasks. However, unfortunately, the free version can only work with text, but a lot of information these days comes in the form of audio or video content, so you can’t easily feed that information into ChatGPT unless you are using a paid version.</p><p>There are software companies out there that offer transcription services, such as <a href="https://otter.ai/">Otter.ai</a>. Otter.ai actually offers a free basic plan with limited transcription minutes and file uploads, which could be enough for some people, but if you need more files transcribed per month, you might have to invest in a paid version … OR you could just use another wonder from OpenAI, <a href="https://openai.com/research/whisper">Whisper AI</a>, an open-source neural net that can perform speech-to-text transcription and translation in unlimited numbers completely for free!</p><p>In this blog, we will explore how to install Whisper AI onto your computer and run it from the command line (I will be using Anaconda prompt instead as my personal preference, but the process should be the same with the command line too) and IDE. I will also demonstrate how you can run Whisper in the cloud without the need to download Python or anything else onto your computer and without the need for a GPU (graphics processing unit; more on this later). We will start with the local download method.</p><h4>Whisper AI Installation and Setup</h4><p>You can find the installation <a href="https://github.com/openai/whisper?tab=readme-ov-file">instructions</a> for Whisper on OpenAI’s official GitHub page, but frankly, I found it quite confusing, so I will break down step-by-step what you need to do to install and start using Whisper on your computer.</p><p>1. The first step, if you don’t have it already, is to install a version of Python on your computer. You can easily download it from the Python Downloads <a href="https://www.python.org/downloads/">page</a>. For this, I would recommend not going above version 3.11 (at least at the time of writing this) just to make sure the package in step 2 is compatible with your version of Python.</p><p>2. Now, we can install the <a href="https://pytorch.org/">PyTorch</a> library, which is a machine-learning library that will help Whisper run. To install, go to this “Start Locally” page and select the settings that match your system description. For example, these are the options I selected for my installation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pez6ZFZyruTGxMAV2dCCDQ.png" /></figure><p>I would suggest selecting the stable version of PyTorch. For OS, I have Windows, but you can select whichever one you have. For the package, I normally use pip to install Python libraries, but it works just as well with Conda (if you have it installed). The language I’m using is Python, and for the compute platform, I selected the CPU (central processing unit). For simplicity, CUDA is a platform running on GPUs, so trust me, if you have CUDA, you would know about it, so if you don’t know what compute platform you have, it’s probably a CPU (GPUs are more expensive, so you probably won’t buy one unless you are serious about coding).</p><p>Now, all you need to do is copy the code from PyTorch’s “Run this Command” field. You can paste it into the command line (just type “cmd” in your computer’s search bar and select the first option that comes up) or into the Anaconda prompt (which you can download from <a href="https://www.anaconda.com/download">here</a>). Once pasted, press Enter, and PyTorch will be installed on your computer.</p><p>3. In this step, we need to first download a package manager for our operating system (before we install ffmpegin the next step), and you can find which one you need on Whisper’s instructions page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*foe4a-45UtG9Yy8sDYewzA.png" /></figure><p>As you can see, for Windows, we can use Chocolatey, which can be found on <a href="https://chocolatey.org/">chocolatey.org</a>. Once you have the Chocolatey webpage open, click on the “Install” tab in the top right corner:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_1G1hWEUQK9bfqYGQKXkxQ.png" /></figure><p>Choose the “Individual” use:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2baB8VZ5cwjoEIjauGJXWw.png" /></figure><p>Below this, you will find instructions on how to install Chocolatey, but I will quickly run through this here as well. Firstly, go to your computer’s search bar and type “PowerShell.” Select “Windows PowerShell” and click the “Run as Administrator” option:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MYimkGERGmBQ_fzkyyHXBA.png" /></figure><p>Now, simply copy the command from the Chocolatey webpage, paste it into the PowerShell, and press Enter:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rvj4eMWp4inH0ybd-nxyjA.png" /></figure><p>4. Now that we have a package manager installed, we can install theffmpeg library as suggested by Whisper’s instructions by typing the following command into the command line or Anaconda prompt:</p><pre># on Windows using Chocolatey (https://chocolatey.org/)<br>choco install ffmpeg</pre><p>5. Finally, you are ready to install Whisper, which you can do by typing the following command into the command line or Anaconda prompt and pressing Enter:</p><pre>pip install -U openai-whisper</pre><p>Note that-U part upgrades Whisper to the latest version if, for whatever reason, you already have a version of Whisper installed. And voila, you are ready to use Whisper on your computer!</p><h4>Running Whisper AI on Your Computer</h4><p>To perform transcription using the command line/Anaconda prompt, use the following command:</p><pre>whisper &quot;Test recording 1.m4a&quot; --model base</pre><p>The--model parameter specifies which of Whisper’s available models you want to use. You have 5 options to choose from:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hm0-Hub8xn97Auef3RDKmQ.png" /></figure><p>Simply put, the larger the model (tiny -&gt; large), the better the model’s performance in terms of transcription quality, but the longer it takes to run, so it’s a bit of a trade-off between quality and speed. I found that the medium model has very good transcription quality but does run very slowly on the CPU, so using the base or small model might be recommended.</p><p>The great thing about Whisper is that you can not only transcribe but also translate audio and video files at the same time by specifying which language the original file is in by adding --language ru (ru for Russian) and adding --task translate parameters, so Whisper will translate the audio file from Russian to English and then display the output in English:</p><pre>whisper &quot;Test recording 2.m4a&quot; --model base --language ru --task translate</pre><p>Note that you don’t actually have to specify which language the original file is in if you are unsure because Whisper can automatically detect that, but bear in mind that it will take more time to get the output due to the language detection time. If you want to check which languages Whisper can work with, you can type in:</p><pre>whisper --help</pre><p>This will display all the parameters and options that Whisper can accept. Another note from me is that while Whisper can accept video files, including .mp4 files, I would recommend first converting them into .mp3 files (which you can do with an online free converter <a href="https://cloudconvert.com/mp4-to-mp3">here</a>) just because video files are a lot larger, your processing time might be very long with video files unless you have a powerful GPU at hand.</p><p>If you are not a fan of command-line methods, you can still use Whisper in a similar way in your favourite IDE, as such:</p><pre>import whisper<br><br>model = whisper.load_model(&quot;base&quot;)<br><br>#Transcribe the recording<br>result1 = model.transcribe(&quot;C:/path/Test recording 1.m4a&quot;)<br><br>#Translate the recording from Russian to English<br>result2 = model.transcribe(&quot;C:/path/Test recording 2.m4a&quot;, language=&quot;ru&quot;, task=&quot;translate&quot;)<br><br>#Display the transcribed and translated text<br>print(result1[&quot;text&quot;])<br>print(result2[&quot;text&quot;])</pre><p>Finally, if you’ve been playing around with Whisper for a bit, you might’ve noticed the creation of a few files with different file extensions, namely .txt, .json, .srt, .tsv, and .vtt. These are just different ways in which your transcription is saved:</p><p>.txt: displays transcription as plain text</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*27EDfk8Cjh7lv4eyQ_JytA.png" /></figure><p>.json: displays transcription in JSON file format</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HzfXN-sv5uFRK4fFSmwmiQ.png" /></figure><p>.srt: displays transcription line by line with timestamps included</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VCdMcC6j5xCcg5wL0EBSMw.png" /></figure><p>.tsv: also displays transcription with timestamps but in a different format to .srt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*Z9hYTbMBaG83D41rgj7xLQ.png" /></figure><p>.vtt: again includes timestamps in yet another format</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*sd8DGWqHmafqvBQssDrXfw.png" /></figure><h4>Running Whisper in the Cloud</h4><p>I mentioned at the start that having a CPU does considerably slow down the performance of Whisper. One way around it would be to use a Cloud environment such as <a href="https://colab.google/">Google Colaboratory</a>. If you have a Google account, go to your Google Drive and press “New.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*8-sPlL052729NgSrKjNM0Q.png" /></figure><p>Then go to &quot;More,” and if you don’t have “Google Colaboratory” there already, click on “Connect more apps”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J60WJAyQAKTMqEzLK9g2KQ.png" /></figure><p>Type “Colaboratory” in the search bar and install Google Colaboratory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9_mDjn7w_2oFxAB-N0qXyA.png" /></figure><p>Now, go back to Google drive, select “New” -&gt; “More” -&gt; “Google Colaboratory” to open a new Colab workbook.</p><p>In the new workbook, go to “Runtime” -&gt; “Change runtime type”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*wr-uNn8E6Ik3YkV6ShndbA.png" /></figure><p>In the pop-up menu, select “T4 GPU” and press “Save”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*bSmcusG9wrJ9B_YjW4hgNQ.png" /></figure><p>Now, you can use a GPU (although limited) to run your Whisper! With Google Colab, you can use both command-line and Python commands to call Whisper. To install Whisper, you can use the following command (as suggested by Whisper instructions for Ubuntu, which is what Colab is running on):</p><pre> !pip install git+https://github.com/openai/whisper.git<br> !sudo apt update &amp;&amp; sudo apt install ffmpeg</pre><p>You can expand the “Files” icon on the left-hand side:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*kKcGSW5RxnJ6voWvMo_abQ.png" /></figure><p>There you can just drag-and-drop the file you want to transcribe and/or translate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*_fIRdWjOzrTKqXmFL8EEow.png" /></figure><p>Once you uploaded the files you want to transcribe, to use Whisper, you can just use the same command-line commands mentioned earlier; just don’t forget to add “!” before the commands:</p><pre>!whisper &quot;Test recording 1.m4a&quot; --model medium.en<br>!whisper &quot;Test recording 2.m4a&quot; --model medium --task translate --language ru</pre><p>Or using Python syntax:</p><pre>import whisper<br><br>model = whisper.load_model(&quot;medium&quot;)<br>result1 = model.transcribe(&quot;Test recording 1.m4a&quot;)<br>result2 = model.transcribe(&quot;Test recording 2.m4a&quot;, language=&quot;ru&quot;, task=&quot;translate&quot;)<br>print(result1[&quot;text&quot;])<br>print(result2[&quot;text&quot;])</pre><p>The use of a GPU should speed up the process substantially, and once done, you can find all the different types of files created in the “Files” tab. Make sure to download the ones you want before you close Colab because all the files will be deleted automatically once the session is over.</p><p>This is it for now, and if you enjoyed this blog, you might also find my generative AI chatbot comparison <a href="https://medium.com/stackademic/which-generative-ai-is-the-best-chatgpt-vs-bard-vs-pi-vs-claude-4c94342bbd6a">article</a> and using ChatGPT to learn Python <a href="https://medium.com/stackademic/learn-python-fast-with-chatgpt-top-tips-for-prompt-engineering-6bdab3a3c2c7">article</a> interesting. And as always, let me know if you have any comments, suggestions, or ideas for future blogs. Follow and subscribe to my email list so you don’t miss when I post (which is usually once a week on Sundays)!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5a0af251710" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Work Smarter, Not Harder: Two ChatGPT Use Cases to Save You Time At Work]]></title>
            <link>https://medium.com/@alenagorb02/work-smarter-not-harder-two-chatgpt-use-cases-to-save-you-time-at-work-1eafe39e822d?source=rss-51d81d71969e------2</link>
            <guid isPermaLink="false">https://medium.com/p/1eafe39e822d</guid>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[automation-tools]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <dc:creator><![CDATA[Alena Gorb]]></dc:creator>
            <pubDate>Sun, 04 Feb 2024 22:01:08 GMT</pubDate>
            <atom:updated>2024-02-04T22:01:08.531Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hh_AgtRtO63KPrpc" /><figcaption>Photo by <a href="https://unsplash.com/@emilianovittoriosi?utm_source=medium&amp;utm_medium=referral">Emiliano Vittoriosi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I think we can all agree that generative AI has revolutionised the way we work. I am personally a big fan of OpenAI’s <a href="https://chat.openai.com/">ChatGPT </a>(in case you haven’t noticed from my other blogs😉). I go in-depth as to why it is one of my favourite chatbots in the other <a href="https://blog.stackademic.com/which-generative-ai-is-the-best-chatgpt-vs-bard-vs-pi-vs-claude-4c94342bbd6a">blog</a> but in this one, I wanted to highlight two more “creative” ways you can use a free version of ChatGPT (version 3.5) in your workplace to save time and money and impress your boss to get that promotion you so deserve! So without further ado, let’s jump right into it.</p><h4>1. Web Scraping and Data Extraction</h4><p>Yes, you’ve read that right. You can do some web scraping with ChatGPT 3.5 fast and with zero coding required. With ChatGPT being a large language model, it can easily take in, analyse, parse, and display text-based information in different formats, including tables. In this example, we will be pasting loads of text from a webpage into ChatGPT and asking it to parse it and display only the relevant information in table format.</p><p>I have previously published an <a href="https://blog.stackademic.com/unlocking-data-scraping-teams-channel-using-selenium-in-python-369a390b07e9">article</a> on web scraping a Teams channel using Python, but you can also do something similar with the free version of ChatGPT without having to download and learn Python! The key here is to make it as easy as possible for ChatGPT to parse the text that you give it, so it can differentiate between the original post and comments added to that post, and for that, I have a few tips I use in my work:</p><ol><li>Start each new post in the Teams channel with a specific identifier. For instance, I add the date in a specific format of DD/MM/YYYY (which is different from how Teams posts are time-stamped automatically since it’s not very consistent in formatting). This way, I can tell ChatGPT that when it encounters a date in the format of DD/MM/YYYY, that indicates the start of a new post</li><li>If your posts include links or other bits of information, such as news titles and news descriptions, try and use a non-trivial delimiter to separate the different parts, which will eventually become different columns in the output table. For example, separate different parts with “%&amp;%” symbols (you can use any delimiter you like, but the more unique the better), as this will make it very easy for ChatGPT to parse your news into different columns</li><li>Describe exactly which part you want to go under each column heading and specify that you want the final output to be in table format</li></ol><p>Once you’ve ensured that your post formatting is consistent and easy to recognise, you can start by describing the formatting to ChatGPT and how you want it parsed and displayed. So your first prompt might be something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nI2l87KeFkz4yUyybuwnsw.png" /></figure><p>Now, you can just switch to the Teams channel you want to scrape, select all text (Ctrl+A) or just parts of the text you want to scrape, copy it (Ctrl+C), and paste it (Ctrl+V) into ChatGPT. This is what I pasted in (note that this is made-up Teams channel content for demo purposes):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KbvxgZXNaQL5QmbgcSNAqQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F-WLj6pso6Gf7wsFHmz2pQ.png" /></figure><p>You should get something like this in response:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m7as5Lp3aqCj0WAb3eh1uA.png" /></figure><p>Now, just something I noticed is that ChatGPT doesn’t always display the data in this nice table format, providing some kind of markdown or SQL version instead. To fix this, you can try regenerating the response a few times, but if this doesn’t work, try clearing your cookies, which, for some reason, finally solved the issue for me.</p><p>There are a few limitations to this method, of course: you can only paste text-based information into ChatGPT 3.5, so images or file attachments won’t be scraped. It could also become quite time-consuming if you have multiple web pages to scrape (like in the case of LinkedIn <a href="https://medium.com/stackademic/web-scraping-linkedin-with-selenium-in-python-a-step-by-step-approach-79bd63dd32ec">scraping</a>) so this is not really suitable if you have hundreds of pages to go through. Nevertheless, it is a neat trick if you also have a PDF file with consistent formatting (such as some kind of event agenda or program) or other kinds of files, such as a FASTA file, which can also be scraped with ChatGPT (instead of using Python, as I did in my first ever <a href="https://medium.com/@alenagorb02/automating-data-extraction-txt-file-to-excel-with-python-step-by-step-guide-4ed89f52c5e6">blog</a>)</p><h4>2. Multiple Calendar Invites</h4><p>Another use case that can save you time is creating multiple calendar invites by generating a custom .ics file. For example, you have 3 company events coming up in the next quarter, for which you can’t just send a recurring link. So you can use ChatGPT to create a single .ics file, which you can then send to your colleagues, who can import it once and have all three invites added to their calendars at once.</p><p>We can start with the following prompt:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*M4mAYQfkFqFVDxm-G9MWvw.png" /></figure><p>Now, notice how the formatting is a bit inconsistent and the time zones are different, but that shouldn’t matter because ChatGPT should still recognise these and convert into .ics file format accordingly so your invites that you get at the end should have time zones adjusted to your current timezone automatically. So, here’s the output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*6cVWS4BegDedWciNw1o8sQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*iRzDOh8uxhBRhveC6_yEoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*RuUe2lv0WYzAYXN7Te1zsg.png" /></figure><p>And now, as ChatGPT suggested, you can just copy and paste this code into a text file and save it as .ics file. Now, you can send this file to your colleagues, who would just need to open it with their calendar application of choice and import it to get something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*mOMZO4YiogkeyAuBFc8ZCA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*SUaFbsgJ3rGlyXDV740hEQ.png" /></figure><p>Notice how the event that I specified in GMT and UK time ended up being recognised as the same time zone while the event that was specified in Eastern Time got converted to GMT time zone automatically without you having to specify anything.</p><p>Of course, you can do the same with many more invites than 3 (I just did this in the interest of time), and you don’t have to spam your colleagues with 100s of email calendar invites for each individual event. Win-win, I say!</p><p>Now this is it for now, and if you enjoyed this blog, you might also find my generative AI chatbot comparison <a href="https://medium.com/stackademic/which-generative-ai-is-the-best-chatgpt-vs-bard-vs-pi-vs-claude-4c94342bbd6a">article</a> and using ChatGPT to learn Python <a href="https://medium.com/stackademic/learn-python-fast-with-chatgpt-top-tips-for-prompt-engineering-6bdab3a3c2c7">article</a> interesting. And as always, let me know if you have any comments, suggestions, or ideas for future blogs. Follow and subscribe to my email list so you don’t miss when I post (which is usually once a week on Sundays)!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1eafe39e822d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn Python Fast with ChatGPT: Top Tips for Prompt Engineering]]></title>
            <link>https://blog.stackademic.com/learn-python-fast-with-chatgpt-top-tips-for-prompt-engineering-6bdab3a3c2c7?source=rss-51d81d71969e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bdab3a3c2c7</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[beginner-coding]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Alena Gorb]]></dc:creator>
            <pubDate>Sun, 21 Jan 2024 12:11:31 GMT</pubDate>
            <atom:updated>2024-01-23T01:46:05.835Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F5Kw8BTBv5HBhuJF" /><figcaption>Photo by <a href="https://unsplash.com/@freshvanroot?utm_source=medium&amp;utm_medium=referral">Rolf van Root</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As a self-taught Python amateur, people often ask me how I learned it and say that I must be smart to do it, and they wish they could code too. Well, today is your lucky day, because I will talk a bit about how I learned Python (before ChatGPT was around) and then explain how you can learn Python even quicker than I did using recent advancements in generative AI.</p><p>To cut straight to the chase, I learned Python by doing this MIT Python <a href="https://www.edx.org/learn/computer-science/massachusetts-institute-of-technology-introduction-to-computer-science-and-programming-using-python">course</a> on the EdX platform (which I did for free without upgrading to the paid version), which I thought was absolutely brilliant in introducing the basic concepts and explaining “coding logic” in Python, so I highly recommend that. However, I would say that if you are short on time and want to “fast-track” your learning, courses might not be the most suitable since they do require some time commitment to watch the videos and then do the practice exercises. But fear not, because, now that we have ChatGPT, I might have a solution for you that is also completely free!</p><p>If you haven’t already, you can check out my generative AI comparison <a href="https://medium.com/stackademic/which-generative-ai-is-the-best-chatgpt-vs-bard-vs-pi-vs-claude-4c94342bbd6a">article</a> to learn more about different chatbots available these days, but for this blog, we will talk about the free version of <a href="https://chat.openai.com/">ChatGPT</a> (i.e., GPT 3.5) and how you can use it to learn Python much faster than I did. So let’s get started.</p><h4>1. Create a suitable “persona” for your needs and current level</h4><p>Creating personas in ChatGPT is a useful trick if you want it to give you outputs in a specific format or include/exclude specific information. To create a &quot;persona,” do the following steps:</p><p>1. Click on your account name in the bottom left-hand corner of the new chat window (after you’ve logged into your ChatGPT account), and then click on “Custom Instructions.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*pAfQ8nm23UbVaWTHH_bDNA.png" /></figure><p>2. A new window will pop up, asking you to set your custom instructions, specifying who you are and what format you want the answers to be in. ChatGPT also gives you some useful tips on what you might want to include there:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DiOpWwqPCt61qFAyrz073A.png" /></figure><p>If you are a Python beginner, you might want to let ChatGPT know about it in the first section, saying something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*YYvHeAIiGnq-fDyGeWMjHQ.png" /></figure><p>And then, in the format section, you can specify something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*ElG64OEv8_9Z_xYocTOPEw.png" /></figure><p>Now I do appreciate that, as a beginner, you might not know what Python libraries or functions are, but just trust me on this one! Also, by default, ChatGPT will try to explain the functions and libraries that it uses, so you might not even need to specify this part, but I just think it ensures more consistent responses, so why not?</p><p>3. Save your custom settings and decide whether you want them to be enabled for the other new chats or not:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*5wG-02ldRmmw-BIkf3-yIA.png" /></figure><p>If you activate “Enable for new chats,” then every new chat after this one will have these same settings applied to it. If not, then only this current new chat will have the custom settings, and all other new chats will have the default settings or different custom settings applied to them. The choice is yours, but if you are using ChatGPT for things other than learning Python, you might want to restrict the custom settings to the current new chat only to avoid confusion.</p><h4>2. Ask ChatGPT for a study plan and stick to it</h4><p>Now that you are all set, you can ask ChatGPT for a day-by-day study plan so you know which topics you want to cover on which day. If you also have a timeframe that you are working with, make sure to include that. So your first prompt might look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RxdiKXkRW623fN1Kwli6nQ.png" /></figure><p>This should hopefully give you a decent roadmap as to what you should do first. Here’s what I got in response (part of it actually):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*YSl0uV-147MCVVf7UoAWEg.png" /></figure><h4>3. Ask ChatGPT to generate the content for the day</h4><p>Now that you have a plan, you can ask ChatGPT to follow it and provide the content needed for you to understand the topic. Don’t forget to ask for code examples. You can copy and paste these code snippets into your favourite IDE (if you read my other blogs, you would know it’s Jupyter Notebook for me, but you can also use others or just ask ChatGPT for suggestions!). Also ask for some practice questions, because it is the best way to learn Python by just doing it! Here’s my prompt:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z5ggfGtjREjuSIfCwSP3ww.png" /></figure><p>And here’s part of ChatGPT’s response:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7oA61JYKqH1NwV_Dl4UnHA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*cXkmDCRj9OcW92bKyq86Zw.png" /></figure><h4>4. Feed your code to ChatGPT for instant debugging and feedback</h4><p>The great thing about ChatGPT is that it can actually check your code for you and quickly identify where the mistake is, so you can quickly see where you went wrong. In this example, I intentionally gave ChatGPT an incomplete code to see if it could correct it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*hbpgIowfKq6OQ1yAGP-1Jg.png" /></figure><p>And here’s what it came back with (spoiler: it did identify the mistake correctly):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nMkEi_txjjj-Rhl6PeaXgg.png" /></figure><p>Now, if you are a beginner, you might not want to just be given an answer right away, but you might want some guidance as to where you might’ve gone wrong, so you can modify the prompt above to specify this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WdGoM8yxiuS9FmXmsHO9eg.png" /></figure><p>And now you would get the response, which just guides you in the right direction without outright telling you what the answer is, which is perhaps more useful at the beginning:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*24bEXGAD2VJcTAwJ0iHVsA.png" /></figure><h4>5. Master new libraries to gain new skills with overviews</h4><p>Once you’ve mastered the basics with the help of ChatGPT, you can now use it to quickly familiarise yourself with a new library or function, so you can quickly gain new, more specialised skills on top of your basic Python knowledge, be it data analysis, web design, or even machine learning. You can use the following prompt for a speedy intro:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*q6xIdsBk0rHtyYK7cqnMTQ.png" /></figure><p>And here’s a snippet of the output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*chnfOfRbALLyw73_xHxTCg.png" /></figure><p>You can also ask ChatGPT for help with specific tasks, like how to web scrape a page with specific HTML code or how to extract a specific chunk of data from an Excel table, and also to check whether your code is correct or ask why your code is not doing quite what you want it to do; the possibilities are endless!</p><p>Now this is it for now, and if you enjoyed this blog, you might also find my generative AI chatbot comparison <a href="https://medium.com/stackademic/which-generative-ai-is-the-best-chatgpt-vs-bard-vs-pi-vs-claude-4c94342bbd6a">article</a> interesting. And as always, let me know if you have any comments, suggestions, or ideas for future blogs. Follow and subscribe to my email list so you don’t miss when I post (which is usually once a week on Sundays)!</p><h3>Stackademic</h3><p>Thank you for reading until the end. Before you go:</p><ul><li>Please consider <strong>clapping</strong> and <strong>following</strong> the writer! 👏</li><li>Follow us <a href="https://twitter.com/stackademichq"><strong>X</strong></a><strong> | </strong><a href="https://www.linkedin.com/company/stackademic"><strong>LinkedIn</strong></a><strong> | </strong><a href="https://www.youtube.com/c/stackademic"><strong>YouTube</strong></a><strong> | </strong><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a></li><li>Visit our other platforms: <a href="https://plainenglish.io/"><strong>In Plain English</strong></a><strong> | </strong><a href="https://cofeed.app/"><strong>CoFeed</strong></a><strong> | </strong><a href="https://venturemagazine.net/"><strong>Venture</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bdab3a3c2c7" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/learn-python-fast-with-chatgpt-top-tips-for-prompt-engineering-6bdab3a3c2c7">Learn Python Fast with ChatGPT: Top Tips for Prompt Engineering</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Scraping LinkedIn with Selenium in Python: A Step-by-Step Approach]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.stackademic.com/web-scraping-linkedin-with-selenium-in-python-a-step-by-step-approach-79bd63dd32ec?source=rss-51d81d71969e------2"><img src="https://cdn-images-1.medium.com/max/2600/0*Zm2tTzHmU2QrSO7H" width="6000"></a></p><p class="medium-feed-snippet">Following on from my tutorial on how to web scrape a Teams channel, here&#x2019;s another one for you, but this time, we are targeting none other&#x2026;</p><p class="medium-feed-link"><a href="https://blog.stackademic.com/web-scraping-linkedin-with-selenium-in-python-a-step-by-step-approach-79bd63dd32ec?source=rss-51d81d71969e------2">Continue reading on Stackademic »</a></p></div>]]></description>
            <link>https://blog.stackademic.com/web-scraping-linkedin-with-selenium-in-python-a-step-by-step-approach-79bd63dd32ec?source=rss-51d81d71969e------2</link>
            <guid isPermaLink="false">https://medium.com/p/79bd63dd32ec</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-automation]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[linkedin]]></category>
            <dc:creator><![CDATA[Alena Gorb]]></dc:creator>
            <pubDate>Sun, 14 Jan 2024 15:51:53 GMT</pubDate>
            <atom:updated>2024-01-15T01:27:26.132Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Quick Introduction to APIs: Harnessing ClinicalTrials.gov API with Python]]></title>
            <link>https://blog.stackademic.com/quick-introduction-to-apis-harnessing-clinicaltrials-gov-api-with-python-c44f26dc5996?source=rss-51d81d71969e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c44f26dc5996</guid>
            <category><![CDATA[application-programming]]></category>
            <category><![CDATA[clinical-trials]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[pandas-dataframe]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Alena Gorb]]></dc:creator>
            <pubDate>Sun, 07 Jan 2024 17:31:25 GMT</pubDate>
            <atom:updated>2024-01-15T01:24:54.979Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Nt8Sz8yft0t2CJzZ" /><figcaption>Photo by <a href="https://unsplash.com/@charlesdeluvio?utm_source=medium&amp;utm_medium=referral">charlesdeluvio</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I have previously mentioned APIs in my Teams scraping <a href="https://medium.com/stackademic/unlocking-data-scraping-teams-channel-using-selenium-in-python-369a390b07e9">blog</a>, but given how useful APIs are, I thought they deserved a separate article on them to give them a proper introduction, so here it is!</p><p><a href="https://en.wikipedia.org/wiki/API">API</a> or application programming interface, is a software interface that allows two (or more) computer programs to “talk” to each other, and by &quot;talk,” I generally mean exchanging information. In my Teams scraping <a href="https://blog.stackademic.com/unlocking-data-scraping-teams-channel-using-selenium-in-python-369a390b07e9">example</a>, we had to go in and examine how the Teams web page is built and how a user would interact with it in order to retrieve the information from it. If something changes in the web page’s structure or how you interact with it, we would need to modify our code to accommodate those changes. With an API, you don’t need to worry about the details of how a specific program or piece of software works; you just need to know how to access its API, which is usually fairly straightforward. You also don’t need to worry about the internal changes to said software because they won’t likely affect how you use its API (although it’s possible that they might).</p><p>Many software and web-based applications offer API access as part of their service (ChatGPT, Microsoft, IBM, Google, and YouTube, just to name a few). Because APIs make developers’ lives so much easier by making access to software’s information or its capabilities straightforward, you usually have to pay to get access to an API (you get a unique API key that will grant you access), or you might have a limit on how many requests you can make for free. There are, however, some websites that provide access to its API completely free of charge, and one such example is <a href="https://clinicaltrials.gov/">ClinicalTrials.gov</a>, one of the largest publicly available registries for clinical trials.</p><p>There are a few reasons why I chose the <a href="https://classic.clinicaltrials.gov/api/gui">ClinicalTrials.gov API</a> for this blog. Firstly, it is quite intuitive and easy to use. Secondly, you don’t need authentication with an API key to access it (at least for now; see below). Thirdly, Python has a special library called <a href="https://pypi.org/project/pytrials/">pytrials</a> which enables even easier access to the ClinicalTrials.gov entries. And finally (but most importantly, of course), if you didn’t know, I have a master’s in neuroscience, so I am very familiar with ClinicalTrials.gov! So today, we will learn how to retrieve data on specific trials from ClinicalTrials.gov and use it to track changes to these trials over time.</p><p>Before we start, I should mention that you can track changes to specific clinical trials by subscribing to their RSS feed. For instance, you can search for all trials that investigate aspirin for migraine and then press the “RSS” button in the top right corner of the results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r-WxdfMI6QuRKmzARqI-Ig.png" /></figure><p>Then you can create an RSS feed that includes new and existing studies added or modified to track any new studies added for this query or changes to any of the existing studies:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P2fuh5iv-qTiynFghhb2oA.png" /></figure><p>You would need to have some kind of RSS feed reader installed before you could create such a feed, but if you just google “RSS feed reader,” you should get plenty of free options to choose from.</p><p>Now why would you bother with using Python and an API to track changes to the trials if you can just subscribe to the RSS feed? That’s a good question, but here’s my reasoning: RSS feeds usually track any changes to the web page (there are feeder readers that allow you to customise this, but I believe you generally have to pay for it), which means you will get a notification each time something changes, regardless of whether or not you care about the change. However, by using API and Python, you can specify which changes you actually want to track.</p><p>The final thing before we get to the code, this tutorial uses the classic ClinicalTrials.gov API, which will retire in mid-2024, so if you are trying to use this code after the migration is completed, you will need to modify it to use the new API (which will be finished in early 2024). With that out of the way, let’s get started with the code!</p><p>First, you need to make sure that you have the pytrials library installed using pip.</p><pre>pip install pytrials</pre><p>Now you can open our favourite IDE (Jupyter Notebook for me!!) and create an instance of the ClinicalTrials object.</p><pre>#Imports<br>from pytrials.client import ClinicalTrials<br>import os<br>import pandas as pd<br><br>def get_clinical_trials(search_terms, target_fields, max_no_studies, target_format):<br>    ct = ClinicalTrials()<br><br>    #Get the fields of interest from studies related to the search terms in desired format<br>    clinical_trials = ct.get_study_fields(<br>    search_expr = search_terms,<br>    fields = target_fields,<br>    max_studies = max_no_studies,<br>    fmt = target_format<br>    )<br>    <br>    return clinical_trials<br><br>search_terms = &quot;Alzheimer AND donanemab&quot;<br>target_fields = [&quot;NCTId&quot;, &quot;BriefTitle&quot;, &quot;Phase&quot;, &quot;PrimaryCompletionDate&quot;, &quot;PrimaryOutcomeMeasure&quot;, &quot;CompletionDate&quot;]<br>max_no_studies = 20<br>target_format = &quot;csv&quot;<br><br>#Get the fields of interest from studies related to Alzheimer&#39;s and donanemab in csv format<br>donanemab_trials = get_clinical_trials(search_terms, target_fields, max_no_studies, target_format)</pre><p>We started with creating a custom function (not necessary in this case, but a good practice to ensure the code’s reusability), which specifies the search terms that we are after (Alzheimer’s disease and donanemab in this case, because did I mention I studied neuroscience!!!) which specific fields we want to track (I went for the trial ID, title, phase, primary completion date, primary outcome measure, and study completion date, but you can select any fields you want from ClinicalTrials.gov&#39;s extensive options <a href="https://classic.clinicaltrials.gov/api/info/study_fields_list">here</a>), and what format we want the data in (I went with csv here).</p><p>In this next part, we will save our retrieved data to an Excel file (by converting it to a Pandas dataframe first) in the directory of your choice:</p><pre># Read the csv data in Pandas<br>df = pd.DataFrame(donanemab_trials[1:], columns=donanemab_trials[0]) #set the first list as colunm labels<br>df.set_index(&#39;Rank&#39;, inplace=True) #set &quot;Rank&quot; as the first row<br><br>#Navigate to the directory where you want to save the table<br>os.chdir(&quot;your target directory&quot;)<br><br>#Save the dataframe as an Excel file<br>df.to_excel(&quot;Donanemab_trials.xlsx&quot;)</pre><p>This will be our initial sweep of the studies. Now let’s imagine that after a week (or however long you want), you came in and repeated this whole process and created an updated version of this table, which you saved under the “Donanemab_trials_updated.xlsx” file name. To track what has actually changed since the last time, we can load each Excel file as a dataframe and then compare the two versions.</p><pre>#Load the older and newer ct.gov entries tables<br>df_new = pd.read_excel(&quot;Donanemab_trials_updated.xlsx&quot;)<br>df_new.set_index(&#39;Rank&#39;, inplace=True) #set &quot;Rank&quot; as the first row<br><br>df_old = pd.read_excel(&quot;Donanemab_trials.xlsx&quot;)<br>df_old.set_index(&#39;Rank&#39;, inplace=True) #set &quot;Rank&quot; as the first row</pre><p>Now, we can compare all the columns in two databases and print out all the changes that happened since the last time. I also added the timestamp for our check, so we can track when we performed the comparison.</p><pre>from datetime import datetime<br><br>current_date = datetime.now().strftime(&quot;%b %d, %Y&quot;) #Current date in the format: 3 letter month code, day, year<br><br>columns_to_compare = df_old.columns.tolist() #Get all the column names<br><br>for column in columns_to_compare:<br>    df_differences = df_old[column].values == df_new[column].values<br>    for i, val in enumerate(df_differences):<br>        if not val:<br>            print(f&quot;As of {current_date}, the value in column {column} changed from {df_old[column].values[i]} to {df_new[column].values[i]}.&quot;)</pre><p>And here you go! We used the ClinicalTrials.gov API to access specific fields for our studies of interest, tracked the change over time, and compared the two versions to identify the changes in the fields that we care about. In Part 2 of this tutorial, we will save the comparison to a variable and send an email to ourselves containing all the updates, so stay tuned for that!</p><h3>Stackademic</h3><p>Thank you for reading until the end. Before you go:</p><ul><li>Please consider <strong>clapping</strong> and <strong>following</strong> the writer! 👏</li><li>Follow us <a href="https://twitter.com/stackademichq">X</a> | <a href="https://www.linkedin.com/company/stackademic"><strong>LinkedIn</strong></a><strong> |</strong> <a href="https://www.youtube.com/c/stackademic"><strong>YouTube</strong></a><strong> | </strong><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a></li><li>Visit our other platforms: <a href="https://plainenglish.io/"><strong>In Plain English</strong></a><strong> | </strong><a href="https://cofeed.app/"><strong>CoFeed</strong></a><strong> | </strong><a href="https://venturemagazine.net/"><strong>Venture</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c44f26dc5996" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/quick-introduction-to-apis-harnessing-clinicaltrials-gov-api-with-python-c44f26dc5996">Quick Introduction to APIs: Harnessing ClinicalTrials.gov API with Python</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking Data: Scraping Teams Channel Using Selenium in Python]]></title>
            <link>https://blog.stackademic.com/unlocking-data-scraping-teams-channel-using-selenium-in-python-369a390b07e9?source=rss-51d81d71969e------2</link>
            <guid isPermaLink="false">https://medium.com/p/369a390b07e9</guid>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[microsoft-teams]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[scraping-with-python]]></category>
            <dc:creator><![CDATA[Alena Gorb]]></dc:creator>
            <pubDate>Sun, 03 Dec 2023 20:09:39 GMT</pubDate>
            <atom:updated>2024-01-07T15:39:53.310Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PyZ2mbDOg8ZhQNmP" /><figcaption>Photo by <a href="https://unsplash.com/@dkfra19?utm_source=medium&amp;utm_medium=referral">Dimitri Karastelev</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>So you and your colleagues have been posting all sorts of useful messages, notes, links, images, documents, etc., into your shared Teams channel, and now you want to retrieve all, most, or some of these messages (or attachments) and save them somewhere (maybe an excel spreadsheet or a folder on your desktop). But what if there are 100s of these messages to go through, and some of these messages are also irrelevant?</p><p>I mean, you can always dedicate a day or two or three to this endeavour, but I have a better solution for you. What if I told you that you can just use the code that I am about to share with you to access messages on your target Teams channels and then sort them, modify them, do whatever you want with them, and then save them on your computer in a convenient format (Excel, Word, or folder)? Once you’ve set up this code and adopted it for your needs, you can just press go on your Python script, sit back, and relax (or work, I guess) while Python is doing its magic in the background.</p><p>Now, before we get into the code, I have to note that Microsoft does offer an <a href="https://learn.microsoft.com/en-us/graph/api/resources/teams-api-overview?view=graph-rest-1.0">API</a> for Teams channels and messages. Simply put, an API, or application-programming interface, is an easy way for your Python script to “talk” to a given application (Teams in this case) to request and retrieve specific data. This is a “proper” way of getting information from applications and webpages, and you should always try and use an API in the first instance where possible. Unfortunately, with Teams, it is a bit tricky since you need to request special admin permission first and get access through the API, and then you also have to pay for each message that you access (it’s a very small amount, but still), so it’s not ideal if you just want to quickly and cheaply access a few messages from a Teams channel.</p><p>So, without further ado, let’s get into the code, for which I will be using Python and the Selenium library.</p><h4>1. Install Selenium &amp; Download Chromedriver</h4><p>If you haven’t used Selenium in Python before, there are a few preparatory steps that you need to take before you can run your script.</p><p>First, install the Selenium library in Python using the command line or Anaconda prompt by typing in:</p><pre>pip install selenium</pre><p>Then, install or make sure that your version of Chromedriver (or another driver, depending on which browser you are using) is up-to-date and matches your current version of Chrome browser. To check which Chrome browser you have, click on ⋮ symbol in the top right corner of the browser, then go to Settings &gt; About Chrome, and this should specify which version you currently have (as shown below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*_tmRSdqO6iwdKAA2DuzR8g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lgaCTohvztAeMDcJ1PkSFg.png" /></figure><p>Now you can go to this <a href="https://googlechromelabs.github.io/chrome-for-testing/">website</a> and download the version of Chromedriver that matches your browser. Save the downloaded driver in the folder, which you can easily access, and note its directory path for later.</p><p>Now you are all set to begin your scrape!</p><h4>2. Scrape the Teams Channel with Selenium</h4><p>Start by opening your favourite IDE (integrated development environment, basically software for code writing and execution). For this, I strongly recommend using a Jupyter Notebook, for reasons that will become more apparent later.</p><p>We will begin by importing all the necessary objects and functions from the Selenium library:</p><pre>#Imports<br>import time<br>from selenium import webdriver<br>from selenium.webdriver.common.keys import Keys<br>from selenium.webdriver.support import expected_conditions as EC<br>from selenium.webdriver.chrome.service import Service<br>from selenium.webdriver.common.by import By<br>from selenium.webdriver.support.wait import WebDriverWait<br>from selenium.webdriver.common.action_chains import ActionChains</pre><p>Now let’s load an instance of Chromedriver from a local disk (or wherever you saved your Chromedriver):</p><pre>#Load the instance of Chrome Driver from local disk drive<br>opts = webdriver.ChromeOptions()<br>serv = Service(&quot;C:/**********/chromedriver.exe&quot;) #folder directory where your chromdriver is saved<br>driver = webdriver.Chrome(service=serv, options=opts)<br>driver.maximize_window() # Maximize the browser window<br>time.sleep(5)</pre><p>And finally, let’s open an online version of Teams in Chrome (Selenium wouldn’t work for a desktop version):</p><pre>#Open Teams webpage in Chrome<br>driver.get(&#39;https://teams.microsoft.com/v2/&#39;) #Teams URL; for now, it load as classic version only on Chats tab<br>time.sleep(10)</pre><p>A few things here. You might’ve noticed that we also added a few time.sleep(X) in the code. This command explicitly tells Python to wait for X seconds before proceeding with the rest of the code. This is quite important when using Selenium because, in a way, it interacts with the webpage in a similar manner to how you interact with it as a user: you enter a URL, then wait for the page to load; you click on something, and then wait for it to load. time.sleep() allows you to give a webpage time to load all the elements on it before proceeding (if the element isn’t loaded on the page, Selenium cannot see it).</p><p>The second thing to note is that this code is for the new <a href="https://support.microsoft.com/en-us/office/switch-to-the-new-microsoft-teams-2d4a0c96-fa52-43f8-a006-4bfbc62cf6c5">version</a> of Teams that was introduced in October 2023. It is still being improved and updated, so your code might need to be updated accordingly, depending on how long has passed since the publication of this article. For now, at least, you cannot add a URL for a specific channel (you used to be able to in the classic version, but unfortunately, Selenium cannot scrape it anymore for whatever reason), so we have to start with a generic URL that will bring you onto the landing page of the classic Teams version (I’m not sure why it doesn’t just load the new version straight away, but it is what it is).</p><p>Now, before we can open Teams online, we have to log into our Microsoft account, which we can also do automatically using Selenium. Note that you can just as easily log in manually (and you will still need to go through any further authentication separately), but for my friends who love everything hands-free, here’s how you automate your log-in part:</p><pre>#Target username<br>username = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, &quot;input[name=&#39;loginfmt&#39;]&quot;)))<br><br>#Enter your username<br>username.clear() #Ensures there are no characters there; not strictly necessary but good practice<br>username.send_keys(&quot;YOUR_USERNAME&quot;) #Your MS username<br><br>#Target the Next button and click it<br>WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, &quot;input[type=&#39;submit&#39;]&quot;))).click()<br>time.sleep(5)<br><br>#Target password<br>password = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, &quot;input[name=&#39;passwd&#39;]&quot;)))<br><br>#Enter your password<br>password.clear()<br>password.send_keys(&quot;YOUR_PASSWORD&quot;) #Your MS password<br><br>#Target the sign-in button and click it<br>button = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, &quot;input[type=&#39;submit&#39;]&quot;))).click()</pre><p>Here, we use a combination of explicit wait, i.e. time.sleep() and implicit wait, i.e. WebDriverWait(driver, X).until(EC.element_to_be_clickable()) The latter basically waits until the element you are targeting becomes clickable or until X seconds pass, whichever comes first. After X seconds, you will get a Timeout error. It’s not the easiest thing to guess how long you need to wait until the element loads because it depends on many factors that you can’t necessarily control, such as webpage design, size, or your internet speed, all of which could affect your element loading time in sometimes unpredictable ways. So, in a way, you just have to experiment a little with different explicit and implicit waits and see what works best for you (the timings that I provided worked for me, but you might need to adjust them for your code).</p><p>With that said, I usually start with 10 or 20 seconds, and if that results in the Timeout error, it usually suggests that you are targeting the wrong element, so just try a different one and see if that helps. This ability to try out searching for different elements without the need to reload the instance of Chromedriver and re-log into Teams (thanks to the ability to have code cells that can be run independently) is exactly the reason I prefer Jupiter Notebook for this job over other IDEs.</p><p>A neat trick that works most of the time for me is to use “Developer Tools” (Ctrl+Shift+I shortcut) to find the elements I want to target (Ctrl+Shift+C to inspect specific elements on the page). If the element has complex HTML associated with it, I normally copy and paste it all into ChatGPT and ask it to help me target that element using Selenium in Python. Its suggestions for these are usually on point (in fact, I used it to target most elements in this code)!</p><p>Now that we are logged into classic Teams, in the following code, we will automatically switch from that classic version to the new version and then go to the Teams channel of interest. I should repeat, at this point, that you can just as easily do this part manually (and it will probably be quicker that way, actually), but for illustrative purposes, I’ve included the code that does this automatically below:</p><pre>#Automatically switch to new version of Teams and navigate to the right channel<br>#Press on the slider to stiwch to the new version of Teams<br>slider = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CLASS_NAME, &quot;slider&quot;))).click()<br><br>#Press &quot;Switch to new Teams&quot; button in the pop-up window<br>switch_to_new_teams_button = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, &quot;//button[@aria-label=&#39;Switch to new Teams&#39;]&quot;))).click()<br>time.sleep(20)<br><br>#Press on the &quot;Teams&quot; icon to access the Teams channels<br>teams_channels_button = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, &quot;//button[@aria-label=&#39;Teams&#39;]&quot;))).click()<br><br>#Create an ActionChains object and perform a double click on the element<br>actions = ActionChains(driver)<br>actions.double_click(teams_channels_button).perform()<br><br>#Press on the scrolling bar to scroll down to the required channel<br>scroll_element = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.CSS_SELECTOR, &#39;.ui-box.dg.n.ab.ac.ae.af.ag.ah.ai.aj.ak.al.am.an.ao.ap.dh.virtual-tree-list-scroll-container&#39;))).click()<br><br>#Scroll down the page to get to the channel you want to scrape<br>n_scrolls = 2 #no. of scrolls depends on where your desired channel is and how many other channels there are<br>for i in range(0, n_scrolls):<br>    WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.TAG_NAME, &quot;body&quot;))).send_keys(Keys.PAGE_DOWN)<br>    time.sleep(5)<br><br>#Click on your target channel<br>target_channel = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, &quot;//span[@data-tid=&#39;channel-list-item-text-19:9e33cea7ff8042098c3848f496da5b7e@thread.tacv2&#39;]&quot;))).click()</pre><p>In this block, there are a couple of interesting things going on. Firstly, notice how we used .click() method to click on most buttons, but we needed to use ActionChains() object to perform a double-click (as you would if you were to just do this bit manually).</p><p>Secondly, if your target channel isn’t visible when the page is first loaded, you might need to scroll down to it. For that, we need to click on the scrolling bar to “activate” it and then scroll down a few times to get to the target channel using the for loop above. Again, the number of scrolls required here is more of a trial-and-error process because it’s difficult to determine by how much it will scroll down each time, so just play around with the number of scrolls and see what gets you to the point where you can see your target channel.</p><p>This last block of code is the most important part because it will actually do what we set out to do: scrape the text from the channel posts. The code basically targets the text part of the message body from all messages that are currently loaded. Next, it scrolls up a bit to allow the earlier messages to load and then scrapes the text from them too:</p><pre>#Create a function to get the text from all Teams channel messages that are currently loaded then scroll up and get <br>#the text from the earlier messages as well <br>def get_messages(driver):<br>    <br>    time.sleep(5)<br>    <br>    #Target the message body content for messages<br>    messages = WebDriverWait(driver, 20).until(EC.presence_of_all_elements_located((By.CSS_SELECTOR, &#39;[data-tid=&quot;message-body&quot;]&#39;)))<br>    time.sleep(10)<br>    <br>    #Extract all text content from the messages<br>    message_text = [message_text.find_element(By.TAG_NAME, &quot;p&quot;).text for message_text in messages]<br>    time.sleep(5)<br><br>    #Click anywhere on the screen<br>    WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.CSS_SELECTOR, &#39;[data-tid=&quot;channel-pane-runway&quot;]&#39;))).click()<br><br>    #Scroll up the page to load earlier entries<br>    n_scrolls = 5 #no. of scrolls depends on the number and length of your messages<br>    for i in range(0, n_scrolls):<br>        WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.TAG_NAME, &quot;body&quot;))).send_keys(Keys.PAGE_UP)<br>        time.sleep(5)<br><br>    #Target the message body content for messages<br>    messages = WebDriverWait(driver, 20).until(EC.presence_of_all_elements_located((By.CSS_SELECTOR, &#39;[data-tid=&quot;message-body&quot;]&#39;)))<br>    time.sleep(10)<br>    <br>    #Extract all text content from the messages<br>    message_text = [message_text.find_element(By.TAG_NAME, &quot;p&quot;).text for message_text in messages]<br>    time.sleep(5)<br>    <br>    return message_text<br><br>message_text = get_messages(driver)</pre><p>This code essentially scrapes, scrolls and then scrapes again, but you can actually repeat this process as many times as you need since we have created a custom function for this.</p><p>The interesting part here is that we cannot just access the text of the message straight away because the text itself is “hidden” within a generic &lt;p&gt; (paragraph) tag. So instead of targeting p tag directly and getting text from all p tags in the channel, we first target its parent data-tid=&quot;message-body&quot; and then we access all p tags within that element to retrieve our message text.</p><p>While this specific script only targets text (and any links that are there as part of that text), you can target other things as well, such as images, using e.g. &lt;img&gt; tag or an attached file (you might need to add a few more steps if you want these downloaded too). You can add additional filters to your text, e.g. only include messages containing specific words, etc. After this, you can, for example, use the Pandas library to transfer the text (or images) to an Excel file or Openpyxl to add them to an existing Excel file. You can also use the os library to save attachments to the folders. The choice is yours to make!</p><p>And here you go. A quick script for getting multiple messages from the Teams channel using Selenium in Python. Let me know what you think, has this code worked for you, and whether you have any suggestions for improvements. And always remember to use web scraping responsibly and ethically!</p><p>If you want to access the full code (and copy and adopt it), you can find it on my <a href="https://github.com/alenagorb/teams_channel_scrape_selenium/blob/main/General_Teams_Channel_Scraper.ipynb">GitHub</a>.</p><h3>Stackademic</h3><p><em>Thank you for reading until the end. Before you go:</em></p><ul><li><em>Please consider </em><strong><em>clapping</em></strong><em> and </em><strong><em>following</em></strong><em> the writer! 👏</em></li><li><em>Follow us on </em><a href="https://twitter.com/stackademichq"><strong><em>Twitter(X)</em></strong></a><em>, </em><a href="https://www.linkedin.com/company/stackademic"><strong><em>LinkedIn</em></strong></a><em>, and </em><a href="https://www.youtube.com/c/stackademic"><strong><em>YouTube</em></strong></a><strong><em>.</em></strong></li><li><em>Visit </em><a href="http://stackademic.com/"><strong><em>Stackademic.com</em></strong></a><em> to find out more about how we are democratizing free programming education around the world.</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=369a390b07e9" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/unlocking-data-scraping-teams-channel-using-selenium-in-python-369a390b07e9">Unlocking Data: Scraping Teams Channel Using Selenium in Python</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenAI’s CEO Saga: The Rise, Fall, and Swift Return of Sam Altman]]></title>
            <link>https://medium.com/@alenagorb02/openais-ceo-saga-the-rise-fall-and-swift-return-of-sam-altman-fb03408425c4?source=rss-51d81d71969e------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb03408425c4</guid>
            <category><![CDATA[ceo]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[sam-altman]]></category>
            <category><![CDATA[artificial-general-intell]]></category>
            <dc:creator><![CDATA[Alena Gorb]]></dc:creator>
            <pubDate>Sat, 25 Nov 2023 21:14:59 GMT</pubDate>
            <atom:updated>2023-11-25T21:14:59.666Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2GtNAL0C6VbvuJtm" /><figcaption>Photo by <a href="https://unsplash.com/@andrewtneel?utm_source=medium&amp;utm_medium=referral">Andrew Neel</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Not often do you get tech-AI-Twitter drama dominating mainstream media, but when it comes to the sacking and reinstatement of the CEO of one of the most famous Silicon Valley AI start-ups, all in a span of less than a week, I can see why people might be fascinated by the story (myself included). It has all the features of a Hollywood-worthy script: rise to fame, glamorous tech start-up CEO, betrayal, incredible loyalty &amp; camaraderie, mutiny, and heartwarming return of the hero.</p><p>Now, in case you are like me and have been loosely following the <a href="https://www.business-standard.com/world-news/ceo-sam-altman-fires-openai-board-that-sacked-him-last-week-123112300367_1.html">news</a> of <a href="https://openai.com/">OpenAI</a>’s CEO, <a href="https://en.wikipedia.org/wiki/Sam_Altman">Sam Altman</a>, being sacked by the board and then asked to come back, but got confused, you’re not alone (I’m still confused, to be honest). So in this article, we will try to unpack what happened to OpenAI in the past few weeks and, more importantly, why.</p><p>Let’s begin by breaking down the timeline of what happened first:</p><p><strong>Friday, 17th November</strong>: OpenAI <a href="https://openai.com/blog/openai-announces-leadership-transition">announced</a> that its board fired its then-CEO, Sam Altman, from the company, replacing him with Mira Murati, OpenAI’s CTO, as interim CEO. The press release stated that Altman “w<em>as not consistently candid in his communications with the board,</em>” so the board “<em>no longer has confidence in his ability to continue leading OpenAI,</em>” but no further reasoning was provided. At that time, the board consisted of Ilya Sutskever, OpenAI’s chief scientist, and independent directors Adam D’Angelo, CEO of Quora, Tasha McCauley, a tech entrepreneur, and Helen Toner, director and AI safety expert at Georgetown University’s Center for Security and Emerging Technology. Greg Brockman, OpenAI’s chair and president, was removed from the board but was allowed to stay at the company.</p><p>In response to the news, Altman posted a rather sweet message on his X (or Twitter, whatever you want to call it these days):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*OOmEfoSp28TkMDNGE_hwDQ.png" /></figure><p>Shortly after the news spread, Greg Brockman quit OpenAI, apparently in solidarity with Altman, posting the following tweet:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*Qc0_OiZeqTabErROMS3rig.png" /></figure><p><strong>Saturday, 18th November</strong>: According to the <a href="https://www.theguardian.com/technology/2023/nov/25/how-crisis-openai-sam-altman-unfolded">memo</a> from OpenAI’s chief strategy officer, Jason Kwon, the talks were ongoing to bring Altman back, together with a few other colleagues who quit following Friday’s announcement.</p><p><strong>Sunday, 19th November:</strong> The talks with the board allegedly didn’t go too well, so a new CEO, Emmett Shear, the former CEO of the streaming platform Twitch, was appointed.</p><p><strong>Monday, 20th November:</strong> Satya Nadella, CEO of Microsoft, announced that Altman and Brockman will be leading Microsoft’s new advanced AI research team:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*j6hO5ov8FHC5i6swmnDKZQ.png" /></figure><p>Meanwhile, OpenAI employees were also not too happy with the board’s decision to remove Altman and threatened to leave the company if Sam didn’t get reinstated as a CEO. In the letter to the board, the employees <a href="https://www.theguardian.com/technology/2023/nov/20/openai-staff-walkout-sam-altman-board">said</a>:</p><blockquote>“Your actions have made it obvious that you are incapable of overseeing OpenAI. We are unable to work for or with people that lack competence, judgment and care for our mission and employees.”</blockquote><p>Many OpenIA employees also posted the following message on their X accounts:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*wbpZVxzNy4IciHbjwFovOA.png" /></figure><p><strong>Wednesday, 22nd November:</strong> OpenAI posted in its X saying that the company reached an agreement in principle for Altman to return as a CEO, with the new board consisting of Bret Taylor, former co-CEO of Salesforce, Larry Summers, the former US Treasury secretary, and Adam D’Angelo (the only member of the previous board):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*jwL_3cqXZwZQCYI6HjFc7A.png" /></figure><p>In response, Sam Altman posted the following heartwarming tweet:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*6kKlQsI_gWucvu9WeQY05Q.png" /></figure><p>Greg Brockman also returned to the company:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*6kmEB6VSw1s3hWZaUIRu3g.png" /></figure><p>THE END …</p><p>Well, at least for now it seems like the drama is over, and we are back to where we started. However, the big question remains: why was Sam Altman actually sacked in the first place?</p><p>The internet <a href="https://www.reuters.com/technology/sam-altmans-ouster-openai-was-precipitated-by-letter-board-about-ai-breakthrough-2023-11-22/">rumour</a> has it, that apparently, the not-so-secretive (it’s all over the news now) Q* (Q-star) project might have had something to do with the sudden decision to sack Altman. Q* is OpenAI’s latest breakthrough (or so it is speculated) in getting closer to <a href="https://www.investopedia.com/artificial-general-intelligence-7563858">artificial general intelligence</a> or AGI (not to be confused with generative artificial intelligence or GAI, like <a href="https://chat.openai.com/">ChatGPT</a>).</p><p>It is hard to explain what AGI exactly is, largely because the definitions vary depending on who you ask, but OpenAI <a href="https://openai.com/blog/planning-for-agi-and-beyond">calls</a> it “<em>AI systems that are generally smarter than humans.</em>” In a nutshell, the general idea of AGI seems to be performing cognitive tasks such as problem-solving or novel idea generation on a level comparable to or better than humans. So basically, imagine if ChatGPT was capable of not just replicating what it was trained to do, but also teaching itself new concepts and applying them to come up with unique solutions (or something of that sort, you get the idea).</p><p>Back to the story, it appears that OpenAI recently saw a breakthrough with Q* which was able to solve a school-grade math problem (I know it doesn’t sound that impressive, but it really is). Several employees were allegedly <a href="https://fortune.com/2023/11/23/openai-sam-altman-board-directors-agi-breakthrough-reuters/amp/">concerned</a> over the speed with which Altman wanted to proceed in an attempt to commercialize the technology as fast as possible. These concerns were stated in the letter to the board, which is thought to have contributed to Altman’s firing.</p><p>At the AI <a href="https://www.youtube.com/watch?v=ZFFvqRemDv8">discussion</a> during the Asia-Pacific Economic Cooperation (APEC) summit on Thursday, 16th November, Altman apparently hinted at the significant advancement with the Q* in his speech:</p><blockquote>“Four times now in the history of OpenAI, the most recent time was just in the last couple weeks, I’ve gotten to be in the room, when we sort of push the veil of ignorance back and the frontier of discovery forward, and getting to do that is the professional honour of a lifetime” — Sam Altman, CEO of OpenAI</blockquote><p>So, that’s it for now, folks. It would be very interesting to see whether such a leadership shake-up will have any long-term consequences for OpenAI’s strategy, and if so, what they would be. I am personally excited to see what OpenAI’s version of AGI would look like, but I also acknowledge that there are potential risks associated with the irresponsible use of such technology. But for now, we can only wait and see what happens next.</p><p>As always, let me know your thoughts on the situation and on AGI in general: do you think it will be a blessing or a Pandora’s box?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb03408425c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Which Generative AI Is the Best? ChatGPT vs. Bard vs. Pi vs. Claude]]></title>
            <link>https://blog.stackademic.com/which-generative-ai-is-the-best-chatgpt-vs-bard-vs-pi-vs-claude-4c94342bbd6a?source=rss-51d81d71969e------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c94342bbd6a</guid>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[bard-ai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[claude-ai]]></category>
            <category><![CDATA[inflectionai]]></category>
            <dc:creator><![CDATA[Alena Gorb]]></dc:creator>
            <pubDate>Sun, 19 Nov 2023 13:57:09 GMT</pubDate>
            <atom:updated>2024-07-01T07:11:06.063Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*glEQOts9yJnJLm1AYlrCLg.png" /></figure><p>If you have read the news for the past year, you have almost certainly heard of OpenAI’s large language model (LLM) called ChatGPT. For those not familiar, simply put, LLM is a type of artificial intelligence (AI) model trained on large amounts of text data. LLM essentially learns how to generate human-like text by predicting which word is most likely to follow the previous one (the actual stats is way more complex than this, but that’s the gist).</p><p>ChatGPT broke records for the fastest-growing user base, with <a href="https://explodingtopics.com/blog/chatgpt-users">180M+</a> people using it. Pretty crazy, right? But did you know that ChatGPT is not the only freely available generative AI out there? In March 2023, Google <a href="https://www.theverge.com/2023/3/21/23649794/google-chatgpt-rival-bard-ai-chatbot-access-hands-on">released</a> its own LLM called Bard AI. A few other companies and AI start-ups released theirs as well, but today we will discuss two: Infection’s Pi AI and Anthropic’s Claude.</p><p>Just a note before we start: I’m not an AI developer or expert, so I will be comparing the four chatbots from the user perspective rather than their technical specifications (e.g., training methodology, training data, etc.) Also, I will only be considering <strong>publicly available free versions</strong> of the chatbots, so bear in mind that paid versions could have a lot more functionality available. Finally, all assessments represent my opinions and experience with the aforementioned AIs, so please let me know your thoughts and whether you agree in the comments (but be nice!) Now, with the disclaimers out of the way, let’s get into the discussion itself!</p><blockquote><em>💡</em> <strong>Also, learn the basics of generative AI:</strong></blockquote><p><a href="https://differ.blog/p/foundation-pillars-of-genai-generative-models-latent-space-sampling-and-reconstruction-3b852d">Foundation Pillars of GenAI: Generative Models, Latent Space, Sampling and Reconstruction</a></p><h4>OpenAI’s ChatGPT (plus Microsoft Copilot)</h4><p>I might be biased here, but ChatGPT was my first experience with generative AI, so it will always be one of my favourites. It usually understands the prompts that are not very clear and generates comprehensive answers to them. One of the features that I use the most, as I previously <a href="https://medium.com/stackademic/best-web-scraping-tools-in-2024-quick-guide-from-beginner-to-pro-3c3c799ca4ca">mentioned</a>, is help with coding problems. Here’s an example of ChatGPT helping me debug my web scraper:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JxItmRLlyPyZG7wTTgJh8g.png" /></figure><p>Aside from coding, ChatGPT could do all sorts of other things: solve math problems, write essays on a given topic, summarise large amounts of text, generate custom advice for your problem, and more. ChatGPT can also present data in different formats, including tables, JSON, HTML, and other formats. Each chat is also automatically named (although you can change the name if you like) and stored, so you can come back to it if you want.</p><p>What is quite remarkable about ChatGPT is the relatively low rate of AI hallucinations (a fancy term for when AI presents false information as facts in its answer), at least in my experience. This does require the user to input well-designed prompts into it, but overall, I rarely notice mistakes from ChatGPT, and if I do, it usually corrects itself when I ask it to.</p><p>The free version of ChatGPT is, however, limited to the data up to January 2022 (in my latest version), which means that ChatGPT can’t comment on or analyse current affairs, which is especially useful for my job as a pharma consultant. Moreover, ChatGPT does not output or accept as input images, tables, or other files. I believe this is not the case for ChatGPT 4, which is connected to the internet and can deal with different input and output data formats, but you have to pay for it.</p><p>A way around the need for a paid version would be a tool that I discovered recently called <a href="https://adoption.microsoft.com/en-us/copilot/">Microsoft Copilot</a>. It is currently available in a preview version to Microsoft 365 users (if admin permissions allow). Copilot runs on ChatGPT 3.5 (the same version as free ChatGPT), but it is connected to the internet and can generate images using another tool from OpenAI, <a href="https://labs.openai.com/">DALL-E 2</a>. For now, however, Copilot is limited to 30 responses per conversation, but this will likely change in the future. Copilot will allow users to essentially use ChatGPT capabilities within Microsoft apps, which would be pretty convenient if you ask me!</p><h4><strong>Google’s Bard AI</strong></h4><p>By and large, I would say that <a href="https://bard.google.com/chat">Bard</a> is mostly on par with ChatGPT in terms of its different capabilities, like coding help, math problems, data analysis and summaries, etc. However, it’s one big advantage is that it’s connected to the internet. Ironically enough, I found this to be its biggest limitation too. Let me explain. On one hand, having Bard connected to the internet allows me to get answers to the things that are happening in real-time.</p><p>On the other hand, Bard rarely seems to generate correct answers when asked about current affairs (i.e., displays a lot of AI hallucinations), so it is not awfully helpful in this regard. Bard does have a feature that allows you to use Google search to verify Bard’s answers for correctness, although I found that this feature isn’t very helpful when Google can’t find exact matches to Bard’s answers (Google leaves most of the answer unevaluated).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*Cv0eYvFLN2P1H0LbC4yBrA.png" /><figcaption>Google search button to double-check Bard’s responses</figcaption></figure><p>Unlike ChatGPT, Bard also seemed to struggle to process large amounts of text data, giving me an unsatisfactory “I couldn’t complete your request. Try submitting your prompt again,” three times in a row.</p><p>Overall, I think Bard is a decent option to have if you need to analyze current news, but I would definitely not rely on it for this. In other aspects, it is pretty interchangeable with ChatGPT, although I found a lower rate of AI hallucinations with the latter.</p><h4>Inflection’s Pi AI</h4><p>As far as chatbots go, <a href="https://pi.ai/talk">Pi </a>is the most “conversational” AI of the four. And I mean emoji-at-the-end-of-every-paragraph kind of conversational! But it is the most entertaining one, in my opinion, as well.</p><p>Unlike ChatGPT or Bard, Pi is not the most proficient when it comes to helping with code or summarising data in different output formats, but it is the only one that can actually talk to you (as in through your computer’s speakers). Pi also has a 1000-character limit for its prompts, so it cannot analyze large amounts of data at once. Annoyingly, it only allows you to have a single long conversation (no separate chats), which means that finding older responses could be quite a challenge.</p><p>Nevertheless, I found Pi to be the most engaging when it comes to conversations on life or career topics. ChatGPT and Bard would most certainly give you quite a formal answer and then send you to a qualified professional (which, don’t get me wrong, is great advice!) But if you are just looking for a way to vent and feel understood, Pi will be your friend! However, always remember that Pi is just an AI chatbot, so please seek professional help for any serious issues you might have.</p><h4>Anthropic’s Claude AI</h4><p>I first heard about <a href="https://claude.ai/chat">Claude</a> from a friend and decided to give it a try. Claude can answer simple questions from a text-based prompt, but this seems to be the extent of its capabilities. I wasn’t able to get Claude to do code generation, complex math problems, analyze large amounts of data, or summarise data into different output formats. It is also not connected to the internet or able to interact with images or tables (despite having a button in the prompt to submit different file types). Based on these considerations, I would say that Claude is perhaps the least advanced of the four chatbots, and because the other three offer a lot more capabilities, I personally rarely use Claude, although I imagine it will get better in future iterations.</p><p>To sum up, all four chatbots have their merits and their limitations, so I think it largely depends on the task at hand which one is actually the “best”. I created a quick summary table to highlight which chatbot has which capabilities (listing the ones I thought were most helpful):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_vKgrQMt8ErfJyYN5878gA.png" /></figure><p>As always, let me know what you think about these, what your experience with them was, and if you are using any other AI in your daily life.</p><h3>Stackademic</h3><p><em>Thank you for reading until the end. Before you go:</em></p><ul><li><em>Please consider </em><strong><em>clapping</em></strong><em> and </em><strong><em>following</em></strong><em> the writer! 👏</em></li><li><em>Follow us on </em><a href="https://twitter.com/stackademichq"><strong><em>Twitter(X)</em></strong></a><em>, </em><a href="https://www.linkedin.com/company/stackademic"><strong><em>LinkedIn</em></strong></a><em>, and </em><a href="https://www.youtube.com/c/stackademic"><strong><em>YouTube</em></strong></a><strong><em>.</em></strong></li><li><em>Visit </em><a href="http://stackademic.com/"><strong><em>Stackademic.com</em></strong></a><em> to find out more about how we are democratizing free programming education around the world.</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c94342bbd6a" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/which-generative-ai-is-the-best-chatgpt-vs-bard-vs-pi-vs-claude-4c94342bbd6a">Which Generative AI Is the Best? ChatGPT vs. Bard vs. Pi vs. Claude</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best Web Scraping Tools in 2024: Quick Guide From Beginner to Pro]]></title>
            <link>https://blog.stackademic.com/best-web-scraping-tools-in-2024-quick-guide-from-beginner-to-pro-3c3c799ca4ca?source=rss-51d81d71969e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c3c799ca4ca</guid>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[web-scraping-tools]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[power-automate]]></category>
            <dc:creator><![CDATA[Alena Gorb]]></dc:creator>
            <pubDate>Sun, 12 Nov 2023 13:56:28 GMT</pubDate>
            <atom:updated>2023-11-15T00:43:24.611Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*s74MBEU068rnTEkJv694VA.png" /><figcaption>Different Web Scraping Tools</figcaption></figure><p>In this day and age, there is no shortage of information, with the Internet being able to tell you anything from how to look after an orchid at home to how to start your own business. The real advantage now lies in being able to collect all this data together and extract meaningful and actionable insights from that data. This is where web scraping (also known as web harvesting or web data extraction) can come in handy.</p><p>According to Wikipedia, <a href="https://en.wikipedia.org/wiki/Web_scraping">web scraping</a> involves data extraction for a web page. Sounds simple enough, right? Theoretically, you can manually select all text, images, videos, etc. and just copy and paste it into an Excel spreadsheet or a Word document. But what if you have to do it for 1000 web pages? Or 10,000 web pages? The process can quickly become very time-consuming.</p><p>This is where the automation part of web scraping comes in. Broadly speaking, you can automate web scraping using one of two strategies:</p><ul><li>Using web-scraping software, which will allow you to easily get the information from multiple pages with little to no coding skills,</li><li>Using programming languages, such as Python or JavaScript, where you can extract any data from the web pages and then process it further in any way you want really!</li></ul><p>Now let’s break these strategies a bit further and discuss the benefits and drawbacks of each.</p><h4>1. Web Scraping Software</h4><p><strong>Difficulty:</strong> 2/5</p><p><strong>Versatility:</strong> 3/5</p><p>These days, there is plenty of specialised software for web scraping. Listing all of them would be impossible in a single short article, but some examples include <a href="https://webscraper.io/">Web Scraper</a>, <a href="https://www.octoparse.com/">Octoparse</a>, <a href="https://www.webharvy.com/">WebHarvy</a>, and <a href="https://parsehub.com/">Parsehub</a>. The obvious advantage of these is that they do not require you to have any coding skills whatsoever. Just type in the URL of interest, and then point and click on any elements that you want to extract data from. Many of these also offer very comprehensive tutorials and support services in case you get stuck on something.</p><p>On the other hand, however, one of the major drawbacks, at least in my opinion, is the fact that these are rarely free. Most will offer you a free trial, after which you can continue using the software only if you choose to pay for it. Web Scraper allows you to download a free Chrome <a href="https://chromewebstore.google.com/detail/web-scraper-free-web-scra/jnhgnonknehpejjnehehllkliplmbmhn?hl=en">Extension</a> that you can use to carry out simple web scrapes, albeit with limited functionality. Parsehub actually allows you to download basic software for free, but again, to increase the number of pages per run, the number of projects, or to scrape images and files, you would need to purchase a subscription. Another issue that I discovered while trialling a few of these was that the debugging (aka finding out why the software isn’t doing exactly what you want it to do) could be quite tricky, largely because it’s not always obvious to me what the software is actually doing behind the scenes. All in all, because to get more advanced capabilities, you have to pay, and because I found it tricky to use the web scraping software for more dynamic websites, I gave them a 3/5 on how versatile your capabilities are when using these.</p><h4>2. Microsoft Power Automate</h4><p><strong>Difficulty:</strong> 3/5</p><p><strong>Versatility: </strong>4/5</p><p>Now, I decided to put this handy tool into a separate category for a few reasons. Firstly, if you are not familiar with it, <a href="https://powerautomate.microsoft.com/en-us/">Power Automate</a> is general-purpose Microsoft software for automating repetitive tasks, so it is not web scraping-specific. Secondly, while it also doesn’t require any coding skills as it has quite an intuitive drag-and-drop interface to build workflows, some basic understanding of “coding logic” can certainly be very helpful.</p><p>The benefit of Power Automate is that it is really easy to start using it for scraping simple websites. One of my favourite YouTubers, Leila Gharani, has an amazing intro <a href="https://www.youtube.com/watch?v=DgBZiBIgh3w">video</a> on how to use Power Automate to scrape multiple web pages from her website. Just launch an instance of the Chrome browser (or any other browser of your choice) and then use the “record” button to record your actions on the web page, which Power Automate can then repeat for all other pages. Additionally, since Power Automate is not limited to web scraping in its capabilities, you can do further processing on your extracted data, e.g., extracting titles that contain only certain words or are of a certain length. There also aren’t any restrictions on how many workflows you can have once you get the software.</p><p>However, while getting started is relatively easy, doing more advanced processing would require a little bit more time and learning. Debugging can also sometimes get difficult because you don’t have full control over how web pages are loaded and accessed. Furthermore, Power Automate is only free to download and use for people with a Microsoft 365 subscription; otherwise, you have to purchase the software separately or get a Microsoft 365 subscription to get free access to it. Overall, though, I think this is a great middle ground between specialised web scraping software and full-on custom programming scripts since no coding skills are required, but you can still do some complex post-extraction processing on the data.</p><h4>3. Hard-Core Programming</h4><p><strong>Difficulty:</strong> 5/5</p><p><strong>Versatility: </strong>5/5</p><p>If you know me, you wouldn’t be surprised if I told you that this is my favourite way to web scrape. I personally use Python, so I will be talking about using it for the rest of the article, but I believe there are also libraries for web scraping in other programming languages too.</p><p>Now, if you are serious about your web scraping, Python is the way to go! It has numerous libraries specifically for that purpose, including BeautifulSoup, Requests, Scrapy, and Selenium, so you can pick and choose which library to use depending on the task. While the BeautifulSoup and Requests libraries are more beginner-friendly and can quickly and easily scrape basic websites, Scrapy and Selenium have some advanced capabilities that allow you to interact with dynamic and JavaScript-enabled content. You can also take advantage of all other Python libraries, such as Pandas or Numpy, to perform all sorts of analyses on the extracted data, so your options are virtually limitless! And did I mention that Python is open-source and free for anyone to download? It also has a huge community of people with well-written documentation, so if you ever get stuck, help is usually not hard to find (Python documentation, StackOverflow, Google, and ChatGPT are the sources I usually use).</p><p>On the flip side, the obvious disadvantage of this strategy is that you want to have at least some basic knowledge and understanding of programming in Python and how the “coding logic” works. The good news, however, is that, at least for web scraping, the basics could be picked up relatively quickly and the rest could be learned by actually doing the scrapes yourself.</p><p>Here you go. These are, in my opinion, the best tools for web scraping in 2024. Let me know what you think about these and share the tools that you use for web scraping and your experiences with them!</p><h3>Stackademic</h3><p><em>Thank you for reading until the end. Before you go:</em></p><ul><li><em>Please consider </em><strong><em>clapping</em></strong><em> and </em><strong><em>following</em></strong><em> the writer! 👏</em></li><li><em>Follow us on </em><a href="https://twitter.com/stackademichq"><strong><em>Twitter(X)</em></strong></a><em>, </em><a href="https://www.linkedin.com/company/stackademic"><strong><em>LinkedIn</em></strong></a><em>, and </em><a href="https://www.youtube.com/c/stackademic"><strong><em>YouTube</em></strong></a><strong><em>.</em></strong></li><li><em>Visit </em><a href="http://stackademic.com/"><strong><em>Stackademic.com</em></strong></a><em> to find out more about how we are democratizing free programming education around the world.</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c3c799ca4ca" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/best-web-scraping-tools-in-2024-quick-guide-from-beginner-to-pro-3c3c799ca4ca">Best Web Scraping Tools in 2024: Quick Guide From Beginner to Pro</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>