Kindly use this link to test this app. Link URL : credential : Password : Hello@1234 App name : crickbot

Inspiration CrickBot – a conversational bot for cricket. Sports is one of those arenas that needs an instant match status. And for a game like cricket in a country like India, where about more than 60% of people are hooked up to TV’s and websites to check the scores, bringing in some innovative ideas will get into limelight easily. Usually, websites need manual interventions to filter and get the results. Mostly, one will have to navigate pages to get the results if in case of multiple match status. Bringing a bot into the picture makes your life easy. This bot essentially does that. Knowing a few keywords that are related to cricket are the bare minimal. Construct your question with a regular sentence or just keywords. This bot can return you the results. Ultimately, this bot can save few minutes of online search to get the match status anyday which is vital.

What it does This chatbot has two components:

Query Component Reminder Component Query Component: Here, you can converse and query the bot pretty about the status like scheduled matches/ abandoned/drawn/won/lost/completed matches. Now, this bot is designed to search through and get the match list that had happened last week/yesterday, happening right now and scheduled matches tomorrow/next week. Also, you can get a list of matches given the date yyyy-mm-dd format. It spans range of match categories like Internationals, County, Domestic, Womens and so on. So, ensuring to add these keywords will help the bot to narrow down the search and return you the right results that you would expect. This bot will answer your questions in a formatted text that’s easy to read and get the grasp of it without having to search online further. Importantly, the bot is designed and developed to recognize the international teams. So, without any fuss you can query the bot with shorter formats of the playing countries like ( IND for India, Aus for Australia and WI for west Indies and so on). In the same lines, you can add keywords of two international teams in your chat to see the status of matches.

Reminder Component: This is a unique feature added to this bot. This bot can update you the status of a match whenever a wicket in any of the innings goes down. Moreover, if the update ‘Update after every 5 overs’ is set, it can update you the score after every 5 overs. This feature helps you to get stay updated about your favourite matches all the time. If you know that match has gotten over, and want to remove the updates, you can do that by sending the bot a simple ‘remove’

Demo: Keywords that are related to cricket. Wickets, matches, teams, won, lost, schedule, score, drawn, abandoned, no result, international, county, domestic, international teams(12 countries), women’s, live, today, tomorrow, yesterday, last week, this week, next week

Few Sample Questions • Live Matches now • Matches this week/next week/last week • Matches today/tomorrow/yesterday • Matches scheduled today/tomorrow • Matches scheduled this week/next week • Matches on 07-03-2017 • Teams which won today/yesterday • Teams which won this week/last week • Teams which lost today/yesterday • Teams which lost this week/last week • Drawn matches played today/yesterday • Abandoned matches today/yesterday • International matches today/tomorrow/yesterday • International matches this week/last week/next week • one-day matches this week/last week/next week • Test Matches this week/next week/last week • Matches played by India last week • Match between India vs WI • What’s the score • Matches • Update • Remove

Technical Details: This bot extensively makes use of espncricinfo website. This website is scraped in multiple fashions to answer the user questions.

• Programming language : Python 3 • Libraries used : Beautiful soup, Requests, URLlib • AWS Tools : AWS Lambda, AWS CloudWatch, AWS Gateway • Scheduler – AWS CloudWatch Events at the rate of 2 minutes.

As a part of this challenge, I have developed a library to scrape all the details from cricinfo. To understand the code, one needs to know the python classes that I developed. Here is the high level understanding of the Python code.

Python Classes

MatchInfoPortfolio – This contains all match information on a given day/week. MatchInfo – This contains Individual match Information. Innings – This contains First Innings and Second Innings informations. Overs – All information about overs. Batsman – Batsman object for batsmen in both the innings. Bowler – Bowler object for bowlers in both the innings. Ball – Ball Object Utility Class and other functions. Challenges I ran into Since all the information are really cluttered when scraped from websites, the very concept of extracting and storing the data were tough. I followed OOP way to store the data in python objects. So, this way of extracting the data and putting into classes was time heavy process though it is efficient. Regular expressions were heavy.

The idea to run a scheduler and update the information was difficult. Though following OOP way helped save my time, to implement a small piece of code for scheduler took away a lot of my time.

Accomplishments that I'm proud of I'm happy that I completed the bot. I think as just an individual with more than 20 days of 7 hours work put into this chatbot, the bot has come out really good except for few issues with AWS Lambda.

Solving a complex problem and solving it by understanding the pieces was the most amazing thing I'm proud of.

What I learned How can I improve the current solution with the help of NLP packages in Python How to improve more and add analytics into the work and present the work in a more usuable way.

What's next for Extending the current bot to add various functionalities. I'm sure countries where cricket craze is really high will definitely use the bot one or the other. So, will work on it to improve the bot.

Built With

Share this project: