GithubHelp home page GithubHelp logo

ipshitac / behaviors Goto Github PK

View Code? Open in Web Editor NEW

This project forked from personality-insights/behaviors

0.0 1.0 0.0 340 KB

Obtain behaviors from Personality Insights' profiles. Behaviors present in this component are based on scientific research.

License: Apache License 2.0

JavaScript 100.00%

behaviors's Introduction

Behaviors for Personality Insights

last-release npm-version npm-license Build Status codecov.io npm-downloads

Obtain behaviors from Personality Insights' profiles. Behaviors present in this component are based on scientific research.

Getting Started

  1. Require and instance personality-behaviors component
const PersonalityBehaviors = require('personality-behaviors');
const personalityBehaviors = new PersonalityBehaviors({ locale: 'es' });
  1. Get profile's behavior
const profile = require('./resources/profile');
const behaviors = personalityBehaviors.behaviors(profile);
  1. Render behaviors somewhere! Try rendering them as cards!

See the complete example code or try it live

More Features

There are more features available such as:

  • Including the component as a browser script. Component will be exported as the global variable PersonalityBehaviors.

  • Filtering behaviors by category, industry or both!

const financeBehaviors = personalityBehaviors.behaviors(profile, { category: ['finance'] });
const mediaBehaviors = personalityBehaviors.behaviors(profile, { industry: ['media'] });
  • Get category and industry listings
const industries = personalityBehaviors.industries();
const categories = personalityBehaviors.categories();
  • Formatting descriptions in html or markdown optionally!
const personalityBehaviors = new PersonalityBehaviors({ format:'html' });
const mediaBehaviors = personalityBehaviors.behaviors(profile, { industry: ['media'] });

API Methods

The available methods are the following ones:

  • constructor :: (Options) -> PersonalityBehaviors - Obtain an instance of PersonalityBehaviors.
  • behaviors :: (Profile, FilterOptions) -> [Behavior] - Calculate the list of behaviors that apply to the given Personality Insights Profile.
  • categories :: [Category] - List of categories available.
  • industries :: [Industry] - List of industries available.

Definitions:

  • Profile is a IBM Watson Personality Insights profile which is basically the service JSON output, parsed into a JavaScript Object.
  • Options are options for the behaviors component. Available options are:
    • locale - A String with the locale used to generate the labels.
    • format - A String with format. Available formats are ["plain", "html", "markdown"].
  • FilterOptions are filter options for the behaviors matching.
    • category - A String or [String] with the categories to include.
    • industry - A String or [String] with the industries to include.
  • Category and Industry are Strings.

behaviors's People

Contributors

agustincasamayor avatar arypbatista avatar neil-boyette-ibm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.