Skip to content

FranLeston/nlp_chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NLP Chat Flask Server

alt text

About

This project consists of a Python Flask API using MySQL. The endpoints will allow you to create a user, then once created, let you post chat messages to the api. Before the chat message is stored in the DB, it is ran through the NLPTK library. The natural language processing algorithm will assign a value of -1 to 1 to the message. -1 being the most Negative sentiment, 0 is Neutral, and 1 being the most positive.

In this repo, there is also a jupiter notebook in which you may execute the requests in real-time to get an overall analysis of the chat.

Installation

To get the server up and running you must first pip install the libraries in the requirements.txt and have a valid MYSQL DB_URL in a .env file. Afterwards, you may run Python3 main.py and the server should spin up on localhost.

A current build is hosted on Heroku with VueJs in which you and others can participate in the chat in real-time.

The Heroku URL is: https://ironhack-nlp-client.herokuapp.com/

The repo for my VueJS Client is: https://github.com/FranLeston/nlp_chat_client

API ENDPOINTS

CREATE USER -- POST https://ironhack-nlp.herokuapp.com/api/users { "name": "Emilio", "sex": "M", "age": 23, "role": 0 }

GET ALL USERS -- GET https://ironhack-nlp.herokuapp.com/api/users

GET USER BY ID -- GET https://ironhack-nlp.herokuapp.com/api/users/125

GET ALL MESSAGES -- GET https://ironhack-nlp.herokuapp.com/api/chats

CREATE MESSAGE -- POST https://ironhack-nlp.herokuapp.com/api/chats { "user_id": 12, "message": "A chat message" }

Here is a schema of the simple db setup

alt text

Finally, here is an example of a KDE chart inside notebooks/chatAnalisys.ipynb

alt text

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published