This is a final project of my course Information Retrieval. The aim of the project is to find a match for the users based on their personality. We've created a small database of 500 profiles (250 male and 250 female). The new user needs to create a profile and then run the matchmaker to get the list of top 10 matches which are saved in a text file.
- You need to have node.js and Python installed in order to run this project.
- You need to create a Personality Insights service instance on IBM Cloud to generate credentials to use the Watson Personality Insights API. There's a short tutorial here.
- Clone this repository using
git clone https://github.com/nirmaldalmia/IR-Matchmaker - Create a
.envfile in the root directory. The.envfile will look something like the following:PERSONALITY_INSIGHTS_API_KEY = <your_api_key> PERSONALITY_INSIGHTS_API_URL = <your_api_url> - Install all the dependencies by running
npm installin the root directory.
- Create your profile by running
node CreateProfile.js.
You need to provide your gender and a description of yourself (minimum 100 words for accurate results). Auser.jsonfile will be generated with your details. - Run the matchmaking engine by using
python MatchMaker.py.
The engine matches your profile against all the profiles in the databse and finds the top 10 matching personalities. The results are written to aresults.txtfile.
PersonalityInsight.jscontains the code to crawl the entire database (data.json) and performs a personality analysis on it. The results are written topersonality.jsonfile.
The engine works by picking up the user's description and dumping it onto the IBM Watson API. The result is a metrics of various personality traits. This result is sent to anotherpersonality-text-summarylibrary which analyzes the metrics and generates a text description of the personality. This text is tokenized, stemmed and then stored.CreateProfile.jsgenerates a profile for the current user. The same process of personality analysis is applied as in thePersonalityInsight.jsfile to generate personality profile for the user. The results are saved ontouser.jsonfile.MatchMaker.pyis the matchmaking engine that matches the user profile with the database and finds the top 10 matches. The results are written to aresults.txtfile.
The personalities are matched based on cosine similarity.data.jsonfile contains the sample 500 profiles. It contains 250 male and 250 female profile. The keys1-250correspond to female profiles and251-500for male profiles.
Feel free to add your own profiles but keep the structure of json same so that the code doesn't break. There's also a sample with the key"0"for your reference.sampleresponse.jsoncontains a sample response from the IBM Watson API. Incase you are curious, you can go ahead and explore the metrics to write your own matchmaking algorithm.