Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add way to dynamically add processors to cnlp_processors #77

Closed
angus-lherrou opened this issue Jun 9, 2022 · 2 comments
Closed

Add way to dynamically add processors to cnlp_processors #77

angus-lherrou opened this issue Jun 9, 2022 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@angus-lherrou
Copy link
Collaborator

Currently, adding a processor in order to use the cnlp_transformers library for new tasks requires the following steps:

  1. Clone the repository and install it in editable mode
  2. Write a class in cnlp_processors.py that inherits from the proper base class, defining get_labels and get_one_score
  3. Add the class to the cnlp_processors dictionary, defining a task name as the key
  4. Add the task name and output mode (mtl, classification, tagging, or relex) to the cnlp_output_modes dictionary
  5. If the task isn't a classification task, edit cnlp_compute_metrics to define which metrics to calculate for the task

Steps 2-4 can currently be done dynamically, without editing any files, obviating step 1. Step 5 requires code be edited or the cnlp_compute_metrics function be manually replaced in the cnlpt.cnlp_processors module, which is not a user-friendly workflow.

This process could be simplified so that users never have to clone the repository unless they want to contribute to the project itself; specifically, steps 3-5 could be abstracted into a function so that direct modification of module state is not exposed to the user.

@angus-lherrou angus-lherrou added the enhancement New feature or request label Jun 9, 2022
@angus-lherrou angus-lherrou added this to the v0.next milestone Jun 9, 2022
@angus-lherrou angus-lherrou self-assigned this Jun 9, 2022
@angus-lherrou angus-lherrou removed their assignment Sep 26, 2022
@angus-lherrou
Copy link
Collaborator Author

Ongoing work on #17 and #96 should address this.

@tmills
Copy link
Contributor

tmills commented Dec 7, 2022

this is addressed in v0.4.0

@tmills tmills closed this as completed Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants