Git Product home page Git Product logo

multilanguage-cs's Introduction

Janus, a multilanguage Cognitive System

This repo contains a simple use case integrating CST and DCT, having and information flow from (DCT) Codelets in Python to (CST) Codelets in Java.

On Python side, Janus will read a .npy file containing a list of numpy arrays and, one-by-one, will pass each entry through a ML model. After that the prediction result may be accessed by the Java side of the agent, activating a specific behavior (depending on prediction result) and finally printing a message on terminal. We use the simplified propublica compas dataset for fair ML in which the classifier will judge if the subject will reincid or not.

How it works

First, you'll need to create and activate a virtual environment. Instructions may be found here and here.

You'll need to install dct package manually (sorry about that, we'll fix it soon):

cd python/dct
pip install .
cd ../ # you should be in python folder now

Then, install the other required packages:

pip3 install -r requirements.txt

Notice that we used localhost and ports 5000 to 5003, but this may be customized by changing both the Python script`s arguments and the Java agent's internal (hardcoded) parameter. The ML model can be selected from the six methods in the 'models' folder, but it also has to be changed manually.

After that, running the Java program will execute the proposed example.

What is going on?

This simple agent will, in Python, read a npy file, call an ML model and put the result that can be reached via API calls. A Java process will make HTTP GET requests and print a textual response on terminal about the ML prediction.

The figure below illustrates the Agent's topology.

Janus

Why Janus?

According to Wikipedia, Janus is the god of beginnings, gates, transitions, time, duality, doorways, passages, frames, and endings. He is usually depicted as having two faces. Also, Janus presided over the beginning and ending of conflict, and hence war and peace. As a god of transitions, he had functions pertaining to birth and to journeys and exchange. The month of January is named for Janus (Ianuarius)

multilanguage-cs's People

Contributors

wandgibaut avatar wandemberg-eldorado avatar

Watchers

 avatar  avatar

Forkers

h-iaac wandgibaut

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.