Skip to content

Clapiniella/API-project

Repository files navigation

API project

The goal of this project is to analyze the conversations of my team to ensure they are happy 😃

Main goal: Analyze the conversations coming from a chat like slack

How ?

  • (L1🧐) Writing an API in bottle just to store chat messages in mySQL

  • (L2🥳) Extracting sentiment from chat messages and perform a report over a whole conversation

  • (L4🤭) Recommending friends to a user based on the contents from chat documents using a recommender system with NLP analysis

  • (L3😎) Creating an image of the API with Docker

API endpoints

@route('/hello/')

- Gives you the chance to say hello to your own self, very useful if you are just testing the API works 

@get('/idUser/user')

- Returns every user in DB, UserId and their names

@get('/idUser/')

- Returns every message a user has sent, given an UserId

@get('/mensajes/')

- Returns the user name and how many messages has ever sent, given an UserId

@get('/chat/<chat_id>/list')

- Returns a list of all the messages in a chat, given an ChatId

@post('/user/create')

- Create a user and save into DB
- Returns the UserId

Params: UserName

@post('/create/chat')

- Create a conversation in the DB, to load messages
- Returns the ChatId

@post('/chat/addmessage')

- Add a message to an existing conversation into DB
- Returns the MessageId

Params: Text, ChatId and UserId

@get('/user/<user_id>/sentiment')

- Returns a JSON array with the results of analyzing all messages from a User, given a UserId

{'neg': 0.1, 'neu': 0.776, 'pos': 0.125, 'compound': 0.501} used nltk for this task

@get('/chat/<chat_id>/sentiment')

- Returns a JSON array with the results of analyzing all messages from a Chat, given a ChatId

{'neg': 0.209, 'neu': 0.69, 'pos': 0.101, 'compound': -0.834} used nltk for this task

@get('/findafriend/')

- Given a UserName, it recommends you a friend based on similarities with other Chat's users

Used Sklearn for this task

Links - API dev in python

About

Create an API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors