DIGITAL AI ASSISTED CHATBOT FOR LEGAL�SUPPORT MARGINALIZED COMMUNITIES.pptx

sivakumar896484 103 views 35 slides Jun 12, 2024
Slide 1
Slide 1 of 35
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35

About This Presentation

DIGITAL AI ASSISTED CHATBOT FOR LEGAL�SUPPORT MARGINALIZED COMMUNITIES
with telegram not


Slide Content

DIGITAL AI ASSISTED CHATBOT FOR LEGAL SUPPORT MARGINALIZED COMMUNITIES SUBMITED BY VISHAL. S SHIVA.K.M SUSNITHAN.R

INTRODUCTION The development of technology allows introducing more advanced solutions in everyday life. This makes work less exhausting for employees, and also increases the work safety. As the technology is developing day by day people are becoming more dependent on it, one of the mostly used platform is computer. We all want to make the use of these computers more comfortable, traditional way to give a command to the computer is through keyboard but a more convenient way is to input the command through voice. Giving input through voice is not only beneficial for the normal people but also for those who are visually impaired who are not able to give the input by using a keyboard. For this purpose, there is a need of a law virtual assistant which can not only take command through voice but also execute the desired instructions and give output either in the form of voice or any other means. OBJECTIVE OF THE PROJECT

INTRODUCTION A Law Virtual Assistant is the software that can perform task and provide different services to the individual as per the individual’s dictated commands. This is done through a synchronous process involving recognition of speech patterns and then, responding via synthetic speech. Through these assistants a user can provide a legal support. It is typically a cloud-based program that requires internet connected devices and/or applications to work. The technologies that power virtual assistants are machine learning, natural language processing and speech recognition platforms. It uses sophisticated algorithms to learn from data input and become better at predicting the end user's needs.

INTRODUCTION The main purpose of this project is to build a program that will be able to service to humans like a personal assistant. This is an interesting concept and many people around the globe are working it. Today, time and security are the two main things to which people are more sensitive, no one has the time to spoil; nobody would like their security breach, and this project is mainly for those kinds of people.   This system is designed to be used efficiently on desktops. Virtual Assistants software improves user productivity by managing routine tasks of the user and by providing information from an online source to the user. This project was started on the premise that there is a sufficient amount of openly available data and information on the web that can be utilized to build a virtual assistant that has access to making intelligent decisions for routine user activities. MOTIVATION

INTRODUCTION The mass adoption of artificial intelligence in users’ everyday lives is also fuelling the shift towards voice. The number of IoT devices such as smart thermostats and speakers are giving voice assistants more utility in a connected user’s life. Smart speakers are the number one way we are seeing voice being used. Many industry experts even predict that nearly every application will integrate voice technology in some way in the next 5 years. The use of virtual assistants can also enhance the system of IoT (Internet of Things). Twenty years from now, Microsoft and its competitors will be offering personal digital assistants that will offer the services of a full-time employee usually reserved for the rich and famous. APPLICABILITY VIRTUAL ASSISTANT

LITERATURE REVIEW TERMINOLOGY : Human-Computer Interaction, Conversational Interface, Conversational agents and Chatbots HUMAN-COMPUTER INTERACTION Human-Computer Interaction (HCI) is a research field that focuses on individuals to communicate with a machine. HCI reached traction as a research field during the 1980s, at the same time, the personal computer (PC) increased in popularity. The PC made technology more available for the people by enabling peripherals to be in a smaller setup. HCI, as a research method, has centred on the design, evaluation and implementation of interactive systems. Human-Computer Interaction, as a research field, initially had focused on the PC, it has over time developed to incorporate the design of a more extensive array of topics and devices as related to information and communication technology (ICT). HCI as a field of research has since its inception been in constant growth which has changed its rules and how Human-Computer Interaction researchers approach their case. Bødker (2015) illustrates the advancement of HCI by breaking it into three phases, attributed to as waves of HCI. Bødker (2015, p. 24) describes the first wave motivated by cognitive science and human factors. In contradiction, in the second wave, the focus shifted to how groups could use software applications in work settings. In a past article by Bødker (2006, p. 1), the author explains the variations in the second wave as “ rigid guidelines, formal methods, and systematic testing were mostly abandoned for proactive methods such as a variety of participatory design workshops, prototyping and contextual inquiries”.  Ultimately, the third wave expands the focus and brings awareness to topics which drew less attention in the past such as context, culture and values, along with the role of the researcher ( Bødker , 2015). Harrison et al. (2007) conducted a related investigation on the growth of HCI, and they refer to the phases as “the three paradigms of HCI ”

LITERATURE REVIEW HCI AND CONVERSATIONAL INTERFACES A conversational interface refers to an interface where it is possible to interact with a computer using natural language. In the field of conversational interfaces, it is likely to distinguish interfaces from each other depending on the way one interacts with it and its design. There are for instance chatbots where the chatbot interacts with a user utilising text ( McTear , Callejas , & Griol , 2016b), whereas voice user interfaces designed around using the voice as the primary input ( Porcheron , Fischer, Reeves, & Sharples , 2018). In the tech industry, there have, in recent years, been an optimism towards conversational interfaces as a way to interact with computers ( Følstad & Brandtzæg , 2017). According to Luger & Sellen (2016), as conversational interfaces though have become more prevalent, there has been designed many poorly interfaces which do not meet the actual desires and needs of the users. Følstad & Brandtzæg (2017) touches upon the same topic and say that are many challenges reveal themselves when designing conversational interfaces and that conversational interface has not received enough attention from HCI researches. They, therefore, do argue that HCI researchers should embrace Human-Chatbot interaction as an area of design and practice. Though, according to Følstad et al. (2018) in a more recent paper, the interest among researchers to research and design chatbots have now grown. The primary objective is to develop a lawyer chatbot, with a conversational interface for law firms and clients as a proposed contribution to the field of HCI .

LITERATURE REVIEW CHATBOT According to Weiser (1991), the most powerful technologies are the ones that pass. They devise a framework of a regular life till they are interchangeable. What is assimilated from this quotation is that technologies executed, accepted and often used by the general public is taken for granted while becoming indispensable and identified as an everyday life necessity. At a certain period, there will be a point of no return, ensuring that the stated technology will be part of everyone’s life. Benton & Radziwill (2017) propose that this could happen with chatbots. According to Benton & Radziwill (2017), a chatbot has the illusion of interacting with humans online, while interacting with a system, using natural language input. Others interpret it as a program which mimics human conversations while utilising artificial intelligence (AI). Wong (2016) & Scharl (2004) describes that chatbots are software that allows text-based communications making the use of natural language to process conversations. It is important for the user’s assent of chatbots to mimic real human behaviour, which additionally highlights the large knowledge base importance, i.e. the current guidelines a chatbot follows ( Scharl , 2004). With more consumers both online and in the real world, the challenge of reaching out turns into a tricky job. Chatbots will someday be the best way for companies to relate with the its consumers and may determine upon a businesses' competitiveness (Moore, 2017). Moreover, crucial improvements regarding the growth of conversational services and the progress in Artificial Intelligence (AI) credited mainly to the new interest in chatbots (Guzman & Pathania , 2016).

LITERATURE REVIEW CHATBOTS AND CONVERSATIONAL AGENTS Chatbots and conversational agents give form to a conversational interface. The application of logic to the user interface parses language to understand the intent of a user and acts on it. Although the terms "conversational agents" and "chatbots" are interchangeably used in throughout this literature, the following contrast is made. A conversational application is a "chatbot" if its only purpose is to bridge a conversation between the application and the user interface. In contrast, conversational agents are much more obscure. Conversational agents have an additional layer of logic supported by various subsystems that is available for connection. However, a chatbot has an emphasis on the prefix "chat", i.e., mimicking a human-like interface. Conversational agents have abilities to aid users in the performance of intricate tasks. On the one hand, chatbots have a direct mapping between intents and application capabilities. For instance, companies like Pizza Hut have a chatbot on the social media platform, Facebook, which can customise and place an order for a pizza. At the same time, it can also be ordered on their website. On the other hand, conversational agents have a mapping between application capabilities and user intents are more intricate. Fast et al. (2017), describes Iris, as a conversational agent which aids users with tasks related to data science. Iris draws on human conversational pattern to make a combination of commands which allows users to complete tasks other than the one is was designed to perform.

LITERATURE REVIEW Embodied Conversational Agent Embodied conversational agents display a behaviour that is lifelike and uses a range of communication behaviours (i.e., verbal and non-verbal) that is similar to a real human-like conversation ( Cauell et al., 2000). These are more complex advanced intelligence components not discussed in this thesis.

EXISTING SYSTEM This project describes one of the most efficient ways for type recognition . It overcomes many of the drawbacks in the existing solutions to make the Virtual Assistant more efficient. It uses natural language processing to carry out the specified tasks. It has various functionalities like network connection and managing activities by just voice commands. It reduces the utilization of input devices like keyboard. This project describes the method to implement a virtual assistant for desktop using the APIs. In this module, the typing commands are converted to text through Google Speech API. Text input is just stored in the database for further process. It is recognized and matched with the commands available in database. Once the command is found, its respective task is executed as text or through user interface as output.

DISADVANTAGES They propose a new detection scheme that gets two similar results which could cause confusions to the user on deciding the actual/desired output. Though the efficiency is high of the proposed module, the time consumption for each task to complete is higher and also the complexity of the algorithms would make it very tough to tweak it if needed in the future.

PROPOSED SYSTEM 1.QUERIES FROM THE WEB: Making queries is an essential part of one’s life. We have addressed the essential part of a netizen’s life by enabling our voice assistant to search the web. Virtual Assistant supports a plethora of search engine like Google displays the result by scraping the searched queries . 2. ACCESSING CASE: Being up-to-date in this modern world is very much important. In that way meat a lawyer. And its one is more expecive . This application will be assets to a case. 3. TO SEARCH SOMETHING ON WIKIPEDIA: Wikipedia's purpose is to benefit readers by acting as a widely accessible and free encyclopaedia; a comprehensive written compendium that contains information on all branches of knowledge. 4. ACCESSING CASE DETAIL: judgment have remained as a main source of entertainment, one of the most prioritized tasks of this virtual assistants. you can see any judgment of your cast. 5. OPENING CHAT BOT: Virtual Assistant is capable of opening your chat bot.

ADVANTAGES Platform independence Increased flexibility  Saves time by automating repetitive tasks Accessibility options for Mobility and the visually impaired Reducing our dependence on screens Adding personality to our daily lives More human touch Coordination of IoT devices Accessible and inclusive Aids hands free operation

SYSTEM SPECIFICATIONS HARDWARE REQUIREMENTS Processor - Intel Pentium 4 RAM - 512 MB Hardware capacity:80GB Monitor type- 15inch colour monitor CD-Drive type- 52xmax Mouse Microphone Personal Computer / Laptop SOFTWARE REQUIREMENTS Operating System - Windows Simulation Tools - Visual Studio Code Python - Version 3.12.2 Packages - Pyttsx3 Flask json joblib numpy pandas

ARCHITECTURE DIAGRAM An architectural diagram is a diagram of a system that is used to abstract the overall outline of the software system and the relationships, constraints, and boundaries between components. It is an important tool as it provides an overall view of the physical deployment of the software system and its evolution roadmap. An architecture description is a formal description and representation of a system, organized in a way that supports reasoning about the structures and behaviors of the system. After going through the above process, we have successfully enabled the model to understand the features.

DIAGRAM FIGURE 1.1 SYSTEM ARCHITECTURE DIAGRAM

DATAFLOW DIAGRAM An activity diagram is a behavioral diagram. It depicts the behavior of a system. An activity diagram portrays the control flow from a start point to a finish point showing the various decision paths that exist while the activity is being executed. Initially, the system is in idle mode. As it receives any wakeup call it begins execution. The received command is identified whether it is a question or task to be performed. Specific action is taken accordingly. After the question is being answered or the task is being performed, the system waits for another command. This loop continues unless it receives a quit command.

DIAGRAM FIGURE 1.2 DATAFLOW DIAGRAM

ALGORITHM An algorithm is a procedure used for solving a problem or performing a computation. Algorithms act as an exact list of instructions that conduct specified actions step by step in either hardware- or software-based routines. Algorithms are widely used throughout all areas of IT. In mathematics, computer programming and computer science, an algorithm usually refers to a small procedure that solves a recurrent problem. Algorithms are also used as specifications for performing data processing and play a major role in automated systems. An algorithm could be used for sorting sets of numbers or for more complicated tasks, such as recommending user content on social media. Algorithms typically start with initial input and instructions that describe a specific computation. When the computation is executed, the process produces an output.

ALGORITHM The class which we are using is called Recognizer . It converts the audio files into text and module is used to give the output in speech. Energy threshold function represents the energy level threshold for sounds. Values below this threshold are considered silence, and values above this threshold are considered speech. 17 Recognizer instance.adjust_for_ambient_noise (source , duration = 1), adjusts the energy threshold dynamically using audio from source (an AudioSource instance) to account for ambient noise. SPEECH RECOGNITION MODULE

ALGORITHM Pyttsx3 is a text-to-speech conversion library in Python. And can change the Voice, Rate and Volume by specific commands. Python provides an API called Speech Recognition to allow us to convert audio into text for further processing converting large or long audio files into text using the Speech Recognition API in python. We have Included sapi5 and espeak TTS Engines which can process the same. SPEECH TO TEXT & TEXT TO SPEECH CONVERSION

ALGORITHM The said command is converted into text via speech recognition module and further stored in a temp . Then , Analyze the user’s text via temp and decide what the user needs based on input provided and runs the while loop . Then , Commands are executed. PROCESS & EXECUTES THE REQUIRED COMMAND

MODULES FLASK Flask is a popular Python web framework that allows you to build web applications quickly and with a minimalistic approach. It is lightweight, flexible, and easy to learn, making it a great choice for developing small to medium-sized web applications and APIs. Key features of Flask include: Minimalistic : Flask provides just what you need to get started building a web application, without imposing any particular way of structuring your application. Routing : You can define URL routes using decorators, allowing you to map URLs to Python functions easily. Template Engine : Flask comes with Jinja2, a powerful and designer-friendly template engine, for generating HTML pages. HTTP Request Handling : It provides simple ways to handle HTTP requests and access request data such as form data, query parameters, and request headers. Session Management : Flask supports client-side sessions, allowing you to store user-specific data across multiple requests. Integration with WSGI : Flask is based on the Werkzeug WSGI toolkit, making it compatible with other WSGI components and servers. Extensions : Flask has a rich ecosystem of extensions that add extra functionality to your applications, such as support for database integration, authentication, and more .

MODULES JSON In Python, JSON (JavaScript Object Notation) is a lightweight data interchange format commonly used for transmitting data between a server and a web application, or between different parts of an application. Python has built-in support for JSON through the json module, which provides functions for encoding Python data structures into JSON strings, and for decoding JSON strings into Python data structures . JOBLIB joblib is a Python library primarily used for saving and loading Python objects (typically data structures) to and from disk efficiently. It is particularly useful for saving the results of expensive computations, such as machine learning model training, to avoid recomputation in the future.

MODULES NUMPY NumPy , short for Numerical Python, is one of the fundamental packages for numerical computing in Python. It provides support for large, multi-dimensional arrays and matrices, along with a collection of mathematical functions to operate on these arrays efficiently. NumPy is widely used in scientific computing, engineering, and data analysis applications due to its powerful array manipulation capabilities . PANDAS Pandas is a popular Python library used for data manipulation and analysis. It provides easy-to-use data structures and functions for working with structured data, making it a powerful tool for tasks such as data cleaning, transformation, exploration, and visualization. Pandas is widely used in data science, machine learning, and other domains where data handling and analysis are crucial.

MODULES OS The os module is a built-in module which provides functions with which the user can interact with the os when they are running the program. This module provides a portable way of using operating system-dependent functionality. This module has functions with which the user can open the file which is mentioned in the program.

SAMPLE CODE from flask import Flask , request , make_response , jsonify , render_template import json import joblib import numpy as np import pandas as pd import os data = pd . read_csv ( "helpers.csv" ) data [ 'Organisation' ]. fillna ( '' , inplace = True ) data [ 'Contact' ]. fillna ( '' , inplace = True ) selected_features = [ 'Access to Information' , 'Citizenship ' ,         'Corruption' , 'Criminal Justice' , 'Economic Empowerment' ,         'Education' , 'Environmental Justice' , 'Family ' ,         'Gender-based violence' , 'Generalist Legal Services' , 'Governance' ,         ' Health' , "Women's Rights" ]

SAMPLE CODE def make_description ( lawyer_id ):     row = data . iloc [ lawyer_id ]     name = str ( row [ "Name" ])     org = str ( row [ "Organisation" ])     contact = str ( row [ 'Contact' ])     return str ( name + '.' + org + '.' + contact ) def make_query ( text ):     result = []     for feature in selected_features :         if feature . lower () in text :             result . append ( 1 )         else :             result . append ( )     return result

SAMPLE CODE Logo_folder = os . path . join ( 'static' , ' logo_folder ' ) # initialize the flask app app = Flask ( __name__ ) knn = joblib . load ( " knn.pickle " ) app . config [ 'UPLOAD_FOLDER' ] = Logo_folder # default route @ app .route ( '/' ) def index ():     full_filename = os . path . join ( app . config [ 'UPLOAD_FOLDER' ], 'hello.png' )     return render_template ( "home.html" , user_image = full_filename ) @ app .route ( '/registration' ) def registration ():     return render_template ( "registration.html" ) @ app .route ( '/user-registration' ) def Userregistration ():     return render_template ( "userRegistration.html" ) @ app .route ( '/review' ) def review ():     return render_template ( 'review.html' )

SAMPLE CODE @ app .route ( '/ webhook ' , methods = [ 'GET' , 'POST' ]) def webhook ():     # return response     req = request . get_json ( force = True )     text = req .get ( " queryResult " ).get( " queryText " )     print ( text )     query = make_query ( text )     query = np . array ( query ). reshape ( 1 , - 1 )     _ , indices = knn .kneighbors ( query )     top_match = indices [ ][ ]     second = indices [ ][ 1 ]     third = indices [ ][ 2 ]     result = "1. " + make_description ( top_match ) + "  2. " + make_description ( second ) + "  3. " + make_description ( third )     #result = "1. "+ result1 + "  2.  " + result2 + "  3.  " + result3     result = result + "Would you like us to connect you to these lawyers?"     return make_response ( jsonify ({ ' fulfillmentText ' : result })) # run the app if __name__ == '__main__' :     app . run ( debug = True )

SCREEN SHOTS Telegram Slack

CONCLUTION Through this virtual assistant, we have automated various services using a single line command. It eases most of the tasks of the user like searching the web, playing music and doing Wikipedia searches. We aim to make this project a complete server assistant and make it smart enough to act as a replacement for a general server administration. The project is built using available open-source software modules with visual studio code community backing which can accommodate any updates in future. The modular nature of this project makes it more flexible and easier to add additional features without disturbing current system functionalities. It not only works on human commands but also give responses to the user based on the query being asked or the words spoken by the user such as opening tasks and operations. The application should also eliminate any kind of unnecessary manual work required in the user life of performing every task.

FUTURE ENHANCEMENT The virtual assistants which are currently available are fast and responsive but we still have to go a long way. The understanding and reliability of the current systems need to be improved a lot. The assistants available nowadays are still not reliable in critical scenarios. The future plans include integrating our virtual assistant with mobile using React Native to provide a synchronised experience between the two connected devices. Further, in the long run, our virtual assistant is planned to feature auto deployment supporting elastic beanstalk, backup files, and all operations which a general Server Administrator does. The future of these assistants will have the virtual assistants incorporated with Artificial Intelligence which includes Machine Learning, Neural Networks, etc. and IoT .