npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

comper_tree_reco_xai

v1.0.6

Published

Explanation system for the recommandation system of the COMPER project

Downloads

5

Readme

reco_explanation

Name

comper tree recommendation explainer.

Description

This package uses the comper recommender traces to display arrows and tooltips explaining the recommendation process to the user, as an overlay of the profile display.

Installation

Import comper_tree_reco_xai with npm :

npm install comper_tree_reco_xai

Usage

Instanciating and displaying explanations :

Everything is done through the Texpl singleton :

import {Texpl} from "comper_tree_reco_xai"

the instance of the singleton is automatically instanciated the first time you will call the getInstance() function.

The first thing to do is to pass the div containing your profile display to the singleton. Example where the div would be named "profileTreeView" :

Texpl.getInstance().setIndentedTree(document.getElementById('profileTreeView'));

To initialise explanations, you will have to ask the COMPER recommendation system to send them to you. For that, you have to add :

["sendTraces", ""] at the end of your objectives list to send to the recommender.

Once the request is treated you should receive the recommendation traces with the rest of the recommendations. You have to pass them to the Texpl singleton. Example where the result of the request to the COMPER recommendation system is received through the variable "res" :

Texpl.getInstance().setTraceText(res.data.traces);

Then, in order to display an explanation, you have to indicate the objective number and the id of the recommendation, which are included in the normal response sent by the COMPER recommendation system :

Texpl.getInstance().initializeExpl(nobj, suggestion.id);

This will display the corresponding explanation for the objective nobj, for the resource suggestion.id

Managing traces :

Before any explanation can be asked through initializeExpl, you will have to give an url where to send your traces to the singleton :

Texpl.getInstance().setTracesURL(url)

with url, a simple string containing the link to your traces database.

You can check if it worked by using

Texpl.getInstance().getTracesConnected()

which should return True, if it worked.

Contributing

For contributing you have to be part of the COMPER project or the following projects. Here is a breakdown of the files and their functions :

arrowsDrawer : Handles the displaying of arrows over the user's profile. It contains the class ArrowDrawer, which have a drawArrow function, which displays an arrow between two provided nodes, if the ArrowDrawer class have been instanciated correctly by providing the div which contains the user profile display.

constants : self explanatory : contains the constants of the project.

Index : the entry point of the project, contains the "Texpl" class, which is a singleton from which all the other functionalities are accessed.

LRSManager : handles the sending of traces to a remote mongodb.

main : contains the global functions launched by the Texpl singleton.

tests : contains some simple tests.

textBuilder : handles the construction of the tooltip texts displayed when clicking on an arrow of an explanation.

traces : processes the traces generated by the COMPER recommendation system.

TracesManager : builds user's traces to send to a traces database, and pass them along to LRSManager.

Authors and acknowledgment

This project was first created by Gabriel Ferrettini for the LIRIS' COMPER project.