Skip to content

Instantly share code, notes, and snippets.

@BarisSari
Last active December 24, 2020 09:48
Show Gist options
  • Save BarisSari/15345f2f30e8fe6bb45a5ad365220285 to your computer and use it in GitHub Desktop.
Save BarisSari/15345f2f30e8fe6bb45a5ad365220285 to your computer and use it in GitHub Desktop.
spacy.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "spacy.ipynb",
"provenance": [],
"collapsed_sections": [],
"authorship_tag": "ABX9TyPVax9Vc6+SoomToiGT4FXo",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/BarisSari/15345f2f30e8fe6bb45a5ad365220285/spacy.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"metadata": {
"id": "Y9q0UMteW1o2"
},
"source": [
"!pip install spacy\n",
"!python -m spacy download en_core_web_sm"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "Xc7SXBrFWjQS",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "97891698-71f7-4dc0-ed3a-ef8dc18b4899"
},
"source": [
"import spacy\n",
"\n",
"nlp = spacy.load(\"en_core_web_sm\")\n",
"[sent.text for sent in nlp(first_dialogue).sents]"
],
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"['Do you know what this is all about?',\n",
" 'Do you know, why were here?',\n",
" 'To be out, this is out...and out is one of the single most enjoyable experiences of life.',\n",
" 'People...did you ever hear people talking about We should go out?',\n",
" 'This is what theyre talking about...',\n",
" 'this whole thing, were all out now, no one is home.',\n",
" 'Not one person here is home, were all out!',\n",
" 'There are people tryin to find us, they dont know where we are.',\n",
" '(on an imaginary phone) Did you ring?',\n",
" ', I cant find him.',\n",
" 'Where did he go?',\n",
" 'He didnt tell me where he was going.',\n",
" 'He must have gone out.',\n",
" 'You wanna go out',\n",
" 'you get ready',\n",
" ', you pick out the clothes, right?',\n",
" 'You take the shower, you get all ready, get the cash, get your friends, the car, the spot, the reservation...',\n",
" 'Then youre standing around, whatta you do?',\n",
" 'You go',\n",
" 'We gotta be getting back.',\n",
" 'Once youre out, you wanna get back!',\n",
" 'You wanna go to sleep, you wanna get up, you wanna go out again tomorrow,',\n",
" 'right?',\n",
" 'Where ever you are in life, its my feeling, youve gotta go.']"
]
},
"metadata": {
"tags": []
},
"execution_count": 7
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment