{
  "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": 1,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "_dGGN8UBX0oH",
        "outputId": "09caaa48-5b69-4b35-e3bf-98533a65aacb"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "GeeksforGeeks\n",
            "is\n",
            "a\n",
            "one\n",
            "stoplearning\n",
            "destination\n",
            "for\n",
            "geeks\n"
          ]
        }
      ],
      "source": [
        "import spacy\n",
        "nlp = spacy.blank(\"en\")\n",
        "\n",
        "doc = nlp(\"GeeksforGeeks is a one stop\\\n",
        "learning destination for geeks\")\n",
        "\n",
        "for token in doc:\n",
        "    print(token)"
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "nlp = spacy.load(\"en_core_web_sm\")\n",
        "\n",
        "nlp.pipe_names"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "imX7HUYTX4Ds",
        "outputId": "6da76d05-6dd7-4dd9-a689-ffb076864c3b"
      },
      "execution_count": 2,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "['tok2vec', 'tagger', 'parser', 'attribute_ruler', 'lemmatizer', 'ner']"
            ]
          },
          "metadata": {},
          "execution_count": 2
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "import spacy\n",
        "nlp = spacy.load(\"en_core_web_sm\")\n",
        "\n",
        "doc = nlp(\"If you want to be an excellent programmer \\\n",
        ", be consistent to practice daily on GFG.\")\n",
        "\n",
        "for token in doc:\n",
        "    print(token, \" | \",\n",
        "          spacy.explain(token.pos_),\n",
        "          \" | \", token.lemma_)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "Dw6mwhisX4GI",
        "outputId": "601f0d91-56cc-4ace-9504-d230354032ae"
      },
      "execution_count": 3,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "If  |  subordinating conjunction  |  if\n",
            "you  |  pronoun  |  you\n",
            "want  |  verb  |  want\n",
            "to  |  particle  |  to\n",
            "be  |  auxiliary  |  be\n",
            "an  |  determiner  |  an\n",
            "excellent  |  adjective  |  excellent\n",
            "programmer  |  noun  |  programmer\n",
            ",  |  punctuation  |  ,\n",
            "be  |  auxiliary  |  be\n",
            "consistent  |  adjective  |  consistent\n",
            "to  |  particle  |  to\n",
            "practice  |  verb  |  practice\n",
            "daily  |  adverb  |  daily\n",
            "on  |  adposition  |  on\n",
            "GFG  |  proper noun  |  GFG\n",
            ".  |  punctuation  |  .\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [],
      "metadata": {
        "id": "JG23rjKUX4NO"
      },
      "execution_count": null,
      "outputs": []
    }
  ]
}