1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-12-22 13:08:13 +00:00
senpy/example-plugins
J. Fernando Sánchez 54e4dcd5d4 WIP: working on a full refactor for v2.0
This is still not functional, because it involves a LOT of changes to
the basic structure of the project. Some of the main changes can be seen
in the CHANGELOG.md file, if you're interested, but it boils down to
simplifying the logic of plugins (no more activation/deactivation
shenanigans), more robust typing and use of schemas (pydantic) to
avoid inconsistencies and user errors.
2024-12-13 00:01:27 +01:00
..
moral WIP: working on a full refactor for v2.0 2024-12-13 00:01:27 +01:00
sklearn WIP: working on a full refactor for v2.0 2024-12-13 00:01:27 +01:00
basic_analyse_entry_plugin.py WIP: working on a full refactor for v2.0 2024-12-13 00:01:27 +01:00
basic_box_plugin.py WIP: working on a full refactor for v2.0 2024-12-13 00:01:27 +01:00
basic_plugin.py WIP: working on a full refactor for v2.0 2024-12-13 00:01:27 +01:00
basic.py Add headers and minor fixes 2019-07-17 16:29:30 +02:00
configurable_plugin.py WIP: working on a full refactor for v2.0 2024-12-13 00:01:27 +01:00
dummy_plugin.py WIP: working on a full refactor for v2.0 2024-12-13 00:01:27 +01:00
dummy_required_plugin.py WIP: working on a full refactor for v2.0 2024-12-13 00:01:27 +01:00
emorand_plugin.py WIP: working on a full refactor for v2.0 2024-12-13 00:01:27 +01:00
mynoop.py WIP: working on a full refactor for v2.0 2024-12-13 00:01:27 +01:00
mynoop.senpy make noop plugin optional 2023-09-26 19:31:50 +02:00
parameterized_plugin.py WIP: working on a full refactor for v2.0 2024-12-13 00:01:27 +01:00
rand_plugin.py WIP: working on a full refactor for v2.0 2024-12-13 00:01:27 +01:00
README.md Multiple changes in the API, schemas and UI 2019-04-04 10:00:24 +02:00
sleep_plugin.py WIP: working on a full refactor for v2.0 2024-12-13 00:01:27 +01:00

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