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

Implement save and load methods in DIET classifier #240

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

NoB0
Copy link
Collaborator

@NoB0 NoB0 commented Aug 8, 2023

Fixes #239

@github-actions
Copy link

github-actions bot commented Aug 8, 2023

Unit Test Results

83 tests   83 ✔️  1m 41s ⏱️
  1 suites    0 💤
  1 files      0

Results for commit dfcefad.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Aug 8, 2023

Coverage Report •
FileStmtsMissCoverMissing
dialoguekit/nlu/models
   diet_classifier_rasa.py98591%76, 111–>108, 140–>158, 199–213, 256–>exit
dialoguekit/utils
   dialogue_evaluation.py104198%96, 154–>160
tests/nlu
   test_diet_classifier_rasa.py570100% 
TOTAL205017490% 

@github-actions
Copy link

github-actions bot commented Aug 8, 2023

Current Branch Main Branch
Coverage Badge Coverage Badge

@NoB0 NoB0 requested a review from WerLaj August 8, 2023 12:58
Copy link
Collaborator

@WerLaj WerLaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with some minor issues

"""
raise NotImplementedError("Rasa Diet")
self._diet.persist()
pipeline_path = os.path.join(self._model_path, "pipeline.pkl")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could move "pipeline.pkl" to a global variable

),
resource=self._def_resource,
)
pipeline_path = os.path.join(self._model_path, "pipeline.pkl")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a global variable here

@@ -298,4 +304,14 @@ def load_model(self, file_path: str) -> None:
Raises:
NotImplementedError: If not implemented in derived class.
"""
raise NotImplementedError
self._diet = DIETClassifier.load(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename it to diet_classifier?

self.init_pipeline()
try:
self.load_model()
self._processes_utterances: Dict[str, Any] = {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this? Are these processed utterances? If yes, can we change the name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement save and load methods in DIET classifier
2 participants