1. Semester Long Internship
Tata Motors .LTD GDC (Global Delivery Center)
Project Title: Chatbot & dashboard development
Under Guidance
of
Mr. Sidhant Chatterjee & Mr. Abhijeet Dalavi
TML GDC , Digital Transformation Tower
- Omkar Rane
Block-A ,BETA17, Exam Seat No. B197026,0120160172 B.TECH ENTC ,MIT-AOE
2. Vendor chatbot project.
Drishti dashboard for employees.
Sending automated mails and employee health monitoring dashboard (TML-Arogya Bot).
AWS EC2 & RDS instance creation (deployment).
Contract life cycle management (CLM) dashboard project .
Content
3. A chatbot is a computer program designed to interact with users replacing human. They
mimic human conversations and provide end to end support.
Chatbots are classified into two :
1.Scripted bots
2. AI based bots
Scripted bots: These bots are pre-defined with a conversational flow and so when a user
throws a query, the bot responds with a pre-defined script from the library.
e.g.- bots direct implemented using TelegramBot api.
AI bots: AI bots or intelligent bots use NLP to answer user queries. The intelligent bots act
smart and respond back with most appropriate answer possible. It actually gets trained to
user’s queries and makes a pattern to respond back to them with the most reliable answer
possible.
e.g. – chatbots developed with frameworks like Rasa and chatterbot.
What is a chatbot ?
4. What is NLP?
NLP is a subset of AI, and it involves programming
computers to process massive volumes of language data.
It involves numerous tasks that break down natural language
into smaller elements in order to understand the relationships
between those elements and how they work together.
Common tasks include parsing, speech recognition, part-of-
speech tagging, and information extraction. NLP focuses
largely on converting text to structured data.
What is NLU?
NLU is to teaches machines how to interpret and understand
language inputted by humans.
NLU leverages AI algorithms to recognize attributes of
language such as sentiment, semantics, context, and intent,
entities.
For example, the questions “what’s the weather in pune?” and
“how’s the weather in pune?” are both asking the same thing.
The question “what’s the weather in pune?” can be asked in
hundreds of ways. With NLU, computer applications can
recognize the many variations in which humans say the same
things.
NLP & NLU
5. About Rasa and Spacy
Rasa is an open source machine learning framework for building AI assistants and
chatbots. Mostly you don’t need any programming language experience to work in Rasa.
Although there is something called “Rasa Action Server” where you need to write code
in Python, that mainly used to trigger External actions like Calling Google API or REST
API etc.
Rasa has three main modules:
1.Rasa NLU for understanding user messages (we are making use of only this in
project).This is the place, where rasa tries to understand User messages to
detect Intent and Entity in your message. Rasa NLU has different components for
recognizing intents and entities, most of which have some additional dependencies
2.Rasa Core for holding conversations and deciding what to do next.
3. Rasa X is a tool that helps you build, improve, and deploy AI Assistants that are
powered by the Rasa framework.
spaCy is an open-source software library for advanced natural language processing,
written in the programming languages Python and Cython. The library is published under
the MIT license and its main developers are Matthew Honnibal and Ines Montani, the
founders of the software company Explosion.
6.
7. Key Features of Vendor chatbot project
User has to get registered with vendor desk before using bot.
Bot will send disclaimer and will ask user to accept it contact details will be shared and verified if it matches then
only he will be getting replies for his queries. This is authentication method for bot.
It will initially ask invoice number then user has to enter invoice number if it matches the record then only it will
display record information related to invoices.
It is displaying data from SAP excel file record. (for future use it could be a production database).
If user does not knows his invoice number then it will show all paid and unpaid invoice details.
User has to just click on respective invoice number to get details his of invoice.
It can extract numbers from text with concept of python text regularization.
9. •Intent: An intent represents the purpose of a user's input. You define an intent for each type of user request you want
your application to support.
•Entity: An entity represents a term or object that is relevant to your intents and that provides a specific context for
an intent. You list the possible values for each entity and synonyms that users might enter.
What is Intent & Entities?
Intent and entity extraction
Chatbot replies based on intent
and entities
10. Launching Rasa GUI NLU Trainer
With command: rasa-nlu-trainer
Rasa GUI based NLU trainer
Training of Rasa NLU model
Placing blank json file at
project location.
11. Generated training data in json file with intent and
entities
Training of model with command : rasa train or rasa train-nlu
12. Including trained model into project and pass user chat to model and extract intent and entities from it.
13. Writing function for extracting invoice number from string(chat as input for function)
Including it in actual project for extraction of invoice number from chat string and passing to other
function.
Concept of Regex( regular expression) in python.
It is basically used here to extract numbers from string data.
A RegEx, or Regular Expression, is a sequence of characters that
forms a search pattern.
RegEx can be used to check if a string contains the specified search
pattern.
‘d’ matches a single digit pattern.
‘+’ matches one or more of the preceding character (greedy match).
findall( ) : Returns a list containing all matches
14. Results: Vendor Chatbot
greeting Verifying invoice number If vendor is registered then it
can show invoices paid &
unpaid.
Ending a chat
15. By clicking on appropriate inline
keyboard of respective vendor can get
its details
If invoice number is valid then it will
show details related to that invoice
number.
16. Learning outcomes
Take away:
Telegramchatbot api & telegram api key library used with python programming.
Creation of telegram based chatbot.
Natural language processing concept i.e. In particular Natural Language understanding
used for intent and entities extraction from user chat.
Revisiting Python programming language concepts.
Rasa A.I frame work for NLU training and processing data. (A.I Engine of chatbot).
Regex in python for extracting numbers from string data.
17. System for adding new users to drishti dashboard.
Problem statement:
Previously there was manual process of adding users (new joiner’s/employee’s) from excel file received from H.R it was
done by python based script that converts excel data into nested dictionary in form of json file. That was done by technical
person. So now we have develop a database based system with functionality to view database entries into website and new
upload new data in specified file and format (json & excel csv file only). This online RDS database can be used any office
chatbot applications.
AWS
RDS
DATABASE
(online)
Employee Data
from .json file
Employee data
from excel .csv
format
Drishti Dashboard
(Website)
(any)
Chatbot
application
Upload data
(view data)
Send data
Get data
22. Dashboard for employee health monitoring System
Dashboard was made using HTML-CSS web technologies and python flask was web framework.
Rev 1 Rev 2
23. Results for Python based mailing server for automatically sending mails
.This system will automatically send mails to recipients in “To” and “CC”.
It is part of TML Arogya project and send employee sick details and his
data to respective authority.
Sending automated mails using python .
28. TATA Motors Contract Lifecycle Management (TML CLM).
Contract Lifecycle Management (CLM) is the proactive, methodical management of a contract from initiation through
creation, compliance and renewal. Implementing CLM can lead to significant improvements in cost savings and
efficiency. Understanding and automating CLM can also limit organizational liability and increase compliance with legal
requirements.
Background of project and key technologies.
Corporate legal and GDC working together to identify opportunities where digital technologies can augment contract
management
Identify gaps in existing scenarios and bring changes in existing processes
Identify opportunities in new contract formulation
Identify opportunities to monitor existing contracts
29. Contract Data loading:
Inserting Contract Type, Sections and Clauses which are manually added.
Contract Creation:
We can use loaded contract data to create the dynamic contract template and render data on the template, after this we
can also download the data in a word file.
Contract Suggestion:
Users can suggest the new clauses and the sections in particular contract type.
Custom Authentication:
Users can now register successfully only after adding their emails in the invite screen.
Email Invite:
We can Invite users to the portal by sending mail through the SMTP server.
Current features in the TML CLM:
33. Features of subscription page:
1) As per role of per only admin and super admin as right to access subscription page. User is only allowed to use
service.
2) On subscription page feature of three subscription gold, silver and platinum along with start date and end date of
subscription for contract life cycle management is shown.
3) On subscription page if user is registered then data in fields like email, name and phone section will be auto
filled from database table ‘users’ .we can also collect information like name, contact number from user. we will
provide an option for user to select product as per user need.
4) Only registered user is able to subscribe to CLM service.
5) User can be invited from email and can be registered to CLM service.
Developing Billing page generating invoices, Subscription pages and modification in database.
37. User has no access to billing & subscription option.
38.
39.
40. 1) In billing page one can see user details start date and end date ,subscription data in tabular form.we can set basic price value
of product from backend of code.
2) We create an export of excel file.
3) We can select user name drop down list and generate its invoice using open source FPDF library.
4) Generated invoice can be saved in pdf format.
5) Super admin will be able to see summary of customer data in tabular form on website.
41.
42. select customer and then clicking on generate invoice button automatically pdf invoice will be generated.
43. Click on export to excel for downloading excel file and viewing data in excel file .
44.
45. a) password_hash() method:
Syntax:
password_hash ( string $password , mixed $algo [, array $options ] ) : string
password_hash() creates a new password hash using a strong one-way hashing algorithm. password_hash() is compatible with crypt(). Therefore, password
hashes created by crypt() can be used with password_hash().
The following algorithms are currently supported:
PASSWORD_DEFAULT - Note that this constant is designed to change over time as new and stronger algorithms are added to PHP. For that reason, the
length of the result from using this identifier can change over time. Therefore, it is recommended to store the result in a database column that can expand
beyond 60 characters (255 characters would be a good choice).
PASSWORD_BCRYPT - Use the CRYPT_BLOWFISH algorithm to create the hash. This will produce a standard crypt() compatible hash using the "$2y$"
identifier. The result will always be a 60 character string, or FALSE on failure.
PASSWORD_ARGON2I - Use the Argon2i hashing algorithm to create the hash. This algorithm is only available if PHP has been compiled with Argon2
support.
PASSWORD_ARGON2ID - Use the Argon2id hashing algorithm to create the hash. This algorithm is only available if PHP has been compiled with Argon2
support.
Supported options for PASSWORD_BCRYPT:
salt (string) - to manually provide a salt to use when hashing the password. Note that this will override and prevent a salt from being automatically generated.
.
46. b) password_verify( ):
Syntax:
password_verify ( string $password , string $hash ) : bool
Verifies that the given hash matches the given password.
Note that password_hash() returns the algorithm, cost and salt as part of the returned hash. Therefore, all information that's
needed to verify the hash is included in it. This allows the verify function to verify the hash without needing separate storage
for the salt or algorithm information.
This function is safe against timing attacks.
51. Take away:
Frontend:HTML,CSS,BOOTSTRAP,PHP.
Backend:PHP programming.
Codeignitor MVC framework .
Creating invoice format using php FPDF library, making using of inbuilt php libraries for encryption & decryption of
passwords in php.
Database Management Systems : MYSQL PHP admin, XAMP server.
52. References
[1] Official Documentation Rasa Framework
https://rasa.com/docs/
[2] Udemy Course on python flask:
https://www.udemy.com/certificate/UC-8913f109-3fb0-48af-b575-c9c5a528450f/
[3] MySQL official documentation and learnt on W3C schools.
https://www.w3schools.com/sql/
[4] AWS official documentation on website.
https://docs.aws.amazon.com/
[5] Telegrambot and telegram api documentation on website.
https://core.telegram.org/bots/api
[6] codeignitor framework
https://codeigniter.com/user_guide/index.html