GithubHelp home page GithubHelp logo

sauravkb94 / chatbot Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.28 MB

A chatbot that responds to a specific text that you provide. using nltk lib (NLP). Cosine similarity is used and build an application

Jupyter Notebook 99.78% Python 0.22%

chatbot's Introduction

Chatbot PyPI - Python Version

GitHub Repo stars Open In Colab

Chatbot

A chatbot that responds to a specific text that you provide using nltk lib (NLP) and Cosine similarity for similarity score and builds a basic application

nlp_utils- nltk stand for natural lang toolkit used for building python prohrams which work with human lang data and natural language processing. string- is concatenation of ASCII Lowercase and ASCII uppercase string constant pandas- python lib used to create data frames and help us to manipulate these data frames (read, load and manipulate the dataset. matplotlib.pyplot -is a collection of functions that make matplotlib work like MATLAB. Each pyplot function makes some change to a figure: e.g., creates a figure, creates a plotting area in a figure, plots some lines in a plotting area, decorates the plot with labels, etc.

In this, I have divided the dataset into Query and Response using Panda function

  1. Data visualization
  • I used sentiment analysis (to verify the repetition and if the statement is positive, negative or natural) - import SentimentIntensityAnalyzer, it does have a dictionary which already assigned values for corresponding. from nltk.sentiment.vader NLTK Vader sentiment analyzer is a rule-based model for sentiment analysis of social media text. It is a part of the Natural Language Toolkit (NLTK), which is a popular Python library for working with human language data. The Vader model uses a lexicon of words and their sentiment scores to determine the sentiment of a given text. It also takes into account punctuation, capitalization, and intensifiers to provide a more accurate sentiment score. The Vader model is particularly useful for analyzing short texts such as tweets, reviews, and comments.

Example : - why would i do that? - neg: 0.0, neu: 1.0, pos: 0.0, compound: 0.0,

  • import WordCloud, A word cloud is a visual representation of the most frequently used words in a text. The words are arranged in a way that the more frequently a word appears in the text, the larger and more prominent it appears in the word cloud
  1. Text Normalization
  • we change our text and convert the text into a usable form, where we remove all the specail chars and we convert the text in lowercase, also remove any non ASCII characters and alphanumeric values as well. help us to covert in upper to lower,number into words, remove white space, expand abbreviation and also we can remove words(most fequently words).import re regular expressions

Import tfidf victimizer will fit_transform takes to feature vectors, which can be used as an input to estimate.So it converts each token or a word to a feature index in the matrix where each unique token gets a feature index.Then we have changed it to an array once we had converted our query column into TFIDF. I have used cosine_distance(To measure the similarity, it is one of the most widely used and powerful similarity measures in data science, and it is used in the cases of NLP or natural language processing used for information retrieval. It is also used in multiple applications).

chatbot's People

Contributors

sauravkb94 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.