Skip to content

A document recommendation system based on a hybrid of content based recommendation algorithm (cosine similarity in user profile embedding and document embeddings) and spaced repetition SM-2 algorithm.

License

Notifications You must be signed in to change notification settings

prathyand/document-recommendation-system

Repository files navigation

document-recommendation-system

A document recommendation system based on a hybrid of content based recommendation algorithm (cosine similarity in user profile embedding and document embeddings) and spaced repetition SM-2 algorithm.

🏗️ System Architecture

sysarch

Requirements:

latest version of docker/docker compose

Instructions:

  1. Clone the repository
git clone https://github.com/prathyand/document-recommendation-system.git
  1. Configure user preferences in:
zoteroapiserv/app/userProfile.json

userProfile.json

{"ZoteroUserID":"1234567",
"ZOTERO_API_SECRET_KEY":"aF2cfw18ikd92VpqqQFpAVoY",
"git_repository_list":["prathyand/samplerepo","prathyand/floorplan_obfuscation"],
"gitAuthenticationToken":"ghp_foEuMidWdbm6nzPaSvrxWNGeNHcVfY0KSJbC",
"arxiv_subscribed_topics":["cs.CV","cs.DC","cs.AI","cs.LG"],
"arxiv_fetchNewItemsLimit":20
}
  1. Build the project and run from root directory using:
docker compose up

Project Structure:

Project has five major components, each running in it's own docker environment:

  • zoteroapiserv: This component is responsible for fetching any updated data from Zotero, Git or arxiv based on configuration parameters set in zoteroapiserv/app/userProfile.json

  • RECservice: This component contains the logic for recommendation algorithm based on cosine similarity, sm2like logic, semantic search and generating embeddings from documents

  • backendAPI: This is the Django API interface that handles all API calls to and from Frontend and triggers recommendation update/search events in recommendation engine (RECservice) if necessary

  • RD_webapp: Front end ReactJS UI

  • mysqlREC: MySQL database client


sm2like logic

more about spaced repetition SM-2

def sm2like(quality,repetitions,previous_interval,previous_ef):

    if quality>=3:
        if repetitions == 0:
            interval = 1
        elif repetitions == 1:
            interval = 3
        else:
            interval = int(round(previous_interval * previous_ef))
        
        repetitions+=1
        easeFactor = previous_ef + (0.1 - (5 - quality) * (0.08 + (5 - quality) * 0.02))

    else:
        repetitions = 0
        interval = 1
        easeFactor = previous_ef

    if (easeFactor < 1.3):
        easeFactor = 1.3
        
    return (interval,repetitions,easeFactor)

Input3

Web UI

Input2

Input2

About

A document recommendation system based on a hybrid of content based recommendation algorithm (cosine similarity in user profile embedding and document embeddings) and spaced repetition SM-2 algorithm.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published