TestModel
This module contains tests for evaluating the performance of models on anime and manga datasets. It includes fixtures and test functions to ensure that the models are correctly loaded, similarities are calculated, and evaluation results are saved properly.
The tests verify
- Model and embedding loading functionality
- Similarity calculation between new descriptions and existing content
- Proper saving and structure of evaluation results
- Consistent behavior across both anime and manga datasets
new_description
¶
Fixture that provides a new description for testing similarity calculations.
The description represents a common isekai anime/manga plot to test against the datasets.
RETURNS | DESCRIPTION |
---|---|
str
|
A test description about a character being reborn in another world as a slime.
TYPE:
|
Source code in tests/test_model.py
test_anime_model
¶
Test the anime model's ability to find similar content based on description.
This test verifies
- Proper loading of the model and anime embeddings
- Accurate calculation of similarities between new description and existing anime
- Correct structure and saving of evaluation results
- Expected number and format of top similar results
PARAMETER | DESCRIPTION |
---|---|
new_description
|
A test description to compare against the anime database.
TYPE:
|
model_name
|
The identifier of the model being tested.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
AssertionError
|
If any of the test conditions fail, including file existence, data structure, or expected result format. |
Source code in tests/test_model.py
test_manga_model
¶
Test the manga model's ability to find similar content based on description.
This test verifies
- Proper loading of the model and manga embeddings
- Accurate calculation of similarities between new description and existing manga
- Correct structure and saving of evaluation results
- Expected number and format of top similar results
PARAMETER | DESCRIPTION |
---|---|
new_description
|
A test description to compare against the manga database.
TYPE:
|
model_name
|
The identifier of the model being tested.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
AssertionError
|
If any of the test conditions fail, including file existence, data structure, or expected result format. |