This is day 1 of #100DaysOfMLCode.
I am happy to try some technique in machine learning, basically text classification.
I had gone through various articles and I stumbled across one, which was clear in its explanation and categorization of steps on how to achieve text classification using TensorFlow.
So, I quickly read through the article and found out some of the techniques which we basically need, namely: Stemming, Tokenization, Bag of words model etc. These techniques transform the input text into a format which is easy to process by the machine learning model. Finally, the machine learning model was built using TFLearn, which is a wrapper on top of Tensorflow.
So, my goal was to run it quickly and see the output. Fortunately, we have Google Colaboratory, which is a online jupyter notebook allowing developers to try out code on top of the free GPUs hosted by Google.
Please find the original article, which I referred to where I learnt about the Text Classification in Tensorflow part here –> https://sourcedexter.com/tensorflow-text-classification-python/
Now about the code, I am copying the code from Google Colaboratory to my github repository, under Day1. Please find the github link here –> https://github.com/inspire99/100DaysOfMLCode/blob/master/Day1/TF_Text_Classification.ipynb
Please find Google Colaboratory link here –> https://colab.research.google.com/drive/1qMCbx7pS8QzKDzkwUmEymx5FNncqX4OG
“time”: [“what time is it?”, “how long has it been since we started?”, “that’s a long time ago”, ” I spoke to you last week”, ” I saw you yesterday”],
“sorry”: [“I’m extremely sorry”, “did he apologize to you?”, “I shouldn’t have been rude”],
“greeting”: [“Hello there!”, “Hey man! How are you?”, “hi”],
“farewell”: [“It was a pleasure meeting you”, “Good Bye.”, “see you soon”, “I gotta go now.”],
“age”: [“what’s your age?”, “How old are you?”, “I’m a couple of years older than her”, “You look aged!”]
sent_2 = “I gotta go now”
sent_3 = “do you know the time now?”
sent_4 = “you must be a couple of years older then her!”