{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "### Digital Cut Up- RWET Assignment 3\n", "The digital cut-up. Create a notebook program that reads in two or more texts and stores portions of them in Python data structures. The program should create textual output that creatively rearranges the contents of the text. Use functions from the random module as appropriate. You must use lists and dictionaries as part of your procedure. Choose one text that you created with your program to present in class." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": true }, "outputs": [], "source": [ "text1=[line.strip() for line in open(\"HW3_texts/cybernetic_bacteria.txt\")]" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/plain": [ "['Cybernetic Bacteria is an ongoing trans- disciplinary investigation which brings together art, philosophy, microbiology and digital technology to examine the relationship of the emerging science of bacterial communication to our own digital communications networks, look- ing in particular at “packet data” and bacterial quorum sensing. The project was developed within the context of Dumitriu’s ongoing research into micro- biology and more specifically her re- search involving normal flora bacteriology through art practice.',\n", " 'The project is framed within Dumitriu’s role as artist in residence in The Centre for Computational Neuroscience and Robotics (CCNR) at The University of Sussex, which places her at the heart of one of the largest artificial life (AL) research groups in the world. The prima- ry concern of the group is trying to understand what actually constitutes life and attempting to model it, or even recreate it through artificial processes (which are generally computational but could include wet processes too). For many researchers there, life can be considered an abstract concept, not directly linked to biological processes. Through her residency, which started in 2006, she is able to research complex systems through simulation and modeling. In particular she is concerned with evolutionary and adaptive computational systems to which bacteria (as the simplest living organisms) are strongly relevant [1].',\n", " '',\n", " 'Dumitriu’s collaborators in Cybernetic Bacteria are Simon Park, a microbiologist based at The University of Surrey, Blay Whitby, a philosopher specializing in artificial intelligence and ethics, Tom Keene, a freelance interactive media artist, and Lorenzo Grespan, a freelance programmer specialising in artificial life and computational neuroscience.',\n", " 'Bacteria and Communication',\n", " 'The initial ideas for working with chemical communication stemmed from a discussion between Dumitriu and Park about bacterial communication and new insights recently discovered by Bonnie Bassler at Princeton University. Bassler studies a phenomenon called quorum sensing in bacteria, which she describes as:',\n", " 'Bassler’s work has shown that bacteria are continually sending messages to each other, in the form of bursts of hormones (such as Homoserine lactones) and other signaling chemicals. They are also able to communicate to any eukaryotic animal or plant cell (and in some cases affect their structure also). As Lynn Margulis and Doran Sagan stated, “Life did not take over the globe by combat, but by networking\" [3].',\n", " '“a process that allows bacteria to communicate using secreted chemical signaling molecules called autoinducers. This process enables a population of bacteria to collectively regulate gene expression and, therefore, behavior” [2].',\n", " 'Intricate bacterial communication techniques, such as quorum sensing, chemotactic signaling (detecting harmful or favourable substances in the environment), and plasmid exchange (e.g. for transfer of antibiotic resistance genes) are now being investigated as a form of social intelligence as it is realized that these so called ‘simplest’ of life forms can work collectively, obtain information about their environment and use that information in meaningful ways.',\n", " 'This means that bacteria are able to pass signals between them in relatively complex ways. The simplest form of this is by signaling their presence within the colony, a message which effectively states: “I’m here”, through a burst of hormone.',\n", " 'To enable this level of complexity, bacteria communicate using a wide range of different biochemical agents and use intricate intercellular signaling mechanisms. Research continues into how precisely these messages are being sent and received, but the potential of that research is surely clear. If we can decode the bacteria’s communication signals, then we can communicate with them and perhaps ask them to behave in different ways. Bacterial communication offers the potential of a powerful new direction in infection control, which as the power of antibiotics continues to dwindle in efficacy seems increasingly attractive.',\n", " 'Cybernetics',\n", " 'The messages bacteria pass can have a global impact, as they are able to send signals to one another, theoretically ad infinitum, and learn through their inter- actions. This phenomenon is well de- scribed by the field of cybernetics, which is the interdisciplinary study of the structure of complex systems, especially communication processes, control mechanisms and feedback principles, often using computational methods.',\n", " 'Complex Networks',\n", " 'The way in which bacterial life threads across our planet, through the soil, the water and the ice, constantly passing messages and flagging its effective message of “I’m here” to other bacteria, forms a complex and diverse network of microbial life, particularly in terms of ability to communicate. This is very much echoed within human digital communications networks such as the Internet. Data traffic travels through the Internet by being routed through active nodes, which flag their activity by streaming “packet data” signals, which also effectively say: “I am here” and “I am active”.',\n", " '',\n", " 'Since 1959 all complex networks have been treated as randomized networks, based on the work of Paul Erdos and Alfred Renyi, who were studying net- works seen in life sciences. They believed that such complex networks could be modeled by connecting nodes with',\n", " 'randomly set links, which produced a highly democratic system with nodes in the network having more or less the same number of links. So when in 1998 a project to map the world wide web was undertaken, the researchers, who included Albert-László Barabási, anticipated that a randomized network would be found. But this was not to be the case, the results actually showed that, although most nodes had just a few links, there were in fact a small number of highly connected nodes, which they called “hubs” and in this sense the network can be described as having no scale, as being a “scale-free network”. Scale-free net- works have also been observed in the bacteria such as Escherichia coli at a cellular level in their metabolic networks [4].',\n", " 'Cybernetic Bacteria 2.0',\n", " 'Cybernetic Bacteria 2.0 is a multiple screen projection, that makes explicit the correlations between bacterial and human communications networks dis- cussed earlier. The work combines, in real time, the raw network traffic taking place live around the gallery (including web traffic, mobile technology and Blue- tooth) and data from a time-lapse film of bacterial communication occurring (involving two strains of genetically modified [GM] bacteria, which will indicate, by changing colour or glowing, the communication taking place). From those two sources a new cellular automata artificial life form based on Conway’s ‘Game of Life’ was generated [5].',\n", " 'To create this work a purple bacterium called Chromobacterium violaceum was used. This bacterium emits and detects a chemical signal. When a population hits a critical density, the concentration of the chemical signal reaches a threshold, which the bacterium is able to detect responding by turning on production of the purple pigment. The white coloured, genetically modified form Chromobacterium violaceum CV026 was also used to detect chemical signals and responded by producing a purple pigment also, but it cannot produce the chemical signal itself. The other bacterium used was Serratia marcescens; it is also able to send out signals but cannot communicate to the CV026. Colonies of this bacterium are a striking red colour due to the production of the pigment prodigiosin.',\n", " 'Human “airborne” communication was detected using a specially built de- vice, which consisted of a network of micro-controllers, each searching for other electronic devices in the immediate',\n", " \"environment. Each time a new device was discovered (from touch and remote RFID tags, Bluetooth devices and wire- less activity) its unique ID was recorded and sent to a computer generating artificial life in a variation of Conway's Game of Life. The data is used as a trigger to turn on a small burst of coloured pixels at a random location on the screen.\",\n", " 'The presence of new pixels affects the global behaviour of the game, as in the original Game of Life, and echoes the behaviour of the bacteria, each pixel stays on or is turned on if and only if two or three neighbouring pixels are also on. Furthermore, white pixels become purple if they have a purple neighbour. Red pixels do not affect other pixels’ colour but only their on/off state.',\n", " 'Conclusion',\n", " 'The artworks described here attempt to investigate the relationship between digital and bacterial communications net- works. The research takes a threefold approach by combining artistic, philosophical and scientific methodologies through a transdisciplinary approach (focussing on microbiology and artificial life disciplines in science). They look at parallels with scale-free networks in both digital and bacterial communications networks and to do so they use performativity and participation in order to engage the audience with a visceral sense of the vast, complex, unseen communications networks that surround them.']" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "text1" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": true }, "outputs": [], "source": [ "text2=[line.strip() for line in open(\"HW3_texts/thesis_feedback.txt\")]" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": true }, "outputs": [], "source": [ "text3=[line.strip() for line in open(\"HW3_texts/thesis_proposal.txt\")]" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/plain": [ "['',\n", " 'His opening statement is a bit hard to understand but the description is good. I wonder though if this is \"post-human\". Will bots have any reason to exist without humans?',\n", " '',\n", " \"like the concept and motivation behind this project very much but i'm having a hard time understanding how this will work technically - are the bots and protozoa running off random algorithms? or is sebastian ultimately controlling them and their behavior - it seems human input is still important here, right?\",\n", " '',\n", " \"there is a wonderful cell biologist at NYU's institute for systems genetics named Timothee Lionnet who does a lot of work with microsocopy: http://www.timotheelionnet.net/\",\n", " '',\n", " \"I find the premise interesting, though I'm curious how the implementation of the bots and protozoa. Are the bots classified to release different type of bacteria? Do the protozoa exist from the beginning on this webslide, their actions dictated by the bots?\",\n", " '',\n", " \"I like the concept of the human interaction with the protozoa and look forward to seeing how you execute this on a website. However, I don't understand how the bots will affect the protozoa. Are we talking about internet bots here? how will they alter a living organism?\",\n", " '',\n", " 'Nice concept! The description could include more of the WHY (for future reference :) )',\n", " '',\n", " 'Not sure that it is post-human...since humans are a part of it... even if just as observers. \"The World Without Us\" is a book about what happens to the earth once humans are gone (climate change, war, whatever!) What would your world be like without humans-- are humans at all necessary to it, the flora or fauna?']" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "text2" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/plain": [ "['My project takes an atiprocentric approach where humans are not in the center of it all. In fact it seeks to explore/invent/speculate/imagine the relationship between inorganic and organic primitive live forms with humans having limited agency.',\n", " '',\n", " '',\n", " 'The audience is divided in 3 groups: Internet bots, unicellular organisms, and humans with internet and interests in exploring primitive posthuman ecosystems.',\n", " '',\n", " '**Humans** can visit a website to observe a live feed from a microscope camera. The video is of microscopic protozoa. Humans can remotely move the slide to look at different areas of the slide. Humans can slightly change the focus of the microscope though the website. Humans can also share the website in social media or write about it. Humans have no further agency.',\n", " '',\n", " '**Bots, crawlers and spambots.** Bots for short, bots can visit the website, in fact the website is a honeypot designed to attract them.',\n", " 'As they go though forms, and hyperlinks, speeding through the website, their presence is recorded. The bots moving though the website release bacteria in the protozoa tank, feeding and giving life to protozoa.',\n", " '',\n", " '**Protozoa** are single-cell organisms, this is important because “unicellular organisms are thought to be the oldest form of life” [reference]. Protozoa can feed, grow, reproduce and die. In other words, they can exist.',\n", " '',\n", " '### Describe your research process. What are the sources you plan to look at, who do you plan to speak to about your project. How will you approach your research?',\n", " '',\n", " 'The past couple of months I have been analyzing diverse sources on posthuman thought. As well as talking to professors and colleagues about it.',\n", " '',\n", " 'My future research involves interviewing microbiology experts (I plan to start with Elizabeth Hénaff). Depending on the findings I would also need to talk to a microscopy expert.',\n", " '',\n", " 'I also need to research into creating a site that attracts large numbers of software visits. After talking to Shawn Van Every I am now going to talk to Yen. I might start prototyping with sites known for their bots abundance (tumblr, twitter, wordpress)',\n", " '',\n", " 'Currently I am reading a couple of books: \"Beyond webcams, an introduction to online robotics\". Also reading \"The Robot in the Garden\", both by Ken Goldberg. One is more from a philosophical perspective while the other is more technical. I am considering writing to Dr. Goldberg.',\n", " '',\n", " '',\n", " \"The concept emerges from the idea of hacking as art. How can we take a stablished system, find a small section of it and repurpose it under a different context? The idea doesn't pretend to be grand and it doesn't try to change the system. It doesn't try to fix it, it doesn't try to break it. In fact, it hopes to pass unnoticed by the system as a whole. Yet, to whomever is paying close attention, it is a prove that there is room for much more than intended, different realities, no matter how fantastical.\",\n", " '',\n", " 'It would be inappropriate to talk about this project without making reference to Ken Goldberg 1995 project Telegarden. Here, users around the world could visit a website and find a live stream of a garden, they could control a robotic arm to water the plants, take care of the garden and plant more seeds. The project was a reflection of the times, the breaking of physical boundaries, joining people though technology to take care of something beautiful.',\n", " '',\n", " '22 years later, the internet has change dramatically, humans are not the creature navigating though the internet. The network is dominated, some might say infested by robots; some scrolling the web for content, some spamming everything they can find, some others pretending to be large groups of individuals swaying the public discourse.',\n", " '',\n", " 'This project bridges many thoughts together, lastly in this list, is the posthuman influence. I want to imagine a ecosystem where humans are not in the center, perhaps because there is no center. Where inorganic life can directly interact with organic life. At the most primitive level.']" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "text3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Remove all the empty lines" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": true }, "outputs": [], "source": [ "text1=[line for line in text1 if line!='']\n", "text2=[line for line in text2 if line!='']\n", "text3=[line for line in text3 if line!='']" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['His opening statement is a bit hard to understand but the description is good. I wonder though if this is \"post-human\". Will bots have any reason to exist without humans?',\n", " \"like the concept and motivation behind this project very much but i'm having a hard time understanding how this will work technically - are the bots and protozoa running off random algorithms? or is sebastian ultimately controlling them and their behavior - it seems human input is still important here, right?\",\n", " \"there is a wonderful cell biologist at NYU's institute for systems genetics named Timothee Lionnet who does a lot of work with microsocopy: http://www.timotheelionnet.net/\",\n", " \"I find the premise interesting, though I'm curious how the implementation of the bots and protozoa. Are the bots classified to release different type of bacteria? Do the protozoa exist from the beginning on this webslide, their actions dictated by the bots?\",\n", " \"I like the concept of the human interaction with the protozoa and look forward to seeing how you execute this on a website. However, I don't understand how the bots will affect the protozoa. Are we talking about internet bots here? how will they alter a living organism?\",\n", " 'Nice concept! The description could include more of the WHY (for future reference :) )',\n", " 'Not sure that it is post-human...since humans are a part of it... even if just as observers. \"The World Without Us\" is a book about what happens to the earth once humans are gone (climate change, war, whatever!) What would your world be like without humans-- are humans at all necessary to it, the flora or fauna?']" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "text2" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'His opening statement is a bit hard to understand but the description is good. I wonder though if this is \"post-human\". Will bots have any reason to exist without humans?'" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "text2[0]" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['His',\n", " 'opening',\n", " 'statement',\n", " 'is',\n", " 'a',\n", " 'bit',\n", " 'hard',\n", " 'to',\n", " 'understand',\n", " 'but',\n", " 'the',\n", " 'description',\n", " 'is',\n", " 'good.',\n", " 'I',\n", " 'wonder',\n", " 'though',\n", " 'if',\n", " 'this',\n", " 'is',\n", " '\"post-human\".',\n", " 'Will',\n", " 'bots',\n", " 'have',\n", " 'any',\n", " 'reason',\n", " 'to',\n", " 'exist',\n", " 'without',\n", " 'humans?']" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "text2[0].split()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Counting the number of words in a sentence:**" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "30" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(text2[0].split())" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "7\n" ] } ], "source": [ "import random\n", "from random import randint\n", "print(randint(0, 9))" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "collapsed": true }, "outputs": [], "source": [ "ran=randint(0,len(text2[0].split()))" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ran" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[18, 38, 71, 13]" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "[randint(0,len(line.split())) for line in text1 if randint(0,9)>7]" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "---\n", "Lets try a function" ] }, { "cell_type": "code", "execution_count": 99, "metadata": { "collapsed": true }, "outputs": [], "source": [ "list_text1=[]" ] }, { "cell_type": "code", "execution_count": 85, "metadata": { "collapsed": true }, "outputs": [], "source": [ "list_text2=[]" ] }, { "cell_type": "code", "execution_count": 126, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def modifier(line):\n", " words=line.split()\n", " numb=randint(0,len(words)-4)\n", " selected_words=[words[numb],words[numb+1],words[numb+2],words[numb+3]]\n", " return(\" \".join(selected_words))" ] }, { "cell_type": "code", "execution_count": 127, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[None, None, None, None, None, None, None, None]" ] }, "execution_count": 127, "metadata": {}, "output_type": "execute_result" } ], "source": [ "list_text2=[]\n", "[list_text2.append(modifier(line)) for line in text1 if (randint(0,9)>5 and (len(line.split())>4))]" ] }, { "cell_type": "code", "execution_count": 128, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['programmer specialising in artificial',\n", " 'recently discovered by Bonnie',\n", " 'form of bursts of',\n", " 'potential of a powerful',\n", " 'to map the world',\n", " 'it cannot produce the',\n", " 'white pixels become purple',\n", " 'research takes a threefold']" ] }, "execution_count": 128, "metadata": {}, "output_type": "execute_result" } ], "source": [ "list_text2" ] }, { "cell_type": "code", "execution_count": 129, "metadata": {}, "outputs": [], "source": [ "list_text3=[]\n", "for x in range(0, len(list_text2)):\n", " list_text3.append(modifier(random.choice (text2))) \n" ] }, { "cell_type": "code", "execution_count": 130, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['like the concept of',\n", " 'description could include more',\n", " '\"post-human\". Will bots have',\n", " 'this will work technically',\n", " 'description could include more',\n", " 'release different type of',\n", " '(for future reference :)',\n", " 'description is good. I']" ] }, "execution_count": 130, "metadata": {}, "output_type": "execute_result" } ], "source": [ "list_text3" ] }, { "cell_type": "code", "execution_count": 131, "metadata": {}, "outputs": [], "source": [ "def concat(t1,t2):\n", " for line in range(0,len(t1)):\n", " print(t1[line]+\" \" +t2[line])" ] }, { "cell_type": "code", "execution_count": 133, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "programmer specialising in artificial like the concept of\n", "recently discovered by Bonnie description could include more\n", "form of bursts of \"post-human\". Will bots have\n", "potential of a powerful this will work technically\n", "to map the world description could include more\n", "it cannot produce the release different type of\n", "white pixels become purple (for future reference :)\n", "research takes a threefold description is good. I\n" ] } ], "source": [ "concat(list_text2,list_text3)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "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.6.3" } }, "nbformat": 4, "nbformat_minor": 2 }