Sunday, October 31, 2010

SeMap - final year project (9th - 22nd October)


On 9th of October I have created a new private mailing list in our sourceforge project account, nldex-devs, since that would be much easier platform for us to have our project discussions going on.  I added all my group members to the mailing list and made them aware about it and requested them to always use this mailing list for project based discussions.
Around 13th October we got few comments from our internal supervisor Dr. Shehan Perera, on our project proposal. We altered our proposal according to his suggestions.
I found few sample SRSs on 15th October, from our seniors and looked at them and discussed with the group members. We figured out the necessary parts for our project’s requirement specification, and divided parts among each of us. I took up the sections of Operating Environment, User Documentation, Assumptions and Dependencies, and went through few resources to find out what I need to write. I put up the basic draft of my parts on 17th October; in our mailing list so all my group members can review them. We planned to finish the SRS on 26th October.
Throughout this period I continued to read on Drools documentation. I had downloaded Drools examples projects and ran them in Eclipse IDE and play around to get familiar with its behaviour. Also I looked at a rule creation method in Drools, called Domain Specific Language (DSL) and will be continued to look at them in coming days as well.
I tried to setup the RelEx in the Eclipse IDE since as it will make our lives easier when dealing with RelEx code. So I successfully setup the RelEx source code in Eclipse IDE. Following are the steps I followed.
·        File --> New --> Java Project --> Create project from existing source --> specified the path to relex folder
·        Now an eclipse project will be created based on the existing project
·        Go to the project root in the Package Explorer in the IDE
·        Right click on it --> properties
·        Select "Java Build Path" --> Libraries --> add external jars, and add the following jar files and press ok.

·        gate.jar
-gate.jar can be found inside the bin folder
·        jwnl.jar
-jar file can be found inside the extracted folder
·        linkgrammar-4.7.0.jar
          -jar file can be found inside the extracted folder
·        opennlp-tools-1.4.3.jar
          -Go to the path of the folder from a terminal and run "ant" command
          -That will build the opennlp-tools-1.4.3.jar for you inside the "output" folder of the same directory.

·        Go to Project and un-tick "Build Automatically" in the menu strip of the IDE.
·        Then go to the project root in the Package Explorer in the IDE
·        Right click on it --> Build Project
·        This will build the RelEx source without any errors.

Tuesday, October 12, 2010

SeMap - final year project (25th Sept. - 8th Oct.)



I started from what I left earlier week, basically to setting up the environment for us to use RelEx. RelEx has lot of dependencies which are in turn needed some other dependencies. I gave a try to set up RelEx in a windows environment, using MinGW which is a minimalist development environment for native Microsoft Windows applications. RelEx developers preferred us to use linux environment, but they asked me to give a try on windows (since most of us wanted to use windows) which they had no experiences of building RelEx. In an IRC discussion I told them that if I got successful, I will come up with a “how-to-do” document which will help someone who is planned to use OpenCog on windows and they were appreciated that.

Link grammar parser is one of the dependencies of RelEx and I had a nightmare of building it in MinGW environment, since some libraries used by them are not there in the windows platform. So I tried to manually download some of the missing libraries after debugging the build, but was unsuccessful. Then Nisansa started to build link grammar using Visual C++, neither he got it to build without errors (I think he will continue his investigation). Without further wasting our time on just setting up the environment, we thought to move to Linux based OS. I already had some experiences of using Ubuntu, so I just re-booted and logged into Ubuntu. Amazing fact is that within 10 minutes I was able to build RelEx successfully! But I had no regret of trying to install RelEx in windows.

I came up with a set of steps which one should follow in order to get RelEx installed in Ubuntu. Here I list them.

*sudo apt-get install build-essential
*./configure
*make
*sudo make install
*sudo ldconfig
*cd link-grammar
*./link-parser (this will run LGP, you can just verify that it is working)
*sudo cp linkgrammar-4.7.0.jar /usr/share/java
                sudo apt-get install bzr
  • Go to the folder where you need the RelEx trunk to be in and issue following:
                bzr branch lp:relex
                    ;this will check out the relex source code
  • In relex source code there's a build.xml file. Open it up and change the following:
                line 20:
                     pathelement location="${PREFIX}/linkgrammar-4.7.0.jar"
        Save it!
  • Finally go to the folder which contains build.xml (relex) & issue:
*ant -Check whether the "Build Successful" . This will build the code.
*ant run -to run the relex
*ant test -to test the relex

Project proposal was due on 8th of October so we had started are work on the proposal on 30th September. We discussed and distributed parts of the project proposal among us. I had taken the parts of introduction and methodology. Danaja and Nisansa proof-read the separated parts of the proposal and Chamilka did the most of the formatting part. I did help them in possible ways that I can. I should note here that I was down with a contagious eye disease, from 6th - 9th of October where I was instructed to keep my eyes rest. But I participated in group chats in that period as well, to keep me in touch of the project. We submitted our proposal to Dr. Ben Goertzel; our external supervisor and also to Dr. Shehan; our internal supervisor to get their approvals on 5th of October. Dr. Ben had reviewed our proposal within 24 hours and sent us few suggestions, and we all agreed to alter our proposal according to his amendments, and sent the revised proposal to Dr. Shehan. Unfortunately Dr. Shehan was attending a conference in US, so he was unable to sent us a reply.

Dr. Shantha had asked project groups to appoint a leader, and my project members appointed me as the group leader. I will try to do my best as the group leader and is desperate to make our project a success by getting contributions from all my passionate and highly talented group mates.

Saturday, October 2, 2010

Inception of an exciting time!



Ok, now I'm in my final year as an undergraduate, and this post is all about the 10 credits worth final year project of me. We've formed our group when we were in training, and my group mates are Nisansa de Silva, Chamilka Wijeratne and Danaja Maldeniya. Further this post carries what I did in first two or so weeks since the start of the semester.

During this period we went across an exciting time with the selection of a project idea and analysing the feasibility of ideas for a final year project in the area we are most interested i.e. Artificial Intelligence. We had few interesting ideas, some are posted in Moodle, and some ideas came up from my group mates. We had met with the lecturers and got to know about their expectations etc. about those ideas. But we decided to explore few ideas which are more interesting to us.


While I was thinking about a project idea, suddenly I remembered about an AI related open source project which I got familiar with during GSoC-2010, that is OpenCog. OpenCog is an open source Artificial General Intelligence framework, intended to one day express general intelligence at the human level and beyond. I did surf about OpenCog to get more familiar with it. Meanwhile I sent an email to the co-founder of OpenCog Dr. Ben Goertzel (CEO of Novamente LLC and Biomind LLC, CTO of Genescient Corp., Chairman of Humanity+, Advisor in Singularity University and Singularity Institute, Adjunct Professor of Cognitive Science, Xiamen University, China) and Dr. Joel Pitt who is a developer in OpenCog, by mentioning our interest to work under OpenCog and inquiring him possible project ideas with good research value. I got a really quick response from Dr. Ben with four possible categories namely NLP, machine learning, virtual embodiment and cognition, including brief descriptions. I shared Dr. Ben’s reply with my project members and went on a process of selecting the most interesting and doable two categories. We were able to select two categories i.e. NLP and machine learning and requested Dr. Ben to give us more detailed descriptions, at the same time I introduced other members of my team to Dr. Ben.

Dr. Ben was on a trip for couple of days, so we were asked to wait till he is back at home. Meanwhile I did few readings on OpenCog, NLGen and RelEx. On 26th I had a chat in gTalk with Dr. Ben and got to know that machine learning involves pretty hard core C++ programming including lots of templates and use of STL and Boost, since most of us were not familiar with C++, he suggested us to do a project in NLP which is more java based. Dr. Ben suggested three possible project ideas with brief descriptions on each, all were really interesting. After discussing with Vishaka Madam and Dr. Shehan we all agreed to do the project which is involved in improving the RelEx2Frame rule engine, which is used to identify the semantic relationships in English sentences. Dr. Shehan extended his support as our internal supervisor, while Dr. Ben Goertzel will support us as an external supervisor.

Dr. Ben provided us with the list of tasks that would be possible to do under the selected project, which will help us to come up with a comprehensive project proposal. Last few days I had looked into RelEx and RelEx2Frame, and tried to set up the environment to use RelEx. Also today I had a useful discussion on #opencog IRC channel with two OpenCog developers including Dr. Joel Pitt, and got very useful information about the project and they asked me to give the details of our group and our university etc. to mention us on the OpenCog Recap which is a fortnightly summary of stuff that is happening in the OpenCog community.

This is how things went since the inception of our project group.

Sunday, August 22, 2010

ගූගල් සමර් ඔෆ් කෝඩ් -2010 ඉවරායී....


අගෝස්තු 20 වෙනිදා "ගූගල් සමර් ඔෆ් කෝඩ් -2010" වැඩ නිල වශයෙන් අවසන් කලා :),එ අවසන් ප්‍රතිඵල නිකුත් වීමත් සමගයි. ගූගල් නිල වශයෙන් ප්‍රතිඵල 23 වෙනිදා දැනුම් දීමට නියමිතයි. මගේ ප‍්රජෙක්ට් එක වූනේ Apache Derby වලට අලුත් ටූල් එකක් හදන්නයි. Derby කියන්නේ සරලව කිව්වොත් දත්ත ගබඩා කරන්න සහ අවශ්ය දත්ත ලබාගන්න උදව්වෙන FOSS software එකක්, ඉන්ග්‍රිසියෙන් කිව්වොත් Relational Database Management System (RDBMS) එකක්.

මගේ ටූල් එක ගැන කිව්වොත් එය Derby යූසර්ස්ලට තමා execute කරපු query එකක් execute වෙන අවස්ථාවෙදී Derby අනුගමනය කරපු පියවරවල් tree අකෘතියක් ලෙස බලා ගන්න හැකියාව සලසනවා. Tree අකෘතියේ තියෙන හැම node එකක් ගැනම තෝරා ගත් විස්තර සමූහයක් අන්තර්ගතයි. මෙමගින් Derby යූසර්ස්ලට තමා execute කරපු query එකේ performance බලාගන්න පුලුවන් වීම නිසා, performance අඩුයි වගේ පෙනෙනවානම් එ query එක වෙන විදියකට ලියන්න උනන්දු කරවනවා. මෙම අලුත් ටූල් එක Derby මීළග release එකට එ කියන්නේ 10.7 වලට අන්තර්ගත කරන්න ඉන්නෙ. ටූල් එකේ එක interface එකක් මෙතනින් බලන්න පූලූවන්.

මගේ ප‍්රජෙක්ට් මෙන්ට වුනේ Bryan Pendleton. Bryan ගෙ උදවූ මට ගොඩාක් උපකාරී වුනා ප‍්රජෙක්ට් එක වෙලාවටත් ඉස්සෙල්ලා ඉවර කරන්න, මට කියන්න බරිවුනානේ ප‍්රජෙක්ට් එක මම වෙලාවටත් ඉස්සෙල්ලා ඉවර කලා (අගෝස්තු 4) (මෙන්ට බලාපොරොත්තු වුන විදියට), ඊට පස්සෙ community එකෙන් පොඩි පොඩි අදහස් මතු වුනා. එ අදහස් වලට ගරැ කරමින් මට අගෝස්තු 16 ට ඉස්සෙල්ලා කල හැකි දේවල් මම කලා, community එක එකග වුනා අනිත් අදහස් ඉදිරියේදී කරන්න, තව සාකච්චා වලින් පස්සෙ. මෙහෙම තමා FOSS ප‍්රජෙක්ට් එකක් ඉදිරියටම යන්නේ.:)

Community එකේ හැමෝම මට ගොඩාක් උදවු කලා Derby එක්ක familiar වෙන්න. හැමෝටම ගොඩාක් Thanks! ගොඩාක් අය මට සුබ පැතුවා, එ අයටත් Thanks! මේ මගේ පළමු සිංහල බ්ලොග් පෝස්ට් එකයි.:)

ස්තූතියි!

Saturday, August 7, 2010

My Second Project at IFS as an Intern

It was a requirement of the training division itself, and an idea of Nalin, my training manager. He wanted me to write a C# GUI application, which will automate a hectic, tedious manual process. They already have a pretty old GUI, which is capable of doing 2/3 of work that the new tool should cover. But the problem with that is they need to follow a process which is sequentially ordered and they have to closely watch till one step over to proceed with the other step. So a successful solution will save lot of money and effort.


I was not familiar with any of scripting languages before start up of the project. The most challenging task was to find a scripting language which can be used to automate a Windows GUI. After searching in the Internet I found a scripting language called AutoIt (AutoIt), which is capable of automating Windows GUIs, and also very easy to learn type of language. After went through some tutorials on AutoIt, I started writing small scripts, which are basically will automate a simple installation process. Next I got familiar with the tool that is currently used at IFS. After designing a process view I implemented the needed functionality.



GUI is a most important part of an application, which I haven’t done enough thinking into. But Nalin gave me wonderful ideas and best practices of designing a GUI, which I think will help me in my future work as well. GUI has created using C# programming language, such that it takes the minimum possible inputs from a user.
·         GUI consists with four steps.
·         Easy to use, user friendly design.
·         User will be guided through steps, minimized the number of scary messages.
Following our the screen shots of the GUI.





Thursday, August 5, 2010

My Work at Google Summer of Code -2010

As I am reaching the end of successful summer, with Apache Derby and Google, I like to share with you a prototype that I've done using the tool, PlanExporter, which I've developed to Apache Derby.

You can visit this page to see the prototype.

This tool provides a high level view of the execution plans of complex queries you have executed. You can see the steps followed by the "Query Optimizer" of Derby, in order to execute the particular query. In this case Optimizer had followed a query plan with four "plan nodes", namely PROJECTION, HASH JOIN, TABLE SCAN and HASH SCAN. Intermediate results flow from the bottom of the tree to the top. In this case the filtered results of TABLE SCAN and HASH SCAN was given as the input for HASH JOIN. After performing the HASH JOIN the filtered result set given as a input to the PROJECTION node.

You can move the mouse point over an any node of the query plan to view set of available details about the execution at that step.

It is just the output that shown there. To convert to this output I had done lot of coding :).

Thanks for reading!