SlideShare a Scribd company logo
UnBBayes – Plugin


                  Feature Overview
    ~ Usage and development of plugins for UnBBayes ~




1                  02/07/2010
    Contact: Shou Matsumoto (cardialfly@[yahoo|gmail].com)
Contents
       Concepts
       Features & Benefits
       Applications
       Sample Plugins (you may skip this section)
       Specification
       Extension Points’ Spec. (you may skip this section)
       Availability



2

    Project page: http://sourceforge.net/projects/unbbayes/
What is UnBBayes?

           UnBBayes is a probabilistic network
           framework written in Java. It has both a
Concepts




           GUI and an API with inference,
           sampling, learning and evaluation. It
           supports BN, ID, MSBN, OOBN, HBN,
           MEBN/PR-OWL, structure, parameter
           and incremental learning.


 3                Source: <http://sourceforge.net/projects/unbbayes/>
What is a plugin?

           A plugin consists of a computer program that
           interacts with a host application to provide a
           certain, usually very specific, function "on
Concepts




           demand“ [wikipedia].
           An UnBBayes’ plugin can be a folder, a ZIP or
           a JAR file located in “plugins” folder.
           Content of an ordinal UnBBayes’ plugin:
           –   Plugin descriptor (XML file)
           –   Classes (a program)
           –   Resources (e.g. icons, message files...)
 4                A plugin descriptor is the main and minimal content of a plugin
General Benefits of Plugins
Features & Benefits


                       To enable third-party developers to create
                       capabilities to extend an application
                       To support features yet unforeseen
                       To reduce the size of each application
                       To separate source code from an application
                       because of incompatible software licenses.
                       Modularization/Componentization of the
                       software
                       – Interfaces are modeled as extension points.
   5                           Modularization/componentization = organized system
General Features
Features & Benefits


                      Plugin dependency
                      Plugin’s version control
                      Plugins for Plugins
                      Hotplug
                      Flexible I/O handler



   6
Plugin dependency
                      We can develop new plugins reusing a pre-
Features & Benefits



                      existing one.
                      – A plugin may have some dependency to a pre-
                        existing one.
                      Pros:
                      – Fast development
                      – Less redundancy – smaller programs
                      Contras.
                      – Dependency hell
                         • If my plugin depends on “A” and “A” depends on “B” and
                           so on, my plugin will not work until the user obtains all
                           the dependencies.
   7                           A dependency is declared in plugin descriptor (XML)
Plugin’s version control
Features & Benefits


                      The application can manage several
                      different versions of a plugin.
                      – E.g. version 1.0.0, version 5.2.1...
                      Usually, the newest version is loaded by
                      the application.
                      – Except if a given plugin claims dependency
                        to a unique version.


   8                    There is no need to overwrite files in order to overwrite features anymore.
Plugins for Plugins
Features & Benefits


                      ...This application, under the academic
                      world, shall have a new birth of freedom
                      -- and that government of the plugin, by
                      the plugin, for the plugin, shall not perish
                      from the earth.
                      – If a plugin has an extension point, we can
                        add a plugin for it.
                      – In another words, we can have plugins
                        adding functionalities to another plugin.

   9                        An extension point is declared in plugin descriptor (XML)
Hotplug
Features & Benefits


                      Usually, there is no need to restart the
                      application in order to enable a plugin.
                      – Obviously, there are some exceptions.
                      UnBBayes has a menu item to “reload”
                      plugins at runtime.




 10
Flexible I/O handler
                      If more than one module plugin can handle a file,
Features & Benefits



                      ask for the user.




                      If more than one I/O plugin can handle a file, ask
                      for the user.


 11                                    File handling is flexible
Applications

               Development of a full new functionality
               – Projects / Modules
Applications




               – New formalisms
               Development of a new file format.
               Modeling new node types and/or CPD
               Usage of new Inference Algorithms
               Localization
               – E.g. Spanish, Japanese
 12
Summary of
               extension points
      New                        Split button for new modules
     Modules



                                                          I/O




                           New Nodes
                            and CPD
                                                     Inference
13              Localization                         Algorithm
Datamining Module -
                     UnBMiner
Sample Plugins




 14                A tool with 10 functionalities for massive data handling
Metaphor – Medical,
                      Human Identification
Sample Plugins




 15              A tool that offers an easy interface for finding entries and analisis. Expert Systems.
Sampling - Likelihood
                 Weighting, Monte Carlo, Gibbs
Sample Plugins




 16                   Generation of sample data sets from a given network.
Inference Algorithms –
                 Likelihood Weighting, Gibbs
Sample Plugins




 17                We can select another algorithm to compile a network under the core
OOBN Module’s Japanese
                     Localization
Sample Plugins




 18                   It is possible to add resource files as plugin
I/O – DNE, XMLBIF, NET
Sample Plugins




 19                   Save or load different network file formats
Conditional Probability
                 Distribution Using Scripts
Sample Plugins




 20                It is possible to edit a Conditional Probability Distribution using scripts
Specification

                UnBBayes uses Java Plugin Framework (JPF)
                for plugin support.
Specification




                – JPF is a open-source, LGPL licenced plug-in
                  mechanism adapted from Eclipse's plug-in
                  mechanism.
                The “core” of UnBBayes is the BN module.
                – All other modules/functionalities are being
                  refactored as plugins.
                The core has its plugin descriptor to declare
                extension points (unbbayes.core).

 21                    Everything is configured using plugin descriptors (XML)
Folder Structure

                        Place the
                      plugins here
Specification




                                       These are
                                     default plugins
                                       that come
                                      with the core
 22
Modules
Extension Points’ Spec.



                            UnBBayes' modules are basically swing
                            internal frames.
                          <extension-point id="Module">
                            <!--class extends unbbayes.util.extension.UnBBayesModule-->
                            <parameter-def id="class"/>
                            <!--builder implements unbbayes.util.extension.UnBBayesModuleBuilder-->
                            <parameter-def id="builder" multiplicity="none-or-one" />
                            <parameter-def id="name"/>
                            <parameter-def id="description" multiplicity="none-or-one" />
                            <parameter-def id="icon" multiplicity="none-or-one" />
                            <!--category creates new menu items on demmand-->
                            <parameter-def id="category" multiplicity="none-or-one" />
                          </extension-point>

 23                                       These XML definitions follow the JPF specification.
Sample Module - UnBMiner
                          <?xml version="1.0" ?>
Extension Points’ Spec.


                          <!DOCTYPE plugin PUBLIC "-//JPF//Java Plug-in Manifest 1.0" "http://jpf.sourceforge.net/plugin_1_0.dtd">
                          <plugin id="unbbayes.datamining" version="0.0.1">
                            <requires>
                               <import plugin-id="unbbayes.util.extension.core"/>
                            </requires>
                            <runtime>
                               <library id="unbminer" path="classes/" type="code">
                                  <export prefix="*" />
                               </library>
                               <library type="resources" path="icons/" id="icons" />
                            </runtime>
                            <extension plugin-id="unbbayes.util.extension.core" point-id="Module" id="unbminer">
                               <parameter id="class" value="unbbayes.datamining.gui.extension.UnBMinerJPFModule" />
                               <parameter id="name" value="Data Mining Project" />
                               <parameter id="builder" value="unbbayes.datamining.gui.extension.UnBMinerJPFModule" />
                                         <parameter id="description" value="UnBBayes Dataminer - UnBMiner" />
                                         <parameter id="icon" value="mining.png" />
                                         <parameter id="category" value="tool" />
                            </extension>
                          </plugin>
 24                                          This is how UnBMiner's plugin descriptor (plugin.xml) looks like
Inference Algorithm
Extension Points’ Spec.



                             This is basically a panel (for options)
                              – This panel holds an implementation of
                                  unbbayes.util.extension.bn.inference.IInferenceAlgorithm,
                                  which runs a specific inference algorithm.

                          <extension-point id="InferenceAlgorithm">
                            <!--class extends
                              unbbayes.util.extension.bn.inference.InferenceAlgorithmOptionPanel-->
                            <parameter-def id="class"/>
                          </extension-point>




 25                                   Inference Algorithms are usually started when we "compile" a BN
Sample Algorithm - Gibbs
                          <?xml version="1.0" ?> <!DOCTYPE plugin PUBLIC "-//JPF//Java Plug-in Manifest 1.0"
Extension Points’ Spec.


                               "http://jpf.sourceforge.net/plugin_1_0.dtd">
                          <plugin id="unbbayes.simulation.sampling.GibbsSampling" version="1.0.0">
                            <requires><import plugin-id="unbbayes.util.extension.core"/><import plugin-
                               id="unbbayes.simulation.montecarlo.sampling"/></requires>
                            <runtime>
                               <library id="gibbs" path="classes/" type="code"><export prefix="*" /></library>
                               <library type="resources" path="icons/" id="icons" />
                            </runtime>
                            <extension plugin-id="unbbayes.util.extension.core" point-id="Module" id="gibbsSampling">
                               <parameter id="class" value="unbbayes.gui.GibbsSamplingModule" />
                               <parameter id="name" value="Gibbs Sampling" />
                               <parameter id="builder" value="unbbayes.gui.GibbsSamplingModule" />
                               <parameter id="description" value="Sampling using Gibbs" />
                               <parameter id="icon" value="sampling.png" />
                               <parameter id="category" value="sampling" />
                            </extension>
                            <extension plugin-id="unbbayes.util.extension.core" point-id="InferenceAlgorithm" id="gibbsAlgorithm">
                               <parameter id="class" value="unbbayes.gui.option.GibbsSamplingOptionPanel" />
                            </extension>
                          </plugin>

 26                                              A single plugin.xml may implement several extension points
I/O
                            This is just a combination of
Extension Points’ Spec.




                            unbbayes.io.BaseIO and a name
                             – The name is displayed when a conflict occurs


                                 <extension-point id="PNIO">
                                   <parameter-def id="class"/>
                                   <parameter-def id="name"/>
                                 </extension-point>


 27                       A single plugin.xml may specify several extension points - a plugin may expect several plugins
Sample I/O - DNE
Extension Points’ Spec.


                          <?xml version="1.0" ?>
                          <!DOCTYPE plugin PUBLIC "-//JPF//Java Plug-in Manifest 1.0"
                             "http://jpf.sourceforge.net/plugin_1_0.dtd">
                          <plugin id="unbbayes.io.DneIO" version="1.0.0">
                            <requires>
                               <import plugin-id="unbbayes.util.extension.core"/>
                            </requires>
                            <extension plugin-id="unbbayes.util.extension.core" point-id="PNIO"
                             id="DneIO">
                               <parameter id="class" value="unbbayes.io.DneIO" />
                               <parameter id="name" value="DNE" />
                            </extension>
                          </plugin>

 28                                      This is how DNE's plugin descriptor (plugin.xml) looks like
Resources - Localization
Extension Points’ Spec.



                             This is basically a
                             java.util.ListResourceBundle
                              – Naming: <ClassName>_<LocaleID>
                                    •   Resources_es.class (Spanish)
                                    •   Resources_pt.class (Portuguese)
                                    •   Resources_ja.class (Japanese)

                          <extension-point id="ResourceBundle">
                            <parameter-def id="class"/>
                          </extension-point>


 29                          This extension point is a bridge between JPF mechanism and ResourceBundle mechanism
Sample Localization
                          <?xml version="1.0" ?>
Extension Points’ Spec.


                          <!DOCTYPE plugin PUBLIC "-//JPF//Java Plug-in Manifest 1.0" "http://jpf.sourceforge.net/plugin_1_0.dtd">
                          <plugin id="unbbayes.oobn.resources.ja" version="1.0.0">
                            <requires><import plugin-id="unbbayes.util.extension.core"/></requires>
                            <runtime>
                               <library id="oobnResource_ja" path="classes/" type="code"><export prefix="*" /></library>
                            </runtime>
                            <extension plugin-id="unbbayes.util.extension.core" point-id="ResourceBundle" id="oobn_gui_ja">
                               <parameter id="class" value="unbbayes.gui.oobn.resources.OOBNGuiResource_ja" />
                            </extension>
                            <extension plugin-id="unbbayes.util.extension.core" point-id="ResourceBundle" id="oobn_controller_ja">
                               <parameter id="class" value="unbbayes.controller.oobn.resources.OOBNControllerResources_ja" />
                            </extension>
                            <extension plugin-id="unbbayes.util.extension.core" point-id="ResourceBundle" id="oobn_io_ja">
                               <parameter id="class" value="unbbayes.io.oobn.resources.OOBNIOResources_ja" />
                            </extension>
                            <extension plugin-id="unbbayes.util.extension.core" point-id="ResourceBundle" id="oobn_prs_ja">
                               <parameter id="class" value="unbbayes.prs.oobn.resources.Resources_ja" />
                            </extension>
                          </plugin>


 30                                  Unfortunatelly, most of classes load resources statically, so hotplug is only partial.
New Types of Nodes
                                This is a Node and a set of additional information
Extension Points’ Spec.



                                to display it within GUI.
                          <extension-point id="PluginNode">
                          <!--class implements unbbayes.prs.extension.IPluginNode-->
                            <parameter-def id="class"/>
                          <!--shapeClass implements unbbayes.draw.extension.IPluginUShape-->
                            <parameter-def id="shapeClass"/>
                            <parameter-def id="name"/>
                          <!--panelBuilder implements unbbayes.gui.table.extension.IProbabilityFunctionPanelBuilder-->
                            <parameter-def id="panelBuilder"/>
                            <parameter-def id="description" multiplicity="none-or-one" />
                            <parameter-def id="icon" multiplicity="none-or-one" />
                            <parameter-def id="cursor" multiplicity="none-or-one" />
                          </extension-point>

 31                             Inference algorithms or I/O must be implemented separately to compile/save these nodes
Sample Nodes
                          <?xml version="1.0" ?>
Extension Points’ Spec.


                          <!DOCTYPE plugin PUBLIC "-//JPF//Java Plug-in Manifest 1.0" "http://jpf.sourceforge.net/plugin_1_0.dtd">
                          <plugin id="unbbayes.prs.extension.impl.ProbabilisticNodePluginStub" version="1.0.0">
                            <requires> <import plugin-id="unbbayes.util.extension.core"/> </requires>
                            <runtime>
                               <library id="ProbabilisticNodePluginStub" path="classes/" type="code">
                                  <export prefix="*" />
                               </library>
                               <library type="resources" path="icons/" id="ProbabilisticNodePluginStub_icons" />
                            </runtime>
                            <extension plugin-id="unbbayes.util.extension.core" point-id="PluginNode" id="ProbabilisticNodePluginStub">
                               <parameter id="class" value="unbbayes.prs.extension.impl.ProbabilisticNodePluginStub" />
                               <parameter id="shapeClass" value="unbbayes.draw.extension.impl.DefaultPluginUShape" />
                               <parameter id="name" value="Boolean Node For Plugin Test" />
                               <parameter id="panelBuilder" value= "unbbayes.gui.table.extension.StubPanelBuilder" />
                               <parameter id="description" value="This is a stub in order to test plugins" />
                               <parameter id="icon" value="icon_stub.gif" />
                               <parameter id="cursor" value="cursor_stub.gif" />
                            </extension>
                          </plugin>


 32                                                                 This is a sample stub.
Probability Distribution
                                         Editor
Extension Points’ Spec.



                             Identical to “New Node Type” plugin
                               – Difference: these are for nodes already
                                 incorporated into UnBBayes’ core
                                    • E.g. unbbayes.prs.bn.ProbabilisticNode

                          <extension-point id="ProbabilityFunctionPanel">
                            <parameter-def id="class"/> <!--Node‘s class-->
                            <parameter-def id="name"/>
                            <parameter-def id="panelBuilder"/> <!--Panel to edit node-->
                            <parameter-def id="description" multiplicity="none-or-one" />
                            <parameter-def id="icon" multiplicity="none-or-one" />
                          </extension-point>

 33                                         See the specs of "New Node Type" plugin for details
Sample Probability
                                              Distribution Editor
                          <?xml version="1.0" ?>
Extension Points’ Spec.



                          <!DOCTYPE plugin PUBLIC "-//JPF//Java Plug-in Manifest 1.0" "http://jpf.sourceforge.net/plugin_1_0.dtd">
                          <plugin id="edu.gmu.seor.prognos.unbbayesplugin.cps" version="1.0.0">
                            <requires> <import plugin-id="unbbayes.util.extension.core"/> </requires>
                            <runtime>
                               <library id="cps" path="classes/" type="code">
                                  <export prefix="*" />
                               </library>
                               <library type="resources" path="icons/" id="cps_icons" />
                            </runtime>
                            <extension plugin-id="unbbayes.util.extension.core" point-id="ProbabilityFunctionPanel"
                               id="cps_ProbabilisticNode">
                               <parameter id="class" value="unbbayes.prs.bn.ProbabilisticNode" />
                               <parameter id="name" value="Script edition" />
                               <parameter id="panelBuilder" value=
                               "edu.gmu.seor.prognos.unbbayesplugin.cps.gui.extension.CPSPanelBuilder" />
                               <parameter id="description" value="Edit conditional probability function using scripts" />
                               <parameter id="icon" value="new_script.png" />
                            </extension>
                          </plugin>


 34                                               This is the plugin descriptor (plugin.xml) for CPS plugin
Availability

               Currently, these extension points and
               sample plugins are only available in the
Availability




               sourceforge’s SVN (trunk).
               – By now, there are no releases supporting
                 plugins yet.
               SVN repository URL:
               – https://unbbayes.svn.sourceforge.net/svnroot
                 /unbbayes/trunk/UnBBayes

 35                A release version for UnBBayes w/ plugin support is yet to come
Finally
What plugins can do for you



                              Plugins can enable third-party developers to
                              extend UnBBayes
                              – Develop features yet unforeseen
                                    • New formalisms
                                    • Customization
                              – Flexible software license
                                    • Separate sources of incompatible licenses.
                              – Fast development
                                    • Plugin dependency control
                              Plugins reduce the size of UnBBayes
                              – Distribution is easier and application is light

36                             Although this is already an open source project, plugins makes it easier to customize

More Related Content

Similar to UnBBayes Plugin Framework (20)

PDF
664 eclipse plugin
arnamoy10
 
PDF
Plugin theme
Honeysingh347121
 
PDF
QtQuick Day 3
Timo Strömmer
 
PPTX
Thrift vs Protocol Buffers vs Avro - Biased Comparison
Igor Anishchenko
 
PDF
BeJUG JavaFx In Practice
Pursuit Consulting
 
PPTX
Plugin architecture (Extensible Application Architecture)
Chinmoy Mohanty
 
PDF
GR8Conf 2009. The Grails Plugin System by Graeme Rocher
GR8Conf
 
PDF
Create *real* modular Java applications - a brief introduction -
Jeffrey Groneberg
 
PDF
Uml2
Majong DevJfu
 
PDF
Osgi Sun 20080820
Eduardo Pelegri-Llopart
 
PPTX
Managing modular software for your nu get, c++ and java development
Baruch Sadogursky
 
PPTX
Lifting variability from C to mbeddr-C
Federico Tomassetti
 
PDF
Project Zero JavaOne 2008
Robert Nicholson
 
ODP
Firebird 3: provider-based architecture, plugins and OO approach to API
Mind The Firebird
 
PDF
Make Your Builds More Groovy
Paul King
 
PDF
make builds groovy
guest88884d
 
KEY
groovy & grails - lecture 6
Alexandre Masselot
 
PDF
Rest style web services (google protocol buffers) prasad nirantar
IndicThreads
 
PDF
Real World Technologies
José Maria Silveira Neto
 
PPTX
Plug in framework made easy
Thomas Cheah
 
664 eclipse plugin
arnamoy10
 
Plugin theme
Honeysingh347121
 
QtQuick Day 3
Timo Strömmer
 
Thrift vs Protocol Buffers vs Avro - Biased Comparison
Igor Anishchenko
 
BeJUG JavaFx In Practice
Pursuit Consulting
 
Plugin architecture (Extensible Application Architecture)
Chinmoy Mohanty
 
GR8Conf 2009. The Grails Plugin System by Graeme Rocher
GR8Conf
 
Create *real* modular Java applications - a brief introduction -
Jeffrey Groneberg
 
Osgi Sun 20080820
Eduardo Pelegri-Llopart
 
Managing modular software for your nu get, c++ and java development
Baruch Sadogursky
 
Lifting variability from C to mbeddr-C
Federico Tomassetti
 
Project Zero JavaOne 2008
Robert Nicholson
 
Firebird 3: provider-based architecture, plugins and OO approach to API
Mind The Firebird
 
Make Your Builds More Groovy
Paul King
 
make builds groovy
guest88884d
 
groovy & grails - lecture 6
Alexandre Masselot
 
Rest style web services (google protocol buffers) prasad nirantar
IndicThreads
 
Real World Technologies
José Maria Silveira Neto
 
Plug in framework made easy
Thomas Cheah
 

More from Rommel Carvalho (20)

PPTX
Ouvidoria de Balcão vs Ouvidoria Digital: Desafios na Era Big Data
Rommel Carvalho
 
PDF
Como transformar servidores em cientistas de dados e diminuir a distância ent...
Rommel Carvalho
 
PPTX
Proposta de Modelo de Classificação de Riscos de Contratos Públicos
Rommel Carvalho
 
PPTX
Categorização de achados em auditorias de TI com modelos supervisionados e nã...
Rommel Carvalho
 
PPTX
Mapeamento de risco de corrupção na administração pública federal
Rommel Carvalho
 
PDF
Ciência de Dados no Combate à Corrupção
Rommel Carvalho
 
PDF
Aplicação de técnicas de mineração de textos para classificação automática de...
Rommel Carvalho
 
PDF
Filiação partidária e risco de corrupção de servidores públicos federais
Rommel Carvalho
 
PDF
Uso de mineração de dados e textos para cálculo de preços de referência em co...
Rommel Carvalho
 
PDF
Detecção preventiva de fracionamento de compras
Rommel Carvalho
 
PDF
Identificação automática de tipos de pedidos mais frequentes da LAI
Rommel Carvalho
 
PDF
BMAW 2014 - Using Bayesian Networks to Identify and Prevent Split Purchases i...
Rommel Carvalho
 
PDF
A GUI for MLN
Rommel Carvalho
 
PDF
URSW 2013 - UMP-ST plug-in
Rommel Carvalho
 
PDF
Integração do Portal da Copa @ Comissão CMA do Senado Federal
Rommel Carvalho
 
KEY
Dados Abertos Governamentais
Rommel Carvalho
 
KEY
Modeling a Probabilistic Ontology for Maritime Domain Awareness
Rommel Carvalho
 
PDF
Probabilistic Ontology: Representation and Modeling Methodology
Rommel Carvalho
 
PDF
SWRL-F - A Fuzzy Logic Extension of the Semantic Web Rule Language
Rommel Carvalho
 
ODP
Default Logics for Plausible Reasoning with Controversial Axioms
Rommel Carvalho
 
Ouvidoria de Balcão vs Ouvidoria Digital: Desafios na Era Big Data
Rommel Carvalho
 
Como transformar servidores em cientistas de dados e diminuir a distância ent...
Rommel Carvalho
 
Proposta de Modelo de Classificação de Riscos de Contratos Públicos
Rommel Carvalho
 
Categorização de achados em auditorias de TI com modelos supervisionados e nã...
Rommel Carvalho
 
Mapeamento de risco de corrupção na administração pública federal
Rommel Carvalho
 
Ciência de Dados no Combate à Corrupção
Rommel Carvalho
 
Aplicação de técnicas de mineração de textos para classificação automática de...
Rommel Carvalho
 
Filiação partidária e risco de corrupção de servidores públicos federais
Rommel Carvalho
 
Uso de mineração de dados e textos para cálculo de preços de referência em co...
Rommel Carvalho
 
Detecção preventiva de fracionamento de compras
Rommel Carvalho
 
Identificação automática de tipos de pedidos mais frequentes da LAI
Rommel Carvalho
 
BMAW 2014 - Using Bayesian Networks to Identify and Prevent Split Purchases i...
Rommel Carvalho
 
A GUI for MLN
Rommel Carvalho
 
URSW 2013 - UMP-ST plug-in
Rommel Carvalho
 
Integração do Portal da Copa @ Comissão CMA do Senado Federal
Rommel Carvalho
 
Dados Abertos Governamentais
Rommel Carvalho
 
Modeling a Probabilistic Ontology for Maritime Domain Awareness
Rommel Carvalho
 
Probabilistic Ontology: Representation and Modeling Methodology
Rommel Carvalho
 
SWRL-F - A Fuzzy Logic Extension of the Semantic Web Rule Language
Rommel Carvalho
 
Default Logics for Plausible Reasoning with Controversial Axioms
Rommel Carvalho
 
Ad

Recently uploaded (20)

PPTX
Top 10 AI Tools, Like ChatGPT. You Must Learn In 2025
Digilearnings
 
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
PPTX
Digital Professionalism and Interpersonal Competence
rutvikgediya1
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PPTX
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
PPTX
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
PPTX
ENGLISH 8 WEEK 3 Q1 - Analyzing the linguistic, historical, andor biographica...
OliverOllet
 
DOCX
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
PPTX
Electrophysiology_of_Heart. Electrophysiology studies in Cardiovascular syste...
Rajshri Ghogare
 
PPTX
TOP 10 AI TOOLS YOU MUST LEARN TO SURVIVE IN 2025 AND ABOVE
digilearnings.com
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
The Future of Artificial Intelligence Opportunities and Risks Ahead
vaghelajayendra784
 
PDF
John Keats introduction and list of his important works
vatsalacpr
 
PPTX
Virus sequence retrieval from NCBI database
yamunaK13
 
PPTX
K-Circle-Weekly-Quiz12121212-May2025.pptx
Pankaj Rodey
 
PDF
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
PPTX
I INCLUDED THIS TOPIC IS INTELLIGENCE DEFINITION, MEANING, INDIVIDUAL DIFFERE...
parmarjuli1412
 
Top 10 AI Tools, Like ChatGPT. You Must Learn In 2025
Digilearnings
 
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
Digital Professionalism and Interpersonal Competence
rutvikgediya1
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
ENGLISH 8 WEEK 3 Q1 - Analyzing the linguistic, historical, andor biographica...
OliverOllet
 
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
Electrophysiology_of_Heart. Electrophysiology studies in Cardiovascular syste...
Rajshri Ghogare
 
TOP 10 AI TOOLS YOU MUST LEARN TO SURVIVE IN 2025 AND ABOVE
digilearnings.com
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
The Future of Artificial Intelligence Opportunities and Risks Ahead
vaghelajayendra784
 
John Keats introduction and list of his important works
vatsalacpr
 
Virus sequence retrieval from NCBI database
yamunaK13
 
K-Circle-Weekly-Quiz12121212-May2025.pptx
Pankaj Rodey
 
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
I INCLUDED THIS TOPIC IS INTELLIGENCE DEFINITION, MEANING, INDIVIDUAL DIFFERE...
parmarjuli1412
 
Ad

UnBBayes Plugin Framework

  • 1. UnBBayes – Plugin Feature Overview ~ Usage and development of plugins for UnBBayes ~ 1 02/07/2010 Contact: Shou Matsumoto (cardialfly@[yahoo|gmail].com)
  • 2. Contents Concepts Features & Benefits Applications Sample Plugins (you may skip this section) Specification Extension Points’ Spec. (you may skip this section) Availability 2 Project page: http://sourceforge.net/projects/unbbayes/
  • 3. What is UnBBayes? UnBBayes is a probabilistic network framework written in Java. It has both a Concepts GUI and an API with inference, sampling, learning and evaluation. It supports BN, ID, MSBN, OOBN, HBN, MEBN/PR-OWL, structure, parameter and incremental learning. 3 Source: <http://sourceforge.net/projects/unbbayes/>
  • 4. What is a plugin? A plugin consists of a computer program that interacts with a host application to provide a certain, usually very specific, function "on Concepts demand“ [wikipedia]. An UnBBayes’ plugin can be a folder, a ZIP or a JAR file located in “plugins” folder. Content of an ordinal UnBBayes’ plugin: – Plugin descriptor (XML file) – Classes (a program) – Resources (e.g. icons, message files...) 4 A plugin descriptor is the main and minimal content of a plugin
  • 5. General Benefits of Plugins Features & Benefits To enable third-party developers to create capabilities to extend an application To support features yet unforeseen To reduce the size of each application To separate source code from an application because of incompatible software licenses. Modularization/Componentization of the software – Interfaces are modeled as extension points. 5 Modularization/componentization = organized system
  • 6. General Features Features & Benefits Plugin dependency Plugin’s version control Plugins for Plugins Hotplug Flexible I/O handler 6
  • 7. Plugin dependency We can develop new plugins reusing a pre- Features & Benefits existing one. – A plugin may have some dependency to a pre- existing one. Pros: – Fast development – Less redundancy – smaller programs Contras. – Dependency hell • If my plugin depends on “A” and “A” depends on “B” and so on, my plugin will not work until the user obtains all the dependencies. 7 A dependency is declared in plugin descriptor (XML)
  • 8. Plugin’s version control Features & Benefits The application can manage several different versions of a plugin. – E.g. version 1.0.0, version 5.2.1... Usually, the newest version is loaded by the application. – Except if a given plugin claims dependency to a unique version. 8 There is no need to overwrite files in order to overwrite features anymore.
  • 9. Plugins for Plugins Features & Benefits ...This application, under the academic world, shall have a new birth of freedom -- and that government of the plugin, by the plugin, for the plugin, shall not perish from the earth. – If a plugin has an extension point, we can add a plugin for it. – In another words, we can have plugins adding functionalities to another plugin. 9 An extension point is declared in plugin descriptor (XML)
  • 10. Hotplug Features & Benefits Usually, there is no need to restart the application in order to enable a plugin. – Obviously, there are some exceptions. UnBBayes has a menu item to “reload” plugins at runtime. 10
  • 11. Flexible I/O handler If more than one module plugin can handle a file, Features & Benefits ask for the user. If more than one I/O plugin can handle a file, ask for the user. 11 File handling is flexible
  • 12. Applications Development of a full new functionality – Projects / Modules Applications – New formalisms Development of a new file format. Modeling new node types and/or CPD Usage of new Inference Algorithms Localization – E.g. Spanish, Japanese 12
  • 13. Summary of extension points New Split button for new modules Modules I/O New Nodes and CPD Inference 13 Localization Algorithm
  • 14. Datamining Module - UnBMiner Sample Plugins 14 A tool with 10 functionalities for massive data handling
  • 15. Metaphor – Medical, Human Identification Sample Plugins 15 A tool that offers an easy interface for finding entries and analisis. Expert Systems.
  • 16. Sampling - Likelihood Weighting, Monte Carlo, Gibbs Sample Plugins 16 Generation of sample data sets from a given network.
  • 17. Inference Algorithms – Likelihood Weighting, Gibbs Sample Plugins 17 We can select another algorithm to compile a network under the core
  • 18. OOBN Module’s Japanese Localization Sample Plugins 18 It is possible to add resource files as plugin
  • 19. I/O – DNE, XMLBIF, NET Sample Plugins 19 Save or load different network file formats
  • 20. Conditional Probability Distribution Using Scripts Sample Plugins 20 It is possible to edit a Conditional Probability Distribution using scripts
  • 21. Specification UnBBayes uses Java Plugin Framework (JPF) for plugin support. Specification – JPF is a open-source, LGPL licenced plug-in mechanism adapted from Eclipse's plug-in mechanism. The “core” of UnBBayes is the BN module. – All other modules/functionalities are being refactored as plugins. The core has its plugin descriptor to declare extension points (unbbayes.core). 21 Everything is configured using plugin descriptors (XML)
  • 22. Folder Structure Place the plugins here Specification These are default plugins that come with the core 22
  • 23. Modules Extension Points’ Spec. UnBBayes' modules are basically swing internal frames. <extension-point id="Module"> <!--class extends unbbayes.util.extension.UnBBayesModule--> <parameter-def id="class"/> <!--builder implements unbbayes.util.extension.UnBBayesModuleBuilder--> <parameter-def id="builder" multiplicity="none-or-one" /> <parameter-def id="name"/> <parameter-def id="description" multiplicity="none-or-one" /> <parameter-def id="icon" multiplicity="none-or-one" /> <!--category creates new menu items on demmand--> <parameter-def id="category" multiplicity="none-or-one" /> </extension-point> 23 These XML definitions follow the JPF specification.
  • 24. Sample Module - UnBMiner <?xml version="1.0" ?> Extension Points’ Spec. <!DOCTYPE plugin PUBLIC "-//JPF//Java Plug-in Manifest 1.0" "http://jpf.sourceforge.net/plugin_1_0.dtd"> <plugin id="unbbayes.datamining" version="0.0.1"> <requires> <import plugin-id="unbbayes.util.extension.core"/> </requires> <runtime> <library id="unbminer" path="classes/" type="code"> <export prefix="*" /> </library> <library type="resources" path="icons/" id="icons" /> </runtime> <extension plugin-id="unbbayes.util.extension.core" point-id="Module" id="unbminer"> <parameter id="class" value="unbbayes.datamining.gui.extension.UnBMinerJPFModule" /> <parameter id="name" value="Data Mining Project" /> <parameter id="builder" value="unbbayes.datamining.gui.extension.UnBMinerJPFModule" /> <parameter id="description" value="UnBBayes Dataminer - UnBMiner" /> <parameter id="icon" value="mining.png" /> <parameter id="category" value="tool" /> </extension> </plugin> 24 This is how UnBMiner's plugin descriptor (plugin.xml) looks like
  • 25. Inference Algorithm Extension Points’ Spec. This is basically a panel (for options) – This panel holds an implementation of unbbayes.util.extension.bn.inference.IInferenceAlgorithm, which runs a specific inference algorithm. <extension-point id="InferenceAlgorithm"> <!--class extends unbbayes.util.extension.bn.inference.InferenceAlgorithmOptionPanel--> <parameter-def id="class"/> </extension-point> 25 Inference Algorithms are usually started when we "compile" a BN
  • 26. Sample Algorithm - Gibbs <?xml version="1.0" ?> <!DOCTYPE plugin PUBLIC "-//JPF//Java Plug-in Manifest 1.0" Extension Points’ Spec. "http://jpf.sourceforge.net/plugin_1_0.dtd"> <plugin id="unbbayes.simulation.sampling.GibbsSampling" version="1.0.0"> <requires><import plugin-id="unbbayes.util.extension.core"/><import plugin- id="unbbayes.simulation.montecarlo.sampling"/></requires> <runtime> <library id="gibbs" path="classes/" type="code"><export prefix="*" /></library> <library type="resources" path="icons/" id="icons" /> </runtime> <extension plugin-id="unbbayes.util.extension.core" point-id="Module" id="gibbsSampling"> <parameter id="class" value="unbbayes.gui.GibbsSamplingModule" /> <parameter id="name" value="Gibbs Sampling" /> <parameter id="builder" value="unbbayes.gui.GibbsSamplingModule" /> <parameter id="description" value="Sampling using Gibbs" /> <parameter id="icon" value="sampling.png" /> <parameter id="category" value="sampling" /> </extension> <extension plugin-id="unbbayes.util.extension.core" point-id="InferenceAlgorithm" id="gibbsAlgorithm"> <parameter id="class" value="unbbayes.gui.option.GibbsSamplingOptionPanel" /> </extension> </plugin> 26 A single plugin.xml may implement several extension points
  • 27. I/O This is just a combination of Extension Points’ Spec. unbbayes.io.BaseIO and a name – The name is displayed when a conflict occurs <extension-point id="PNIO"> <parameter-def id="class"/> <parameter-def id="name"/> </extension-point> 27 A single plugin.xml may specify several extension points - a plugin may expect several plugins
  • 28. Sample I/O - DNE Extension Points’ Spec. <?xml version="1.0" ?> <!DOCTYPE plugin PUBLIC "-//JPF//Java Plug-in Manifest 1.0" "http://jpf.sourceforge.net/plugin_1_0.dtd"> <plugin id="unbbayes.io.DneIO" version="1.0.0"> <requires> <import plugin-id="unbbayes.util.extension.core"/> </requires> <extension plugin-id="unbbayes.util.extension.core" point-id="PNIO" id="DneIO"> <parameter id="class" value="unbbayes.io.DneIO" /> <parameter id="name" value="DNE" /> </extension> </plugin> 28 This is how DNE's plugin descriptor (plugin.xml) looks like
  • 29. Resources - Localization Extension Points’ Spec. This is basically a java.util.ListResourceBundle – Naming: <ClassName>_<LocaleID> • Resources_es.class (Spanish) • Resources_pt.class (Portuguese) • Resources_ja.class (Japanese) <extension-point id="ResourceBundle"> <parameter-def id="class"/> </extension-point> 29 This extension point is a bridge between JPF mechanism and ResourceBundle mechanism
  • 30. Sample Localization <?xml version="1.0" ?> Extension Points’ Spec. <!DOCTYPE plugin PUBLIC "-//JPF//Java Plug-in Manifest 1.0" "http://jpf.sourceforge.net/plugin_1_0.dtd"> <plugin id="unbbayes.oobn.resources.ja" version="1.0.0"> <requires><import plugin-id="unbbayes.util.extension.core"/></requires> <runtime> <library id="oobnResource_ja" path="classes/" type="code"><export prefix="*" /></library> </runtime> <extension plugin-id="unbbayes.util.extension.core" point-id="ResourceBundle" id="oobn_gui_ja"> <parameter id="class" value="unbbayes.gui.oobn.resources.OOBNGuiResource_ja" /> </extension> <extension plugin-id="unbbayes.util.extension.core" point-id="ResourceBundle" id="oobn_controller_ja"> <parameter id="class" value="unbbayes.controller.oobn.resources.OOBNControllerResources_ja" /> </extension> <extension plugin-id="unbbayes.util.extension.core" point-id="ResourceBundle" id="oobn_io_ja"> <parameter id="class" value="unbbayes.io.oobn.resources.OOBNIOResources_ja" /> </extension> <extension plugin-id="unbbayes.util.extension.core" point-id="ResourceBundle" id="oobn_prs_ja"> <parameter id="class" value="unbbayes.prs.oobn.resources.Resources_ja" /> </extension> </plugin> 30 Unfortunatelly, most of classes load resources statically, so hotplug is only partial.
  • 31. New Types of Nodes This is a Node and a set of additional information Extension Points’ Spec. to display it within GUI. <extension-point id="PluginNode"> <!--class implements unbbayes.prs.extension.IPluginNode--> <parameter-def id="class"/> <!--shapeClass implements unbbayes.draw.extension.IPluginUShape--> <parameter-def id="shapeClass"/> <parameter-def id="name"/> <!--panelBuilder implements unbbayes.gui.table.extension.IProbabilityFunctionPanelBuilder--> <parameter-def id="panelBuilder"/> <parameter-def id="description" multiplicity="none-or-one" /> <parameter-def id="icon" multiplicity="none-or-one" /> <parameter-def id="cursor" multiplicity="none-or-one" /> </extension-point> 31 Inference algorithms or I/O must be implemented separately to compile/save these nodes
  • 32. Sample Nodes <?xml version="1.0" ?> Extension Points’ Spec. <!DOCTYPE plugin PUBLIC "-//JPF//Java Plug-in Manifest 1.0" "http://jpf.sourceforge.net/plugin_1_0.dtd"> <plugin id="unbbayes.prs.extension.impl.ProbabilisticNodePluginStub" version="1.0.0"> <requires> <import plugin-id="unbbayes.util.extension.core"/> </requires> <runtime> <library id="ProbabilisticNodePluginStub" path="classes/" type="code"> <export prefix="*" /> </library> <library type="resources" path="icons/" id="ProbabilisticNodePluginStub_icons" /> </runtime> <extension plugin-id="unbbayes.util.extension.core" point-id="PluginNode" id="ProbabilisticNodePluginStub"> <parameter id="class" value="unbbayes.prs.extension.impl.ProbabilisticNodePluginStub" /> <parameter id="shapeClass" value="unbbayes.draw.extension.impl.DefaultPluginUShape" /> <parameter id="name" value="Boolean Node For Plugin Test" /> <parameter id="panelBuilder" value= "unbbayes.gui.table.extension.StubPanelBuilder" /> <parameter id="description" value="This is a stub in order to test plugins" /> <parameter id="icon" value="icon_stub.gif" /> <parameter id="cursor" value="cursor_stub.gif" /> </extension> </plugin> 32 This is a sample stub.
  • 33. Probability Distribution Editor Extension Points’ Spec. Identical to “New Node Type” plugin – Difference: these are for nodes already incorporated into UnBBayes’ core • E.g. unbbayes.prs.bn.ProbabilisticNode <extension-point id="ProbabilityFunctionPanel"> <parameter-def id="class"/> <!--Node‘s class--> <parameter-def id="name"/> <parameter-def id="panelBuilder"/> <!--Panel to edit node--> <parameter-def id="description" multiplicity="none-or-one" /> <parameter-def id="icon" multiplicity="none-or-one" /> </extension-point> 33 See the specs of "New Node Type" plugin for details
  • 34. Sample Probability Distribution Editor <?xml version="1.0" ?> Extension Points’ Spec. <!DOCTYPE plugin PUBLIC "-//JPF//Java Plug-in Manifest 1.0" "http://jpf.sourceforge.net/plugin_1_0.dtd"> <plugin id="edu.gmu.seor.prognos.unbbayesplugin.cps" version="1.0.0"> <requires> <import plugin-id="unbbayes.util.extension.core"/> </requires> <runtime> <library id="cps" path="classes/" type="code"> <export prefix="*" /> </library> <library type="resources" path="icons/" id="cps_icons" /> </runtime> <extension plugin-id="unbbayes.util.extension.core" point-id="ProbabilityFunctionPanel" id="cps_ProbabilisticNode"> <parameter id="class" value="unbbayes.prs.bn.ProbabilisticNode" /> <parameter id="name" value="Script edition" /> <parameter id="panelBuilder" value= "edu.gmu.seor.prognos.unbbayesplugin.cps.gui.extension.CPSPanelBuilder" /> <parameter id="description" value="Edit conditional probability function using scripts" /> <parameter id="icon" value="new_script.png" /> </extension> </plugin> 34 This is the plugin descriptor (plugin.xml) for CPS plugin
  • 35. Availability Currently, these extension points and sample plugins are only available in the Availability sourceforge’s SVN (trunk). – By now, there are no releases supporting plugins yet. SVN repository URL: – https://unbbayes.svn.sourceforge.net/svnroot /unbbayes/trunk/UnBBayes 35 A release version for UnBBayes w/ plugin support is yet to come
  • 36. Finally What plugins can do for you Plugins can enable third-party developers to extend UnBBayes – Develop features yet unforeseen • New formalisms • Customization – Flexible software license • Separate sources of incompatible licenses. – Fast development • Plugin dependency control Plugins reduce the size of UnBBayes – Distribution is easier and application is light 36 Although this is already an open source project, plugins makes it easier to customize