Samples


Let's now look at some samples of the algorithm using a variety of different text inputs.

In the first example, a set of quotes from Albert Einstein was used as the training file. This training set consists of 13 quotes with 377 unique words. See Listing 10.9 for example products from the Einstein corpus .

Listing 10.9: Emitted Text from Albert Einstein Quotes.
start example
 [root@plato bigram]./bigram -f einstein Imagination is shipwrecked by language and other symbolic devices. [root@plato bigram]./bigram -f einstein We all ruled in the authority of imagination. 
end example
 

Each of the generated quotes from Listing 10.9 sound reasonable and is actually thought provoking.

Consider now generated text from a corpus of Albert Camus' Absurd Man (see Listing 10.10).

Listing 10.10: Emitted Text from Albert Camus' Absurd Man.
start example
 [root@plato bigram]./bigram -f absurdman It is to speak only truth that is the breath of future actions. [root@plato bigram]./bigram -f absurdman "My field" said Goethe "is time and unfolds in a disservice to make. 
end example
 

Finally, consider a Markov Chain that was created from two separate works (see Listing 10.11). The first work is the poem "Ode to Joy" by anonymous, and the second from book one of The Odyssey by Homer.

Listing 10.11: Emitted Text from a Collection of Works.
start example
 [root@plato bigram]./bigram -f combo From chaos and beasts and hostile shores!  From the woods the hunter strayed. 
end example
 



Visual Basic Developer
Visual Basic Developers Guide to ASP and IIS: Build Powerful Server-Side Web Applications with Visual Basic. (Visual Basic Developers Guides)
ISBN: 0782125573
EAN: 2147483647
Year: 1999
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net