Talk on Natural Language Processing at Indian Institute of Science, Bangalore

As usual this post was in my todo list for a long time, finally on 1st day of the year I feel I have some time to aggregate all that I have in mind about the event.

It first started when I got the news about Miss Annapoornima Koppad becoming the one of the 12 Directors of PSF(Python Software Foundation)
I was quite impressed by her profile and sent her a request on LinkedIn.

She also operates PyLadies group for Lady Python coders

Couple of days after she messaged me if I was available to give a talk on topics related to Python in a conference being organized by her at IISc, Bangalore.

Since, Currently I have been working with multiple people along with my current job so I usually do not have much time to think about anything but she requested if I could send her the deck for a 3 hour session.

Well, even though she explicitly mentioned that the organizers won’t be able to pay much for the talk , I agreed as I it’s extremely honourable to be able to give a talk at a place where people dream to study.

So, everything setup , we were connected with other speakers/organizers of the conference through mail.
Below is the screenshot the speakers info put up on Explara’s website. The registration were happening through explara.

Speaker Info

This is the flyer organizers created to promote the events participation.

Python Workshop Flyer, IISc

The two day conference was setup on 19th-20th of August, 2016.
My talk was scheduled for Day 2.

It was quite a nice experience getting to know scholars from IISc and they appreciating your talk and want to know more about the things that I had showcased during the talk.

I talked about Natural Language Processing using Python. Gave the full context right from how to start with NLP , basics of NLP and gradually getting our hands dirty with real coding to solve real NLP problems.

Since the conference was little aligned to Machine Learning as well. I kept some elements on ML in my talk where I demonstrated on how to use NLP with Machine Learning.
For an instance:-

    Predicting if a given name is a Male/Female
    Classification of a give mail into Ham/Spam

People really enjoyed the show and I was extremely honoured to be felicitated by Indian Institute of Science for being a Guest speaker to talk about Natural Language Processing.

Here are some of the pictures:-

I really don’t know about the feedback taken on papers after the conference but since I shared my Facebook, Twitter, Quora, I got many requests from the participants.

One of the good appreciation sent to me on Facebook by one of the attendee named

Appreciation about the talk at IISc on Facebook

Looking forward for more such talks/conferences/workshops.

How to POST Python requests with CSRF token ?


import requests
client = requests.session()

# Retrieve the CSRF token first
URL = 'http://www.example.com/'
client.get(URL) # sets cookie
csrftoken = client.cookies['csrftoken']
print csrftoken #Check if it's getting printed. Sometimes key name could be 'csrf' only

payload = {
'csrfmiddlewaretoken':csrftoken,
'key1':'value1',
'key2':'value2',
'key3':'value3'
}

r = client.post(URL, data=payload, headers=dict(Referer=URL))

Running two Flask applications under one AWS instance using Apache

Running two Flask applications under one AWS instance using Apache

Have two application files copied in /var/www

Application 1:- /var/www/apple
Application 2:- /var/www/banana

Create two wsgi files at both the above location with below content:-
apple.wsgi
*************************************
import sys
sys.path.insert(0, ‘/var/www/apple’)

from app import app as application
*************************************
banana.wsgi
*************************************

import sys
sys.path.insert(0, ‘/var/www/banana’)

from app import app as application
*************************************

=================================================================

Create one conf file at location:-

/etc/apache2/sites-available/amazonaws.com.conf

Content:-


ServerName ec2-52-20-211-238.compute-1.amazonaws.com

# logs configuration
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

WSGIDaemonProcess apple threads=5
WSGIScriptAlias /apple /var/www/apple/apple.wsgi
Alias /apple/static/ /var/www/apple/static/

Order allow,deny
Allow from all

WSGIDaemonProcess banana threads=5
WSGIScriptAlias /banana /var/www/banana/banana.wsgi
Alias /banana/static/ /var/www/banana/static/

Order allow,deny
Allow from all

Enable the above file which we created

sudo a2ensite amazonaws.com
sudo a2dissite 000-default

How to host a Flask app on Amazon AWS in 5 minutes ?

Apache Configuration for Amazon AWS

Location:- /etc/apache2/sites-available/amazonaws.com.conf

NameVirtualHost *:80


ServerName ec2-52-20-211-238.compute-1.amazonaws.com
WSGIScriptAlias / /var/www/aira/aira/aira/aira.wsgi

Order allow,deny
Allow from all

ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel info
CustomLog ${APACHE_LOG_DIR}/access.log combined

Enable the above file which we created.

sudo a2ensite amazonaws.com
sudo a2dissite 000-default
———————————————————–
Location of app.py :- /var/www/aira/aira/aira/app.py
Location of .wsgi:- /var/www/aira/aira/aira/aira.wsgi

Content of aira.wsgi
**********************************************
import sys
sys.path.insert(0, ‘/var/www/aira/aira/aira’)
from app import app as application
**********************************************

sudo /etc/init.d/apache2 reload
tail -500 /var/log/apache2/error.log

Shoot me a mail if it takes more than 5 minutes 🙂 sumit786raj@gmail.com