Thursday 26 December 2013

Çok güzel haber! Türkçe kitap okuyup ilgili soruları cevaplayan pprogramım LANGANA

Çok güzel haber!  Türkçe kitap okuyup ilgili soruları cevaplayan pprogramım LANGANA ilk cevaplarını verdi.

İlk olarak STEINBECK’in ‘Fareler ve İnsanlara Dair’ adlı romanını okuyup parse etti.  Sonuçları bir pseuodo dile convert edip bir MySQL database’ine sakladı.  Daha sonra benim şimdilik elle hazırladığım bir soruyu, ‘Lennie nereye gitti?’ cevapladı.    

Aşağıda ilk sütun SENTENCE_NO ikinci sütun WORD_NO, üçüncü sütun OPTION_NO’dur.
Dördüncü sütun ROOT_TYPE, altıncı sütun ROOT , sekizinci sütun ek-RAW_EXT vb...dir.

Görüldüğü gibi, basit bir 3 seviyeli SQL querysi dizisi ile, sorunun cevabını içeren cümleleri yaklaşık 30 bin kelime (100 sayfa) içinden çekip çıkardı, LANGANA...

LENNİE NEREYE GİTTİ?

****************************************
33333333333333333333333 1561              6             0             29356    İsim       null        kerevet               nounExt              ine         %%?in%&e
-----------------------------------------------------------------
1561      0             0             0            Özelİsim              null        Lennie  null        null        null
1561      1             0             30488    Zamir    null        kimse    pronounExt       nin         +ni+n
1561      2             0             13520    İsim       null        dikkat   nounExt              ini           %%?in%&i
1561      3             0             10344    Fiil          -i,-e       çek        nounFromVerbExt         memeye             -meme-ye
1561      4             0             9754      Fiil          nsz        çalış      gerundFromVerbExt     arak       ;;-ar;.ak
1561      5             0             53348    Zarf        null       usulcacık             null        null        null
1561      6             0             29356    İsim       null        kerevet               nounExt              ine         %%?in%&e
1561      7             0             19913    Fiil          -den,-e  git           verbExt                ti             ::-ti:
1561      8             0             54481    Bağlaç   null        ve           null        null        null
1561      9             0             39490    Fiil          -e           otur       verbExt                du          ::-du:
*****************************************
33333333333333333333333 2015              13           0             48386    İsim       null        şehr       nounExt              e             %%%&e
-------------------------------------------------------------------
2015      0             0             0            Özelİsim              null        Lennie  null        null        null
2015      1             0             37999    Zamir    null        ne          null        null        null
2015      2             0             55685    Fiil          -i           yap        nounFromVerbExt         acağını  -acağ-ın-ı
2015      3             0             48299    Fiil          -i           şaşır       gerundFromVerbExt     arak       ;;-ar;.ak
2015      4             0             30799    Sıfat       null       kocaman             null        null        null
2015      5             0             15879    İsim       null        el            nounExt              lerini      #ler%%?in%&i
2015      6             0             10392    Sıfat       null       çelimsiz                null        null        null
2015      7             0             6880      İsim       null        bir          null        null        null
2015      9             0             6906      Zamir    null        birbir     pronounExt       lerine    +lerine
2015      10           0             10027    Fiil          -i,-e       çarp       verbExt                tı             ::-tı:
2015      11           0             54481    Bağlaç   null       ve           null        null        null
2015      12           0             22578    İsim       null        Herkes null        null        null
2015      13           0             48386    İsim       null        şehr       nounExt              e             %%%&e
2015      14           0             19913    Fiil          -den,-e git           verbExt                ti             ::-ti:
2015      15           0             12648    Fiil         de          verbExt                di            ::-di:



****************************************
1.       QUERY:
query = "SELECT * FROM text_read_tst WHERE ROOT = '"+convertToCharSet("git","Windows-1254", "Cp1252")
            +"' AND RAW_EXT = '"+convertToCharSet("ti","Windows-1254", "Cp1252")+"'" ;
2.       QUERY:
query = "SELECT * FROM text_read_tst WHERE SENTENCE_NO = '"+convertToCharSet(ref_sentence_no,"Windows-1254", "Cp1252")
            +"' AND ROOT = '"+convertToCharSet("Lennie","Windows-1254", "Cp1252") +"' ";
3.       QUERY:
query = "SELECT * FROM text_read_tst WHERE SENTENCE_NO = '"+convertToCharSet(ref_sentence_no,"Windows-1254", "Cp1252")
            +"' AND (RAW_EXT = '"+convertToCharSet("ye","Windows-1254", "Cp1252")
             +"' OR RAW_EXT = '"+convertToCharSet("e","Windows-1254", "Cp1252")
            +"') ";

Projemin bundan sonraki aşaması:
1     1.     Bir kaç gün dinlenme...
2     2.      Bankalar, özel şirketler ve TUBITAK’tan destek arayışı...
3     3.      Referans olarak herkesin kullanımına açmak için Fareler ve İnsanlara Dair’in LANGANA-PARSER çıktısını 0 ambiguity ve %100 doğruluğa getirmek.  (En son değişikliklerle bugün %5 ambiguity’ye indirdim).
4     4.      Öncelikle soru algoritmaları geliştirmek gerek.
5     5.      Yaptığım DB’yi kullanarak ÖZNE, NESNE, İSİM-SIFAT TAMLAMALARI ayrışımını yapmak gerek.
6     6.      Geliştirdiğim soru algoritmalarını kullanıcı sorularına göre tetikleyen userinterface’i geliştirmek.

Ham olsa da elimdeki ürünü görmek denemek isteyenlere her zaman kapım açık...  Bilgisayar ortamındaki yazıların giderek arttığı günümüz ortamında yaptığım programın çarpıcı avantajlar oluşturacağından kuşkum yok.  Tıp, hukuk, basın, bankacılık vb bir çok alanda çok faydalı uygulamalar geliştirilebilir.

Saygılarımla.


Ali R+ SARAL

Wednesday 25 December 2013

Langana - Turkish Language Parser - First Output

LANGANA - A COMPUTER PROGRAM THAT UNDERSTANDS A GIVEN TEXT AND ANSWERS QUESTIONS ABOUT IT

This work is protected by the Copyright:
Creative Commons -CC Attribution-NonCommercial-NoDerivatives 4.0 International


I have been working on LANGANA for the last 5 months.  LANGANA is a computer program
that reads and understands a given text or book and then answers questions related to it.

I have finished the LANGANA-parser program which parses Turkish Language texts and
converts the output to a pseudo language and outputs this parsed text to a file
and a MySQL database.

Currently, I am working on designing queries on this parsed pseudo language database tables.
The parsed DB table data enables me to make complex queries to extract sentences and
reach out to data to answer questions such as "Ali nereye gitti?".  The query has to
check for PrivateName('Ali') + nounExt('e OR a OR ye OR ya') + Verb('git'+(verbExt('ti'))
within  a sentence.  The program will be able to switch to deeper understanding modes by
checking the context, going through more than 1 sentence, for example 2 sentences before
and 3 sentences after it finds 'Ali'.

I will be working on a userinterface which takes questions and parses/converts them.
There will be need to find an algorithm to convert the question forms such as what, which,
where to search algorithms.

Please find attached the output of LANGANA's parse of STEINBECK's book 'Of Mice and Men'
in Turkish languge.

OF MICE AND MEN statistical data:
---------------------------------
total #of words: 27740
total #of roots: 29577
total #of exts:  29366
nonprocessed  :      3
% ambiguity :  (29577 - 27740)/ 29577 = 0.07 = %7

Ambiguity may be reduces by program retouches, procedural changes and manual changes
to produce a reference book for further parses of other Turkish books.  But reducing
ambiguity may in some cases reduce the possibilities to search in case of answering
questions, for ex. adjFromVerb and nounFromVerb ambiguity.

I wish my work serves my other collegues who also take the challenges of  the Turkish language.
Last but not the least, my work is available for only academical and non-commercial endeavours,
unless you get a written consent from me.

Ali Riza SARAL

Copyright condition:
Creative Commons -CC Attribution-NonCommercial-NoDerivatives 4.0 International
Attribution-NonCommercial-NoDerivs
 CC BY-NC-ND

You are free to:
Share — copy and redistribute the material in any medium or format

The licensor cannot revoke these freedoms as long as you follow the license terms.

Under the following terms:

Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made.
You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

Information

NonCommercial — You may not use the material for commercial purposes.
NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material.


http://master.dl.sourceforge.net/project/turkishlanguageparser/LANGANA%20report3.txt