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

quese-test

v3.1.18

Published

Package that make easier the searching process in javascript, through Embeddings and Semantic Similarity

Downloads

103

Readme

QUESE

"Quese" allows you implement in an easy way a Search Algoritm, based on Embeddings and Semantic Similarity, in your JavaScripts apps. The package is available in python (pip) as well: https://pypi.org/project/quese/

The module provides:

COMPATIBILITY

| | Create React App | Node | | ---------------------- | :----------------------------------: | ------------------------------------- | | Searcher | YES | NO | | searchByEmbeddings | NO | YES |

USAGE

1. Searcher component:

Example of an implementation of the Searcher component.

2. searchByEmbeddings function:

Example of an implementation of the searchByEmbeddings function.

PARAMS AND PROPS

1. Seacher props:

| Name | Required | Format | Description | Default value | | ---------------------- | :-----------------------------------------------------------------------: | :----------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------: | :-----------: | | data | true | Array of objects | Represents the data you want to search for | undefined | | by | true if not template | String | Represents the key of your objects that is going to be compared with the query in the searching process | undefined | | template | true if not by | String, object keys between {} | Similar to the "by" prop, allows you to create a customized sentence for compare with the query | undefined | | accuracy | false | Number (0-1) | It represents the minimum similarity rate wich the object must have with the quey to be returned | 0.5 | | defaultStyle | false | Boolean | Boolean value wich indicates if the default style will be charged or the user prefer her own style | true | | InputStyle | false | Object | The typical object for stylize your components in react, but in this case to stylize the input of the Searcher component | undefined | | ContainerStyle | false | Object | The typical object for stylize your components in react, but in this case to stylize the div of the Searcher component | undefined | | inputClassName | false | String | The typical className prop, but in this case to stylize the input of the Searcher component | undefined | | ContainerClassname | false | String | The typical className prop, but in this case to stylize the div of the Searcher component | undefined | | renderItemFunction | false unless you use the template prop | JSX Function | Function with two params: the item and the index, in wich you can customize the structure and the style of the previous results | undefined | | itemLinkFunction | false | Function | Function with two params: the item and the index, in wich you can customize the href of each previous result returning a dinamyc string | undefined | | onSearchChange | false | Function | It's a function to handle the results for each change of the input. The first param are this results. | undefined | | onSearchSubmit | false | Function | It's a function to handle the results for each submit of the input. The first param are this results. | undefined | | iconCancel | false | Boolean | Boolean value to define if the icon for cancel the search will be charged or not | true | | iconSearch | false | Boolean | Boolean value to define if the search icon will be charged or not | true | | placeholder | false | String | The typical input placeholder... | "Search..." | | prevResults | false | String | Boolean value to define if the previous results (the results between the input) will be charged or not | true |

2. seachByEmbeddings() params:

| Name | Required | Format | Description | Default value | | ------------ | :---------------------------------------------------: | :----------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------: | | data | true | Array of objects | Represents the data you want to search for | undefined | | query | true | String | Represents the query of your searching process | undefined | | by | true if not template | String | Represents the key of your objects that is going to be compared with the query in the searching process | undefined | | template | true if not by | String, object keys between {} | Similar to the "by" prop, allows you to create a customized sentence for compare with the query | undefined | | accuracy | false | Number (0-1) | It represents the minimum similarity rate wich the object must have with the quey to be returned | 0.5 | | model | false | String | The HuggingFace model you want to use to create the embeddings (take care if it works with Transformers.js and if it's able to do the feature-extraction task) | "Xenova/all-MiniLM-L6-v2" |