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

“What is this Indian language ?”

ezhil-release-screenshotதமிழில் மென்பொருள் பற்றிய விமரிசனங்கள்

சென்ற மூன்று மாதங்களாக எனது முழுநேர அலுவலக வேலையில், தமிழில் [தமிழ் இடைமுகத்தில் மட்டும்] Microsoft Outlook, Office செயலிகளை தினமும் வேலை நெருக்கடியில் பயன்படுத்தி ஒரு தமிழில் செயல்படும் ஒரு முழுநேர அனுபவத்தை நேர்கிறேன். இதே வேளையில் வீட்டில் திற மூல மென்பொருள் பங்களிப்பிற்கும், திட்டமிடுதல், கட்டுரை, குறிப்புகள் ஆகியவற்றிக்கும் Open Office பயன்படுத்தி வருகிறேன். இதற்க்கு சிறிதளவாவது காரணம் அழகாக தமிழில் பேசி படைத்த செல்லினம் செயலியை வெளியிட்ட, முரசு அஞ்சல், முத்து நெடுமாறனின் “கருவாக்கல், உருவாக்கல், விரிவாக்கல்” என்ற தமிழ் இணைய மாநாடு 2017-இன் போது கேட்ட பேச்சு – அவர் “நாம் தமிழில் இடைமுகங்களை செயல்படுத்தினால் நம்மளுடைய மொழி பற்றி மாதவர் கேட்பார்கள், நமது மொழிக்கும் விளம்பரம் கிடைக்குமே!” என்பது போல் பேசினார்.

இதே  போலே எனது சீன வேலை-நண்பர்  [இது முற்றிலும் ஒரு வேடிக்கையான “தெரிந்தவர் -ஆனால் நண்பர் அல்ல” என்பதற்கு அமெரிக்கர்கள் கூறும் நாசூக்கான சொல் என அறிவேன்] “என்ன இந்தியன் மொழி இது?” என்றும் கேட்க – [பாவம் அவருக்கு ஆரியம்-திராவிடம் போன்ற மொழிகள், 1500 கூடுதலான மொழிகள் பற்றியெல்லாம் பேசி பாடம் நடத்தாமல்] தமிழ் என்று சொல்லி “இந்தியாவில் இல்லை, சிங்கப்பூரில் சீன மொழிக்கு நிராக இருக்கு” என்றும் சொல்லி, அவரது பெயரை தமிழில் எழுதி அனுப்பினேன். தமிழ் இடைமுகம் பயன்படுத்தினால் அதற்கும் ஒரு மதிப்பு, தனித்துவம்!

இந்த பதிவில் எனது Microsoft Office, Open-Office பற்றிய அனுபவங்கள் குறித்து எழுதுகிறேன்.

அழகிய மென்பொருள், beautifully crafted software, ஒரு திரைப்பட காதல் கட்சியில் எப்படி காதலன்-காதலி சேர்கின்ற நொடியில்  (படம் பார்ப்பவரின் பார்வையில் இயக்குநர் மறைந்து இருப்பதுபோல்), வேலைக்கும் வேலைசெய்யும்ப-யனர் இடையே ஊடுறுவாமல் பின்புலத்தில் இருக்கவேண்டும். இதனை சரியே செய்யும் இடைமுகம் நல்ல மென்பொருள்; இத்தகைய தமிழாக்கம் கொண்ட இடைமுகம் இவ்வாறே ஊடுறுவாமல் இருக்கவேண்டும்.

உண்மையில் Microsoft நிறுவனத்தின் தமிழாக்கம், (l10n – [localization-இக்கு இட்ட சுருக்கம்]), மிக எளிமையாக உள்ளது. இதனை கையாண்ட குழு நல்ல வேலை செய்தார்கள். சில default-கள் அபத்தமாக இருந்தாலும் பெரும்பாலும் ஓரளவு தமிழ், தமிழ் கணிமை கலைச்சொற்கள், எதார்த்தமாக தமிழில் புழங்கும் ஒரு சாமானியன்/யர், இதில் எளிதாக இயங்கும் வகையில் அமைந்தது!

முதலில் Open Office இடைமுகத்தை தமிழில் தந்த ழ-கணினி-குழுவிற்கு நன்றி. Open Office இடைமுகம், உண்மையில் ழ-கணினி திட்டத்தில் வழி தன்னார்வலர்களால் வெளியிடப்பட்ட மொழியாக்கம் – மிக பாராட்டத்தக்கது ஆயினும், Microsoft நிறுவனத்தின் மென்பொருளுக்கு இணையாக இல்லை. நிறைய பிழைகள் – “text fields” என்பதை வயல்கள் என்றும் ஓரிடத்தில் தவறாக மொழி பெயர்க்கப்பட்டது. இவ்வாறு சில வேறுபாடுகளும், தரம் சார்ந்த வகையில் முன்னேற்றங்கள் தேவைப்படுகின்றன. நான் ஒன்றை மட்டுமே இங்கு குறிப்பிட்டாலும், நீண்ட நாள் திற மூல பயனாளர் என்பதனாலும் இதில் கருத்து வேறுபாடுகள் கிடையாது.

இதே நேரத்தில் மற்றோரு மென்பொருளையும் இவற்றோடு ஒப்பிடவேண்டும்; தமிழில் சிறந்து விளங்கும் “மென்தமிழ்” ஆவண திருத்தி (Word processor) முழுமையும் தமிழ் மொழியியல் கொண்டு, சிறப்பாக பேரா. திரு. தெய்வசுந்தரம்நயினார், அவர்களது தலைமையில் வெளியிடப்பட்டு வருகிறது. இதற்கும் அவரது பல தமிழ் கணினி மொழியியல் பங்களிப்பிற்கும் அவருக்கு 2015-ஆம் ஆண்டு தமிழக அரசு கணினி விருது அளித்து சிறப்பிக்க பட்டார். இந்த மென்தமிழ் திருத்தியை சில நேரம் மட்டுமே பயன்படுத்தியதால் நான் இதற்கு தற்போது ஒப்பீடுகள் கொடுக்க முடியவில்லை.

கோரிக்கை

தமிழில் இடைமுகங்களை கிடைக்கும் இடங்களில் பயன்படுத்துங்கள்; இவற்றை பற்றி வெகுஜன இதழ்களிலும், வலை பதிவுகளிலும் இடுங்கள்; நண்பர்களுக்கும், குடும்பங்களுக்கும் சொல்லுங்கள். தமிழ் மொழியில் கணினியியல், கணினி இடைமுகவியல் (interface design) போன்ற துறைகளின் வளர்ச்சி விமர்சன பார்வைகள், பின்னூட்டங்கள், இல்லாவிடில் தேய்ந்து போய்விடும்; மறக்கப்படும். காற்றோடு தூசியாகிவிடும். இது மென்பொருள் வடிவமைப்பாளருக்கு நீங்கள் அளிக்கும் பரிசு.

நன்றி, முத்து (01/27/18: சான் ஓசே, கலிஃபோர்னியா)

அடிக்குறிப்பு : சில சொற்பிழைகளை திருத்தியுள்ளேன்

GPUs powering the AI revolution

Ganapathy Raman Kasi*, Muthiah Annamalai+

[This article originally appeared in the 2017 Tamil Internet conference, UT-SC, Toronto, Canada, magazine ]

Introduction

The current hot trend in AI revolution is “deep learning” – which is a fancy way of talking about multi-layered convolutional neural networks; this field of study has heralded a new age in computing extending human capabilities by automation and intelligent machines [1].

These neural networks aren’t the same as neuron networks in your brain! We are talking about artificial neural networks which reside in computers and tries to mimic the biological neural network with its synapses (connections) of axons, dendrons and their activation potentials. These thinking machines have their beginnings in post WW-II research at MIT, in the work of Seymour Papert who introduced “Perceptrons,” and Norbert Weiner’s “Cybernetics”.

But do we know why there is sudden interest in these biologically inspired computer models ? It is due to GPUs which has accelerated all the complex computations associated with neural networks for it be practical in such a large scale. They allow these networks to operate on gigabytes (or even terabytes) of data and have significantly reduced the computation time from months to days, or days to hours, or hours to minutes usually by an order of magnitude – not possible in an earlier generation of computing. Before we jump into the details let us understand why we need deep learning and convolutional neural networks in the first place.

Scientific Innovations

Science and engineering have traditionally advanced by our ability to understand phenomena in natural world and describe them mathematically, since the times of Leonardo Da Vinci, Nicolas Copernicus, Galileo Galilei, Tycho Brahe, Johannes Kepler and Isaac Newton. However gaining models through experimentation and scientific breakthroughs piece-meal for each problem at hand is a slow process. Outside of Physics and Mathematics the scientific method is largely driven by an empirical approach.

It is in such pursuits of building models of unknown processes where observational data far exceed our human intelligence to divine an analytical model, the advent of deep learning and GPU based multi-layered neural networks provide an ad-hoc computable model. System identification for particular classification tasks, image recognition, and speech recognition to the modern miracle of a self-driving cars are all enabled by deep learning technology. All this came about due to the seminal work of many innovators culminating in the discovery of efficient convolutional neural networks by Prof. Geoff Hinton, who trained them by hardware acceleration via GPUs.

An original pioneer in the field of AI, before the AI winter, Prof. Geoff Hinton and co-workers [2] recently showed deep learning models that beat status-quo benchmarks on classification and prediction tasks on the following speech, text or image datasets: Reuters, TIMIT, MNIST, CIFAR and ImageNet, setting off the renewed interest in the field of AI from academia and industry giants – Google, Microsoft, Baidu and Facebook alike [3].

What is a GPU ?

GPU stands for Graphics Processing Unit [4]. These were originally designed for graphics rendering used in video games in 1990s. They have a large number of parallel cores which are very efficient for doing simple mathematical computations like matrix multiplications. These computations are the fundamental basis for machine learning methods such as deep learning. While the improvement in CPUs over years has slowed down over the years as Moore’s law has hit a bottleneck, the GPUs increase in performance has continued unabated showing tremendous improvements over the generations.

Figure. 1 (left): Deep Learning training task times as function of various GPU processors from NVidia. Figure. 2(right): AlexNet training throughput for 20 iterations on various CPU/GPU processing platforms.

Such GPUs were originally invented for shading algorithms algorithms, are now applied in training large machine learning models using a Open CL or CUDA like frameworks (variants of C-language with description for parallel execution via threading) from the vendors.

The pioneering hardware vendors include Nvidia with their GPU series like GeForce, Tesla; AMD with its Radeon, GP GPU, Google has entered this race with its TPU (Tensor Processing Unit) and some offerings from Intel for ML training applications. Nvidia and AMD are the main players in the GPU space with Nvidia laying special emphasis on parallel computing and deep learning over the years. Nvidia just announced the new Volta generation chip based GPU V100 which is about 2.5 x faster than the previous generation chip Pascal GP100 which was announced less than 2 years ago [5].Compared to CPU, however GPUs are more than 50x faster for Deep learning. Performance of GPUs as function of various GPU families in shown in Figure. 1, and for another AlexNet data set is shown in Figure. 2.

Hardware Innovation

If the Harvard architecture and RISC architecture based CPUs have been workhorses of personal computer revolution, then the advent of high framerate video-gaming pushed the CPU based graphics rendering from CPU + Video card based rendering to CPU + GPU, to CPU + GPU + GP-GPU (general purpose GPU); some of this overview is shown in Figure. 3a, 3b.

Figure. 3(a,b): Evolution of GPU performance from video graphics cards and rendering from CPU; courtesy PC Magazine [4]; Figure. 3(c): NVIDIA Tesla GPU applications in scientific research.

Limitations

GPU’s are suitable for large numerical algorithms where various data have to be moved through a computational pipeline often in parallel; this SIMD problem, like genome sequencing shown in Figure. 3c, when solved by GPU gain the maximum speedup/acceleration. However, there is a fundamental limitations of GPU acceleration due to the Amdahl’s law which saturates the parallelization upto the available serial bottlenecks for a given computational task.

Software Frameworks

To build a deep learning application one may use their labeled datasets to build a learning model on any of the various frameworks [6] (both open-source or closed) provided from competing vendors in the industry as follows:

  1. TensorFlow, developed by google, python API over C++ engine, low level api, good for researchers, not commercially supported; notably Google is in process of developing a TPU – an advanced version of GPU for direct use with TensorFlow.

  2. Caffe 2, developed by UC Berkeley used at Facebook among other places, focussed on computer vision, one of the earlier frameworks to gain significant adoption, Python API over C++ and CUDA code

  3. Scikit Learn (Python based) general inference and machine-learning framework

  4. Theano written in python, grand-daddy of deep learning frameworks

  5. CNTK developed by Microsoft

Applications

Tamil applications for deep learning including providing or improving existing solutions to the problems of,

  1. Tamil Speech Recognition
  2. Tamil Character Recognition [7,8]
  3. Natural Language Processing for Tamil

Hardware acceleration and availability of big-data (labeled datasets) will play key role in the success of applying deep learning techniques to these problems.

References

  1. Jensen Huang, “Accelerating AI with GPUs: A New Computing Model,” link

  2. G. E. Hinton et-al. “Imagenet classification with deep convolutional neural networks,” Advances in Neural Information Processing Systems (2012).

  3. LeCun, Y., Bengio, Y. and Hinton, G. E., “Deep Learning” Nature, Vol. 521, pp 436-444. (2015), link.

  4. GPU definition at PC Magazine Encyclopedia, PC Magazine, (2017) link.

  5. Tesla GPU Application notes from NVidia, (2017) link.

  6. Comparing deep learning frameworks”, Deeplearning4j.org (2017), link.

  7. Prashanth Vijayaraghavan, Mishra Sra, “Handwritten Tamil Recognition using a Convolutional Neural Network,” NEML Poster (2015) link.

  8. R. Jagadeesh Kannan, S. Subramanian, “An Adaptive Approach of Tamil Character Recognition Using Deep Learning with Big Data-A Survey”, Proceedings of 49th Annual Convention of Computer Society of India (vol. 1) pp 557-567 (2015), link.

Ezhil, Open-Tamil conference articles – 2017

One of major achievements of last year has been collecting inputs from our team and writing up two important papers – one for historical review and other for collective call to action on great opportunity that is Tamil open-source software.

Acknowledgements

We also take time to thank all co-authors who have pulled together their efforts at short notice to make these research works happen! Together these two papers represent a value of tens of thousands of Indian rupees, or more in the making (going by estimates of other Tamil software foundations).

We also thank conference organizers for partial travel grant toward making this presentation happen. Thank you!

Conference Articles – 2017

Ezhil, Open-Tamil conference articles – 2017 presented at Tamil Internet Conference, August, 2017, in Toronto, Canada. Both the papers were well received and good academic and development points were debated at the forum.

  1. Ezhil – எழில் மொழி பொது பயன்பாட்டிற்கும், வெளியீடு நோக்கிய சவால்களும்
    • This paper summarizes the path taken by Ezhil from inception toward delivering a fully installable product on Windows 64/32bit, Linux (Unbutnu, Fedora) systems, and offers a meditation on how students and teachers may adopt this product, and future pathways.
    • Presentation slides are here on slideshare.
  2. Open-Tamil / Open Source in Tamil – Tamil Open-Source Landscape – Opportunities and Challenges_MA_2017_final 
    • Some important contributions of this paper show collective interest in Tamil open-source which outpaces the other languages with larger speaking-population. This is a key indicator to develop better pathways to bring new developers and train them into developing Tamil software
    • GitHub Tamil language repositories

      GitHub Tamil language repositories compared with other languages, as measure of software developers interest.

    • Presentation slides are at slide-share

For questions and queries on these articles, please write to us at ezhillang@gmail.com or leave your comments below.

Ezhil Language Foundation

 

Classifying Tamil words – part 2

Recap

Continuing from previous post (see part-1) I am sharing my results on classifying a Tamil alphabet sequence as a valid Tamil-like word or English-like word using a binary classifier.

Pre-requisities

You need to get scikit-learn API installed by following directions on website here.

pip install -U scikit-learn

This will also get dependencies like Numpy and other Python libraries supporting the SciKit learn.

Next ensure your installation is okay by typing,

python -m sklearn

which should run without any output if all your settings are okay.

Training the AI Classifier

To train the classifier based on multi-layer perceptron (in other words – an AI neural network)

  1. we need to represent our input as a CSV file, with each sampled encoded as a feature of rows.
    • for this case the data are in the form of CSV files representing features of Jaffna, Azhagi, Combinational transliterated output of input words
    • See: files ‘english_dictionary_words.azhagi’ and ‘tamilvu_dictionary_words.txt’ at repo open-tamil/examples/classifier
  2. each word (represented as features) will also be given training label usually as integer, forming a column data on CSV file (across all samples); typical features encoded for the data file are defined in class Field under file ‘classifier/preprocess.py’;
    • Typically the information for each word like number of letters, juries, medics, ayutha letters, vallinams, mellinams, idayinams, first, last and vowels are stored in feature record within CSV.
    • We can generate various feature records of the data files by running the code of preprocessor.py
  3. next we may train the neural network using the Scikit learn API,
    • this is key code in ‘classifier/modelprocess2.py’
    • first we load the CSV feature vectors into Python as Numpy array for both class-0 (English words) and class-‘1’ (Tamil)
    • next we setup scaling of data sets for both classes
    • we pick test set, and training set which are key information to getting a good model network and generalized fit
    • We import various tools out of scikit learn like input scaler ‘StandardScalar’, ‘train_test_split’ etc for keeping up with good training conventions
    • Since we are doing classification both test and training inputs need to be scaled but not the label data
  4. Next step we setup a 3-layer neural network with ‘lbfgs’ activation function. We can fit this data with X_train data  and corresponding Y_train labels
    • nn = MLPClassifier(hidden_layer_sizes=(8,8,7),solver=lbfgs)
      nn.fit(X_train,Y_train)

      Y_pred = nn.pred( X_test )

      print(” accuracy => “,accuracy_score(Y_pred.ravel(),Y_test)

  5. The fitted neural network is capable of generating a score (goodness of fit), and immediately serialized into disk for future references; we also output diagnostic informations like,
    • confusion matrix
    • classification report
  6. Next we use the training neural network to show the results of  a few known inputs.
screen-shot-2017-12-20-at-2-24-21-am.png

Fig. 2: 89% accuracy trained classifier with correct identification of word “Hello”; while both are acceptable in native script form it is a English origin word!

  1. Key points for this prediction with ANN are to keep the input transformed as a feature vector before applying it to the classifier input
  2. Once the training is complete we see results like in item [6].

Finally we can automatically tell (via a neural network) if computer is a Tamil or English origin word; there is some sensitivity in this decision due to the 10% error. I have a screenshot of the predictions for various words (feature vectors are written as output as well)

Screen Shot 2017-12-20 at 2.28.35 AM.png

Fig. 3: Neural Network prediction of Tamil words and English (transliterated into Tamil) words

Finally we would like to conclude saying various types of Artificial Neural Network topologies and hidden-layer sizes were used but we chose to stick with simplest. At this time this trained neural network seems like a quite satisfying, and even ready to use for practical purposes.

Conclusion

Scikit-learn provides powerful framework to train and build classification neural networks.

This work has shown easy classification with 10% false-alarm rate (or ~90% classification rate) of various Tamil/English vocabularies and out of training vocabulary sets. The source codes are provided at open-tamil site including the various CSV data etc.

Goodluck, to exploring Neural Networks. Getting beyond 90% in this task seemed hard, and long way to go.

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!