{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "provenance": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "RTJUwus6cTPh"
      },
      "outputs": [],
      "source": [
        "# Install the Required Library\n",
        "!pip install vaderSentiment\n",
        "\n",
        "# Import the Required Library\n",
        "from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer\n",
        "\n",
        "# Create the Sentiment Analyzer\n",
        "sid_obj = SentimentIntensityAnalyzer()\n",
        "\n",
        "# Create a Function to Analyze Sentiment\n",
        "def sentiment_scores(sentence):\n",
        "\n",
        "    sentiment_dict = sid_obj.polarity_scores(sentence)\n",
        "\n",
        "    print(\"Sentiment Scores:\", sentiment_dict)\n",
        "    print(f\"Negative Sentiment: {sentiment_dict['neg']*100:.1f}%\")\n",
        "    print(f\"Neutral Sentiment: {sentiment_dict['neu']*100:.1f}%\")\n",
        "    print(f\"Positive Sentiment: {sentiment_dict['pos']*100:.1f}%\")\n",
        "\n",
        "    if sentiment_dict[\"compound\"] >= 0.05:\n",
        "        print(\"Overall Sentiment: Positive\")\n",
        "    elif sentiment_dict[\"compound\"] <= -0.05:\n",
        "        print(\"Overall Sentiment: Negative\")\n",
        "    else:\n",
        "        print(\"Overall Sentiment: Neutral\")\n",
        "\n",
        "# Analyze Sample Sentences\n",
        "if __name__ == \"__main__\":\n",
        "\n",
        "    print(\"\\n1st Statement:\")\n",
        "    sentiment_scores(\n",
        "        \"GeeksforGeeks is an excellent platform for learning programming.\"\n",
        "    )\n",
        "\n",
        "    print(\"\\n2nd Statement:\")\n",
        "    sentiment_scores(\n",
        "        \"The presentation was informative and well organized.\"\n",
        "    )\n",
        "\n",
        "    print(\"\\n3rd Statement:\")\n",
        "    sentiment_scores(\n",
        "        \"I am feeling disappointed with today's results.\"\n",
        "    )"
      ]
    }
  ]
}