Chennai Python 24th, March, 2018

24th March, 2018,  Chennai Python Meet-up

Open-Tamil and Ezhil-Language Projects

“எழில் என்பது முதல் திர மூலமாக கிடைக்கக்கூடிய தமிழ் ஸ்கிரிப்டை அடிப்படையாகக்
கொண்ட நிரலாக்க மொழி ஆகும், இது விண்டோஸ் 32, 64 மற்றும் Ubuntu, Fedora Linux மற்றும் Docker தளங்களில் 2017 ஆம் ஆண்டில் வெளியான http://ezhillang.org. எழில் ஒரு பைத்தான்-அடிப்படையிலான மொழிஇயக்கி. வளர்ச்சி GitHub வழியாக நடைபெறுகிறது.

திறந்த-தமிழ் தமிழ் நெருக்கமாக தொடர்புடைய தமிழ் மொழி செயலாக்க கருவிகள் கொன்டது; நூலகம் ஆரம்பத்தில் எழில் மொழியின் ஒரு கீற்றாக துவங்கியது; ஆனால் விரைவாக வார்த்தை-வடிகட்டுதல், N- கிராம் பகுப்பாய்வு, புணற்சசி இலக்கணம், தமிழ் எழுத்துப்பிழை சொல்திருத்தி உருவாக்கம் முதலியன, பல மொழிகளில் பைத்தான், முக்கியமாக, ஜாவா, ரூபி முதலியவற்றிற்கான தமிழ் தொகுப்புகள் பரிசுரம் செய்யபட்டன். http://tamilpesu.us வலையில், மற்றும் Play Store இல் Kalsee பயன்பாட்டில் எங்கள் வேலைகளை பயன்படுத்தலாம்.”

600_469542627

 

Thanks to kind arrangements of friends in Chennai Python, and open-tamil community I had an opportunity to make a presentation on Open-Tamil and Ezhil-Lang projects, and completion. Talk was well received, and delivered in unique Tamil mixed with English due to comfort of being in Chennai only!

open-tamil -conference articles (2014, ’16, ’17)

Thanks to our co-authors and open-tamil collaborators [Shrinivasan, Arulalan, Sathia Narayanan, among others], we were able to submit 3 articles to INFITT conferences in 2014, 2016, and 2017 respectively.

This year too with some luck we hope to make it to the TIC 2018. We are in process of drafting another article for upcoming 2018 Tamil Internet Conference in Coimbatore, India, to report additional developments from our team. We will be having a somewhat larger author list to properly acknowledge contributors – old and new.

At this time for our own review, we recollect the prior three research articles published about open-tamil (in chronological order) they are:

  1. “Open-Tamil text processing tools,” (2014) Tamil Internet Conference at Puducherry, India : here (Aug, 2014)
  2. “Developments in Open-Tamil library,” (2016) Tamil Internet Conference at Dindugul, India : here (2016)
  3. “Tamil open-source landscape: opportunities and challenges,” (2017) Tamil Internet Conference, UT-Scarborough, Toronto, Canada : here (June, 2017)

-Muthu,

San José, CA

Open-Tamil v0.7 release

I’m happy to announce Open-Tamil 0.7 release, today 23rd March, 2018. Open-Tamil is distributed under MIT license, and available for Python 2.6, 2.7, 3+ and PyPy platforms, via the Python Package index at https://pypi.python.org/pypi/Open-Tamil/0.7

You can install the package via ‘$ pip install –upgrade open-tamil’ command issued in your console.

Following updates are made to the Python package:

  1. Series of command line tools will be installed into your Python (for Windows) or local/bin directory (for Linux) with this release. The command line tools are,

     

1. tamilphonetic – convert EN input to Tamil text

2. tamilwordfilter – filter Tamil input only from all input text data

3. tamilurlfilter – filter Tamil text from the input website data

4. tamiltscii2utf8 – convert encoding from TSCII to UTF-8 for input file

5. tamilwordgrid – generate a crossword from Tamil input text and write to output.html file

6. tamilwordcount – like UNIX wc program but for Tamil

  1. Transliteration package updates: Reverse transliteration functions is added; Univ of Madras scheme support is added.
  2. Tamil package: added text summarizer tool via module ‘tamil.utils.SummaryTool’
  3. Solthiruthi package updates: To do spell checking reasonable times and ability to identify and correct many classes of errors are added.
  4. Bug fixes for issues in get_letters(), tamil.numeral, added capability for generating string version of numerals in Tamil [previously only numeric version was supported]

In addition to the package, a web interface was developed for Open-Tamil in Django hosted at http://tamilpesu.us for demonstrating some of our capabilities.

We like to thank all our contributors in general, and in particular those members who contributed new code or bug fixes going into this release.

Previous release was v0.67 on Aug 23rd, 2017 and v0.65 was released on Oct 22nd 2016. Please share the word, and send us any bugs, feature requests or feedback via our github page https://github.com/Ezhil-Language-Foundation/open-tamil

Sincerely,

Muthu for Open-Tamil team.

Chennai, India.

Open-Tamil user commands

Lot of times we have felt the problem with open-tamil : it has many utilities, but none of them are usually available as functions or commands out of the box. It has very much been a developer tool, and not a user or informed-layperson tool.

A quick fix is to add the example Python scripts to the default install paths along with open-tamil installation [which is still simple as ‘$ pip install –upgrade open-tamil‘].

1. tamilphonetic - convert EN input to Tamil text
2. tamilwordfilter - filter Tamil input only from all input text data
3. tamilurlfilter - filter Tamil text from the input website data
4. tamiltscii2utf8 - convert encoding from TSCII to UTF-8 for input file
5. tamilwordgrid - generate a crossword from Tamil input text and write to output.html file
6. tamilwordcount - like UNIX wc program but for Tamil

All these functions will be made available in version 0.7 of open-tamil to be released soon. Currently these functions have landed in the development branch through the commit 02810461bef216df56b10ebf09818b94dfc75574

The next step should be to really bundle these tools into a binary executable for various platforms. Also to note, the function tamilwordcount was contributed by a new member to the Open-Tamil group, Mr. Surendhar. Thanks much, and welcome!

-Muthu

Chennai, India

open-tamil on web

Today, you are welcome to play with open-tamil API via web at http://tamilpesu.us

DXrBTyUX0AEm7ET.jpg-large

Generating multiplication tables via Open-Tamil APIs’: http://tamilpesu.us/vaypaadu/

This is collective work of our team underlying the website (written in Django+Python) highlighting various aspects of open-tamil like transliteration, numeral generation, encoding converters, spell checker among other things. At this time I hope to keep the website running through most of this year, and add features as git-repo https://github.com/Ezhil-Language-Foundation/open-tamil gets updated.

Thanks to Mr. Syed Abuthahir, many months ago, in winter of 2017, he has developed an interface for open-tamil on the web and shared with us under GNU Affero GPL terms. Later, we is added as part of main open-tamil as well.

Open-Tamil moves forward; come join us!

-Muthu

Classifying Tamil words – part 1

Problem

One of problems faced when building a Tamil spell checker, albeit somewhat marginal, can be phrased as follows:

Given a series of Tamil alphabets, how do you decide if the letters are true Tamil word (even out of dictionary) or if it is a transliterated English word ?

e.g. Between the words, ‘உகந்த’ vs ‘கம்புயுடர்’ can you decide which is true Tamil word and which is transliterated ?

Tools

This is somewhat simple with help of a neural network; given sufficient “features” and “training data” we can train some of these neural networks easily. With current interest in this area, tools are available to make this task quite easy – any of Pandas, Keras, PyTorch and Tensorflow may suffice.

Generally, the only thing you need to know about Artificial Intelligence (AI) is that machines can be trained to do tasks based on two distinctive learning processes:

  1. Regression,
  2. Classification

Read more at the Wikipedia – the current “problem” is a classification task.

Features

Naturally for task of classifying a word, we may take features as following:

  1. Word length
  2. Are all characters unique ?
  3. Number of repeated characters ?
  4. Vowels count, Consonant count
    1. In Tamil this information is stored as (Kuril, Nedil, Ayudham) and (Vallinam, Mellinam and Idayinam)
  5. Is word palindrome ?
  6. We can add bigram data as features as next step

Basically this task can be achieved with new code checked into Open-Tamil 0.7 (dev version) called ‘tamil.utf8.classify_letter

Screen Shot 2017-12-17 at 1.03.03 PM.png

Data sets

To make data sets we can use Tamil VU dictionary as a list of valid Tamil words (label 1); next we can use a transliterated list of words from English into Tamil as list of invalid Tamil words (label 0).

Using a 1, 0 labeled data, we may use part of this combined data for training the neural network with gradient descent algorithm or any other method for building a supervised learning model.

Building Transliterated Data

Using the Python code below and the data file from open-tamil repository you can build the code and run it,

def jaffna_transliterate(eng_string):
  tamil_tx = algorithm.Iterative.transliterate(jaffna.Transliteration.table,eng_string)
  return tamil_tx

def azhagi_transliterate(eng_string):
  tamil_tx = algorithm.Iterative.transliterate(azhagi.Transliteration.table,eng_string)
  return tamil_tx

def combinational_transliterate(eng_string):
  tamil_tx = algorithm.Iterative.transliterate(combinational.Transliteration.table,eng_string)
  return tamil_tx

# 3 forms of Tamil transliteration for English word
jfile = codecs.open('english_dictionary_words.jaffna','w','utf-8')
cfile = codecs.open('english_dictionary_words.combinational','w','utf-8')
afile = codecs.open('english_dictionary_words.azhagi','w','utf-8')
with codecs.open('english_dictionary_words.txt','r') as engf:
for idx,w in enumerate(engf.readlines()):
  w = w.strip()
  if len(w) < 1:
    continue
  print(idx)
  jfile.write(u"%s\n"%jaffna_transliterate(w))
  cfile.write(u"%s\n"%combinational_transliterate(w))
  afile.write(u"%s\n"%azhagi_transliterate(w))
  jfile.close()
  cfile.close()
  afile.close()

to get the following data files (left pane shows ‘Jaffna’ transliteration standard, while the right pane shows the source English word list); full gist on GitHub at this link

Screen Shot 2017-12-17 at 1.47.42 PM.png

In the next blog post I will share the details of training the neural network and building this classifier. Stay tuned!

 

திருத்த திருத்த … பிழைகள் ஒழிந்திட – spellchecker

இந்த பதிவில் ஏற்கனவே எழுதிய மயங்கொலி எழுத்துகள் பற்றிய பதிவில் (எப்படி மயங்கொலி பிழைகளை திருத்தம் செய்யலாம் என்பது பற்றி)  சிந்தனைகளை வழிமுறைபடுத்தி இங்கு பதிவு செய்கிறேன்.

இந்த பதிவில் எப்படி மயங்கொலி பிழைகளை சொல்திருத்தியில் நடைமுறைப்படுத்தி open-tamil-இல் செயல்படுத்துவது என்றும், இதன் நல்ல விளைவுகளையும் பார்க்கலாம்.

திருத்தம்

 

“தமிழ் திருத்தி” என்ற பெயரில் இந்த (web-based) வலை வழி இடைமுகம் காணலாம் [படம் 1].

தமிழ் திருத்தியில் “பளம்” என்றும் மற்ற இரண்டு சொற்களை (“காதள்”, “எலிதில்”) உள்ளீடு செய்து, சறிபார்க்க சொல்லலாம்.

விடைகளும் மாற்றங்களும் இங்கே! தவறான சொற்கள் சிகப்பு நிர கோட்டில் சுட்டி காட்டப்படும். இதனை விரைவில் open-tamil-இல் காணலாம்.

spell-checker-mayangoli-cases

படம்: எழுத்தாளர் சொற்களை செதுக்குகிறாள்; ஆனால் அவளுக்கு சில சொற்பிழை வந்துள்ளது. இவற்றை எப்படி அவள் நிவர்த்தி செய்தாள் ?

 

spell-checker-mayangoli-replace-1

படம் 2: முதல் சொல் மாற்றம் பழம், கனி

spell-checker-mayangoli-replace-2

படம் 3: இரண்டாம் சொல் “காதல்”

spell-checker-mayangoli-replace-3

படம் 4: மூன்றாம் சொல் “எளிதில்”