You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
senpy/example-plugins
J. Fernando Sánchez 8a516d927e Multiple changes in the API, schemas and UI
Check out the CHANGELOG.md file for more information
5 years ago
..
sklearn Multiple changes in the API, schemas and UI 5 years ago
README.md Multiple changes in the API, schemas and UI 5 years ago
async_plugin.py Fix bug in py3.5 5 years ago
basic.py Multiple changes in the API, schemas and UI 5 years ago
basic_analyse_entry_plugin.py Multiple changes in the API, schemas and UI 5 years ago
basic_box_plugin.py Multiple changes in the API, schemas and UI 5 years ago
basic_plugin.py Multiple changes in the API, schemas and UI 5 years ago
configurable_plugin.py Multiple changes in the API, schemas and UI 5 years ago
dummy_plugin.py Macro commit 6 years ago
dummy_required_plugin.py Add sklearn 6 years ago
emorand_plugin.py Multiple changes in the API, schemas and UI 5 years ago
mynoop.py Macro commit 6 years ago
mynoop.senpy Macro commit 6 years ago
parameterized_plugin.py Multiple changes in the API, schemas and UI 5 years ago
rand_plugin.py Multiple changes in the API, schemas and UI 5 years ago
sleep_plugin.py Macro commit 6 years ago

README.md

This is a collection of plugins that exemplify certain aspects of plugin development with senpy.

The first series of plugins are the basic ones. Their starting point is a classification function defined in basic.py. They all include testing and running them as a script will run all tests. In ascending order of customization, the plugins are:

  • Basic is the simplest plugin of all. It leverages the SentimentBox Plugin class to create a plugin out of a classification method, and MappingMixin to convert the labels from (pos, neg) to (marl:Positive, marl:Negative
  • Basic_box is just like the previous one, but replaces the mixin with a custom function.
  • Basic_configurable is a version of basic with a configurable map of emojis for each sentiment.
  • Basic_parameterized like basic_info, but users set the map in each query (via extra_parameters).
  • Basic_analyse_entry uses the more general analyse_entry method and adds the annotations individually.

In rest of the plugins show advanced topics:

  • mynoop: shows how to add a definition file with external requirements for a plugin. Doing this with a python-only module would require moving all imports of the requirements to their functions, which is considered bad practice.
  • Async: a barebones example of training a plugin and analyzing data in parallel.

All of the plugins in this folder include a set of test cases and they are periodically tested with the latest version of senpy.

Additioanlly, for an example of stand-alone plugin that can be tested and deployed with docker, take a look at: lab.gsi.upm.es/senpy/plugin-example bbm