<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Chaoticity &#187; Artificial Intelligence</title>
	<atom:link href="http://chaoticity.com/category/artificial-intelligence/feed/" rel="self" type="application/rss+xml" />
	<link>http://chaoticity.com</link>
	<description>a state of things in which chance is supreme</description>
	<lastBuildDate>Tue, 06 Jul 2010 20:13:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>observing infinities</title>
		<link>http://chaoticity.com/observing-infinities/</link>
		<comments>http://chaoticity.com/observing-infinities/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 21:39:55 +0000</pubDate>
		<dc:creator>awais</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[chaos]]></category>
		<category><![CDATA[infinities]]></category>
		<category><![CDATA[observing]]></category>

		<guid isPermaLink="false">http://chaoticity.com/observing-infinities/</guid>
		<description><![CDATA[&#160;]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p><a href="http://chaoticity.com/images/infinities.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="infinities" border="0" alt="infinities" src="http://chaoticity.com/images/infinities_thumb.jpg" width="563" height="788" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://chaoticity.com/observing-infinities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making a copy of WEKA Instances</title>
		<link>http://chaoticity.com/making-a-copy-of-weka-instances/</link>
		<comments>http://chaoticity.com/making-a-copy-of-weka-instances/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 21:54:09 +0000</pubDate>
		<dc:creator>awais</dc:creator>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[OpenWare]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[chaos]]></category>
		<category><![CDATA[attribute]]></category>
		<category><![CDATA[classification]]></category>
		<category><![CDATA[dataset]]></category>
		<category><![CDATA[instances]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[weka]]></category>

		<guid isPermaLink="false">http://chaoticity.com/making-a-copy-of-weka-instances/</guid>
		<description><![CDATA[This ‘thing’ took about 30 minutes to figure out. According to the WEKA documentation, if  you add a new Instance to an existing Instances object, String values are not transferred ! In case you are working on copying a dataset with a string attribute, you need to transfer the string manually. The code segment below [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chaoticity.com/images/image11.png"><img style="display: inline; margin-left: 0px; margin-right: 0px; border-width: 0px;" title="image" src="http://chaoticity.com/images/image_thumb11.png" border="0" alt="image" width="128" height="149" align="right" /></a>This ‘thing’ took about 30 minutes to figure out. According to the <a href="http://weka.sourceforge.net/doc/weka/core/Instances.html#add(weka.core.Instance)">WEKA documentation</a>, if  you add a new Instance to an existing Instances object, <strong>String values are not transferred</strong> <strong>! </strong>In case you are working on copying a dataset with a string attribute, you need to transfer the string manually. The code segment below copies the i^th instance from source to dest where the first attribute (at index 0) is a string attribute.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dest.add(source.instance(i));<br />
dest.instance(dest.numInstances()-1)<br />
&nbsp; &nbsp; .setValue(0,source.instance(i).toString(0));</div></td></tr></tbody></table></div>
<p>This should come in handy for text classification using WEKA (and hopefully save your time).</p>
]]></content:encoded>
			<wfw:commentRss>http://chaoticity.com/making-a-copy-of-weka-instances/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google as a Question Answering System</title>
		<link>http://chaoticity.com/google-as-a-question-answering-system/</link>
		<comments>http://chaoticity.com/google-as-a-question-answering-system/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 04:34:58 +0000</pubDate>
		<dc:creator>awais</dc:creator>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Language]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[chaos]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[MRR]]></category>
		<category><![CDATA[Question Answer]]></category>
		<category><![CDATA[Summary]]></category>

		<guid isPermaLink="false">http://chaoticity.com/google-as-a-question-answering-system/</guid>
		<description><![CDATA[A Question Answering (QA) system is an Information Retrieval system which gives the answer to a question posed in natural language. For example, if you ask it Who wrote Hamlet?, it should answer Shakespeare. A few years ago (don’t ask me how many), search engines did not focus on language queries. Recently [sic], Google has [...]]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://en.wikipedia.org/wiki/Question_answering">Question Answering</a> (QA) system is an Information Retrieval system which gives the answer to a question posed in natural language. For example, if you ask it <i>Who wrote Hamlet?</i>, it should answer <i>Shakespeare</i>. A few years ago (don’t ask me how many), search engines did not focus on language queries. Recently [sic], Google has started incorporating some NLP (Natural Language Processing) in their results. You can try it out by typing the same question in the search box yourself ( <a href="http://www.google.co.uk/search?q=Who+wrote+Hamlet">or clicking here</a> ). </p>
<p><a href="http://chaoticity.com/images/image9.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; margin-left: 0px; border-left: 0px; margin-right: 0px; border-bottom: 0px" height="199" alt="image" src="http://chaoticity.com/images/image_thumb9.png" width="330" align="right" border="0" /></a> </p>
<p>During my <a href="http://www.cl.cam.ac.uk/admissions/cstit/">M.Phil. course</a>, one of the tasks was to build a basic QA system and extend it however we liked. We used the <a href="http://trec.nist.gov/data/qa/t8_qadata.html">TREC 8 dataset</a> for evaluations. While building the system, I evaluated how current search engines (read Google) performed on this task. For this, I just queried the exact question and used the summaries of the top five results as answers. Evaluating at that time (2008), I got a <a href="http://en.wikipedia.org/wiki/Mean_reciprocal_rank">Mean Reciprocal Rank</a> (MRR) score of <b>0.212</b> over 198 questions. 156 questions had no answers found in top 5 responses.</p>
<p>This term, I am demonstrating for the same task. Demonstrators are usually PhD students who provide help and guidance to junior students. For pure geek fun and lack of better things to do while taking a break, I decided to quickly jolt down a JavaScript (read&#160; <a href="http://chaoticity.com/wp-admin/jquery.com">JQuery</a> ) based QA system. This time,&#160; the resulting MRR score over 198 questions was <b>0.384 </b>while only 79 questions had no answers found in top 5 responses.</p>
<p>The results show clearly that during the last two years, Google has significantly improved on answering NLP queries. In fact (IIRC), my baseline system back in 2008 (based on <a href="http://www.cl.cam.ac.uk/~aac10/papers/rmrsdraft.pdf" target="_blank">RMRS</a> based matching of sentences from the top 100 documents returned by an IR system) could only achieve an MRR score of approximately <b>0.290, </b>showing that the current results are much better than that baseline. I hope this decade sees some more developments/improvements in QA systems and I can ask a system <em>What do you get if you multiply</em> <em>six by nine?</em></p>
<blockquote><p>I&#8217;ve always said there was something fundamentally wrong with the universe. <strong>~Arthur Dent</strong></p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://chaoticity.com/google-as-a-question-answering-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get formants of phones from sound files</title>
		<link>http://chaoticity.com/how-to-get-formants-of-phones-from-sound-files/</link>
		<comments>http://chaoticity.com/how-to-get-formants-of-phones-from-sound-files/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 16:01:08 +0000</pubDate>
		<dc:creator>awais</dc:creator>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Speech]]></category>
		<category><![CDATA[Formant]]></category>
		<category><![CDATA[Praat]]></category>
		<category><![CDATA[PraatCon]]></category>
		<category><![CDATA[Script]]></category>

		<guid isPermaLink="false">http://chaoticity.com/how-to-get-formants-of-phones-from-sound-files/</guid>
		<description><![CDATA[This tutorial is mostly for people (esp. my AI students) who want to find formants of any sounds sample. So here are the things/software you will need. a good mic (recommended but not necessary) a quite room any software which can cut and save wav files. I use Praat. the console version of Praat, called [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial is mostly for people (esp. my AI students) who want to find <a href="http://en.wikipedia.org/wiki/Formant" target="_blank">formants</a> of any sounds sample. So here are the things/software you will need.</p>
<ol>
<li>a good mic (recommended but not necessary) </li>
<li>a quite room </li>
<li>any software which can cut and save wav files. I use <a href="http://www.fon.hum.uva.nl/praat/praat5111_winsit.exe" target="_blank">Praat</a>. </li>
<li>the console version of Praat, called <a href="http://www.fon.hum.uva.nl/praat/praatcon5111_winsit.exe" target="_blank">PraatCon</a>. This will be used to extract the formants from wav files. </li>
<li>about 30 mins. </li>
</ol>
<p>Once you have all these things, here is what you do for recording the phone sounds</p>
<ol>
<li>Start Praat. You will see two windows. You can close the other window but keep the one titled <strong>Praat Objects</strong> open. </li>
<li>In the menu, select <strong>New/Record mono sound</strong>. Select sampling frequency to 16000 Hz, press <strong>Record</strong> and start speaking in the mic. When you are through, press <strong>Stop</strong>. Speak all the phones you want in a single go but with silence in between. In the screenshot below, AA (as in f<u>a</u>ther) is spoken multiple times. </li>
<li>Press <strong>Save to list</strong> and then <strong>Close. </strong>You should now an entry in the Objects listbox. Make sure the entry is select and then press <strong>Edit</strong>. </li>
<li>Select the phone for which you want to extract the formants by pressing the mouse button on the start of the phone and dragging it to the point <em>right before</em> it finishes. Please note that we will be using the mean formant value for a phone so it is essential that only the middle part of the phone is selected to ensure accuracy and no other noise or silence is present. The selected area will be highlighted. </li>
<li>From the <strong>File </strong>menu, select <strong>Write selected sound to WAV file</strong>, enter the name of the wav file and save. </li>
<li>Repeat step 4 and 5 for all the phones you want to save. </li>
</ol>
<p><a href="http://chaoticity.com/images/image2.png"><img title="Saving WAV in Praat" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="Saving WAV in Praat" src="http://chaoticity.com/images/image_thumb2.png" width="586" border="0" /></a> </p>
<p>That’s it for the recording part. Alternately, if you already have a collection of sound files with a single phone, you can use that. You can download one such collection here. The zip file has 40 files where 2 speakers have spoken AA (as in f<u>a</u>ther) and II (as in b<u>ee</u>n) 10 times each. </p>
<p align="center"><a href="/software/formanter.zip">Click here to download script and sound files.</a></p>
<p>Although you can use the GUI based Praat to find out the formant values for each phone, we want to automate the task. To do so, we will use the console version of Praat called PraatCon, and run a script to extract the formants. The small Praat script written below takes the name of a phone file as argument and outputs the first two formats F1 and F2 to the console.</p>
<pre>form Display mean F1 and F2
   sentence filename
endform
filename_noext$ = replace$ (filename$, &quot;.wav&quot;, &quot;&quot;, 0)

Read from file... 'filename$'
select Sound 'filename_noext$'
To Formant (burg)... 0 5 5500 0.025 50
f1 = Get mean... 1 0 0 Hertz
f2 = Get mean... 2 0 0 Hertz
clearinfo
print 'filename$' 'f1''tab$''f2''newline$'</pre>
<p>&#160;</p>
<p>This script along with a small batch file (run.bat) which runs this script for all wav files present in the current directory, can be downloaded with all the sound files by clicking on the link below. To get this running, extract all files in a directory and place your downloaded copy of PraatCon in the same directory. The just click on the run.bat icon and watch the magic!</p>
<p align="center"><a href="/software/formanter.zip">Click here to download script and sound files.</a></p>
<p><a href="http://chaoticity.com/images/image3.png"><img title="Output of the formanter script" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="327" alt="Output of the formanter script" src="http://chaoticity.com/images/image_thumb3.png" width="644" border="0" /></a> </p>
<p>The sound files in the archive give this nice little graph when their F1 and F2 values are plotted as an XY scatter graph shown below. All this was done to construct a linearly separable dataset which can be given to students for training a perceptron to distinguish between two phones. Any suggestion/comments are welcome. </p>
<p><a href="http://chaoticity.com/images/image4.png"><img title="F1 and F2 scatter plot of AA and II " style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="295" alt="F1 and F2 scatter plot of AA and II " src="http://chaoticity.com/images/image_thumb4.png" width="487" border="0" /></a> </p>
</p>
<p align="center"><a href="/software/formanter.zip">Click here to download script and sound files.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://chaoticity.com/how-to-get-formants-of-phones-from-sound-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>River Crossing and State Space Search</title>
		<link>http://chaoticity.com/river-crossing-and-state-space-search/</link>
		<comments>http://chaoticity.com/river-crossing-and-state-space-search/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 17:49:58 +0000</pubDate>
		<dc:creator>awais</dc:creator>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Puzzle]]></category>
		<category><![CDATA[River Crossing]]></category>
		<category><![CDATA[Simulation]]></category>

		<guid isPermaLink="false">http://chaoticity.com/river-crossing-and-state-space-search/</guid>
		<description><![CDATA[I made a small 10 min demo to simulate the classic river crossing puzzle for teaching state space search in my AI class. I did exercise my right to be creative by changing the characters a bit. Jerry, Tom and Spike have to cross a river, going from the right side to left, in a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chaoticity.com/images/image1.png"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="image" src="http://chaoticity.com/images/image_thumb1.png" border="0" alt="image" width="500" height="186" /></a></p>
<p>I made a small 10 min demo to simulate the classic <a href="http://en.wikipedia.org/wiki/River_crossing_puzzle" target="_blank">river crossing puzzle</a> for teaching state space search in my AI class. I did exercise my right to be creative by changing the characters a bit. Jerry, Tom and Spike have to cross a river, going from the right side to left, in a boat. While you are in the boat, they behave. But as soon as you leave Tom with Jerry or Tom with Spike on one side WITHOUT the boat, they start fighting. Being a peace loving person, you don&#8217;t want that. The goal is to move them across the river with no fights. (as you may have noticed, there is no eating/killing involved in my version)</p>
<p>Here, we can represent each object by a Boolean variable and draw the states accordingly. The picture above can be represented by 1 0 1 0 where the left most 1 represents that the boat is on the left bank and the zero after that tells that Jerry is on right one. Similarly the next 1 and 0 denote Tom on the left bank and Spike on the right one respectively.Here is a link to the executable in case anyone wants to play it or give it to a kid to figure out. Drop me an email if you want the source code (C#). The executable requires an installation of the Microsoft .NET framework 3.5.</p>
<p><a href="http://chaoticity.com/software/RiverCross.exe" target="_blank">Download River Crossing Puzzle</a></p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&amp;displaylang=en" target="_blank">Microsoft .NET framework 3.5</a></p>
]]></content:encoded>
			<wfw:commentRss>http://chaoticity.com/river-crossing-and-state-space-search/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solving the 8 Queens Problem</title>
		<link>http://chaoticity.com/8queens/</link>
		<comments>http://chaoticity.com/8queens/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 20:30:21 +0000</pubDate>
		<dc:creator>awais</dc:creator>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[OpenWare]]></category>
		<category><![CDATA[8 Queens]]></category>
		<category><![CDATA[BFS]]></category>
		<category><![CDATA[Breadth First Search]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Depth First Search]]></category>
		<category><![CDATA[DFS]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://chaoticity.com/solving-the-8-queens-problem/</guid>
		<description><![CDATA[I will be teaching a course in Artificial Intelligence this summer. For some parts of the course, I plan to show implemented demos along with the course material. Looking from the students’ point of view, such tools not only decrease the learning time while in the class room, but also give enough material to play [...]]]></description>
			<content:encoded><![CDATA[<p>I will be teaching a course in Artificial Intelligence this summer. For some parts of the course, I plan to show implemented demos along with the course material. Looking from the students’ point of view, such tools not only decrease the learning time while in the class room, but also give enough material to play around at home in case you want to repeat what was taught. (I can empathise because I was once, and will be again (hopefully soon), a student).</p>
<p>While preparing the first few lectures, I realized I needed a simulation of the <a href="http://en.wikipedia.org/wiki/Eight_queens_puzzle" target="_blank">8 Queens Problem</a> using <a href="http://en.wikipedia.org/wiki/Breadth-first_search" target="_blank">Breadth First Search</a> and <a href="http://en.wikipedia.org/wiki/Depth-first_search" target="_blank">Depth First Search</a>. While there are many solutions on the Internet, I couldn’t find any program which lets me step through the algorithm. Besides, it had been a long time since&#160; I did any programming in Windows.Forms so my code deprived fingers needed a sink.</p>
<p><a href="http://chaoticity.com/images/8queens1.png"><img title="8queens" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="347" alt="8queens" src="http://chaoticity.com/images/8queens_thumb1.png" width="547" border="0" /></a> </p>
<p>So here’s my version of the 8 queens problem solver. Each board state is represented by a string. The string represent the columns starting from the left most column and the number in that position tells the row in which a queen is present.&#160; The screenshot above thus represents the state 03142. The state 0314 would represent an empty column 4. You can download the compiled binary by clicking on the link below. I will try to upload the source once the assignment deadline has passed. It was developed in C# so you might have to install <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&amp;displaylang=en" target="_blank">Microsoft .NET framework 3.5</a> to run this program. Comments/Suggestions/Bug Reports are welcome.</p>
<p align="center"><a href="http://chaoticity.com/software/8Queens.zip">Download the 8 Queen Problem Solver</a></p>
]]></content:encoded>
			<wfw:commentRss>http://chaoticity.com/8queens/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
