Answers.Body: <p>If you wanted to generate more I guess you could take the string and convert to a list then you could randomly select as many words as you want, from the list.</p>
  
  <p>Using Python</p>
  
  <pre><code>import numpy as np
  
  lorem = "lLorem ipsum dolor sit amet, consectetur adipiscing elit. ".split()
  
  number_of_words_needed = 20
  
  new_text = []
  
  for i in range(number_of_words_needed):
      new_text.append(lorem[np.random.randint(len(lorem))])
  
  print(new_text)
  </code></pre>
  
  <blockquote>
    <p>ipsum ['sit', 'dolor', 'elit.', 'sit', 'sit', 'sit', 'elit.', 'dolor', 'amet,', 'ipsum', 'amet,', 'ipsum', 'dolor', 'Lorem', 'Lorem', 'adipiscing', 'sit', 'elit.', 'consectetur', 'adipiscing']</p>
  </blockquote>
  
  <p>for reference</p>
  
  <p><a href="https://www.lipsum.com/" rel="nofollow noreferrer">Source</a>: "Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections <a href="http://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext%3A2007.01.0036%3Abook%3D1%3Asection%3D32" rel="nofollow noreferrer">1.10.32</a> and <a href="http://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext%3A2007.01.0036%3Abook%3D1%3Asection%3D33" rel="nofollow noreferrer">1.10.33</a> of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.</p>
  
  <p>The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham."</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-29T21:21:04.563Z
Answers.Text: Full Latin text of *[de Finibus Bonorum et Malorum](http://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext%3A2007.01.0036%3Abook%3Dpraef)*  Original reads "[dolorem](http://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext%3A1999.04.0060%3Aentry%3Ddolor) ipsum, quia dolor sit, amet"
Answers.UserDisplayName: DukeZhou
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-29T08:42:58.440Z
Answers.LastActivityDate: 2018-08-29T21:26:04.417Z
Answers.LastEditDate: 2018-08-29T21:26:04.417Z
Answers.UserDisplayName: Axle Max
Answers.Body: <p>Lorem ipsum generators don't typically use anything considered as AI. Usually they just store large pieces of text and select sections from it randomly - they are very simple. The main goal is to produce "nonsense" text that fills space but does not distract from issues of layout and design. The variations of it are usually just for fun, and like the original, are mostly simple generators which select strings of text from a core data source randomly and without using any AI techniques.</p>
  
  <p>It <em>is</em> possible to build more sophisticated random text generators that work using data structures from <a href="https://en.wikipedia.org/wiki/Natural_language_processing" rel="nofollow noreferrer">Natural Language Processing</a> (NLP). </p>
  
  <p>One popular and easy-to-code data structure is <a href="https://en.wikipedia.org/wiki/N-gram" rel="nofollow noreferrer">N-grams</a>, which store the frequencies/probabilities of the N<sup>th</sup> word given words 1 to N-1. E.g. a bigram structure can tell you all the possible words to come after "fish" e.g. <code>"fish" =&gt; ["food" =&gt; 0.2, "swims" =&gt; 0.3, "and" =&gt; 0.4, "scale" =&gt; 0.1]</code> To use that structure to generate text, use a random number generator to select a word based on looking up the N<sup>th</sup> word's frequency, then shift the list of words being considered and repeat. </p>
  
  <p>A more recent text generating NLP model is recurrent neural networks (RNNs), which have a variety of designs. Popular right now are LSTM networks, and these are capable of some quite sophisticated generation, provided they are trained with enough data for long enough. The blog <a href="http://karpathy.github.io/2015/05/21/rnn-effectiveness/" rel="nofollow noreferrer">The Unreasonable Effectiveness of Recurrent Neural Networks</a> by Andrej Karpathy has quite a few really interesting examples of using RNNs for text generation. In practice this works similarly to n-grams: Use the RNN to suggest probabilities for next word given words so far, choose one randomly, then feed back the generated word into the RNN and repeat.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-29T08:56:55.713Z
Answers.LastActivityDate: 2018-08-29T16:06:24.727Z
Answers.LastEditDate: 2018-08-29T16:06:24.727Z
Answers.UserDisplayName: Neil Slater
Body: <p>I've seen many <a href="https://en.wikipedia.org/wiki/Lorem_ipsum" rel="nofollow noreferrer">Lorem Ipsum</a> generators on the web, but not only, there is also "bacon ispum", "space ispum", etc. So, how do these generators generate the text? Are they powered by an AI?</p>
  
Tags: <natural-language-processing><text-summarization>
Title: How does the "Lorem Ipsum" generator work?
UserDisplayName: Luke
ThreadText: # How does the "Lorem Ipsum" generator work?
  
  (Asked by: username_0 on 2018-08-28)
  
  I've seen many [Lorem Ipsum](https://en.wikipedia.org/wiki/Lorem_ipsum) generators on the web, but not only, there is also "bacon ispum", "space ispum", etc. So, how do these generators generate the text? Are they powered by an AI?
  
  **Tags:** natural-language-processing, text-summarization
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2018-08-29. Score: 5 | Accepted answer
  
  Lorem ipsum generators don't typically use anything considered as AI. Usually they just store large pieces of text and select sections from it randomly - they are very simple. The main goal is to produce "nonsense" text that fills space but does not distract from issues of layout and design. The variations of it are usually just for fun, and like the original, are mostly simple generators which select strings of text from a core data source randomly and without using any AI techniques.
  
  It *is* possible to build more sophisticated random text generators that work using data structures from [Natural Language Processing](https://en.wikipedia.org/wiki/Natural_language_processing) (NLP).
  
  One popular and easy-to-code data structure is [N-grams](https://en.wikipedia.org/wiki/N-gram), which store the frequencies/probabilities of the Nth word given words 1 to N-1. E.g. a bigram structure can tell you all the possible words to come after "fish" e.g. `"fish" => ["food" => 0.2, "swims" => 0.3, "and" => 0.4, "scale" => 0.1]` To use that structure to generate text, use a random number generator to select a word based on looking up the Nth word's frequency, then shift the list of words being considered and repeat.
  
  A more recent text generating NLP model is recurrent neural networks (RNNs), which have a variety of designs. Popular right now are LSTM networks, and these are capable of some quite sophisticated generation, provided they are trained with enough data for long enough. The blog [The Unreasonable Effectiveness of Recurrent Neural Networks](http://karpathy.github.io/2015/05/21/rnn-effectiveness/) by Andrej Karpathy has quite a few really interesting examples of using RNNs for text generation. In practice this works similarly to n-grams: Use the RNN to suggest probabilities for next word given words so far, choose one randomly, then feed back the generated word into the RNN and repeat.
  
  
  ---
  
  ### Answer by username_1 on 2018-08-29. Score: 3
  
  If you wanted to generate more I guess you could take the string and convert to a list then you could randomly select as many words as you want, from the list.
  
  Using Python
  
  ```
  import numpy as np
  
  lorem = "lLorem ipsum dolor sit amet, consectetur adipiscing elit. ".split()
  
  number_of_words_needed = 20
  
  new_text = []
  
  for i in range(number_of_words_needed):
      new_text.append(lorem[np.random.randint(len(lorem))])
  
  print(new_text)
  
  ```
  
  > ipsum ['sit', 'dolor', 'elit.', 'sit', 'sit', 'sit', 'elit.', 'dolor', 'amet,', 'ipsum', 'amet,', 'ipsum', 'dolor', 'Lorem', 'Lorem', 'adipiscing', 'sit', 'elit.', 'consectetur', 'adipiscing']
  
  for reference
  
  [Source](https://www.lipsum.com/): "Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections [1.10.32](http://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext%3A2007.01.0036%3Abook%3D1%3Asection%3D32) and [1.10.33](http://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext%3A2007.01.0036%3Abook%3D1%3Asection%3D33) of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
  
  The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham."
  
  > **Comments:**
  > **username_2**: Full Latin text of *[de Finibus Bonorum et Malorum](http://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext%3A2007.01.0036%3Abook%3Dpraef)*  Original reads "[dolorem](http://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext%3A1999.04.0060%3Aentry%3Ddolor) ipsum, quia dolor sit, amet"  
  
  ---
  
  