NLTK text analysis: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
Line 1: Line 1:
=Natural Language Tool Kit_141020_Michael=
=Natural Language Tool Kit_141020_Michael=


{
==Basic==
"cells": [
<source lang=python>
  {
url = "https://git.xpub.nl/XPUB/S13-Words-for-the-Future-notebooks/raw/branch/master/txt/words-for-the-future/UNDECIDABILITY.txt"
  "cell_type": "code",
 
  "execution_count": null,
from nltk import word_tokenize, Text
  "metadata": {},
tokens = word_tokenize(text)
  "outputs": [],
len(tokens)
  "source": []
tokens[-1]
  },
tokens[:10] # not including the 10th word
  {
tokens[21:30] # not including the 30th word
  "cell_type": "code",
 
  "execution_count": null,
strengers = Text(tokens)
  "metadata": {},
strengers.concordance("multiplicity", width = 84, lines = 72)
  "outputs": [],
 
  "source": []
Displaying 11 of 11 matches:
  },
] attempts to escape the vortex of multiplicity are useless. ” [ 6 ] In his fifth m
  {
, he subsequently focuses on [ i ] multiplicity [ i ] as a way for literature to co
  "cell_type": "code",
fore , let ’ s think visibility and multiplicity together , as : a multiplication of
  "execution_count": 1,
n the contrary , it is generating a multiplicity of different gazes that are all leg
  "metadata": {},
ed and thus incomplete and open . A Multiplicity of Gazes An undecidable artwork is
  "outputs": [],
ics today , is that they generate a multiplicity of gazes and of forms of spectators
  "source": [
positions and points of view . The multiplicity of gazes produced and gathered by u
    "url = \"https://git.xpub.nl/XPUB/S13-Words-for-the-Future-notebooks/raw/branch/master/txt/words-for-the-future/UNDECIDABILITY.txt\""
tes a radical collectivity based on multiplicity and on conflicting positions that a
  ]
ility and from its encounter with a multiplicity of gazes . Preserving it is possibl
  },
encounter between undecidable art , multiplicity of gazes , and a curatorial dimensi
  {
ibid , p. 98 . 7 . Italo Calvino , Multiplicity , [ i ] Six Memos for the Next Mill
  "cell_type": "code",
 
  "execution_count": 2,
 
  "metadata": {},
for line in strengers.concordance_list("the", width=82, lines=74):
  "outputs": [
    print (line.left_print, line.query, line.right_print)
    {
 
    "data": {
dability Silvia Bottiroli Multiplying the Visible The word [ i ] undecidable [ i
      "text/plain": [
lvia Bottiroli Multiplying the Visible The word [ i ] undecidable [ i ] appears i
      "'https://git.xpub.nl/XPUB/S13-Words-for-the-Future-notebooks/raw/branch/master/txt/words-for-the-future/UNDECIDABILITY.txt'"
e [ i ] appears in [ i ] Six Memos for the Next Millennium [ i ] written by Italo
      ]
ry lectures at Harvard University . In the last months of his life Calvino worked
    },
rishly on these lectures , but died in the process . In the five memos he left be
    "execution_count": 2,
ectures , but died in the process . In the five memos he left behind , he did not
    "metadata": {},
i ] Visibility [ i ] , revolves around the capacity of literature to generate ima
    "output_type": "execute_result"
flow continuously . Calvino focuses on the imagination as “ the repertory of what
    }
alvino focuses on the imagination as “ the repertory of what is potential ; what
  ],
exist but might have existed. ” [ 2 ] The main concern that he brings forth lies
  "source": [
ncern that he brings forth lies within the relation between contemporary culture
    "url"
contemporary culture and imagination : the risk to definitely lose , in the overp
  ]
ion : the risk to definitely lose , in the overproduction of images , the power o
  },
se , in the overproduction of images , the power of bringing visions into focus w
  {
g [ i ] in terms of images. ” [ 3 ] In the last pages of the lecture , he propose
  "cell_type": "code",
f images. ” [ 3 ] In the last pages of the lecture , he proposes a shift from und
  "execution_count": 3,
he proposes a shift from understanding the fantastic world of the artist , not as
  "metadata": {},
m understanding the fantastic world of the artist , not as indefinable , but as [
  "outputs": [],
th this word , Calvino means to define the coexistence and the relation , within
  "source": [
no means to define the coexistence and the relation , within any literary work ,  
    "from urllib.request import urlopen"
, between three different dimensions . The first dimension is the artist ’ s imag
  ]
nt dimensions . The first dimension is the artist ’ s imagination – a world of po
  },
at no work will succeed in realizing . The second is the reality as we experience
  {
l succeed in realizing . The second is the reality as we experience it by living
  "cell_type": "code",
we experience it by living . Finally , the third is the world of the actual work
  "execution_count": 4,
it by living . Finally , the third is the world of the actual work , made by the
  "metadata": {},
. Finally , the third is the world of the actual work , made by the layers of si
  "outputs": [
the world of the actual work , made by the layers of signs that accumulate in it
    {
ns that accumulate in it ; compared to the first two worlds , it is “ also infini
    "data": {
ctory to formulation. ” [ 4 ] He calls the link between these three worlds “ the
      "text/plain": [
the link between these three worlds “ the undecidable , the paradox of an infini
      "<http.client.HTTPResponse at 0x7f2f424be6a0>"
these three worlds “ the undecidable , the paradox of an infinite whole that cont
      ]
ino , artistic operations involve , by the means of the infinity of linguistic po
    },
c operations involve , by the means of the infinity of linguistic possibilities ,
    "execution_count": 4,
infinity of linguistic possibilities , the infinity of the artist ’ s imagination
    "metadata": {},
uistic possibilities , the infinity of the artist ’ s imagination , and the infin
    "output_type": "execute_result"
ty of the artist ’ s imagination , and the infinity of contingencies . Therefore
    }
ity of contingencies . Therefore , “ [ the ] attempts to escape the vortex of mul
  ],
erefore , “ [ the ] attempts to escape the vortex of multiplicity are useless.
  "source": [
as a way for literature to comprehend the complex nature of the world that for t
    "r = urlopen(url)\n",
re to comprehend the complex nature of the world that for the author is a whole o
    "r"
e complex nature of the world that for the author is a whole of wholes , where th
  ]
he author is a whole of wholes , where the acts of watching and knowing also inte
  },
watching and knowing also intervene in the observed reality and alter it . Calvin
  {
are readable as different narratives . The lecture revolves around some novels th
  "cell_type": "code",
ain multiple worlds and make space for the readers ’ imaginations . The common so
  "execution_count": 5,
space for the readers ’ imaginations . The common source to all these experiments
  "metadata": {},
all these experiments seems to rely in the understanding of the contemporary nove
  "outputs": [],
seems to rely in the understanding of the contemporary novel “ as an encyclopedi
  "source": [
, as a network of connections between the events , the people , and the things o
    "rawtext = r.read()"
rk of connections between the events , the people , and the things of the world.
  ]
between the events , the people , and the things of the world. ” [ 7 ] Therefore
  },
vents , the people , and the things of the world. ” [ 7 ] Therefore , let ’ s thi
  {
ic production and define a context for the undecidable , or rather for undecidabi
  "cell_type": "code",
le , or rather for undecidability , as the quality of being undecidable . Calvino
  "execution_count": 6,
tion modes and doesn ’ t fade out from the scene of the ‘ real ’ world . We might
  "metadata": {},
d doesn ’ t fade out from the scene of the ‘ real ’ world . We might stretch this
  "outputs": [],
s potentiality is that of multiplying the visible as an actual counterstrategy t
  "source": [
isible as an actual counterstrategy to the proliferation of images that surrounds
    "text = rawtext.decode()"
ly articulates , redefines , or alters the complex system of links , bounds , and
  ]
specific to some artworks within which the three worlds that Calvino describes me
  },
tains and under certain terms performs the possibility of its actualisation , a w
  {
into one actual form . In particular , the potentiality generated by undecidable
  "cell_type": "code",
c of ‘ and… and… and… ’ as opposite to the logic of ‘ either… or… ’ that seems to
  "execution_count": 7,
ature and just exist as such . None of the images of an artwork are being more or
  "metadata": {},
twork are being more or less real than the others , no matter whether they come a
  "outputs": [
vidual or collective fantasies . It is the art ( work ) as such that creates a gr
    {
s such that creates a ground where all the images that come into visibility share
    "data": {
images that come into visibility share the same gradient of reality , no matter w
      "text/plain": [
itors or spectators to enter into – if the invitation of art is often that of los
      "str"
itation of art is often that of losing the contact with known worlds in order to
      ]
Here , spectators are invited to enter the work ’ s fictional world carrying with
    },
ctional world carrying with themselves the so-called real world and all their oth
    "execution_count": 7,
ll these worlds are equally welcomed . The artwork may then be navigated either b
    "metadata": {},
 
    "output_type": "execute_result"
==Making my own pattern==
    }
<source lang=python>
  ],
 
  "source": [
for w in strengers:
    "type(text)"
    if w.endswith("ity"):
  ]
        print (w) # but then this will show overlapping, looping..
  },
Undecidability
  {
University
  "cell_type": "code",
visibility
  "execution_count": 8,
Visibility
  "metadata": {},
capacity
  "outputs": [],
reality
  "source": [
infinity
    "text = urlopen(url).read().decode()"
infinity
  ]
infinity
  },
multiplicity
  {
multiplicity
  "cell_type": "code",
reality
  "execution_count": 9,
visibility
  "metadata": {},
multiplicity
  "outputs": [
undecidability
    {
quality
    "data": {
potentiality
      "text/plain": [
visibility
      "15990"
undecidability
      ]
undecidability
    },
quality
    "execution_count": 9,
possibility
    "metadata": {},
potentiality
    "output_type": "execute_result"
potentiality
    }
reality
  ],
reality
  "source": [
visibility
    "len(text)"
reality
  ]
undecidability
  },
reality
  {
contemporaneity
  "cell_type": "code",
possibility
  "execution_count": 10,
possibility
  "metadata": {},
possibility
  "outputs": [
undecidability
    {
community
    "data": {
possibility
      "text/plain": [
multiplicity
      "'\\r'"
Multiplicity
      ]
multiplicity
    },
multiplicity
    "execution_count": 10,
community
    "metadata": {},
collectivity
    "output_type": "execute_result"
multiplicity
    }
reality
  ],
responsibility
  "source": [
undecidability
    "text[-1]"
potentiality
  ]
undecidability
  },
collectivity
  {
visibility
  "cell_type": "code",
Undecidability
  "execution_count": 11,
possibility
  "metadata": {},
potentiality
  "outputs": [
quality
    {
undecidability
    "data": {
multiplicity
      "text/plain": [
intensity
      "'U'"
multiplicity
      ]
Visibility
    },
University
    "execution_count": 11,
Multiplicity
    "metadata": {},
University
    "output_type": "execute_result"
 
    }
# and now collected in a list, and squashing case, and using a "set" to remove dupliates.
  ],
 
  "source": [
ity = []
    "text[0]"
for w in strengers :
  ]
    if w.endswith("ity"):
  },
        #print(w)
  {
        ity.append(w.lower())
  "cell_type": "code",
        #strengers.concordance()
  "execution_count": 33,
ity = set(ity)       
  "metadata": {},
 
  "outputs": [],
 
  "source": [
with open("nami_undecidibility_Michael_NLTK_141020.text", "w") as output:
    "words = text.split()"
 
  ]
     s = 0
  },
 
  {
    for word in ity:
  "cell_type": "code",
        #strengers.concordance(word, width = 84)
  "execution_count": 13,
        for line in strengers.concordance_list(word, width=82, lines=74):
  "metadata": {},
            t = line.left_print + " " * (2 + int(s)) + line.query + " " * (2 + int(s)) + line.right_print
  "outputs": [
            #print(s)
    {
            print (t[:82], file = output)#0-82 limited
    "data": {
            s = s + 0.3
      "text/plain": [
    
      "2548"
 
      ]
===Outcome===
    },
 
    "execution_count": 13,
ive works in particular , as the  contemporaneity  of production , consumption , a
    "metadata": {},
] attempts to escape the vortex of  multiplicity  are useless. ” [ 6 ] In his fift
    "output_type": "execute_result"
, he subsequently focuses on [ i ]  multiplicity  [ i ] as a way for literature to
    }
ore , let ’ s think visibility and  multiplicity  together , as : a multiplication
  ],
the contrary , it is generating a  multiplicity  of different gazes that are al
  "source": [
d and thus incomplete and open . A  Multiplicity  of Gazes An undecidable artwor
    "len(words)"
cs today , is that they generate a  multiplicity  of gazes and of forms of spect
  ]
positions and points of view . The   multiplicity   of gazes produced and gather
  },
es a radical collectivity based on    multiplicity    and on conflicting positions
  {
lity and from its encounter with a   multiplicity    of gazes . Preserving it is
  "cell_type": "code",
ncounter between undecidable art ,    multiplicity   of gazes , and a curatorial
  "execution_count": 14,
ibid , p. 98 . 7 . Italo Calvino ,    Multiplicity    , [ i ] Six Memos for the
  "metadata": {},
. Rather , it generates a radical     collectivity    based on multiplicity and
  "outputs": [
of undecidability , art produces a    collectivity    , a future time , and an e
    {
t further and propose that art ’ s      potentiality     is that of multiplying t
    "data": {
potential when it can maintain its      potentiality      and never actualize itse
      "text/plain": [
actual form . In particular , the      potentiality      generated by undecidable
      "'Undecidability'"
to keep being a sheer , glimmering      potentiality      . Indeed , as a practi
      ]
ct the inner nature and the intact      potentiality      of a quality that does
    },
e picture , an artistic fantasy , a      community      theatre work , an emanci
    "execution_count": 14,
orks does not compose itself into a      community      , as there is no ‘ commo
    "metadata": {},
rkness that withholds many forms of        visibility        within . Calvino ’ s
    "output_type": "execute_result"
lvino ’ s fourth memo , [ 1 ] [ i ]        Visibility       [ i ] , revolves arou
    }
. ” [ 7 ] Therefore , let ’ s think        visibility        and multiplicity toge
  ],
f producing different conditions of        visibility        . Embracing what we
  "source": [
where all the images that come into        visibility        share the same grad
    "words[0]"
order to produce different forms of        visibility        within it . Undecid
  ]
, title . 2 . Italo Calvino , [ i ]         Visibility          , in Six Memos fo
  },
r rather for undecidability , as the          quality          of being undecidabl
  {
In this sense , undecidability is a          quality          specific to some ar
  "cell_type": "code",
ure and the intact potentiality of a          quality          that does not mak
  "execution_count": 15,
ations involve , by the means of the          infinity          of linguistic po
  "metadata": {},
ty of linguistic possibilities , the          infinity          of the artist ’
  "outputs": [
the artist ’ s imagination , and the          infinity          of contingencies
    {
d under certain terms performs the            possibility            of its actual
    "data": {
cal of performance intensifies the            possibility            of undecidabl
      "text/plain": [
ating this feminine figure and the            possibility            that it sugge
      "'Multiplying'"
and the concert revolve around the            possibility            of emancipa
      ]
produced , [ 10 ] multiplying the             possibility            to access t
    },
nd consequences already opens this            possibility            and even be
    "execution_count": 15,
the author is then challenged and              responsibility              is shar
    "metadata": {},
eed in realizing . The second is the              reality              as we exper
    "output_type": "execute_result"
owing also intervene in the observed              reality              and alter i
    }
f ‘ either… or… ’ that seems to rule              reality              . Artworks
  ],
atter whether they come as pieces of              reality              or as pro
  "source": [
isibility share the same gradient of              reality              , no matt
    "words[3]"
either by only choosing one layer of              reality              , or by c
  ]
ating as a prism that multiplies the                reality                it refl
  },
nd by setting the conditions for an                intensity                that c
  {
                Undecidability                Silvia Bottiroli Multiplying the
  "cell_type": "code",
r the undecidable , or rather for                undecidability                ,
  "execution_count": 16,
al and Potential Worlds In fact ,                undecidability                i
  "metadata": {},
d actual worlds . In this sense ,                undecidability                i
  "outputs": [
within an art that practices its                undecidability                .
     {
uld trace back to the practice of                  undecidability               
    "data": {
The kind of collective body that                  undecidability               
      "text/plain": [
ality . Indeed , as a practice of                  undecidability               
      "'158-172.'"
t forms of visibility within it .                  Undecidability               
      ]
ng from an art that practices its                  undecidability               
    },
t Norton poetry lectures at Harvard                  University                 
    "execution_count": 16,
the Next Millennium [ i ] , Harvard                    University               
    "metadata": {},
searcher Laura Gemini at the Urbino                    University               
    "output_type": "execute_result"
sibility [ i ] , revolves around the                    capacity
    }
  ],
  "source": [
    "words[-1]"
   ]
  },
  {
  "cell_type": "code",
  "execution_count": 17,
  "metadata": {},
  "outputs": [],
  "source": [
    "from nltk import word_tokenize, Text"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": 18,
  "metadata": {},
   "outputs": [],
   "source": [
    "tokens = word_tokenize(text)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
  "metadata": {},
  "outputs": [
     {
    "data": {
      "text/plain": [
      "3047"
      ]
    },
    "execution_count": 19,
    "metadata": {},
     "output_type": "execute_result"
    }
  ],
  "source": [
    "len(tokens)"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": 20,
  "metadata": {},
  "outputs": [
    {
    "data": {
      "text/plain": [
       "'.'"
      ]
    },
    "execution_count": 20,
    "metadata": {},
    "output_type": "execute_result"
    }
  ],
  "source": [
    "tokens[-1]"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": 21,
  "metadata": {},
  "outputs": [
    {
    "data": {
      "text/plain": [
      "['Undecidability',\n",
      " 'Silvia',\n",
      " 'Bottiroli',\n",
      " 'Multiplying',\n",
      " 'the',\n",
      " 'Visible',\n",
      " 'The',\n",
      " 'word',\n",
      " '[',\n",
      " 'i']"
      ]
    },
    "execution_count": 21,
    "metadata": {},
    "output_type": "execute_result"
    }
  ],
  "source": [
    "tokens[:10]"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": 22,
  "metadata": {},
  "outputs": [
    {
    "data": {
      "text/plain": [
      "['Memos', 'for', 'the', 'Next', 'Millennium', '[', 'i', ']', 'written']"
      ]
    },
    "execution_count": 22,
    "metadata": {},
    "output_type": "execute_result"
    }
  ],
  "source": [
    "tokens[21:30] # not including 30th word"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": 23,
  "metadata": {},
  "outputs": [],
  "source": [
    "strengers = Text(tokens)"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": 38,
  "metadata": {},
  "outputs": [
    {
    "data": {
      "text/plain": [
      "<Text: Silvia Bottiroli Multiplying the Visible The word [ i>"
      ]
    },
    "execution_count": 38,
    "metadata": {},
    "output_type": "execute_result"
    }
  ],
  "source": [
    "strengers"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": 40,
  "metadata": {},
  "outputs": [
    {
    "name": "stdout",
    "output_type": "stream",
    "text": [
      "Displaying 11 of 11 matches:\n",
      " ] attempts to escape the vortex of multiplicity are useless. ” [ 6 ] In his fifth m\n",
      " , he subsequently focuses on [ i ] multiplicity [ i ] as a way for literature to co\n",
      "fore , let ’ s think visibility and multiplicity together , as : a multiplication of\n",
      "n the contrary , it is generating a multiplicity of different gazes that are all leg\n",
      "ed and thus incomplete and open . A Multiplicity of Gazes An undecidable artwork is \n",
      "ics today , is that they generate a multiplicity of gazes and of forms of spectators\n",
      " positions and points of view . The multiplicity of gazes produced and gathered by u\n",
      "tes a radical collectivity based on multiplicity and on conflicting positions that a\n",
      "ility and from its encounter with a multiplicity of gazes . Preserving it is possibl\n",
      "encounter between undecidable art , multiplicity of gazes , and a curatorial dimensi\n",
      " ibid , p. 98 . 7 . Italo Calvino , Multiplicity , [ i ] Six Memos for the Next Mill\n"
    ]
    }
  ],
  "source": [
    "strengers.concordance(\"multiplicity\", width = 84, lines = 72)"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": 26,
  "metadata": {},
  "outputs": [
    {
    "name": "stdout",
    "output_type": "stream",
    "text": [
      "idability Silvia Bottiroli Multiplying the Visible The word [ i ] undecidable [ i\n",
      "lvia Bottiroli Multiplying the Visible The word [ i ] undecidable [ i ] appears i\n",
      "e [ i ] appears in [ i ] Six Memos for the Next Millennium [ i ] written by Italo\n",
      "ry lectures at Harvard University . In the last months of his life Calvino worked\n",
      "rishly on these lectures , but died in the process . In the five memos he left be\n",
      "ectures , but died in the process . In the five memos he left behind , he did not\n",
      "i ] Visibility [ i ] , revolves around the capacity of literature to generate ima\n",
      "flow continuously . Calvino focuses on the imagination as “ the repertory of what\n",
      "alvino focuses on the imagination as “ the repertory of what is potential ; what \n",
      " exist but might have existed. ” [ 2 ] The main concern that he brings forth lies\n",
      "ncern that he brings forth lies within the relation between contemporary culture \n",
      "contemporary culture and imagination : the risk to definitely lose , in the overp\n",
      "ion : the risk to definitely lose , in the overproduction of images , the power o\n",
      "se , in the overproduction of images , the power of bringing visions into focus w\n",
      "g [ i ] in terms of images. ” [ 3 ] In the last pages of the lecture , he propose\n",
      "f images. ” [ 3 ] In the last pages of the lecture , he proposes a shift from und\n",
      "he proposes a shift from understanding the fantastic world of the artist , not as\n",
      "m understanding the fantastic world of the artist , not as indefinable , but as [\n",
      "th this word , Calvino means to define the coexistence and the relation , within \n",
      "no means to define the coexistence and the relation , within any literary work , \n",
      ", between three different dimensions . The first dimension is the artist ’ s imag\n",
      "nt dimensions . The first dimension is the artist ’ s imagination – a world of po\n",
      "at no work will succeed in realizing . The second is the reality as we experience\n",
      "l succeed in realizing . The second is the reality as we experience it by living \n",
      "we experience it by living . Finally , the third is the world of the actual work \n",
      " it by living . Finally , the third is the world of the actual work , made by the\n",
      " . Finally , the third is the world of the actual work , made by the layers of si\n",
      "the world of the actual work , made by the layers of signs that accumulate in it \n",
      "ns that accumulate in it ; compared to the first two worlds , it is “ also infini\n",
      "ctory to formulation. ” [ 4 ] He calls the link between these three worlds “ the \n",
      " the link between these three worlds “ the undecidable , the paradox of an infini\n",
      "these three worlds “ the undecidable , the paradox of an infinite whole that cont\n",
      "ino , artistic operations involve , by the means of the infinity of linguistic po\n",
      "c operations involve , by the means of the infinity of linguistic possibilities ,\n",
      "infinity of linguistic possibilities , the infinity of the artist ’ s imagination\n",
      "uistic possibilities , the infinity of the artist ’ s imagination , and the infin\n",
      "ty of the artist ’ s imagination , and the infinity of contingencies . Therefore \n",
      "ity of contingencies . Therefore , “ [ the ] attempts to escape the vortex of mul\n",
      "erefore , “ [ the ] attempts to escape the vortex of multiplicity are useless. ” \n",
      " as a way for literature to comprehend the complex nature of the world that for t\n",
      "re to comprehend the complex nature of the world that for the author is a whole o\n",
      "e complex nature of the world that for the author is a whole of wholes , where th\n",
      "he author is a whole of wholes , where the acts of watching and knowing also inte\n",
      "watching and knowing also intervene in the observed reality and alter it . Calvin\n",
      "are readable as different narratives . The lecture revolves around some novels th\n",
      "ain multiple worlds and make space for the readers ’ imaginations . The common so\n",
      "space for the readers ’ imaginations . The common source to all these experiments\n",
      "all these experiments seems to rely in the understanding of the contemporary nove\n",
      " seems to rely in the understanding of the contemporary novel “ as an encyclopedi\n",
      " , as a network of connections between the events , the people , and the things o\n",
      "rk of connections between the events , the people , and the things of the world. \n",
      " between the events , the people , and the things of the world. ” [ 7 ] Therefore\n",
      "vents , the people , and the things of the world. ” [ 7 ] Therefore , let ’ s thi\n",
      "ic production and define a context for the undecidable , or rather for undecidabi\n",
      "le , or rather for undecidability , as the quality of being undecidable . Calvino\n",
      "tion modes and doesn ’ t fade out from the scene of the ‘ real ’ world . We might\n",
      "d doesn ’ t fade out from the scene of the ‘ real ’ world . We might stretch this\n",
      " s potentiality is that of multiplying the visible as an actual counterstrategy t\n",
      "isible as an actual counterstrategy to the proliferation of images that surrounds\n",
      "ly articulates , redefines , or alters the complex system of links , bounds , and\n",
      "specific to some artworks within which the three worlds that Calvino describes me\n",
      "tains and under certain terms performs the possibility of its actualisation , a w\n",
      "into one actual form . In particular , the potentiality generated by undecidable \n",
      "c of ‘ and… and… and… ’ as opposite to the logic of ‘ either… or… ’ that seems to\n",
      "ature and just exist as such . None of the images of an artwork are being more or\n",
      "twork are being more or less real than the others , no matter whether they come a\n",
      "vidual or collective fantasies . It is the art ( work ) as such that creates a gr\n",
      "s such that creates a ground where all the images that come into visibility share\n",
      "images that come into visibility share the same gradient of reality , no matter w\n",
      "itors or spectators to enter into – if the invitation of art is often that of los\n",
      "itation of art is often that of losing the contact with known worlds in order to \n",
      "Here , spectators are invited to enter the work ’ s fictional world carrying with\n",
      "ctional world carrying with themselves the so-called real world and all their oth\n",
      "ll these worlds are equally welcomed . The artwork may then be navigated either b\n"
    ]
    }
  ],
  "source": [
    "for line in strengers.concordance_list(\"the\", width=82, lines=74):\n",
    "    print (line.left_print, line.query, line.right_print)"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": 27,
  "metadata": {},
  "outputs": [
    {
    "name": "stdout",
    "output_type": "stream",
    "text": [
      "Undecidability\n",
      "University\n",
      "visibility\n",
      "Visibility\n",
      "capacity\n",
      "reality\n",
      "infinity\n",
      "infinity\n",
      "infinity\n",
      "multiplicity\n",
      "multiplicity\n",
      "reality\n",
      "visibility\n",
      "multiplicity\n",
      "undecidability\n",
      "quality\n",
      "potentiality\n",
      "visibility\n",
      "undecidability\n",
      "undecidability\n",
      "quality\n",
      "possibility\n",
      "potentiality\n",
      "potentiality\n",
      "reality\n",
      "reality\n",
      "visibility\n",
      "reality\n",
      "undecidability\n",
      "reality\n",
      "contemporaneity\n",
      "possibility\n",
      "possibility\n",
      "possibility\n",
      "undecidability\n",
      "community\n",
      "possibility\n",
      "multiplicity\n",
      "Multiplicity\n",
      "multiplicity\n",
      "multiplicity\n",
      "community\n",
      "collectivity\n",
      "multiplicity\n",
      "reality\n",
      "responsibility\n",
      "undecidability\n",
      "potentiality\n",
      "undecidability\n",
      "collectivity\n",
      "visibility\n",
      "Undecidability\n",
      "possibility\n",
      "potentiality\n",
      "quality\n",
      "undecidability\n",
      "multiplicity\n",
      "intensity\n",
      "multiplicity\n",
      "Visibility\n",
      "University\n",
      "Multiplicity\n",
      "University\n"
    ]
    }
  ],
  "source": [
    "for w in strengers:\n",
    "    if w.endswith(\"ity\"):\n",
    "        print (w) # but then this will show overlapping, looping.."
  ]
  },
  {
  "cell_type": "code",
  "execution_count": 41,
  "metadata": {},
  "outputs": [],
  "source": [
    "# and now collected in a list, and squashing case, and using a \"set\" to remove dupliates.\n",
    "\n",
    "ity = []\n",
    "for w in strengers :\n",
    "    if w.endswith(\"ity\"):\n",
    "        #print(w)\n",
    "        ity.append(w.lower())\n",
    "        #strengers.concordance()\n",
    "ity = set(ity)        \n",
    "\n"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": 43,
  "metadata": {},
  "outputs": [],
  "source": [
    "with open(\"nami_undecidibility_Michael_NLTK_141020.text\", \"w\") as output:\n",
    "\n",
    "    s = 0\n",
    "\n",
    "    for word in ity:\n",
    "        #strengers.concordance(word, width = 84)\n",
    "        for line in strengers.concordance_list(word, width=82, lines=74):\n",
    "            t = line.left_print + \" \" * (2 + int(s)) + line.query + \" \" * (2 + int(s)) + line.right_print \n",
    "            #print(s)\n",
    "            print (t[:82], file = output)#0-82 limited\n",
    "            s = s + 0.3\n",
    "  \n",
    "        \n",
    "        \n",
    "        "
  ]
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": []
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": [
    "for w in strengers:\n",
    "    if w.endswith(\"le\"):\n",
    "        print (w) # but then this will show overlapping, looping.."
  ]
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": [
    "# and now collected in a list, and squashing case, and using a set to remove dupliates\n",
    "\n",
    "le = []\n",
    "for w in strengers :\n",
    "    if w.endswith(\"le\"):\n",
    "        #print(w)\n",
    "        le.append(w.lower())\n",
    "        #strengers.concordance()\n",
    "le = set(le)        \n",
    "\n"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": [
    "for word in le:\n",
    "        strengers.concordance(word, width = 84)"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": []
  },
  {
  "cell_type": "code",
  "execution_count": 45,
  "metadata": {},
  "outputs": [
    {
    "name": "stdout",
    "output_type": "stream",
    "text": [
      "Displaying 11 of 11 matches:\n",
      "cape the vortex of multiplicity are useless. ” [ 6\n",
      "y focuses on [ i ] multiplicity [ i ] as a way for\n",
      "ink visibility and multiplicity together , as : a \n",
      "it is generating a multiplicity of different gazes\n",
      "plete and open . A Multiplicity of Gazes An undeci\n",
      "at they generate a multiplicity of gazes and of fo\n",
      "ints of view . The multiplicity of gazes produced \n",
      "lectivity based on multiplicity and on conflicting\n",
      "s encounter with a multiplicity of gazes . Preserv\n",
      " undecidable art , multiplicity of gazes , and a c\n",
      " . Italo Calvino , Multiplicity , [ i ] Six Memos \n"
    ]
    }
  ],
  "source": [
    "strengers.concordance(\"multiplicity\", width = 50)"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": 44,
  "metadata": {},
  "outputs": [
    {
    "name": "stdout",
    "output_type": "stream",
    "text": [
      "kind world logic space practice undecidable visibility capacity images\n",
      "and repertory overproduction power thinking understanding means\n",
      "coexistence layers paradox whole\n"
    ]
    }
  ],
  "source": [
    "strengers.similar(\"multiplicity\")"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": [
    "strengers.common_contexts([\"undecidability\", \"multiplicity\"])"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": [
    "strengers.dispersion_plot([\"the\", \"multiplicity\", \"performance\"])"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": [
    "from IPython.core.pylabtools import figsize"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": [
    "fizsize(20.0, 20.0) #make the graph more longe"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": [
    "from nltk.probability import FreqDist"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": [
    "freq = FreqDist(tokens) # frequency distribution"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": [
    "freq.keys()"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": [
    "freq[\"the\"]"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": [
    "freq.plot()"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": [
    "freq.plot(50, cumulative = True)"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": [
    "freq.plot(30)"
  ]
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": []
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": []
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": []
  },
  {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {},
  "outputs": [],
  "source": []
  }
],
"metadata": {
  "kernelspec": {
  "display_name": "Python 3",
  "language": "python",
  "name": "python3"
  },
  "language_info": {
  "codemirror_mode": {
    "name": "ipython",
    "version": 3
  },
  "file_extension": ".py",
  "mimetype": "text/x-python",
  "name": "python",
  "nbconvert_exporter": "python",
  "pygments_lexer": "ipython3",
  "version": "3.7.3"
  }
},
"nbformat": 4,
"nbformat_minor": 4
}

Revision as of 20:22, 21 October 2020

Natural Language Tool Kit_141020_Michael

Basic

<source lang=python> url = "https://git.xpub.nl/XPUB/S13-Words-for-the-Future-notebooks/raw/branch/master/txt/words-for-the-future/UNDECIDABILITY.txt"

from nltk import word_tokenize, Text tokens = word_tokenize(text) len(tokens) tokens[-1] tokens[:10] # not including the 10th word tokens[21:30] # not including the 30th word

strengers = Text(tokens) strengers.concordance("multiplicity", width = 84, lines = 72)

Displaying 11 of 11 matches:

] attempts to escape the vortex of multiplicity are useless. ” [ 6 ] In his fifth m
, he subsequently focuses on [ i ] multiplicity [ i ] as a way for literature to co

fore , let ’ s think visibility and multiplicity together , as : a multiplication of n the contrary , it is generating a multiplicity of different gazes that are all leg ed and thus incomplete and open . A Multiplicity of Gazes An undecidable artwork is ics today , is that they generate a multiplicity of gazes and of forms of spectators

positions and points of view . The multiplicity of gazes produced and gathered by u

tes a radical collectivity based on multiplicity and on conflicting positions that a ility and from its encounter with a multiplicity of gazes . Preserving it is possibl encounter between undecidable art , multiplicity of gazes , and a curatorial dimensi

ibid , p. 98 . 7 . Italo Calvino , Multiplicity , [ i ] Six Memos for the Next Mill


for line in strengers.concordance_list("the", width=82, lines=74):

   print (line.left_print, line.query, line.right_print)

dability Silvia Bottiroli Multiplying the Visible The word [ i ] undecidable [ i lvia Bottiroli Multiplying the Visible The word [ i ] undecidable [ i ] appears i e [ i ] appears in [ i ] Six Memos for the Next Millennium [ i ] written by Italo ry lectures at Harvard University . In the last months of his life Calvino worked rishly on these lectures , but died in the process . In the five memos he left be ectures , but died in the process . In the five memos he left behind , he did not i ] Visibility [ i ] , revolves around the capacity of literature to generate ima flow continuously . Calvino focuses on the imagination as “ the repertory of what alvino focuses on the imagination as “ the repertory of what is potential ; what

exist but might have existed. ” [ 2 ] The main concern that he brings forth lies

ncern that he brings forth lies within the relation between contemporary culture contemporary culture and imagination : the risk to definitely lose , in the overp ion : the risk to definitely lose , in the overproduction of images , the power o se , in the overproduction of images , the power of bringing visions into focus w g [ i ] in terms of images. ” [ 3 ] In the last pages of the lecture , he propose f images. ” [ 3 ] In the last pages of the lecture , he proposes a shift from und he proposes a shift from understanding the fantastic world of the artist , not as m understanding the fantastic world of the artist , not as indefinable , but as [ th this word , Calvino means to define the coexistence and the relation , within no means to define the coexistence and the relation , within any literary work , , between three different dimensions . The first dimension is the artist ’ s imag nt dimensions . The first dimension is the artist ’ s imagination – a world of po at no work will succeed in realizing . The second is the reality as we experience l succeed in realizing . The second is the reality as we experience it by living we experience it by living . Finally , the third is the world of the actual work

it by living . Finally , the third is the world of the actual work , made by the
. Finally , the third is the world of the actual work , made by the layers of si

the world of the actual work , made by the layers of signs that accumulate in it ns that accumulate in it ; compared to the first two worlds , it is “ also infini ctory to formulation. ” [ 4 ] He calls the link between these three worlds “ the

the link between these three worlds “ the undecidable , the paradox of an infini

these three worlds “ the undecidable , the paradox of an infinite whole that cont ino , artistic operations involve , by the means of the infinity of linguistic po c operations involve , by the means of the infinity of linguistic possibilities , infinity of linguistic possibilities , the infinity of the artist ’ s imagination uistic possibilities , the infinity of the artist ’ s imagination , and the infin ty of the artist ’ s imagination , and the infinity of contingencies . Therefore ity of contingencies . Therefore , “ [ the ] attempts to escape the vortex of mul erefore , “ [ the ] attempts to escape the vortex of multiplicity are useless. ”

as a way for literature to comprehend the complex nature of the world that for t

re to comprehend the complex nature of the world that for the author is a whole o e complex nature of the world that for the author is a whole of wholes , where th he author is a whole of wholes , where the acts of watching and knowing also inte watching and knowing also intervene in the observed reality and alter it . Calvin are readable as different narratives . The lecture revolves around some novels th ain multiple worlds and make space for the readers ’ imaginations . The common so space for the readers ’ imaginations . The common source to all these experiments all these experiments seems to rely in the understanding of the contemporary nove

seems to rely in the understanding of the contemporary novel “ as an encyclopedi
, as a network of connections between the events , the people , and the things o

rk of connections between the events , the people , and the things of the world.

between the events , the people , and the things of the world. ” [ 7 ] Therefore

vents , the people , and the things of the world. ” [ 7 ] Therefore , let ’ s thi ic production and define a context for the undecidable , or rather for undecidabi le , or rather for undecidability , as the quality of being undecidable . Calvino tion modes and doesn ’ t fade out from the scene of the ‘ real ’ world . We might d doesn ’ t fade out from the scene of the ‘ real ’ world . We might stretch this

s potentiality is that of multiplying the visible as an actual counterstrategy t

isible as an actual counterstrategy to the proliferation of images that surrounds ly articulates , redefines , or alters the complex system of links , bounds , and specific to some artworks within which the three worlds that Calvino describes me tains and under certain terms performs the possibility of its actualisation , a w into one actual form . In particular , the potentiality generated by undecidable c of ‘ and… and… and… ’ as opposite to the logic of ‘ either… or… ’ that seems to ature and just exist as such . None of the images of an artwork are being more or twork are being more or less real than the others , no matter whether they come a vidual or collective fantasies . It is the art ( work ) as such that creates a gr s such that creates a ground where all the images that come into visibility share images that come into visibility share the same gradient of reality , no matter w itors or spectators to enter into – if the invitation of art is often that of los itation of art is often that of losing the contact with known worlds in order to Here , spectators are invited to enter the work ’ s fictional world carrying with ctional world carrying with themselves the so-called real world and all their oth ll these worlds are equally welcomed . The artwork may then be navigated either b

Making my own pattern

<source lang=python>

for w in strengers:

   if w.endswith("ity"):
       print (w) # but then this will show overlapping, looping.. 

Undecidability University visibility Visibility capacity reality infinity infinity infinity multiplicity multiplicity reality visibility multiplicity undecidability quality potentiality visibility undecidability undecidability quality possibility potentiality potentiality reality reality visibility reality undecidability reality contemporaneity possibility possibility possibility undecidability community possibility multiplicity Multiplicity multiplicity multiplicity community collectivity multiplicity reality responsibility undecidability potentiality undecidability collectivity visibility Undecidability possibility potentiality quality undecidability multiplicity intensity multiplicity Visibility University Multiplicity University

  1. and now collected in a list, and squashing case, and using a "set" to remove dupliates.

ity = [] for w in strengers :

   if w.endswith("ity"):
       #print(w)
       ity.append(w.lower())
       #strengers.concordance()

ity = set(ity)


with open("nami_undecidibility_Michael_NLTK_141020.text", "w") as output:

   s = 0
   for word in ity:
       #strengers.concordance(word, width = 84)
       for line in strengers.concordance_list(word, width=82, lines=74):
           t = line.left_print + " " * (2 + int(s)) + line.query + " " * (2 + int(s)) + line.right_print 
           #print(s)
           print (t[:82], file = output)#0-82 limited
           s = s + 0.3
  

Outcome

ive works in particular , as the contemporaneity of production , consumption , a ] attempts to escape the vortex of multiplicity are useless. ” [ 6 ] In his fift , he subsequently focuses on [ i ] multiplicity [ i ] as a way for literature to ore , let ’ s think visibility and multiplicity together , as : a multiplication

the contrary , it is generating a   multiplicity   of different gazes that are al

d and thus incomplete and open . A Multiplicity of Gazes An undecidable artwor cs today , is that they generate a multiplicity of gazes and of forms of spect positions and points of view . The multiplicity of gazes produced and gather es a radical collectivity based on multiplicity and on conflicting positions lity and from its encounter with a multiplicity of gazes . Preserving it is ncounter between undecidable art , multiplicity of gazes , and a curatorial ibid , p. 98 . 7 . Italo Calvino , Multiplicity , [ i ] Six Memos for the

. Rather , it generates a radical     collectivity     based on multiplicity and 

of undecidability , art produces a collectivity , a future time , and an e t further and propose that art ’ s potentiality is that of multiplying t potential when it can maintain its potentiality and never actualize itse

actual form . In particular , the      potentiality      generated by undecidable

to keep being a sheer , glimmering potentiality . Indeed , as a practi ct the inner nature and the intact potentiality of a quality that does e picture , an artistic fantasy , a community theatre work , an emanci orks does not compose itself into a community , as there is no ‘ commo rkness that withholds many forms of visibility within . Calvino ’ s lvino ’ s fourth memo , [ 1 ] [ i ] Visibility [ i ] , revolves arou . ” [ 7 ] Therefore , let ’ s think visibility and multiplicity toge f producing different conditions of visibility . Embracing what we where all the images that come into visibility share the same grad order to produce different forms of visibility within it . Undecid , title . 2 . Italo Calvino , [ i ] Visibility , in Six Memos fo r rather for undecidability , as the quality of being undecidabl

In this sense , undecidability is a          quality          specific to some ar

ure and the intact potentiality of a quality that does not mak ations involve , by the means of the infinity of linguistic po ty of linguistic possibilities , the infinity of the artist ’ the artist ’ s imagination , and the infinity of contingencies d under certain terms performs the possibility of its actual cal of performance intensifies the possibility of undecidabl ating this feminine figure and the possibility that it sugge and the concert revolve around the possibility of emancipa

produced , [ 10 ] multiplying the             possibility             to access t

nd consequences already opens this possibility and even be the author is then challenged and responsibility is shar eed in realizing . The second is the reality as we exper owing also intervene in the observed reality and alter i f ‘ either… or… ’ that seems to rule reality . Artworks atter whether they come as pieces of reality or as pro isibility share the same gradient of reality , no matt either by only choosing one layer of reality , or by c ating as a prism that multiplies the reality it refl nd by setting the conditions for an intensity that c

               Undecidability                Silvia Bottiroli Multiplying the 

r the undecidable , or rather for undecidability , al and Potential Worlds In fact , undecidability i d actual worlds . In this sense , undecidability i

within an art that practices its                 undecidability                 .

uld trace back to the practice of undecidability

The kind of collective body that                  undecidability                 

ality . Indeed , as a practice of undecidability t forms of visibility within it . Undecidability ng from an art that practices its undecidability t Norton poetry lectures at Harvard University the Next Millennium [ i ] , Harvard University searcher Laura Gemini at the Urbino University sibility [ i ] , revolves around the capacity