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

test-ai-classifier-client

v1.1.0

Published

grpc client for semantic label classifier

Downloads

5

Readme

Test.ai Classifier - Node.js + WebdriverIO Client

The code in this directory defines a client library for use with the gRPC-based Test.ai classifier server.

Installation & Setup

npm install test-ai-classifier-client

Usage

This client exposes as the default export a ClassifierClient class, which can be instantiated as follows:

const ClassifierClient = require('test-ai-classifier-client');
const client = new ClassifierClient({host, port})

(Where host and port refer to the address and port the server is running on).

The client exposes two instance methods:

  1. classifyElements takes an object parameter with 4 keys:

    1. labelHint: the label you wish to find matching elements with (see lib/labels.js in this repo).
    2. elementImages: an object whose keys are ids, and whose values are Buffer objects containing raw binary data of PNG images.
    3. confidenceThreshold: (optional) the confidence below which not to return matches (0.0 - 1.0)
    4. allowWeakerMatches: (optional) whether or not to return a match for elements that did match the label, but for whom another label had a higher confidence.

    The return value of this method is an object whose keys are the same ids you sent in, and whose values are classification objects with the following keys:

    1. label: the matching label
    2. confidence: the confidence for the matched label
    3. confidenceForLabel: the confidence for the label given in labelHint
  2. findElementsMatchingLabel is a helper function for use with Selenium tests (for Appium use the Appium plugin as described in the main README for this repo). It takes an object parameter with 4 keys: all of the same keys as in classifyElements except for elementImages which is replaced by:

    1. driver: the WebdriverIO driver object The return value of this method is an array of WebdriverIO element objects that match.

For a concrete example, see test/rpc-e2e-specs.js

Development

Tests expect a running Classifier server on port 50051.