Integrating Intellectual Consciousness AI based on Ensemble Machine Learning for Price Negotiation in E-commerce using Text and Voice-Based Chatbot

.


Introduction
Contemporary e-commerce platforms employ diverse AI techniques to identify popular or top-selling products, enabling customers to easily search for items on their websites.However, customers often have to compromise on their product choices when the best items come with high price tags.Moreover, issues can arise when purchasing low-cost goods.Introducing a haggling feature for customers would address these concerns by allowing them to negotiate product prices.Negotiation involves the exchange of ideas that have the potential to meet everyone's needs.The seller sets a minimum price within their selling range, which serves as the lower bound, while the original price of the item represents the upper bound in the algorithm.To practically implement the model, a chatbot is integrated into the website using Flask APIs, enabling users to observe how the system operates in real-life scenarios.A chatbot is an AI program that engages in natural language conversations with users via messaging services, websites, mobile apps, or phone calls.It can handle most customer queries without the need for human intervention.Through the use of natural language processing (NLP) techniques, the chatbot determines user intent and responds accordingly.Additionally, chatbots can automate the Y. Challagundla et al.
2 negotiation process on e-commerce websites.This system allows users to interact freely with the software, input their budget constraints, and ask product-related questions to receive relevant answers.Similar to how logistics and retail businesses employ data to optimize delivery routes, the integration of chatbots in e-commerce will significantly impact sales and user engagement on websites, potentially attracting more customers due to the availability of reasonably priced products.However, a major drawback of conventional e-commerce platforms is the absence of a bargaining mechanism for lowering product prices.To address this limitation, a chatbot utilizing machine learning algorithms has been developed to improve its responses to customer inquiries over time.Unlike rule-based chatbots that rely on preprogrammed responses, machine learning chatbots can learn from user interactions, understand intent, generate appropriate responses, and adapt to new contexts.A classification algorithm is employed to generate predictions based on input data and potential outcomes.In supervised learning, the algorithm learns from labeled data to make predictions or judgments about new, unlabeled data.The objective is to develop a function that accurately maps input variables to output variables, enabling correct predictions for fresh inputs.Common examples of supervised learning techniques include K-Nearest Neighbors (KNN), support vector machines (SVM), and neural networks.SVM is particularly useful when classes cannot be linearly separated, as it locates the best hyperplane in the feature space to divide the classes.KNN, on the other hand, makes predictions based on distances between new data points and existing data points in the training set.This non-parametric algorithm is often applied to binary classification tasks.To create an online shopping application, the paper proposes incorporating user registration, login functionality, chatbot-assisted negotiation, product browsing, order viewing, review posting, review reading, and review sentiment analysis.The chatbot engages with customers, aiding them in negotiating fair prices for products.Both voice commands and text-based chat options are provided for negotiating product prices.The paper suggests employing different machine learning algorithms, specifically KNN and SVM with ensemble learning, to enhance the chatbot's negotiation capabilities.Overall, the paper presents a technically robust approach, discussing various AI techniques, classification algorithms, and their practical implementation in an online shopping application with chatbot-assisted negotiation.

Related Work
For the purpose of developing a dialogue agent for longterm planning, FAIR research-ers came up with the concept of dialogue rollout.While it has been shown that each of these agents is capable of successfully negotiating with others in particular situations, they frequently lack the support for natural language processing necessary to enable interactions of the kind that take place in everyday life.To get around this limitation, this study provides an E-Negotiator chatbot agent that incorporates a number of research initiatives.First, it was found that creating those agents requires more than just modifying existing agents to include an NLP module.Issue-by-issue conversations and partial agreements are some of the strategies that should be adopted by the agents that enable Natural Language.This agent's reasoning is constrained, namely anchoring and Aspiration Adaptation Theory, this agent operates (AAT).Complete offers are made at the outset of encounters, acting as the agent's anchor.If this offer is rejected, the agent moves on to partial agreements and suggests the following matter for discussion in light of the outcomes of earlier conversations [2].
Extensible Markup Language (XML) [19], which is used to create conversational agents (chatbots), is the ancestor of Artificial Intelligence Markup Language (AIML).Many efforts have been created to create conversational agents.However, its accessibility, flexibility, and low price make a variety of applications conceivable.This study provides a quick overview of a few applications that employ AIML chatbots for their conversational services in this paper.These applications pertain to e-government, e-learning, cultural heritage, web base models, dialogue models, semantic analysis frameworks, humorist experts, network management, and adaptive modular architecture as wed.In this instance, in addition to offering helpful services, they also communicate with clients and offer solutions to their problems using AIML chatbots rather than actual people.To give effective service, this is becoming more and more popular among business owners and users [3].Numerous computerized negotiation agents have been developed to this point.Although it has been demonstrated that each of these agents may successfully bargain with individuals in particular settings, they lack the natural language processing (NLP) tools necessary to support interactions of the sort that occur in everyday life.This research has investigated how this constraint can be addressed by modifying the current agents.After conducting a thorough analysis of how agents bar-gain with human beings and discovered that merely adding an NLP module to alreadyexisting agents is insufficient to produce these agents.Instead, to handle partial agree ments and issue-by-issue interactions, the agents' methods must be changed [4].Automated negotiation agents that can successfully negotiate with people must con-sider the fact that people differ in their behavior and that each person may negotiate differently.As a result, automated agents must rely on an effective opponent modeling component to simulate their partner and modify their behavior accordingly.This study introduces the KBAgent.The KBAgent is an automated negotiator that only engages in one negotiation with each person while using data from prior negotiations to model opponents generally.The probability of acceptance and potential counterproposals are extracted from the database.In experiments involving real subjects, the KBAgent out-performs another automated negotiator who has been demonstrated to be effective in negotiations with real subjects in terms of utility values.In terms of individual utility, the KBAgent also achieves agreements much more successfully than its human counterparts in the same job [21].

Methodology
The haggling process incorporates a dataset of e-commerce items containing product prices along with their respective minimum prices.The dataset is stored using MariaDB to establish a comprehensive database.To anticipate pricing, SVM and KNN algorithms analyze various dataset attributes, such as the minimum price, category, likes, and more.By considering the results from both algorithms, the initially agreed-upon price is determined through an ensemble approach.Preprocessing plays a crucial role in our workflow as it significantly enhances the accuracy and performance of the machine learning algorithms employed.To achieve this, we utilized the min-max scaler preprocessing method from the sklearn library.This method normalizes the data by scaling it to a predefined range, often between 0 and 1.Given the wide range of values present in our product pricing data, preprocessing proves to be highly beneficial.Scaling the data simplifies comparison and analysis, leading to more reliable results.In our approach, we split the data into a training set (80%) and a testing set (20%) to evaluate the model's performance.An ensemble model was then trained using SVM and KNN algorithms, combining their predictions for more robust results.To ensure optimal accuracy, we employed GridSearchCV to fine-tune the hyperparameters of the SVM and KNN models.This process helped us identify the best parameter configurations that enhance the models' performance.The e-commerce website's Price Negotiating Chatbot with Text & Voice functionality includes sign-up and login pages for users to access the platform.Upon signing up and logging in, users can browse the product list and select either Text or Voice mode to interact with the chatbot.The chatbot understands commands such as "starting price" and "final price."The starting price, determined by the ensemble model of SVM and KNN algorithms, is provided to the user.To calculate the final cost, an additional 5% discount is applied.The platform also offers features such as order viewing, posting reviews, and analyzing review sentiment, enabling users to review and analyze their orders placed at the agreed-upon price.Ensemble approaches are utilized to enhance the stability and predictive capabilities of models by combining multiple models together.In this case, we have created an ensemble using KNN and SVM.This approach leverages the strengths of different machine learning models, where each model excels at capturing specific aspects of the data.By combining the outputs of these models, we obtain more accurate predictions.The ensemble balances the biases and variances of individual models, resulting in a composite prediction that outperforms any single model.This technique improves the overall performance of the model and is commonly used when parallel base learners are available.The KNN algorithm is considered an instance-based or lazy learning approach because it does not transform training instances into generalized statements.Instead, it makes predictions by identifying similar characteristics and assigning the new instance to the most relevant category among the available instances, without relying on any underlying assumptions about the data.KNN measures the distance between points using Euclidean distance calculation.However, it is important to note that KNN can have a high computational cost due to the need to calculate distances between all instances in the dataset.Support vector machines (SVM) are robust supervised learning algorithms used for regression and classification tasks.They define a discriminative classifier in the form of a separating hyperplane.By creating an optimal hyperplane, SVM can effectively classify new samples based on labeled training data.Different variants of SVMs are used to tackle various machine learning challenges, such as support vector regression (SVR), which extends the capabilities of support vector classification (SVC).SVM aims to maximize class separation by leveraging the concept of margins.One of the advantages of SVM is its efficiency and speed, particularly in high-dimensional spaces.

Fig. 1. Implementation Methodology
Customers have the option to purchase an item immediately without engaging in negotiation, or they can choose to haggle with the assistance of the Chatbot.For basic inquiries, customers can interact with the Chatbot, which accesses the database.When the customer opts for negotiation, the backend executes machine learning algorithms to determine the estimated pricing and initiate the negotiation process.The Chatbot identifies negotiation intents and employs suitable negotiation algorithms.The negotiation continues until the minimum price is reached, at which point the customer can decide to proceed with the purchase at any intermediate price or add the item to their shopping cart for a discounted price.In a real-world e-commerce setting, the lowest price of a product can be subject to change based on the decisions of the product seller.Consequently, the prices paid by customers will also be adjusted to align with any modifications in the lowest price.To implement such a system on e-commerce websites, businesses need to carefully manage their offers and special discounts, ensuring that customers can still engage in price negotiations while maintaining a balance between negotiated prices and other promotional offerings.

Algorithm for Negotiation
1.An ensemble model combining Support Vector Machines (SVM) and K-Nearest Neighbors (KNN) is used to predict the first negotiated price for the customer.
2. If the predicted price is lower than the minimum price or higher than the product price, or if it is significantly lower than the first price, the price is adjusted.The new price is calculated as follows: product_price -(product_price -min_price) * 0.1.This adjustment ensures that the price is not too far from the available discount.
3. If the customer is satisfied with the price, they can proceed to buy the product.Otherwise, they have the option to engage in further negotiation.
4. If the customer does not agree with the initial price, the maximum discount available for the product is calculated as a percentage.
5. The price is further decreased by applying a 5% discount to the previous price.The new price is calculated as follows: previous_price -(previous_price) * 0.05.
6.If the customer is satisfied with the new price, they can proceed with the purchase.
7. If the customer is still not satisfied, the negotiation process continues, starting from the most recent negotiated price (previous price) instead of the product's initial price.This allows for iterative negotiation attempts.
By leveraging a trained model based on historical user interactions with the chatbot, predictions can be made regarding the user's response.Various machine learning algorithms such as decision trees, support vector machines (SVMs), or neural networks are employed to enhance the accuracy of these predictions.Additionally, variables such as the user's purchasing history, preferences, and browsing habits can be considered to further refine the predictions.
Based on the anticipated response, the chatbot can adapt its offer or negotiation strategy, increasing the chances of a successful sale while ensuring customer satisfaction.

Results and Discussion
In this Work the main motto is to design E-commerce application where user can browse products list and then select Chatbot [14] as Text or Voice and then negotiate with Chatbot.Users can look all the reviews given by other user on a specific product before buying the product and finalize their price after having various interactions with Chatbot.Chatbot will understand two types of voice command such as 'first price' which will give reasonable price to the customer and if customer does not satisfy then it will ask for 'final price' and then Chatbot will add another 5% discount as final price and then serve to customer [15].
If say another word other than 'first price' or 'final price' then Chatbot will give error   In the above screen all users can view all reviews given by other users and their sentiments.Similarly, you can sign up, login and view products list and negotiate with Chatbot using text and voice.

Conclusion
The rise of e-commerce has significantly changed how consumers purchase commodities.Numerous benefits of online shopping include accessibility to an enormous variety of goods and the flexibility to shop whenever and from wherever.However, negotiating product prices is one of the difficulties of e-commerce systems.Customers are unable to bargain over costs with salespeople, unlike in conventional physical shops.Several companies have used chatbots to facilitate negotiations with customers in order to overcome this challenge.Computerized conversational agents known as chatbots may con-verse with clients, offer assistance, give suggestions, and even haggle over prices.How-ever, creating a chatbot that can successfully haggle over prices necessitates a thorough comprehension of the client's requirements.One problem with some chatbots is that they occasionally take prices higher than the minimum price, which, if it happens frequently, can result in losses for the vendor.Use of price prediction algorithms that can precisely evaluate a product's value and offer a starting point for discussions is crucial to avoiding this issue.This goal has been attained using machine learning methods like Support Vector Machines (SVM) and K-Nearest Neighbor (KNN).However, when negotiating with customers, it's essential to understand their preferences and respond appropriately.It's also important to predict prices accurately.The broad knowledge bases of KB agents allow them to engage in sophisticated dialogues with customers, making recommendations that are specifically catered to their needs and tastes and negotiating pricing.Businesses can improve the quality of their discussions with customers and offer a more specialized shopping experience by integrating a KB agent into the chatbot application.In conclusion, chatbots and KB agents offer potential alternatives, even though e-commerce has posed certain difficulties in negotiating goods costs.Companies may provide their customers a more effective and customized shopping experience by utilizing the proper mix of knowledge-based agents and machine learning algorithms.

Fig 5 .
Fig 5. Price on a Product is Negotiated with Chatbot Interaction